Tunguska the ternary emulator

Balanced Ternary Numeral System - forum was moved from http://ternary.info

Moderator: haqreu

User avatar
Shaos
Admin
Posts: 24008
Joined: 08 Jan 2003 23:22
Location: Silicon Valley

Re: Tunguska the ternary emulator

Post by Shaos »

eudoxie wrote: CVS is up now.

Access instructions can be found on http://sourceforge.net/projects/tunguska/
Do you plan to have some help from other developers?
Or you want to keep CVS read-only for others?
eudoxie
Maniac
Posts: 277
Joined: 17 Sep 2012 13:36
Location: 81.170.128.52

Re: Tunguska the ternary emulator

Post by eudoxie »

I'm certainly considering making it a collaborative project.

But that requires some sort of project goals to work towards (otherwise it will turn into emacs), and that's project goals I'm not quite clear on even now when I'm working alone, and to compound the problem, a lot of design revisions has to be made on the way so there never -can- be any definitive goals.

But that is the problem with the entire project, binary computing has had half a century to make mistakes and learn what works and what doesn't. But ternary computing is pretty much a blank slate.
Mac Buster
Retired
Posts: 1474
Joined: 03 Aug 2003 22:37
Location: Moscow

Re: Tunguska the ternary emulator

Post by Mac Buster »

eudoxie wrote: But that is the problem with the entire project, binary computing has had half a century to make mistakes and learn what works and what doesn't. But ternary computing is pretty much a blank slate.
The situation is not that bad. In fact ternary computing exists almost as long as the binary one. But, the only problem is that most publications were made in russian language, since ternary computers Setun and Setun-70 were designed, released and used in Soviet Union. There are some theoretical and practical publications, and I do my best to find, collect and store in my library as many of them as it only possible.
eudoxie
Maniac
Posts: 277
Joined: 17 Sep 2012 13:36
Location: 81.170.128.52

Re: Tunguska the ternary emulator

Post by eudoxie »

Be that as it may, binary computing has had a different level level of field testing of their concepts. Also, tunguska is an entirely different sort of a machine from setun. It's a PC, not a mainframe-type machine.

There's so many practical questions that need answering. Example: What screen resolution should a ternary computer have? Conventional resolutions are all aligned to 256b pages, so they're obviously no good. Turns out after some tinkering, factoring in page alignment, and the aspect ratio of screens (4:3), that 324x243 is a good screen resolution (and very close to 320x240 -- a common binary resolution).

But then again, that is what tunguska is all about. The main goal of the project is to see what works and what doesn't, by making lots of stupid mistakes, and then learning from them.
User avatar
Shaos
Admin
Posts: 24008
Joined: 08 Jan 2003 23:22
Location: Silicon Valley

Re: Tunguska the ternary emulator

Post by Shaos »

I downloaded sources from CVS. Demo of raster or vector graphics is not working properly, right? Also new assembler has some strange errors like inability to handle negative decimal numbers.

In machine.cc (machine::init_translation_table) there are 2 JMP operations and no TSX and TXS operations. Is it right?

Also meaning of LDA without arguments (ACC) is loading A to A, is it the same as NOP or flags are somehow involved?

P.S. I checked source code - flags are involved

P.P.S. Is it possible to add increment/decrement for full address saved in pair X:Y?
eudoxie
Maniac
Posts: 277
Joined: 17 Sep 2012 13:36
Location: 81.170.128.52

Re: Tunguska the ternary emulator

Post by eudoxie »

Haven't written any "official" raster and vector demos yet.

