Jump to content
Sign in to follow this  
RSS Bot

Atari_Ace's Blog - Dealer Demo, part 8: Who compiles the compiler?

Recommended Posts

We pick up decompiling again at $148C, where we find 1+ (ONEP). It is followed by 2+ (TWOP), HERE, ALLOT, , (COMMA), C, (CCOMM), - (SUB), = (EQUAL), > (GREAT), ROT, SPACE and -DUP (DDUP). All of these are identical to the fig-Forth listing, which implements these as colon-definitions, which is expected. Although SUB, EQUAL and ROT are sometimes rewritten as primitives to speed up Forth (cf. val-Forth), optimizing these was not done in this Forth.

TRAVERSE is the next word in the listing and it is implemented completed differently. It's used to traverse a name field forwards or backwards to find start or end of the name. Here's the version from fig-Forth:

Dealer Demo.
16D4: 4C 12     PSCOD   .WORD DOCOL16D6: 85 10             .WORD RFROM16D8: 6A 15             .WORD LATES16DA: AC 15             .WORD PFA16DC: 89 15             .WORD CFA16DE: 13 12             .WORD STORE16E0: 45 10             .WORD SEMIS
This just sets the code field of the latest word to the code that follows the PSCOD address. It's used in all definitions because all those definitions finish adding to the dictionary in the same way, so it might as well be shared code.

DODOE deserves a little study:
 dealerdemo.lst (45.84KB)
Number of downloads: 0


http://atariage.com/forums/blog/734/entry-15026-dealer-demo-part-8-who-compiles-the-compiler/

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...