Re: BASIC loaders for machine language (Re: FORTH in ROM for CBM 8032?)

From: Greg King (gngking_at_erols.com)
Date: 2005-01-08 05:55:37

From: Marko Mäkelä; on Date: January 05, 2005, at 07:17 AM -0500
>
> > That macro can be shorter:
> >
> > #mac basicline
> >   org {1}
> >   word 0$  ; link to next line
> >   word {2} ; line number
> >   byte $9E ; SYS token
> > ;   SYS digits
> >   if (* + 8) / 10000
> >     byte $30 + (* + 8) / 10000
> >   endif
> >   if (* + 7) / 1000
> >     byte $30 + (* + 7) /  1000 % 10
> >   endif
> >     byte $30 + (* + 6) /   100 % 10
> >     byte $30 + (* + 5) /    10 % 10
> >     byte $30 + (* + 4) /     1 % 10
> >   byte 0   ; end of BASIC line
> > 0$:
> >   word 0   ; end of BASIC program
> > #endm
>
> That would lead to an unoptimal solution on the PET II series, a.k.a.
> CBM Model B, where the BASIC text starts at address 3.

I had forgotten about that.  Anyway, leaving out some of the "if tests"
wasn't why I sent that message -- my making that "improvement" was an
after-thought.

I had wanted to show that the arithmetic expressions can be shortenned
slightly by re-arranging the operations
(    byte $30 + (* + 7) / 1000 % 10
instead of
     byte $30 + (* + 7) % 10000 / 1000
for example).


       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.