Thursday, May 11, 2017

Solving the :ELSE issue in the subline/endofling scan routine required too much code and just slowed the interpreter down.  It turned out to be a complete waste of time.  I finally just inserted a colon before ELSE in the crunch routine.  It's only 5 instructions and it doesn't impact the speed of the interpreter which is why Microsoft did it that way.  It also took about 5 minutes, which was considerably less time than the other approach.  Some things just aren't worth fighting with.

This
          inx                                    ; pre-increment the output pointer
          stx       OUTPTR              ; store output pointer
...

Became this:
          inx                                         ; pre-increment the output pointer
          cmpb #$C9 ; Token for ELSE?
          bne crnext
         ldaa #':' ; output a colon
          staa ,X
          inx                                         ; increment the output pointer
crnext
          stx       OUTPTR                   ; store output pointer
...


The code has also been cleaned up a bit where it tests for the ELSE special case in the dispatch routine.

I posted the ROM but it still needs more testing, which won't be tonight.
There are still 10 unused bytes I haven't decided what to do with yet.

No comments:

Post a Comment