Talk:ND100 emulator project: Difference between revisions

From NDWiki
Jump to navigation Jump to search
m ((typo))
m (argh..)
Line 17: Line 17:
* At this point, fetch next instruction from current P. If a level switch was performed it will be the saved P from that level.
* At this point, fetch next instruction from current P. If a level switch was performed it will be the saved P from that level.
The level switch basically just have to switch register sets, and save previous level no. in the pvl register.  
The level switch basically just have to switch register sets, and save previous level no. in the pvl register.  
(This is fairly well documented, also in the older RM-100 manual.) Everything goes by itself after that: Just fetch a fresh instruction as usual and process. When level switch is performed the P in the save register set will already point to the instruction to execute when coming back to that level, if you follow the procedure above.
(This is fairly well documented, also in the older RM-100 manual.) Everything goes by itself after that: Just fetch a fresh instruction as usual and process. When level switch is performed the P in the saved register set will already point to the instruction to execute when coming back to that level, if you follow the procedure above.


INSTRUCTION-B runs pretty well in my emulator after I carefully looked at what I did with P (I had some snags related to WAIT and level switching), at least in NORD-10 mode - I have too many missing instructions for running in ND-100 mode. Oh, and I found a couple of non-documented ones, 142700 is one of them.
INSTRUCTION-B runs pretty well in my emulator after I carefully looked at what I did with P (I had some snags related to WAIT and level switching), at least in NORD-10 mode - I have too many missing instructions for running in ND-100 mode. Oh, and I found a couple of non-documented ones, 142700 is one of them.
[[User:TArntsen|TArntsen]] 19:53, 1 May 2011 (CEST)
[[User:TArntsen|TArntsen]] 19:53, 1 May 2011 (CEST)

Revision as of 17:55, 1 May 2011

Progress? Has this project stopped? Or is there progress somewhere? Torfinn 16:00, 25 October 2010 (UTC)

Ok, I see that there has been some progress - nice. The file (v0.1.7) doesn't exist at the URL provided. Will the mailinglist be resurrected? Torfinn 19:36, 13 April 2011 (CEST)

Mailinglist will be resurrected sometime during the next few weeks, also links to updated code will be fixed. The latest git code has some more bugfixes, so now almost runs INSTRUCTION-B testprogram. Roger 17:29, 24 April 2011 (AWST)

Re. Known Bugs

About the ** ERROR **. WRONG VALUE OF P-REG AFTER TEST. LEVEL: ' messages. (btw. it should have said 'LEVEL 1', not just LEVEL..)
I have not looked at how you do this in your emulator, but when I added some support to my user-level emulator for running "bare-bone", i.e. with levels and interrupt support (I developed an interest in looking into IOX and drivers), I ran into that same problem when running INSTRUCTION-B. To fix it you have to be careful about how the P register is left behind when you switch levels. Ref. e.g. page 23 in ND-06.26.1, and what's written about WAIT elsewhere. Basically as follows:

  • Every instruction should finish with the P-register set to the correct next value (usually P+1, but sometimes P+2, or something else after jump istructions)
  • The EXR instruction must not increment/change P by itself, the instruction it executes should do this.
  • Now check for external interrupts, and do any level switching caused by this.
  • If a WAIT was just performed then this may also cause a level switch
  • At this point, fetch next instruction from current P. If a level switch was performed it will be the saved P from that level.

The level switch basically just have to switch register sets, and save previous level no. in the pvl register. (This is fairly well documented, also in the older RM-100 manual.) Everything goes by itself after that: Just fetch a fresh instruction as usual and process. When level switch is performed the P in the saved register set will already point to the instruction to execute when coming back to that level, if you follow the procedure above.

INSTRUCTION-B runs pretty well in my emulator after I carefully looked at what I did with P (I had some snags related to WAIT and level switching), at least in NORD-10 mode - I have too many missing instructions for running in ND-100 mode. Oh, and I found a couple of non-documented ones, 142700 is one of them. TArntsen 19:53, 1 May 2011 (CEST)