Tunguska the ternary emulator
Moderator: haqreu
-
- Maniac
- Posts: 277
- Joined: 17 Sep 2012 13:36
- Location: 81.170.128.52
Re: Tunguska the ternary emulator
After some further minor fixes, I released 0.0.3 just now. =D
-
- Admin
- Posts: 24011
- Joined: 08 Jan 2003 23:22
- Location: Silicon Valley
Re: Tunguska the ternary emulator
One more "unofficial" build for Windows is ready:eudoxie wrote: After some further minor fixes, I released 0.0.3 just now. =D
http://nedopc.org/ternary/tunguska/tung ... _1-win.zip (1.2M)
It includes new examples "snow.asm" and "ants.asm", alternative assembler RASM (now supports new commands XAM, XAX, XAY, XYX, PAUSE) and some examples for it.
Last edited by Shaos on 11 Nov 2012 17:50, edited 1 time in total.
-
- Retired
- Posts: 1474
- Joined: 03 Aug 2003 22:37
- Location: Moscow
Re: Tunguska the ternary emulator
Is there a way to read RTC data of host machine ? I'd like to write ternary clock for vrtual ternary machine 

-
- Maniac
- Posts: 277
- Joined: 17 Sep 2012 13:36
- Location: 81.170.128.52
Re: Tunguska the ternary emulator
I looked into it a while back, but I found no way of implementing it that didn't either slaughter performance or look really ugly.
Maybe some time in the future I'll find some satisfying way of implementing it.
Maybe some time in the future I'll find some satisfying way of implementing it.
-
- Admin
- Posts: 24011
- Joined: 08 Jan 2003 23:22
- Location: Silicon Valley
Re: Tunguska the ternary emulator
I can do special build with this functionalityMac Buster wrote: Is there a way to read RTC data of host machine ? I'd like to write ternary clock for vrtual ternary machine

-
- Retired
- Posts: 1474
- Joined: 03 Aug 2003 22:37
- Location: Moscow
Re: Tunguska the ternary emulator
Well, that would be just great
I think there should be an address what will hold current huor, minute and second values (and of course it does not have to be updated every second, update-on-read-request is enought).

-
- Maniac
- Posts: 277
- Joined: 17 Sep 2012 13:36
- Location: 81.170.128.52
Re: Tunguska the ternary emulator
I dislike the idea of implementing what is really OS-level functionality into the hardware level of the machine: I think on a hardware level the best way to represent time is something like UNIX time_t, the number of seconds relative to some date, since that is easier for a computer to understand than a mixed-radix time measurement like (year:month:day:)hour:minute:second.
But, since Tunguska's OS is pretty lacking at this stage, it might be possible to add this sort of functionality to the AGDP until it can be properly implemented in the OS.
But, since Tunguska's OS is pretty lacking at this stage, it might be possible to add this sort of functionality to the AGDP until it can be properly implemented in the OS.
-
- Retired
- Posts: 1474
- Joined: 03 Aug 2003 22:37
- Location: Moscow
Re: Tunguska the ternary emulator
Well, I didn't say that you have to store date and time in separate thrytes, you can use that UNIX way as well. Just give to programmes a way to read it 

-
- Admin
- Posts: 24011
- Joined: 08 Jan 2003 23:22
- Location: Silicon Valley
Re: Tunguska the ternary emulator
Actually it has to be separate trytes, because any RTC does this. Personally I never met computer hardware that has UNIX time on RTC levelMac Buster wrote: Well, I didn't say that you have to store date and time in separate thrytes, you can use that UNIX way as well. Just give to programmes a way to read it![]()

-
- Maniac
- Posts: 277
- Joined: 17 Sep 2012 13:36
- Location: 81.170.128.52
Re: Tunguska the ternary emulator
Not specifically UNIX time, perhaps, but IBM BIOS for an example, gives you time in seconds or milliseconds passed since some epoch (atleast according to wikipedia.)
It would be very strange for a real time clock to do this sort of a thing on a mixed-radix basis, since they essentially just count the number of oscillations of a quartz crystal. It is much easier to implement a simple second or msecond counter in hardware than one that does second-minute-hour-day spillover in separate fields.
It would be very strange for a real time clock to do this sort of a thing on a mixed-radix basis, since they essentially just count the number of oscillations of a quartz crystal. It is much easier to implement a simple second or msecond counter in hardware than one that does second-minute-hour-day spillover in separate fields.
-
- Admin
- Posts: 24011
- Joined: 08 Jan 2003 23:22
- Location: Silicon Valley
Re: Tunguska the ternary emulator
That page on wikipedia describes software methods to retrieve absolute time, but RTC usually has separated values for date and time: http://linux.die.net/man/4/rtceudoxie wrote: Not specifically UNIX time, perhaps, but IBM BIOS for an example, gives you time in seconds or milliseconds passed since some epoch (atleast according to wikipedia.)
-
- Maniac
- Posts: 277
- Joined: 17 Sep 2012 13:36
- Location: 81.170.128.52
Re: Tunguska the ternary emulator
I stand corrected.
I've added a new instruction AGDP_WHEN that stores the first six fields from struct tm in the AGDP registers to the CVS. To access it, call the following
Fields are:
agdp.R1 -- second
agdp.R1+1 -- minute
agdp.R2 -- hour
agdp.R2+1 -- day of month
agdp.R3 -- month
agdp.R3+1 -- year
I've added a new instruction AGDP_WHEN that stores the first six fields from struct tm in the AGDP registers to the CVS. To access it, call the following
Code: Select all
LDA #agdp.WHEN
STA agdp.OP
agdp.R1 -- second
agdp.R1+1 -- minute
agdp.R2 -- hour
agdp.R2+1 -- day of month
agdp.R3 -- month
agdp.R3+1 -- year
-
- Admin
- Posts: 24011
- Joined: 08 Jan 2003 23:22
- Location: Silicon Valley
Re: Tunguska the ternary emulator
Last edited by Shaos on 11 Nov 2012 17:50, edited 2 times in total.
-
- Retired
- Posts: 1474
- Joined: 03 Aug 2003 22:37
- Location: Moscow
Re: Tunguska the ternary emulator
Great! I'm going to write ternary clock 

-
- Maniac
- Posts: 277
- Joined: 17 Sep 2012 13:36
- Location: 81.170.128.52
Re: Tunguska the ternary emulator
Neat, would make a nice addition to programs in the main command prompt.