I fixed that error in the translation table. There always seems to sneak bugs into that function :-(

And yeah, LDA A isn't entirely meaningless. It's a way to re-evaluate the contents of A and set the P-flag accordingly.
User avatar
Shaos
Admin
Posts: 24008
Joined: 08 Jan 2003 23:22
Location: Silicon Valley

Re: Tunguska the ternary emulator

Post by Shaos »

eudoxie wrote: Haven't written any "official" raster and vector demos yet.

I fixed that error in the translation table. There always seems to sneak bugs into that function :-(

And yeah, LDA A isn't entirely meaningless. It's a way to re-evaluate the contents of A and set the P-flag accordingly.
In updated sources TXS/TSX are still absent in machine::instruction()
eudoxie
Maniac
Posts: 277
Joined: 17 Sep 2012 13:36
Location: 81.170.128.52

Re: Tunguska the ternary emulator

Post by eudoxie »

There, fixed. It's amazing how well Tunguska works with apparently so few working instructions. :-?
User avatar
Shaos
Admin
Posts: 24008
Joined: 08 Jan 2003 23:22
Location: Silicon Valley

Re: Tunguska the ternary emulator

Post by Shaos »

eudoxie wrote: There, fixed. It's amazing how well Tunguska works with apparently so few working instructions. :-?
Thanks for fixes :roll:

P.S. Right now I'm working on "alternative" Tunguska assembler with "alternative" syntax, based on my RoboAssembler (RASM) :hammer:
Next step - to make my C-like programming language to be able to cross-compile programs for Tunguska...
User avatar
Shaos
Admin
Posts: 24008
Joined: 08 Jan 2003 23:22
Location: Silicon Valley

Re: Tunguska the ternary emulator

Post by Shaos »

Another thing - according to enum in machine.h, opcode DEBUG is next after LAD or "3B", but it has to be "44" (40 decimal) as described in PDF, right?
eudoxie
Maniac
Posts: 277
Joined: 17 Sep 2012 13:36
Location: 81.170.128.52

Re: Tunguska the ternary emulator

Post by eudoxie »

Fixed DEBUG.

Having an assembler that isn't actually tied to the Tunguska sources is going to be very hard to maintain, especially in these early stages where design changes are relatively common and rapid.
User avatar
Shaos
Admin
Posts: 24008
Joined: 08 Jan 2003 23:22
Location: Silicon Valley

Re: Tunguska the ternary emulator

Post by Shaos »

eudoxie wrote: Fixed DEBUG.

Having an assembler that isn't actually tied to the Tunguska sources is going to be very hard to maintain, especially in these early stages where design changes are relatively common and rapid.
Lets see things from other point of view - if there isn't "alternative" assembler, then you probably found that bugs much later ;)

P.S. My assembler tied to my C-like language, so it's only intermediate form of code representation...
eudoxie
Maniac
Posts: 277
Joined: 17 Sep 2012 13:36
Location: 81.170.128.52

Re: Tunguska the ternary emulator

Post by eudoxie »

Oh, I am glad to have help finding bugs in Tunguska. Debugging it myself has been a very slow and tedious process.

Interesting. The need for a ternary high level language has become all too apparent when I've been programming Tunguska.
eudoxie
Maniac
Posts: 277
Joined: 17 Sep 2012 13:36
Location: 81.170.128.52

Re: Tunguska the ternary emulator

Post by eudoxie »

Gotten a lot of work done on Tunguska today. Re-implemented the brownian motion demo that was missing from the ram image, and fixed a lot of stuff on the assembler that were flaky. Also, motion support is partially implemented. :-D
User avatar
Shaos
Admin
Posts: 24008
Joined: 08 Jan 2003 23:22
Location: Silicon Valley

Re: Tunguska the ternary emulator

Post by Shaos »

eudoxie wrote: Gotten a lot of work done on Tunguska today. Re-implemented the brownian motion demo that was missing from the ram image, and fixed a lot of stuff on the assembler that were flaky. Also, motion support is partially implemented. :-D
So here is next "unofficial" build of Tunguska for Windows:
http://nedopc.org/ternary/tunguska/tung ... _1-win.zip (1.0M)
:-D
Last edited by Shaos on 11 Nov 2012 17:36, edited 1 time in total.