Tunguska the ternary emulator
Moderator: haqreu
-
- Admin
- Posts: 24008
- Joined: 08 Jan 2003 23:22
- Location: Silicon Valley
Re: Tunguska the ternary emulator
New bug - if I enter something unknown instead of command it starts print zeros to the screen - many lines of zeros...
-
- Maniac
- Posts: 277
- Joined: 17 Sep 2012 13:36
- Location: 81.170.128.52
Re: Tunguska the ternary emulator
In the 3cc memory image? If so, could you post the .asm-file 3CC generated (or upload it somewhere, it's several thousand lines
)

-
- Admin
- Posts: 24008
- Joined: 08 Jan 2003 23:22
- Location: Silicon Valley
Re: Tunguska the ternary emulator
I thinks it's ASM-image. I can't find 3CC-image sources on CVS...eudoxie wrote: In the 3cc memory image? If so, could you post the .asm-file 3CC generated (or upload it somewhere, it's several thousand lines)
-
- Maniac
- Posts: 277
- Joined: 17 Sep 2012 13:36
- Location: 81.170.128.52
Re: Tunguska the ternary emulator
The 3cc image is in "memory_image_3cc" in the CVS.
How did you assemble the sources? You're only supposed to do
"tg_assembler ram.asm" nowadays, though assembling the wrong way should only cause warnings and redundant code. Furthermore, what optimization level are you compiling tunguska in?
Also, if you are running in windows, could you upload the windows binary so I can see the problem for myself?
How did you assemble the sources? You're only supposed to do
"tg_assembler ram.asm" nowadays, though assembling the wrong way should only cause warnings and redundant code. Furthermore, what optimization level are you compiling tunguska in?
Also, if you are running in windows, could you upload the windows binary so I can see the problem for myself?
-
- Admin
- Posts: 24008
- Joined: 08 Jan 2003 23:22
- Location: Silicon Valley
Re: Tunguska the ternary emulator
Yes, I'm using ./tg_assembler ram.asm since July 
Also I took memory_image_3cc from CVS and got this:

Also I took memory_image_3cc from CVS and got this:
cpp string.c -o string.ppc
cpp stdio.c -o stdio.ppc
cpp math.c -o math.ppc
cpp main.c -o main.ppc
cpp system.c -o system.ppc
cpp graphics.c -o graphics.ppc
cpp demos.c -o demos.ppc
../tunguska_3cc/3cc -O 0n400000 -oout.asm string.ppc stdio.ppc math.ppc main.ppc system.ppc graphics.ppc demos.ppc
../tunguska_sources/tg_assembler out.asm
Caught error during assembly (final sweep)
* assembler.cc[257]: Unresolved varaible clear_screen.bootstrapped
* assembler.cc[413]: Error during assembly of out.asm, line 4328
-
- Maniac
- Posts: 277
- Joined: 17 Sep 2012 13:36
- Location: 81.170.128.52
Re: Tunguska the ternary emulator
Are tunguska and 3cc up to date?
Could you try running "../tunguska_sources/tg_assembler -v out.asm" And pasting the output.
Also, if possible, supply out.asm.
Could you try running "../tunguska_sources/tg_assembler -v out.asm" And pasting the output.
Also, if possible, supply out.asm.
-
- Admin
- Posts: 24008
- Joined: 08 Jan 2003 23:22
- Location: Silicon Valley
Re: Tunguska the ternary emulator
http://nedopc.org/ternary/tunguska/tung ... _0-win.zip (2.5M)
See ram_3cc/out.asm and ram_3cc/out
To rebuild ram_3cc run build_ram_3cc.bat that got error described above written to file "out"
See ram_3cc/out.asm and ram_3cc/out
To rebuild ram_3cc run build_ram_3cc.bat that got error described above written to file "out"
Last edited by Shaos on 11 Nov 2012 17:57, edited 1 time in total.
-
- Maniac
- Posts: 277
- Joined: 17 Sep 2012 13:36
- Location: 81.170.128.52
Re: Tunguska the ternary emulator
Yeah, now I see what the problem is.
Something seems to be wrong with the $$-token. I'm thinking either it isn't matched in the lexer for some reason, or something has gotten broken in the porting process.
Could you diff any alterations you have done to scanner.l, parser.ypp and assembler.h?
Something seems to be wrong with the $$-token. I'm thinking either it isn't matched in the lexer for some reason, or something has gotten broken in the porting process.
Could you diff any alterations you have done to scanner.l, parser.ypp and assembler.h?
-
- Admin
- Posts: 24008
- Joined: 08 Jan 2003 23:22
- Location: Silicon Valley
Re: Tunguska the ternary emulator
I didn't do anything special - just got CVS and make...Could you diff any alterations you have done to scanner.l, parser.ypp and assembler.h?
P.S. Actually I did some changes earlier in July in generated lex.yy.cc, but it was just changing cin to std::cin and cout to std::cout, that part wasn't changed since that time, so make didn't recreate it again.
-
- Maniac
- Posts: 277
- Joined: 17 Sep 2012 13:36
- Location: 81.170.128.52
Re: Tunguska the ternary emulator
Strange. I'm not sure what could cause this sort of problem. Either the token isn't recognized, or assembler::get_pc() isn't doing it's job for some reason.
Try changing tunguska_sources/parser.ypp:121 from
to
And compile and see what happens when you assemble out.asm.
Try changing tunguska_sources/parser.ypp:121 from
Code: Select all
| HERE { $<ival>$ = assembler::instance()->get_pc(); }
Code: Select all
| HERE { $<ival>$ = assembler::instance()->get_pc();
fprintf(stderr, "$$-token recognized(%d)\n",$<ival>$); }
-
- Admin
- Posts: 24008
- Joined: 08 Jan 2003 23:22
- Location: Silicon Valley
Re: Tunguska the ternary emulator
I did make clean and make (2 tries, after 1st one I again changed cin,cout,cerr to std::cin,std::cout,std::cerr in lex.yy.cc), now it build out.asm, but it is not working:
It strange, but asm image did the same thing now...
http://nedopc.org/ternary/tunguska/tung ... _1-win.zip (2.4M)
Code: Select all
'symbols.bmp' not found in '/usr/local/share/tunguska/'
Falling back to 'share/symbols.bmp' ... success!
'bg.bmp' not found in '/usr/local/share/tunguska/'
Falling back to 'share/bg.bmp' ... success!
LOADING out.ternobj
...DONE
RTI outside BRK
RTI outside BRK
RTI outside BRK
Initial benchmark: 447.686 thousand operations per second
Spread: 20.119
RTI outside BRK
RTI outside BRK
http://nedopc.org/ternary/tunguska/tung ... _1-win.zip (2.4M)
Last edited by Shaos on 11 Nov 2012 17:58, edited 1 time in total.
-
- Admin
- Posts: 24008
- Joined: 08 Jan 2003 23:22
- Location: Silicon Valley
Re: Tunguska the ternary emulator
I rebuilt tunguska and tg_assembler again with -O2 in Makefile and now it's working! Even many zeros bug also gone...
http://nedopc.org/ternary/tunguskatungu ... _2-win.zip (2.4M)
http://nedopc.org/ternary/tunguskatungu ... _2-win.zip (2.4M)
Last edited by Shaos on 11 Nov 2012 17:58, edited 1 time in total.
-
- Maniac
- Posts: 277
- Joined: 17 Sep 2012 13:36
- Location: 81.170.128.52
Re: Tunguska the ternary emulator
Great news!
-
- Admin
- Posts: 24008
- Joined: 08 Jan 2003 23:22
- Location: Silicon Valley
Re: Tunguska the ternary emulator
So is it final v0.5? Should I prepare windows version for SourceForge now?eudoxie wrote: Great news!
-
- Maniac
- Posts: 277
- Joined: 17 Sep 2012 13:36
- Location: 81.170.128.52
Re: Tunguska the ternary emulator
The sourcecode is final, I need to finish the updates of the manual and maybe the memory image for 3cc (I expect it to be done before next week), but you could probably start the work on the 0.5 package for windows.