Jump to content

Photo

xdt99: New TI 99 cross-development tools available


210 replies to this topic

#26 TheMole ONLINE  

TheMole

    Dragonstomper

  • 721 posts
  • Location:Belgium

Posted Tue Jun 16, 2015 10:34 AM

Thanks for this, just started using xdt99's xvm99 tool to manage the volumes on my CF7+ from my Mac and it works flawlessly!



#27 palmheads OFFLINE  

palmheads

    Chopper Commander

  • 170 posts
  • Location:Christchurch, New Zealand

Posted Wed Jun 17, 2015 12:19 AM

Thanks for this, just started using xdt99's xvm99 tool to manage the volumes on my CF7+ from my Mac and it works flawlessly!

 

 

Yup agreed, great set of tools!



#28 ralphb OFFLINE  

ralphb

    Moonsweeper

  • Topic Starter
  • 414 posts
  • Location:Germany

Posted Thu Jun 18, 2015 12:44 PM

Thanks for your kind words; I'm trying to release an update by the end of the month.



#29 ralphb OFFLINE  

ralphb

    Moonsweeper

  • Topic Starter
  • 414 posts
  • Location:Germany

Posted Wed Jul 1, 2015 1:20 PM

OK, just slightly overdue, but I finally managed to release a new version of xdt99.

 

The release adds the xbas99 tool as another piece of the puzzle.  xbas99 can list TI BASIC and TI Extended BASIC programs and conversely create program files from BASIC listings.  (It was surprisingly difficult to re-create the exact output of the BASIC LIST command in terms of spacing -- not that this would be strictly required, but it added some fun.)

 

Other minor improvements include more flexible E/A5 image generation in xas99 and simplified handling of multiple files in xdm99/xvm99.

 

Download is available on GitHub.



#30 Dexter OFFLINE  

Dexter

    Moonsweeper

  • 271 posts
  • Location:Landgraaf, Netherlands / Übach-Palenberg, Deutschland

Posted Wed Jul 1, 2015 1:29 PM

Your tools are going to have a major impact on our community!

Really marvelous!

 

Attached File  AWESOME.jpeg   14.16KB   3 downloads


Edited by Dexter, Wed Jul 1, 2015 1:42 PM.


#31 RXB OFFLINE  

RXB

    River Patroller

  • 2,585 posts
  • Location:Vancouver, Washington, USA

Posted Wed Jul 1, 2015 5:49 PM

OK, just slightly overdue, but I finally managed to release a new version of xdt99.

 

The release adds the xbas99 tool as another piece of the puzzle.  xbas99 can list TI BASIC and TI Extended BASIC programs and conversely create program files from BASIC listings.  (It was surprisingly difficult to re-create the exact output of the BASIC LIST command in terms of spacing -- not that this would be strictly required, but it added some fun.)

 

Other minor improvements include more flexible E/A5 image generation in xas99 and simplified handling of multiple files in xdm99/xvm99.

 

Download is available on GitHub.

This is very fascinating as a project tool. Why is the GPL command SLL reversed?

 

Also in my RXB GPL Source code I use AORG often as I always hated filling in zeros to pad that area.

Many address in the XB Cart must use the same address as the ROMs are hard coded for  those address.

 

It sucks that they can not be changed and have to be patched, but that is why I use AORG so much.

 

So if I use this tool I will have to make some major changes to the GPL Source code? 



#32 Ksarul OFFLINE  

Ksarul

    River Patroller

  • 3,999 posts

Posted Wed Jul 1, 2015 7:50 PM

Rich, I suspect the most important question here is: which GPL assembler does the code conform to? Code written for the original TI GPL assembler doesn't work fully with the third party GPL assemblers without some modification. The same applies here--if it isn't using the same GPL assembler syntax as the one you are comfortable with, some changes would be necessary to get your code to work on it. How many different versions of GPL assemblers are out there? I know there was the one from TI (for which we have a fully documented manual but no assembler), the one from Ryte Data (also sold in Germany as the Weiand GPL assembler), the RAG GPL assembler, and at least one other I can't remember the name of right now.



#33 RXB OFFLINE  

RXB

    River Patroller

  • 2,585 posts
  • Location:Vancouver, Washington, USA

Posted Thu Jul 2, 2015 1:51 AM

Rich, I suspect the most important question here is: which GPL assembler does the code conform to? Code written for the original TI GPL assembler doesn't work fully with the third party GPL assemblers without some modification. The same applies here--if it isn't using the same GPL assembler syntax as the one you are comfortable with, some changes would be necessary to get your code to work on it. How many different versions of GPL assemblers are out there? I know there was the one from TI (for which we have a fully documented manual but no assembler), the one from Ryte Data (also sold in Germany as the Weiand GPL assembler), the RAG GPL assembler, and at least one other I can't remember the name of right now.

Well I do use the Ryte Data one almost exclusively but there is also besides the ones you listed the Swedish GPL Assember (Nouspikel version)

 

I just need to practice with your new tool.


Edited by RXB, Thu Jul 2, 2015 1:52 AM.


#34 mizapf OFFLINE  

mizapf

    River Patroller

  • 2,369 posts
  • Location:Germany

Posted Thu Jul 2, 2015 2:58 AM

This diversity of GPL specifications was the reason that I did not care about compatibility in TIImageTool but invented my own format. :)  However, I already thought about an option to choose between different dialects.



#35 RXB OFFLINE  

RXB

    River Patroller

  • 2,585 posts
  • Location:Vancouver, Washington, USA

Posted Thu Jul 2, 2015 5:23 AM

This diversity of GPL specifications was the reason that I did not care about compatibility in TIImageTool but invented my own format. :)  However, I already thought about an option to choose between different dialects.

Well think about this.

The Object Code is always the same except for the loaders.

Compressed is normally the standard loader and from there they are pretty much the same. 



#36 mizapf OFFLINE  

mizapf

    River Patroller

  • 2,369 posts
  • Location:Germany

Posted Thu Jul 2, 2015 6:27 AM

Preferable format? Ryte? RAG?

 

The TI GPL Assembler allowed for some interesting degree of structured programming. I'm not sure whether it really relied on that style, or whether it was possible to write pure assembly-like GPL code. Anyway, no one has TI's GPL assembler, right?



#37 Ksarul OFFLINE  

Ksarul

    River Patroller

  • 3,999 posts

Posted Thu Jul 2, 2015 7:26 AM

I suspect that most post-TI GPL code is in the Ryte Data (Weiand) GPL assmebler format. I asked Dave Pitts whether he had ever seen a copy of the TI GPL assembler out in the wild--he had not. With that, we only have the manual. I haven't seen a lot done in the RAG format, although it may be out there and I just haven't seen it.

 

The SDS MAC Assembler, on the other hand, is out there. So it is still possible to work directly with the 990 assembly source code generated internally by TI for the /4A, although some of their later source code was done in TI Editor Assembler format. 



#38 RXB OFFLINE  

RXB

    River Patroller

  • 2,585 posts
  • Location:Vancouver, Washington, USA

Posted Thu Jul 2, 2015 8:20 AM

Preferable format? Ryte? RAG?

 

The TI GPL Assembler allowed for some interesting degree of structured programming. I'm not sure whether it really relied on that style, or whether it was possible to write pure assembly-like GPL code. Anyway, no one has TI's GPL assembler, right?

Yea the TI GPL Assember only worked on the 990 as I saw a copy on Don Blazer's one he had in his basement.

He also had the blank TI GROM boards to make Carts, but not the Burners needed for the GROMs they used.



#39 RXB OFFLINE  

RXB

    River Patroller

  • 2,585 posts
  • Location:Vancouver, Washington, USA

Posted Thu Jul 2, 2015 8:24 AM

I would change to the Swedish Assembler or RAG version but the amount of work to modify my Source Code would be a pain in the rear.



#40 ralphb OFFLINE  

ralphb

    Moonsweeper

  • Topic Starter
  • 414 posts
  • Location:Germany

Posted Thu Jul 2, 2015 9:24 AM

Rich, I suspect the most important question here is: which GPL assembler does the code conform to?

 

Well, I wasn't sure which syntax style is most commonly used either, so I decided to support those variants that I could find. The default is Ryte Data, but you can also select RAG and mizapf style with the -s option (sorry, Michael, you're canon now).  They're all fairly similar, the biggest differences being FMT statements and address formats.

Another option I looked at is the Heiner Martin style. Maybe I'll add support for it eventually as some kind of tribute to Heiner's work.  And I opted not to support the original TI assembler style as specified in the GPL Guide, as the format seemed rather arcane.

 

 

This is very fascinating as a project tool. Why is the GPL command SLL reversed?

Also in my RXB GPL Source code I use AORG often as I always hated filling in zeros to pad that area.

 

The AORG directive should be supported in all styles. Isn't it working for you?

As for the SLL statement -- You're absolutely correct that I reversed the arguments for the shift operations compared to the GPL Guide. I was under the impression that all available GPL assemblers do that -- also note that it is more consistent with all the other instructions, which are always SOURCE, DEST rather than DEST, SOURCE.

But maybe that was a fluke, and only one (dis)assembler actually reverses the order -- I'm looking at you, TI Image Tool! ;-)  Anyway, thanks for the hint, I'll check and update xga99. After all, you should be able to assemble existing sources with the new tool with hardly any modifications.



#41 mizapf OFFLINE  

mizapf

    River Patroller

  • 2,369 posts
  • Location:Germany

Posted Thu Jul 2, 2015 9:30 AM

I followed the TI GPL assembler which has <operation> <src> <dest> order (which is consistent with our 9900 assembler). However, this introduces one inconsistency, namely with some compare instructions (e.g. CGE) where the operands are compared in the reverse order of the 9900 architecture.

 

I actually did not plan to create code that shall be put into a GPL assembler again, as I was not sure about symbolic addressing and some more.



#42 ralphb OFFLINE  

ralphb

    Moonsweeper

  • Topic Starter
  • 414 posts
  • Location:Germany

Posted Thu Jul 2, 2015 2:04 PM

However, this introduces one inconsistency, namely with some compare instructions (e.g. CGE) where the operands are compared in the reverse order of the 9900 architecture.

 

Oh, I didn't even notice that, but you're right.  That's the business of the interpreter, though; for the assembler, it's still Cxx <src>,<dest>.  

 

But for SLL et al. the original syntax specifies SLL <dest>,<src>, and at least the Ryte Data assembler took the liberty of swapping the arguments.  That's what xga99 does as well; I was actually motivated by Ryte Data about this change.

 

So, as an example, the snippet

CEQ 1,@>8300
SLL 1,@>8300

is assembled to

 

00000000  d6 00 01 e2 00 01                                 |......|
 

by both xga99 and Ryte Data.  The TI Image Tool disassembles it back to

 

0000: CEQ   >01,@>8300
0003: SLL   >01,@>8300
 
so I don't actually see any mismatch in syntax or semantics between the three tools.


#43 RXB OFFLINE  

RXB

    River Patroller

  • 2,585 posts
  • Location:Vancouver, Washington, USA

Posted Thu Jul 2, 2015 7:40 PM

 

Well, I wasn't sure which syntax style is most commonly used either, so I decided to support those variants that I could find. The default is Ryte Data, but you can also select RAG and mizapf style with the -s option (sorry, Michael, you're canon now).  They're all fairly similar, the biggest differences being FMT statements and address formats.

Another option I looked at is the Heiner Martin style. Maybe I'll add support for it eventually as some kind of tribute to Heiner's work.  And I opted not to support the original TI assembler style as specified in the GPL Guide, as the format seemed rather arcane.

 

 

 

The AORG directive should be supported in all styles. Isn't it working for you?

As for the SLL statement -- You're absolutely correct that I reversed the arguments for the shift operations compared to the GPL Guide. I was under the impression that all available GPL assemblers do that -- also note that it is more consistent with all the other instructions, which are always SOURCE, DEST rather than DEST, SOURCE.

But maybe that was a fluke, and only one (dis)assembler actually reverses the order -- I'm looking at you, TI Image Tool! ;-)  Anyway, thanks for the hint, I'll check and update xga99. After all, you should be able to assemble existing sources with the new tool with hardly any modifications.

Hnmm that is backwards. You are thinking the Heiner Martin GPL Disassembly as all of those are backwards. 

 

RXB is the ORIGINAL XB GPL Source code here is a sample of the RXB GROM 5 (>A000)

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0001 
Version 2.0 (Weiand 1985)     Options : LCSFPF                                  
[0001]               ***********************************************************
[0002]                      TITL 'RXB 2015'
[0003]               ***********************************************************
[0004]                      GROM >A000
[0005]               ***********************************************************
[0006]                      TITL 'EQUATES EXEC-359'
[0007]               ***********************************************************
[0008]               *           GROM ADDRESSES
[0009]               ***********************************************************
[0010]               *    EQUATES FOR ROUTINES FROM OTHER GROM SECTIONS
[0011]               * GROM >0000
[0012] 0022          GRINT  EQU  >0022             Greatest integer
[0013]               * GROM >6000 EQUATES
[0014] 6016          SPRINT EQU  >6016             Initialize sprites
[0015] 6018          CHRTBL EQU  >6018             RXB CALL CHRTBL load char set
[0016] 601A          TOPL10 EQU  >601A             Return to main and re-init
[0017] 601C          CHRTAB EQU  >601C             Load default character set
[0018] 601E          SZRUN  EQU  >601E
[0019] 6022          KILSYM EQU  >6022             KILL SYMBOL TABLE ROUTINE
[0020] 602E          AUTO1  EQU  >602E             Get arguments for LIST comman
[0021] 6030          TOPL02 EQU  >6030             RTN address for failing AUTOL
[0022] 6032          EDITLN EQU  >6032             Edit a line into the program
[0023] 6034          GRSUB1 EQU  >6034             Read data (2 bytes) from ERAM
[0024] 6036          GWSUB  EQU  >6036             Write a few bytes of data to
[0025] 6048          MSGBRK EQU  >6048             * BREAKPOINT
[0026] 6053          MSGTA  EQU  >6053             Message "try again"
[0027] 6372          TOPLEV EQU  >6372             RXB CALL USER branch
[0028] 6A78          CHKEND EQU  >6A78             Check end of statement
[0029] 6A7C          DISO   EQU  >6A7C
[0030] 6A7E          ENTER  EQU  >6A7E
[0031] 6A80          ENT09  EQU  >6A80
[0032] 6A82          WARNZZ EQU  >6A82             WARNING MESSAGE ROUTINE
[0033] 6A84          ERRZZ  EQU  >6A84             ERROR MESSAGE ROUTINE
[0034] 6A84          ERRZ   EQU  >6A84             ERRor routine
[0035] 6A86          READL1 EQU  >6A86             Read a line from keyboard
[0036] 63A5          SZNEW  EQU  >63A5             RXB CALL NEW branch
[0037] 63DD          TOPL15 EQU  >63DD             RXB CALL USER branch
[0038] 65C9          SZSIZE EQU  >65C9             RXB CALL SIZE branch
[0039]               * GROM >8000
[0040] 8000          DISPL1 EQU  >8000
[0041] 8002          DELET  EQU  >8002
[0042] 8004          PRINT  EQU  >8004
[0043] 8006          INPUT  EQU  >8006
[0044] 8008          OPEN   EQU  >8008
[0045] 800A          CLOSE  EQU  >800A
[0046] 800C          RESTOR EQU  >800C
[0047] 800E          NREAD  EQU  >800E
[0048] 8012          CLSALL EQU  >8012             RXB branch
[0049] 801C          EOF    EQU  >801C
[0050] 801E          ACCEPT EQU  >801E
[0051] 8020          SRDATA EQU  >8020
[0052] 8022          REC    EQU  >8022
[0053] 802C          GRSUB2 EQU  >802C
[0054] 802E          GRSUB3 EQU  >802E
[0055] 8030          LINPUT EQU  >8030
[0056] 9CEA          CHARS  EQU  >9CEA             RXB Character Definitions
[0057]               * GROM >E000
[0058] E025          GE025  EQU  >E025             RXB branch EA module
[0059]               ***********************************************************
[0060]               *    Equates for XMLs
[0061] 0000          SYNCHK EQU  >00               SYNCHK XML selector
[0062] 0001          FILSPC EQU  >01               Fill-space utility
[0063] 0001          PARCOM EQU  >01               PARse to a COMma selector
[0064] 0002          CSTRIN EQU  >02               Copy-string utility
[0065] 0002          RANGE  EQU  >02               RANGE selector

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0002 
EQUATES EXEC-359
[0066] 0003          SEETWO EQU  >03               SEETWO XML selector
[0067] 0006          FADD   EQU  >06               Floating ADD
[0068] 0008          FMUL   EQU  >08               Floating MULtiply
[0069] 0009          FDIV   EQU  >09               Floating DIVide
[0070] 000A          FCOMP  EQU  >0A               Floating COMPare
[0071] 000B          SADD   EQU  >0B               Stack ADD
[0072] 000C          SSUB   EQU  >0C               Stack SUBtract
[0073] 0010          CSNUM  EQU  >10               Convert String to Number
[0074] 0012          CFI    EQU  >12               Convert to two byte integer
[0075] 0012          FLTINT EQU  >12               Convert floating to integer
[0076] 0070          COMPCT EQU  >70               PREFORM A GARBAGE COLLECTION
[0077] 0071          GETSTR EQU  >71               SYSTEM GET STRING
[0078] 0072          MEMCHK EQU  >72               MEMORY check routine: VDP
[0079] 0073          XCNS   EQU  >73               Convert number to string
[0080]               * Warning Defualt changfd in >0079
[0081] 0074          PARSE  EQU  >74               Parse a value
[0082] 0075          CONT   EQU  >75               Continue parsing
[0083] 0076          EXECG  EQU  >76               Execute a XB stmt or program
[0084] 0077          VPUSH  EQU  >77               Push on value stack
[0085] 0078          VPOP   EQU  >78               Pop off value stack
[0086] 0079          PGMCHR EQU  >79               GET PROGRAM CHARACTER
[0087] 007A          SYM    EQU  >7A               Find SYMBOL entry
[0088] 007B          SMB    EQU  >7B               Find symbol table entry
[0089] 007C          ASSGNV EQU  >7C               Assign VARIABLE
[0090] 007D          SCHSYM EQU  >7D               Search symbol table
[0091] 007E          SPEED  EQU  >7E               SPEED UP XML
[0092] 007F          CRUNCH EQU  >7F               Crunch an input line
[0093] 0080          CIF    EQU  >80               Convert INTEGER to FLOATING P
[0094] 0082          RTNB   EQU  >82               Return
[0095] 0083          SCROLL EQU  >83               SCROLL THE SCREEN
[0096] 0084          IO     EQU  >84               IO utility (KW table search)
[0097] 0085          GREAD  EQU  >85               READ DATA FROM ERAM
[0098] 0086          GWRITE EQU  >86               WRITE DATA TO ERAM
[0099] 0087          DELREP EQU  >87               REMOVE CONTENT FROM VDP/ERAM
[0100] 0088          MVDN   EQU  >88               MOVE DATA IN VDP/ERAM
[0101] 0089          MVUP   EQU  >89               MOVE DATA IN VDP/ERAM
[0102] 008A          VGWITE EQU  >8A               MOVE DATA FROM VDP TO ERAM
[0103] 008B          GVWITE EQU  >8B               WRITE DATA FROM GRAM TO VRAM
[0104] 008C          GREAD1 EQU  >8C               READ DATA FROM ERAM
[0105] 008E          GDTECT EQU  >8E               ERAM DETECT&ROM PAGE 1 ENABLE
[0106] 008F          SCNSMT EQU  >8F               SCAN STATEMENT FOR PRESCAN
[0107]               ***********************************************************
[0108]               *    Temporary workspaces in EDIT
[0109] 8300          VAR0   EQU  >8300            TEMPORARY
[0110] 8300          SP00   EQU  >8300            SPRITE value
[0111] 8300          PTFBSL EQU  >8300            Ptr to 1st byte in SPEAK list
[0112] 8300          PHLEN  EQU  >8300            PHrom data LENgth
[0113] 8301          VARV   EQU  >8301            TEMPORARY
[0114] 8301          PHRADD EQU  >8301            PHRom ADDress
[0115] 8302          ACCUM  EQU  >8302            # OF BYTES ACCUMULATOR (4 BYTE
[0116] 8302          STPT   EQU  >8302            TWO BYTES
[0117] 8302          MNUM   EQU  >8302            Ussually a counter
[0118] 8302          AAA1   EQU  >8302
[0119] 8302          SP02   EQU  >8302            SPRITE value
[0120] 8302          PTLBSL EQU  >8302            Ptr to last byte in SPEAK list
[0121] 8304          VARY   EQU  >8304
[0122] 8304          PABPTR EQU  >8304            Pointer to current PAB
[0123] 8304          SP04   EQU  >8304            SPRITE value
[0124] 8304          PTEBSL EQU  >8304            Ptr to end byte in SPEAK list
[0125]               * NOTE: PTEBSL points to the end of the temporary speak lis
[0126]               *       whereas PTLBSL points to the last byte actually use
[0127]               *       i.e.    PTFBSL <= PTLBSL <= PTEBSL
[0128] 8306          VARY2  EQU  >8306            Use in MVDN only
[0129] 8306          DFLTLM EQU  >8306            Default array limit (10)

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0003 
EQUATES EXEC-359
[0130] 8306          CCPPTR EQU  >8306            OFFSET WITHIN RECORED (1)
[0131]               *                             or Pointer to current column
[0132] 8306          SP06   EQU  >8306            SPRITE value
[0133] 8306          PTFCIS EQU  >8306            Ptr to 1st character in string
[0134] 8307          RECLEN EQU  >8307            LENGTH OF CURRENT RECORD (1)
[0135] 8308          CCPADR EQU  >8308            RAM address of current refs
[0136]               *                             or Actual buffer address or c
[0137] 8308          VARC   EQU  >8308
[0138] 8308          CCPADD EQU  >8308            RAM address of current color
[0139] 8308          CCC1   EQU  >8308
[0140] 8308          SPSAL  EQU  >8308            Location of sprite attribute l
[0141] 8308          PTCCIS EQU  >8308            Ptr to current character in st
[0142] 830A          CALIST EQU  >830A            Call list for resolving refs
[0143] 830A          RAMPTR EQU  >830A            Pointer for crunching
[0144] 830A          STADDR EQU  >830A            Start address - usually for co
[0145] 830A          SPTMP  EQU  >830A            Temporary variable
[0146] 830A          PTLCIS EQU  >830A            Ptr to last character in strin
[0147] 830B          VAR2   EQU  >830B
[0148] 830C          BYTES  EQU  >830C            BYTE COUNTER
[0149]               *                             or String length for GETSTR
[0150] 830C          NMPTR  EQU  >830C            Pointer save for pscan
[0151] 830C          BBB1   EQU  >830C
[0152] 830C          PTFCIP EQU  >830C            Ptr to 1st character in phrase
[0153] 830E          CHSAV  EQU  >830E
[0154] 830E          CURINC EQU  >830E            Increment for auto-num mode
[0155] 830E          VAR4   EQU  >830E
[0156] 830E          PTCCIP EQU  >830E            Ptr to current character in ph
[0157] 8310          TOPSTK EQU  >8310            Top of data stack pointer
[0158] 8310          VAR5   EQU  >8310            VAR5 through VAR5+3 used in RA
[0159] 8310          PTLCIP EQU  >8310            Ptr to last character in phras
[0160] 8311          VAR6   EQU  >8311
[0161] 8312          LINUM  EQU  >8312            Used to determine end of scan
[0162] 8312          PTFBPH EQU  >8312            Ptr to 1st byte in PHrom
[0163] 8312          VAR7   EQU  >8312            Used in CHARLY
[0164] 8312          STRPTR EQU  >8312            RXB PATCH CODE
[0165] 8314          NMLEN  EQU  >8314            Current line for auto-num
[0166] 8314          CURLIN EQU  >8314            Current line for auto-num
[0167]               *                             or Starting line number for L
[0168] 8314          PTCCPH EQU  >8314            Ptr to current byte in PHrom
[0169] 8314          VAR9   EQU  >8314             Used in CHARLY
[0170] 8316          XFLAG  EQU  >8316            SCAN FLAG-BITS USED AS BELOW
[0171] 8316          PTLCPH EQU  >8316            Ptr to last byte in PHrom
[0172] 8317          DSRFLG EQU  >8317            INTERNAL =60, EXTERNAL =0 (1)
[0173] 8317          OPTFLG EQU  >8317            Option flag byte during OPEN
[0174] 8317          FORNET EQU  >8317            Nesting level of for/next
[0175] 8317          FNUM   EQU  >8317            Current file number for search
[0176]               ***********************************************************
[0177]               *    Permanent workspace variables
[0178] 8318          STRSP  EQU  >8318            String space begining
[0179] 831A          STREND EQU  >831A            String space ending
[0180] 831C          SREF   EQU  >831C            Temporary string pointer
[0181] 831E          SMTSRT EQU  >831E            Start of current statement
[0182] 8320          VARW   EQU  >8320            Screen address (CURSOR)
[0183] 8322          ERRCOD EQU  >8322            Return error code from ALC
[0184] 8324          STVSPT EQU  >8324            Value-stack base
[0185] 8326          RTNG   EQU  >8326            Return vector from 9900 code
[0186] 8328          NUDTAB EQU  >8328            Start of NUD table
[0187] 832A          VARA   EQU  >832A            Ending display location
[0188] 832C          PGMPTR EQU  >832C            Program text pointer (TOKEN)
[0189] 832E          EXTRAM EQU  >832E            Line number table pointer
[0190] 8330          STLN   EQU  >8330            Start of line number table
[0191] 8332          ENLN   EQU  >8332            End of line number table
[0192] 8334          DATA   EQU  >8334            Data pointer for READ
[0193] 8336          LNBUF  EQU  >8336            Line table pointer for READ

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0004 
EQUATES EXEC-359
[0194] 8338          INTRIN EQU  >8338            Add of intrinsic poly constant
[0195] 833A          SUBTAB EQU  >833A            Subprogram symbol table
[0196] 833C          IOSTRT EQU  >833C            PAB list/Start of I/O chain
[0197] 833E          SYMTAB EQU  >833E            Symbol table pointer
[0198] 8340          FREPTR EQU  >8340            Free space pointer
[0199] 8342          CHAT   EQU  >8342            Current charater/token
[0200] 8343          BASE   EQU  >8343            OPTION BASE value
[0201] 8344          PRGFLG EQU  >8344            Program/imperative flag
[0202] 8345          FLAG   EQU  >8345            General 8-bit flag
[0203] 8346          BUFLEV EQU  >8346            Crunch-buffer destruction leve
[0204] 8348          LSUBP  EQU  >8348            Last subprogram block on stack
[0205]               * FAC  EQU  >834A            Floating-point ACcurmulator
[0206] 834A          CCHAR  EQU  >834A            Current character
[0207] 834B          FAC1   EQU  FAC+1
[0208] 834B          SPLFLG EQU  >834B            SPelL out phrase FLaG
[0209] 834C          FAC2   EQU  FAC+2
[0210] 834C          AAA    EQU  FAC+2
[0211] 834C          TOTTIM EQU  >834C            TOTal wait TIMe
[0212]               * NOTE: DATAD must follow immediately after TOTTIM. The
[0213]               *       routine STDATA is counting on this fact!
[0214] 834D          FAC3   EQU  FAC+3
[0215] 834D          DATAAD EQU  >834D            Speech DATA ADdress
[0216] 834E          FAC4   EQU  FAC+4
[0217] 834E          CCC    EQU  FAC+4
[0218] 834E          FFF    EQU  FAC+4
[0219] 834F          FAC5   EQU  FAC+5
[0220] 834F          PTLCIL EQU  >834F            Pointer To Last Character In L
[0221] 8350          FAC6   EQU  FAC+6
[0222] 8350          BBB    EQU  FAC+6
[0223] 8350          EEE    EQU  FAC+6
[0224] 8351          FAC7   EQU  FAC+7
[0225] 8351          TIMLEN EQU  >8351             TIMe LENgth of timing charact
[0226] 8352          FAC8   EQU  FAC+8
[0227] 8352          PHADDR EQU  >8352             PHrom ADDRess
[0228] 8353          FAC9   EQU  FAC+9
[0229] 8354          FAC10  EQU  FAC+10
[0230] 8354          DDD1   EQU  FAC+10
[0231] 8354          TEMP1  EQU  >8354            TEMPorary CPU location 1
[0232] 8355          FAC11  EQU  FAC+11
[0233] 8356          FAC12  EQU  FAC+12
[0234] 8356          FFF1   EQU  FAC+12
[0235] 8356          TEMP2  EQU  >8356            TEMPorary CPU location 2
[0236] 8357          FAC13  EQU  FAC+13
[0237] 8358          FAC14  EQU  FAC+14
[0238] 8358          EEE1   EQU  FAC+14
[0239] 8358          READ   EQU  >8358            Address of speech peripheral
[0240]               *                             READ byte interface
[0241] 8359          FAC15  EQU  FAC+15
[0242] 835A          FAC16  EQU  FAC+16
[0243] 835A          WRITE  EQU  >835A            Address of speech peripheral
[0244]               *                             WRITE byte interface
[0245] 835B          FAC17  EQU  FAC+17
[0246]               * ARG  EQU  >835C            Floating-point ARGument
[0247] 835D          ARG1   EQU  ARG+1
[0248] 835D          PHDATA EQU  >835D            PHrom DATA
[0249] 835E          ARG2   EQU  ARG+2
[0250] 835E          PTCBED EQU  >835E            Ptr To Current Byte Ext Data
[0251] 835F          ARG3   EQU  ARG+3
[0252] 8360          ARG4   EQU  ARG+4
[0253] 8360          LENCST EQU  >8360            LEN of Current ext data STring
[0254] 8361          ARG5   EQU  ARG+5
[0255] 8362          ARG6   EQU  ARG+6
[0256] 8362          LENWST EQU  >8362            LEN of Whole ext data STring
[0257] 8363          ARG7   EQU  ARG+7

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0005 
EQUATES EXEC-359
[0258] 8364          ARG8   EQU  ARG+8
[0259] 8364          STRLEN EQU  >8364            STRing LENgth
[0260] 8364          TEMP4  EQU  >8364
[0261] 8366          TEMP5  EQU  >8366
[0262]               * NOTE: BYTE1, BYTE2, and BYTE3 must be in consecutive memo
[0263]               *       locations, and in the following order for SPGET to
[0264]               *       work!
[0265] 8366          BYTE1  EQU  >8366            BYTE 1
[0266] 8367          BYTE2  EQU  >8367            BYTE 2
[0267] 8368          BYTE3  EQU  >8368            BYTE 3
[0268] 8368          TEMP6  EQU  >8368
[0269] 8369          SPKSTS EQU  >8369            SPeaK StaTus
[0270]               * FPERAD EQU  >836C          Value stack pointer
[0271] 8367          ARG11  EQU  ARG+11
[0272] 836B          ARG15  EQU  ARG+15
[0273] 836C          ARG16  EQU  ARG+16
[0274]               * VSPTR  EQU  >836E          Value stack pointer
[0275]               ***********************************************************
[0276]               *    GPL Status Block
[0277] 8370          HIVDP  EQU  >8370             Highest VDP Available
[0278]               * SUBSTK EQU  >8373           SUBROUTINE STACK
[0279] 8374          KEYBD  EQU  >8374             KEYBOARD SELCTION
[0280] 8375          RKEY   EQU  >8375             KEY CODE
[0281] 8376          EXPZ   EQU  >8376             Exponent in floating-point
[0282] 8376          JOYY   EQU  >8376             JOYSTICK Y POSITION
[0283] 8377          JOYX   EQU  >8377             JOYSTICK X POSITION
[0284] 8378          RANDOM EQU  >8378             RANDOM NUMBER GENERATOR
[0285] 8379          TIMER  EQU  >8379             TIMING REGISTER
[0286] 837A          MOTION EQU  >837A             NUMBER OF MOVING SPRITES
[0287] 837B          VDPSTS EQU  >837B             VDP STATUS REGISTER
[0288] 837B          VDPSTT EQU  >837B             VDP STATUS REGISTER
[0289] 837C          ERCODE EQU  >837C             STATUS REGISTER
[0290] 837D          CB     EQU  >837D             Character Buffer
[0291]               ***********************************************************
[0292] 8384          RAMTOP EQU  >8384            Highest address in ERAM
[0293] 8386          RAMFRE EQU  >8386            Free pointer in the ERAM
[0294] 8388          RSTK   EQU  >8388            Subroutine stack base
[0295]               *                             (Starts at >8A)
[0296] 8389          RAMFLG EQU  >8389            ERAM flag
[0297] 8389          GRAMFL EQU  >8389            GRAM / VDP flag
[0298] 83AF          STKMIN EQU  >83AF            Base of data stack
[0299] 83BD          STKMAX EQU  >83BD            Top of data stack
[0300] 83CE          PRTNFN EQU  >83CE            Sound - previous tone finished
[0301]               ***********************************************************
[0302]               *    VDP addresses
[0303] 02E0          SCRNBS EQU  >02E0             Screen base addr for last lin
[0304] 02E2          NLNADD EQU  >02E2             New LiNe ADDress
[0305] 02FE          ENDSCR EQU  >02FE             END of SCReen address
[0306] 0300          SPRSAL EQU  >0300             Sprite attribute list
[0307] 0371          LODFLG EQU  >0371             Auto-boot flag
[0308] 0372          START  EQU  >0372             Line to start execution at
[0309]               * Temporary
[0310] 0374          NOTONE EQU  >0374             NO-TONE for SIZE in ACCEPT us
[0311]               *                              in FLMGRS (4 bytes used)
[0312] 0376          SYMBOL EQU  >0376             Saved symbol table pointer
[0313] 0378          ONECHR EQU  >0378             Used for CHRZ
[0314] 0379          VRMSND EQU  >0379             Sound blocks
[0315] 0382          SPGMPT EQU  >0382             Saved PGMPTR for continue
[0316] 0384          SBUFLV EQU  >0384             Saved BUFLEV for contiue
[0317] 0386          SEXTRM EQU  >0386             Saved EXTRAM for continue
[0318] 0388          SAVEVP EQU  >0388             Saved VSPRT for continue
[0319] 038A          ERRLN  EQU  >038A             On-error line pointer
[0320] 0390          CSNTMP EQU  >0390             Use as temporary stored place
[0321]               *                          or CSN TEMPORARY FOR FAC12

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0006 
EQUATES EXEC-359
[0322] 0392          TABSAV EQU  >0392             Saved main symbol table ponte
[0323] 0394          AUTTMP EQU  >0394             AUTOLD TEMPORARY IN SIDE ERRZ
[0324] 0396          SLSUBP EQU  >0396             Saved LSUBP for continue
[0325] 0398          SFLAG  EQU  >0398             Saved on-warning/break bits
[0326] 039A          SSTEMP EQU  >039A             To save subprogram program ta
[0327] 039C          SSTMP2 EQU  >039C             Same as above. Used in SUBPRO
[0328] 039E          MRGPAB EQU  >039E             MERGEd temporary for pab ptr
[0329] 03A0          RNDX2  EQU  >03A0             Random number generator seed
[0330] 03A5          RNDX1  EQU  >03A5             Random number generator seed
[0331] 03AA          INPUTP EQU  >03AA             INPUT TEMPORARY FOR PTR TO PR
[0332] 03AA          SPNUM  EQU  >03AA             Sprite number temporary, also
[0333]               *                              in INPUTP in FLMGR
[0334] 03AC          ACCVRW EQU  >03AC             Temoporary used in ERRZZ, als
[0335]               *                              used in FLMGRS
[0336]               *                             or temporary for @VARW, @VARA
[0337] 03AE          ACCVRA EQU  >03AE             TRY AGAIN
[0338] 03B0          VALIDP EQU  >03B0             Use as two values passing fro
[0339]               *                          or PTR TO STANDARD STRING IN VAL
[0340] 03B2          VALIDL EQU  >03B2             VALIDATE code to READL1
[0341]               *                          or Length of string in validate
[0342] 03B4          SIZCCP EQU  >03B4             SIZE TEMPORARY FOR CCPADR
[0343] 03B6          SIZREC EQU  >03B6             SIZE TEMPORARY FOR RECLEN
[0344]               *
[0345] 03B7          ACCTRY EQU  >03B7             ACCEPT "TRY AGAIN" FLAG
[0346] 03B8          SIZXPT EQU  >03B8             Save XPT in SIZE when "try ag
[0347] 03BA          CSNTP1 EQU  >03BA             CSN TEMPORARY FOR FAC10
[0348]               *
[0349] 03BC          OLDTOP EQU  >03BC             Temporary used in ERRZZ, also
[0350]               *                          or Old top of memory for RELOCA
[0351] 03BC          CPTEMP EQU  >03BC             CCPPTR, RECLEN temp in INPUT
[0352] 03BE          NEWTOP EQU  >03BE             New top of memory for RELOCA
[0353] 03C0          VROAZ  EQU  >03C0             Temporary roll-out area
[0354] 07FF          SPRVB  EQU  >07FF             Sprite velocity block.
[0355] 0820          CRNBUF EQU  >0820             CRuNch BUFfer address
[0356] 08BE          CRNEND EQU  >08BE             CRuNch buffer END
[0357] 0958          VRAMVS EQU  >0958             Default base of value stack
[0358]               ***********************************************************
[0359]               *    IMMEDITATE VALUES
[0360] 0000          NUMBR  EQU  >00               NUMERIC validate
[0361] 0002          LISTZ  EQU  >02
[0362] 0003          X2     EQU  >03
[0363] 0005          OLDZ   EQU  >05
[0364] 0006          RESEQZ EQU  >06
[0365] 0007          SAVEZ  EQU  >07
[0366] 0008          MERGEZ EQU  >08
[0367] 000A          DWNARR EQU  >0A
[0368] 000B          UPARR  EQU  >0B
[0369] 000D          CHRTN  EQU  >0D
[0370] 0020          BKGD   EQU  >20               BACKGROUND CHARACTER
[0371] 0060          OFFSET EQU  >60               OFFSET FOR VIDEO TABLES
[0372] 0065          STRVAL EQU  >65               Value in accum. is string val
[0373]               ***********************************************************
[0374]               * Editting command equates & keys or symbols
[0375] 0002          BREAK  EQU  >02               Break key
[0376] 0003          DLETE  EQU  >03               Delete key
[0377] 0004          INSRT  EQU  >04               Insert key
[0378] 0006          RECALL EQU  >06               Edit-buffer recall
[0379] 0007          CLRLN  EQU  >07               Clear-line key
[0380] 0008          BACK   EQU  >08               Back-space key
[0381] 0009          FORW   EQU  >09               Forward-space key
[0382] 000A          DOWN   EQU  >0A               Down-arrow key
[0383] 000B          UPMV   EQU  >0B               Up-arrow key
[0384] 001C          VWIDTH EQU  >1C               Screen width (PRINT)
[0385] 0020          SPACE  EQU  >20               Space key

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0007 
EQUATES EXEC-359
[0386] 0022          QUOTE  EQU  >22               "
[0387] 0023          NUMBER EQU  >23               #
[0388] 0024          DOLLAR EQU  >24               $
[0389] 007E          CURSOR EQU  >1E+OFFSET        CURSOR
[0390] 007F          EDGECH EQU  >1F+OFFSET        EDGE character
[0391] 002B          PLUS   EQU  >2B               +
[0392] 002C          COMMAT EQU  >2C               ,
[0393] 002D          MINUS  EQU  >2D               -
[0394] 002D          HYPEN  EQU  >2D               +
[0395] 002E          PERIOD EQU  >2E               .
[0396] 0030          ZERO   EQU  >30               0
[0397] 0039          NINE   EQU  >39               9
[0398] 003A          COLON  EQU  >3A               :
[0399] 003B          SEMICO EQU  >3B               ;
[0400] 003C          LESS   EQU  >3C               <
[0401] 003E          GREAT  EQU  >3E               >
[0402] 0041          A      EQU  >41               A
[0403] 0046          F      EQU  >46               F
[0404]               ***********************************************************
[0405]               *    BASIC TOKEN TABLE
[0406]               *      EQU  >80               spare token
[0407] 0081          ELSEZ  EQU  >81               ELSE
[0408] 0082          SSEPZ  EQU  >82               ::
[0409] 0083          TREMZ  EQU  >83               $
[0410] 0084          IFZ    EQU  >84               IF
[0411] 0085          GOZ    EQU  >85               GO
[0412] 0086          GOTOZ  EQU  >86               GOTO
[0413] 0087          GOSUBZ EQU  >87               GOSUB
[0414] 0088          RETURZ EQU  >88               RETURN
[0415] 0089          DEFZ   EQU  >89               DEF
[0416] 008A          DIMZ   EQU  >8A               DIM
[0417] 008B          ENDZ   EQU  >8B               END
[0418] 008C          FORZ   EQU  >8C               FOR
[0419] 008D          LETZ   EQU  >8D               LET
[0420] 008E          BREAKZ EQU  >8E               BREAK
[0421] 008F          UNBREZ EQU  >8F               UNBREAK
[0422] 0090          TRACEZ EQU  >90               TRACE
[0423] 0091          UNTRAZ EQU  >91               UNTRACE
[0424] 0092          INPUTZ EQU  >92               INPUT
[0425] 0093          DATAZ  EQU  >93               DATA
[0426] 0094          RESTOZ EQU  >94               RESTORE
[0427] 0095          RANDOZ EQU  >95               RANDOMIZE
[0428] 0096          NEXTZ  EQU  >96               NEXT
[0429] 0097          READZ  EQU  >97               READ
[0430] 0098          STOPZ  EQU  >98               STOP
[0431] 0099          DELETZ EQU  >99               DELETE
[0432] 009A          REMZ   EQU  >9A               REM
[0433] 009B          ONZ    EQU  >9B               ON
[0434] 009C          PRINTZ EQU  >9C               PRINT
[0435] 009D          CALLZ  EQU  >9D               CALL
[0436] 009E          OPTIOZ EQU  >9E               OPTION
[0437] 009F          OPENZ  EQU  >9F               OPEN
[0438] 00A0          CLOSEZ EQU  >A0               CLOSE
[0439] 00A1          SUBZ   EQU  >A1               SUB
[0440] 00A2          DISPLZ EQU  >A2               DISPLAY
[0441] 00A3          IMAGEZ EQU  >A3               IMAGE
[0442] 00A4          ACCEPZ EQU  >A4               ACCEPT
[0443] 00A5          ERRORZ EQU  >A5               ERROR
[0444] 00A6          WARNZ  EQU  >A6               WARNING
[0445] 00A7          SUBXTZ EQU  >A7               SUBEXIT
[0446] 00A8          SUBNDZ EQU  >A8               SUBEND
[0447] 00A9          RUNZ   EQU  >A9               RUN
[0448] 00AA          LINPUZ EQU  >AA               LINPUT
[0449]               *      EQU  >AB               spare token (LIBRARY)

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0008 
EQUATES EXEC-359
[0450]               *      EQU  >AC               spare token (REAL)
[0451]               *      EQU  >AD               spare token (INTEGER)
[0452]               *      EQU  >AE               spare token (SCRATCH)
[0453]               *      EQU  >AF               spare token
[0454] 00B0          THENZ  EQU  >B0               THEN
[0455] 00B1          TOZ    EQU  >B1               TO
[0456] 00B2          STEPZ  EQU  >B2               STEP
[0457] 00B3          COMMAZ EQU  >B3               ,
[0458] 00B4          SEMICZ EQU  >B4               ;
[0459] 00B5          COLONZ EQU  >B5               :
[0460] 00B6          RPARZ  EQU  >B6               )
[0461] 00B7          LPARZ  EQU  >B7               (
[0462] 00B8          CONCZ  EQU  >B8               &          (CONCATENATE)
[0463]               *      EQU  >B9               spare token
[0464] 00BA          ORZ    EQU  >BA               OR
[0465] 00BB          ANDZ   EQU  >BB               AND
[0466] 00BC          XORZ   EQU  >BC               XOR
[0467] 00BD          NOTZ   EQU  >BD               NOT
[0468] 00BE          EQUALZ EQU  >BE               =
[0469] 00BF          LESSZ  EQU  >BF               <
[0470] 00C0          GREATZ EQU  >C0               >
[0471] 00C1          PLUSZ  EQU  >C1               +
[0472] 00C2          MINUSZ EQU  >C2               -
[0473] 00C3          MULTZ  EQU  >C3               *
[0474] 00C4          DIVIZ  EQU  >C4               /
[0475] 00C5          CIRCUZ EQU  >C5               ^
[0476]               *      EQU  >C6               spare token
[0477] 00C7          STRINZ EQU  >C7               QUOTED STRING
[0478] 00C8          UNQSTZ EQU  >C8               UNQUOTED STRING
[0479] 00C8          NUMZ   EQU  >C8               ALSO NUMERICAL STRING
[0480] 00C8          NUMCOZ EQU  >C8               ALSO UNQUOTED STRING
[0481] 00C9          LNZ    EQU  >C9               LINE NUMBER CONSTANT
[0482]               *      EQU  >CA               spare token
[0483] 00CB          ABSZ   EQU  >CB               ABS
[0484] 00CC          ATNZ   EQU  >CC               ATN
[0485] 00CD          COSZ   EQU  >CD               COS
[0486] 00CE          EXPZZ  EQU  >CE               EXP
[0487] 00CF          INTZ   EQU  >CF               INT
[0488] 00D0          LOGZ   EQU  >D0               LOG
[0489] 00D1          SGNZZ  EQU  >D1               SGN
[0490] 00D2          SINZ   EQU  >D2               SIN
[0491] 00D3          SQRZ   EQU  >D3               SQR
[0492] 00D4          TANZ   EQU  >D4               TAN
[0493] 00D5          LENZ   EQU  >D5               LEN
[0494] 00D6          CHRZZ  EQU  >D6               CHR$
[0495] 00D7          RNDZ   EQU  >D7               RND
[0496] 00D8          SEGZZ  EQU  >D8               SEG$
[0497] 00D9          POSZ   EQU  >D9               POS
[0498] 00DA          VAL    EQU  >DA               VAL
[0499] 00DB          STRZZ  EQU  >DB               STR$
[0500] 00DC          ASCZ   EQU  >DC               ASC
[0501] 00DD          PIZ    EQU  >DD               PI
[0502] 00DE          RECZ   EQU  >DE               REC
[0503] 00DF          MAXZ   EQU  >DF               MAX
[0504] 00E0          MINZ   EQU  >E0               MIN
[0505] 00E1          RPTZZ  EQU  >E1               RPT$
[0506]               *      EQU  >E2               unused
[0507]               *      EQU  >E2               unused
[0508]               *      EQU  >E3               unused
[0509]               *      EQU  >E4               unused
[0510]               *      EQU  >E5               unused
[0511]               *      EQU  >E6               unused
[0512]               *      EQU  >E7               unused
[0513] 00E8          NUMERZ EQU  >E8               NUMERIC

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0009 
EQUATES EXEC-359
[0514] 00E9          DIGITZ EQU  >E9               DIGIT
[0515] 00EA          UALPHZ EQU  >EA               UALPHA
[0516] 00EB          SIZEZ  EQU  >EB               SIZE
[0517] 00EC          ALLZ   EQU  >EC               ALL
[0518] 00ED          USINGZ EQU  >ED               USING
[0519] 00EE          BEEPZ  EQU  >EE               BEEP
[0520] 00EF          ERASEZ EQU  >EF               ERASE
[0521] 00F0          ATZ    EQU  >F0               AT
[0522] 00F1          BASEZ  EQU  >F1               BASE
[0523]               *      EQU  >F2               spare token (TEMPORARY)
[0524] 00F3          VARIAZ EQU  >F3               VARIABLE
[0525] 00F4          RELATZ EQU  >F4               RELATIVE
[0526] 00F5          INTERZ EQU  >F5               INTERNAL
[0527] 00F6          SEQUEZ EQU  >F6               SEQUENTIAL
[0528] 00F7          OUTPUZ EQU  >F7               OUTPUT
[0529] 00F8          UPDATZ EQU  >F8               UPDATE
[0530] 00F9          APPENZ EQU  >F9               APPEND
[0531] 00FA          FIXEDZ EQU  >FA               FIXED
[0532] 00FB          PERMAZ EQU  >FB               PERMANENT
[0533] 00FC          TABZ   EQU  >FC               TAB
[0534] 00FD          NUMBEZ EQU  >FD               #
[0535] 00FE          VALIDZ EQU  >FE               VALIDATE
[0536]               *      EQU  >FF               ILLEGAL VALUE
[0537]               *****************************************************
[0538]               ***********************************************************
[0539]               * NOTE: FILES EXECSD, SUBS AND PART OF PSCANS ARE IN GROM 5
[0540]               *       AS BELOW:
[0541]               *-------NAME------------------ADDRESS---------BYTES LEFT---
[0542]               *      EXECS                  >A000 - >AD92        5
[0543]               *      SUBS                   >AD98 - >B4DC        2
[0544]               *      PSCANS                 >B4E0 - >B7FA        5
[0545]               *
[0546]               * Some of the error calls at the end of EXECS file are
[0547]               * shared and directly addressed by SUBS file. Any change in
[0548]               * EXECS file which affects the address of error calls will
[0549]               * affect error reference in SUBS file. Make sure to edit
[0550]               * SUBS file in that situation.
[0551]               ***********************************************************
[0552] A000 0F,75           XML  CONT              XML CONT used by subprogram
[0553] A002 43,FB           BR   LITS05            Build FAC entry and GETSTR
[0554] A004 40,9C           BR   EXEC              Execute a program
[0555] A006 48,D3           BR   LINE
[0556] A008 48,6E           BR   DATAST
[0557] A00A 48,8A           BR   ASC
[0558] A00C 40,A9           BR   EXEC1
[0559] A00E 41,2B           BR   EXEC6D            Save information on a break
[0560] A010 48,0A           BR   DELINK            Delink symbol table entry
[0561] A012 48,E5           BR   CONV1
[0562] A014 49,FC           BR   SQUISH            Called in error routine in PS
[0563] A016 45,71           BR   VALCD
[0564] A018 42,8D           BR   INTRND
[0565] A01A 40,1A           BR   $
[0566] A01C 4B,1A    GA01C  BR   LNKRTN            Routine to go back to XB prog
[0567] A01E 49,89    GA01E  BR   SPCOL             Clear breakpoint in line # ro
[0568] A020 46,FC           BR   UBSUB             Spare
[0569] A022 40,22           BR   $
[0570] A024 40,24           BR   $         ***     Please let me know it you add
[0571]               *                     ***     branches here since it will a
[0572]               *                     ***     the address of link list. Sum
[0573] A026 A0,30    LINK1  DATA LINK2
[0574] A028 05,53,4F        STRI 'SOUND'           SOUND
       A02B 55,4E,44
[0575] A02E AA,3E           DATA XSOUND
[0576] A030 A0,3A    LINK2  DATA LINK3

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0010 
EQUATES EXEC-359
[0577] A032 05,43,4C        STRI 'CLEAR'           CLEAR
       A035 45,41,52
[0578] A038 AA,18           DATA CLEAR
[0579] A03A A0,44    LINK3  DATA LINK4
[0580] A03C 05,43,4F        STRI 'COLOR'           COLOR
       A03F 4C,4F,52
[0581] A042 A9,1D           DATA COLOR
[0582] A044 A0,4E    LINK4  DATA LINK5
[0583] A046 05,47,43        STRI 'GCHAR'           GCHAR 
       A049 48,41,52
[0584] A04C A8,FA           DATA GCHAR
[0585] A04E A0,58    LINK5  DATA LINK6
[0586] A050 05,48,43        STRI 'HCHAR'           HCHAR
       A053 48,41,52
[0587] A056 AB,03           DATA HCHAR
[0588] A058 A0,62    LINK6  DATA LINK7
[0589] A05A 05,56,43        STRI 'VCHAR'           VCHAR 
       A05D 48,41,52
[0590] A060 AB,26           DATA VCHAR
[0591] A062 A0,6B    LINK7  DATA LINKA
[0592] A064 04,43,48        STRI 'CHAR'            CHAR 
       A067 41,52
[0593] A069 AB,46           DATA CHARLY
[0594] A06B A0,73    LINKA  DATA LINKB
[0595] A06D 03,4B,45        STRI 'KEY'             KEY
       A070 59
[0596] A071 BC,FD           DATA ZKEY
[0597] A073 A0,7D    LINKB  DATA LINKC
[0598] A075 05,4A,4F        STRI 'JOYST'           JOYST
       A078 59,53,54
[0599] A07B BE,15           DATA ZJOYST
[0600] A07D A0,88    LINKC  DATA LINKD
[0601] A07F 06,53,43        STRI 'SCREEN'          KEY
       A082 52,45,45
       A085 4E
[0602] A086 AC,C9           DATA BORDER
[0603] A088 A0,94    LINKD  DATA LINKE
[0604] A08A 07,56,45        STRI 'VERSION'         VERSION
       A08D 52,53,49
       A090 4F,4E
[0605] A092 AA,1F           DATA VERS
[0606] A094 AE,00    LINKE  DATA LINKS1
[0607] A096 03,45,52        STRI 'ERR'             ERR
       A099 52
[0608] A09A AC,F9           DATA ERRWXY
[0609]               ***********************************************************
[0610]               *        START EXECUTION OF A PROGRAM OR STATEMENT
[0611]               * DATA:
[0612]               *      RAM(START) points into line number table at the
[0613]               *      first line to execute
[0614]               *      @PGMFLG contains >FF if executing a program or zero
[0615]               *      if imperative statement
[0616]               ***********************************************************
[0617] A09C 8E,44    EXEC   CZ   @PRGFLG           If program
[0618] A09E 60,AE           BS   GA0AE
[0619] A0A0 BD,2E,A3        DST  V@START,@EXTRAM   Line to start execution at
       A0A3 72
[0620] A0A4 95,2E           DINCT @EXTRAM          Pointer to text pointer
[0621] A0A6 06,A2,8D        CALL INTRND            Initialize random number
[0622] A0A9 BE,7F,03 EXEC1  ST   X2,@XPT           Initialize screen display
[0623] A0AC 40,B2           BR   GA0B2
[0624] A0AE BF,2C,08 GA0AE  DST  CRNBUF,@PGMPTR    Executing out of crunch buffe
       A0B1 20
[0625] A0B2 BF,26,A0 GA0B2  DST  EXEC20,@RTNG      Address of return from ALC

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0011 
EQUATES EXEC-359
       A0B5 BC
[0626] A0B6 BF,28,A1        DST  NUDTB,@NUDTAB     NUD table address for ALC
       A0B9 47
[0627] A0BA 0F,76           XML  EXECG             Execute XB
[0628] A0BC 8A,23    EXEC20 CASE @ERRCOD+1         Check type of return
[0629] A0BE 40,DF           BR   EXECND            0 - NORMAL END
[0630] A0C0 41,1A           BR   EXECBK            1 - BREAKPOINT
[0631] A0C2 40,ED           BR   EXECTR            2 - TRACE
[0632] A0C4 48,AB           BR   ERORZ             3 - ERROR
[0633] A0C6 40,D4           BR   WARNGZ            4 - WARNING
[0634] A0C8 41,DA           BR   ONERR             5 - ON ERROR
[0635] A0CA 47,17           BR   UDF               6 - FUNCTION
[0636] A0CC 42,18           BR   ONBRK             7 - ON BREAK
[0637] A0CE 44,38           BR   CONCAT            8 - CONCATENATE STRINGS "&"
[0638] A0D0 41,AA           BR   ONWARN            9 - ON WARNING
[0639] A0D2 42,2F           BR   GPLCAL            A - CALL STATEMENT
[0640] A0D4 C6,73,B0 WARNGZ CH   >B0,@SUBSTK
[0641] A0D7 6D,CA           BS   ERRSO
[0642]               * Stack overflow
[0643]               *                    ALLOW ROOM ON STACK FOR WARNING CALLS
[0644] A0D9 06,6A,82 WRNN01 CALL WARNZZ        ONLY WARNING MSG FROM XB SUPPORT
[0645] A0DC 02              BYTE 2       *         NUMERIC OVERFLOW
[0646] A0DD 41,16           BR   CLRRTN            Clear ERRCOD and return
[0647]               *                    NORMAL END OF EXECUTION
[0648] A0DF 8E,44    EXECND CZ   @PRGFLG           If imperative mode
[0649] A0E1 40,E9           BR   ERRRDY
[0650] A0E3 06,60,1C        CALL CHRTAB            Load the default character se
[0651] A0E6 05,63,DD        B    TOPL15            Return to top-level
[0652] A0E9 06,6A,84 ERRRDY CALL ERRZZ             Display * READY *
[0653] A0EC 00              BYTE 0
[0654]               * TRACE-MODE turned on - display line number
[0655] A0ED 86,20    EXECTR CLR  @VARW             Clear upper address byte
[0656] A0EF BC,21,7F        ST   @XPT,@VARW+1      Get current x-pointer
[0657] A0F2 A3,20,02        DADD NLNADD-3,@VARW    Make a valid screen address
       A0F5 DF
[0658] A0F6 C7,20,02        DCH  NLNADD+22,@VARW   If might go off screen
       A0F9 F8
[0659] A0FA 41,02           BR   GA102
[0660] A0FC 0F,83           XML  SCROLL            SCROLL to next line
[0661] A0FE BF,20,02        DST  NLNADD,@VARW      Re-initialize screen address
       A101 E2
[0662] A102 BE,B0,20 GA102  ST   LESS+OFFSET,V*VARW Display open bracket "("
       A105 9C
[0663] A106 91,20           DINC @VARW             Increment screen address
[0664] A108 06,A8,8A        CALL ASC               Convert line # into ASCII
[0665] A10B BE,B0,20        ST   GREAT+OFFSET,V*VARW Display close bracket ")"
       A10E 9E
[0666] A10F A7,20,02        DSUB NLNADD-4,@VARW    Update the x-pointer
       A112 DE
[0667] A113 BC,7F,21        ST   @VARW+1,@XPT
[0668] A116 87,22    CLRRTN DCLR @ERRCOD           Clear the return vector
[0669] A118 0F,82           XML  RTNB              Return to ALC
[0670]               * BREAKPOINT OR BREAK-KEY RECIEVED
[0671] A11A 8E,44    EXECBK CZ   @PRGFLG           If break or program
[0672] A11C 61,43           BS   ERRBRK
[0673] A11E BD,52,2E        DST  @EXTRAM,@FAC8     @FAC8 : Source addr in ERAM
[0674] A121 97,52           DDECT @FAC8            Point to the line #
[0675] A123 06,A7,0C        CALL UBSUB1            Reset the breakpoint
[0676] A126 03              SCAN                   Get break key out of queue
[0677] A127 BD,A3,82 EXEC6C DST  @PGMPTR,V@SPGMPT  Save text pointer
       A12A 2C
[0678] A12B BD,A3,86 EXEC6D DST  @EXTRAM,V@SEXTRM  Save line number table pointe
       A12E 2E
[0679] A12F BD,A3,88        DST  @VSPTR,V@SAVEVP   Save value stack pointer

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0012 
EQUATES EXEC-359
       A132 6E
[0680] A133 BD,A3,84        DST  @BUFLEV,V@SBUFLV  Save crunch buffer level
       A136 46
[0681] A137 BD,A3,96        DST  @LSUBP,V@SLSUBP   Save last subprogram on stack
       A13A 48
[0682] A13B BC,A3,98        ST   @FLAG,V@SFLAG     Save FLAG for continue
       A13E 45
[0683] A13F B2,A3,98        AND  >63,V@SFLAG       Only warning and break bits
       A142 63
[0684] A143 06,6A,84 ERRBRK CALL ERRZZ             * BREAKPOINT
[0685] A146 01              BYTE 1
[0686]               ***********************************************************
[0687]               *               NUD / STATEMENT BRANCH TABLE
[0688]               ***********************************************************
[0689] A147 41,89    NUDTB  BR   RECX              'RECORD'              0
[0690] A149 46,8B           BR   NBREAK            'BREAK'               0
[0691] A14B 46,9D           BR   NUNBRK            'UNBREAK'             0
[0692] A14D 46,81           BR   NTRACE            'TRACE'               0
[0693] A14F 46,86           BR   NUNTRC            'UNTRACE'             0
[0694] A151 41,8C           BR   NREADX            'READ'                0
[0695] A153 41,8F           BR   PRINTX            'PRINT'               0
[0696] A155 41,86           BR   SZRUNX            'RUN'                 0
[0697] A157 41,A7           BR   LINPUX            Reserved for LINPUT   1
[0698] A159 41,92           BR   RESTOX            'RESTORE'             1
[0699] A15B 43,7F           BR   NRNDMZ            'RANDOMIZE'           1
[0700] A15D 41,95           BR   INPUTX            'INPUT'               1
[0701] A15F 41,98           BR   OPENX             'OPEN'                1
[0702] A161 41,9B           BR   CLOSEX            'CLOSE'               1
[0703] A163 42,48           BR   NPI               'PI'                  1
[0704] A165 42,58           BR   NMAX              'MAX'                 1
[0705] A167 42,65           BR   NMIN              'MIN'                 2
[0706] A169 46,28           BR   RPTZ01            'RPT$'                2
[0707] A16B 41,9E           BR   ACCEPX            'ACCEPT'              2
[0708] A16D 41,83           BR   EOFX              'EOF'                 2
[0709] A16F 45,1A           BR   ASC01             'ASC'                 2
[0710] A171 45,BD           BR   POS01             'POS'                 2
[0711] A173 45,55           BR   VAL01             'VAL'                 2
[0712] A175 45,2B           BR   STRZ01            'STR$'                2
[0713] A177 44,90           BR   SEGZ01            'SEG$'                3
[0714] A179 41,A4           BR   DELETX            'DELETE'              3
[0715] A17B 41,A1           BR   DISPLX            'DISPLAY'             3
[0716] A17D 44,F3           BR   LEN01             'LEN'                 3
[0717] A17F 44,FF           BR   CHRZ01            'CHR$'                3
[0718]               *RXB PATCH CODE FOR BASIC RND REPLACEMENT ***********
[0719] A181 42,AF           BR   NRND              'RND'                 3      
[0720]               * The following are long branches to another GROM
[0721] A183 05,80,1C EOFX   B    EOF
[0722] A186 05,60,1E SZRUNX B    SZRUN
[0723] A189 05,80,22 RECX   B    REC
[0724] A18C 05,80,0E NREADX B    NREAD
[0725] A18F 05,80,04 PRINTX B    PRINT
[0726] A192 05,80,0C RESTOX B    RESTOR
[0727] A195 05,80,06 INPUTX B    INPUT
[0728] A198 05,80,08 OPENX  B    OPEN
[0729] A19B 05,80,0A CLOSEX B    CLOSE
[0730] A19E 05,80,1E ACCEPX B    ACCEPT
[0731] A1A1 05,80,00 DISPLX B    DISPL1
[0732] A1A4 05,80,02 DELETX B    DELET
[0733] A1A7 05,80,30 LINPUX B    LINPUT
[0734]               ***********************************************************
[0735]               * FLAGS USED IN EXECUTION MODE:    this needs to be checked
[0736]               *  @FLAG   BIT   RESET               SET
[0737]               *           0
[0738]               *           1    Warning PRINT       PRINT off

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0013 
EQUATES EXEC-359
[0739]               *           2    Warning NEXT        STOP
[0740]               *           3    Not in UDF          Executing a UDF
[0741]               *           4    TRACE mode          Normal mode
[0742]               *           5
[0743]               *           6    BREAK allowed       BREAK not allowed
[0744]               *           7    No LST/EDT protect  LIST/EDIT protected
[0745]               ***********************************************************
[0746]               * ON WARNING {NEXT | STOP | PRINT}
[0747]               * ON WARNING NEXT  - Causes warning messages to be ignored
[0748]               *                    and execution to continue as if a
[0749]               *                    warning never occurred
[0750]               * ON WARNING STOP  - Causes a warning to be treated as an
[0751]               *                    error - i.e. the message is displayed
[0752]               *                    and execution is halted
[0753]               * ON WARNING PRINT - Causes the default warning handling to
[0754]               *                    be in effect, i.e. any warning
[0755]               *                    messages are printed and execution
[0756]               *                    continues
[0757]               ***********************************************************
[0758] A1AA 0F,79    ONWARN XML  PGMCHR            GET OPTION
[0759] A1AC D6,42,9C        CEQ  PRINTZ,@CHAT      If print
[0760] A1AF 41,B7           BR   GA1B7
[0761] A1B1 B2,45,F9        AND  >F9,@FLAG         Turn on print and contiue
[0762] A1B4 05,A1,CF        B    ONWRN5
[0763] A1B7 D6,42,98 GA1B7  CEQ  STOPZ,@CHAT
[0764] A1BA 41,C4           BR   GA1C4
[0765] A1BC B2,45,FD        AND  >FD,@FLAG         Turn on print
[0766] A1BF B6,45,04        OR   >04,@FLAG         Turn on stop
[0767] A1C2 41,CF           BR   ONWRN5
[0768] A1C4 D6,42,96 GA1C4  CEQ  NEXTZ,@CHAT       * SYNTAX ERROR
[0769] A1C7 4D,BA           BR   ERRSYN
[0770] A1C9 B6,45,02        OR   >02,@FLAG         Turn off print
[0771] A1CC B2,45,FB        AND  >FB,@FLAG         Turn off stop
[0772] A1CF 0F,79    ONWRN5 XML  PGMCHR            Check for EOS
[0773] A1D1 06,6A,78 ONWRN7 CALL CHKEND            Error if not EOS
[0774] A1D4 4D,BA           BR   ERRSYN            If not EOS
[0775] A1D6 87,22           DCLR @ERRCOD
[0776] A1D8 0F,75           XML  CONT              Continue
[0777]               ***********************************************************
[0778]               * ON ERROR {line number | STOP}
[0779]               * ON ERROR line number - causes the error routine to build
[0780]               *                        an error stack entry and pass
[0781]               *                        control to the line specified in
[0782]               *                        the most-recently executed
[0783]               *                        on-error-statement
[0784]               * ON ERROR STOP - causes the default error handling
[0785]               *                 conditions to be in effect. i.e. any
[0786]               *                 errors that occur cause execution to halt
[0787]               *                 an a message to be displayed
[0788]               ***********************************************************
[0789] A1DA 0F,79    ONERR  XML  PGMCHR            Get option
[0790] A1DC D6,42,C9        CEQ  LNZ,@CHAT         If line # then find the line
[0791] A1DF 42,0E           BR   GA20E
[0792] A1E1 0F,79           XML  PGMCHR            Get upper byte
[0793] A1E3 BC,4A,42        ST   @CHAT,@FAC
[0794] A1E6 0F,79           XML  PGMCHR            Get lower byte
[0795] A1E8 BC,4B,42        ST   @CHAT,@FAC1
[0796] A1EB BD,4C,32        DST  @ENLN,@FAC2
[0797] A1EE A7,4C,00        DSUB 3,@FAC2           Pointing to 1st line #
       A1F1 03
[0798]               * Consider both ERAM and RAM cases to get line # from the
[0799]               * line number table. Also reset the break bit.
[0800] A1F2 06,80,2E ONERR2 CALL GRSUB3            Get 2 bytes from either RAM/E
[0801] A1F5 4C              BYTE FAC2            * FAC2 has the address

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0014 
EQUATES EXEC-359
[0802] A1F6 D5,4A,58        DCEQ @EEE1,@FAC        If found
[0803] A1F9 62,06           BS   ONERR4
[0804] A1FB C5,4C,30        DCH  @STLN,@FAC2       Not found
[0805] A1FE 4D,E6           BR   ERRLNF
[0806] A200 A7,4C,00        DSUB 4,@FAC2           Goto next line
       A203 04
[0807] A204 41,F2           BR   ONERR2
[0808] A206 95,4C    ONERR4 DINCT @FAC2
[0809] A208 BD,A3,8A        DST  @FAC2,V@ERRLN
       A20B 4C
[0810] A20C 42,16           BR   GA216
[0811] A20E D6,42,98 GA20E  CEQ  STOPZ,@CHAT       * SYNTAX ERROR
[0812] A211 4D,BA           BR   ERRSYN
[0813] A213 87,A3,8A        DCLR V@ERRLN           Back to default error handlin
[0814] A216 41,CF    GA216  BR   ONWRN5            Finish up same as ON WARNING
[0815]               ***********************************************************
[0816]               * ON BREAK {NEXT | STOP}
[0817]               * ON BREAK NEXT - Causes any breakpoints which have been
[0818]               *                 set on statements to be ignored when the
[0819]               *                 statement is encountered and also masks
[0820]               *                 the shift-C key so that it is ignored
[0821]               * ON BREAK STOP - Causes the default break handling to be
[0822]               *                 in force., i.e. execution is halted and
[0823]               *                 the BREAKPOINT message is displayed on
[0824]               *                 the screen
[0825]               ***********************************************************
[0826] A218 0F,79    ONBRK  XML  PGMCHR            Get next char to find option
[0827] A21A D6,42,98        CEQ  STOPZ,@CHAT       If stop option specified
[0828] A21D 42,25           BR   GA225
[0829] A21F B2,45,BF        AND  >BF,@FLAG         break allowed
[0830] A222 05,A2,2D        B    GA22D             Don't change this to BR GA22D
[0831] A225 D6,42,96 GA225  CEQ  NEXTZ,@CHAT       If next option number
[0832] A228 4D,BA           BR   ERRSYN            specified then syntax error
[0833] A22A B6,45,40        OR   >40,@FLAG         If next option specified then
[0834]               *                              break NOT allowed
[0835] A22D 41,CF    GA22D  BR   ONWRN5            Finish up same as ON WARNING
[0836]               ***********************************************************
[0837]               * GPLCAL - If a call is made to a subprogram that does not
[0838]               *  not exist either in the BASIC program itself or in the
[0839]               *  internal GPL subprogram list then one final attempt is
[0840]               *  made to find the subprogram at execution time by
[0841]               *  searching for the subprogram in the console or a
[0842]               *  peripheral. If not found there, then a
[0843]               *  *SUBPROGRAM NOT FOUND error occurs
[0844]               *
[0845]               *  Input: the subprogram name is in the FAC and the length
[0846]               *         of the name is in FAC15
[0847]               ***********************************************************
[0848] A22F 8E,80,89 GPLCAL CZ   @RAMFLG           Can't try if CPU program
[0849] A232 4D,F6           BR   ERRSNF
[0850] A234 E7,59,00        DSRL 8,@FAC15          Make name length a double
       A237 08
[0851] A238 A5,2C,59        DSUB @FAC15,@PGMPTR    Point back at name
[0852] A23B 93,2C           DDEC @PGMPTR           Point at name length
[0853] A23D BD,56,2C        DST  @PGMPTR,@FAC12    Set pointer to name
[0854] A240 06,00,10        CALL LINK              Issue 'Call Program Link'
[0855] A243 0A              BYTE 10              * Search subprogram lists
[0856] A244 41,D1           BR   ONWRN7            If all ok, check-end and rtn
[0857] A246 4D,F6           BR   ERRSNF            If not found, error
[0858]               ***********************************************************
[0859]               *                     NUD FOR PI
[0860]               ***********************************************************
[0861] A248 31,00,08 NPI    MOVE 8,G@CONPI,@FAC    Load constant PI
       A24B 4A,A2,50

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0015 
EQUATES EXEC-359
[0862] A24E 0F,75           XML  CONT
[0863] A250 40,03,0E CONPI  BYTE >40,3,14,15,92,65,35,90
       A253 0F,5C,41
       A256 23,5A
[0864]               * 3.1415992653590E+00
[0865]               ***********************************************************
[0866]               *                     NUD FOR MAX
[0867]               ***********************************************************
[0868] A258 06,A2,6D NMAX   CALL MAXMIN            Combine MAX and MIN
[0869] A25B 0A              GT
[0870] A25C 42,63           BR   GA263
[0871] A25E 35,00,08 NMAXZ1 MOVE 8,@ARG,@FAC
       A261 4A,5C
[0872] A263 0F,75    GA263  XML  CONT
[0873]               ***********************************************************
[0874]               *                     NUD FOR MIN
[0875]               ***********************************************************
[0876] A265 06,A2,6D NMIN   CALL MAXMIN            Combine MAX and MIN again
[0877] A268 0A              GT
[0878] A269 42,5E           BR   NMAXZ1
[0879] A26B 0F,75           XML  CONT
[0880]               ***********************************************************
[0881]               *                COMMON MAX / MIN ROUTINE
[0882]               ***********************************************************
[0883] A26D 06,AC,89 MAXMIN CALL LPAR              Skip "(" parse, and insure ,
[0884] A270 C6,4C,63        CH   >63,@FAC2         Must be numeric
[0885] A273 6D,BE           BS   ERRSNM
[0886] A275 0F,77           XML  VPUSH             Push l.h. arg on stack
[0887] A277 0F,74           XML  PARSE             PARSE up to ")"
[0888] A279 B6              BYTE RPARZ
[0889] A27A C6,4C,63        CH   >63,@FAC2         Must be numeric
[0890] A27D 6D,BE           BS   ERRSNM
[0891] A27F 0F,7E           XML  SPEED             Must be
[0892] A281 00              BYTE SYNCHK        *    at a
[0893] A282 B6              BYTE RPARZ         *      right parenthesis
[0894] A283 35,00,08        MOVE 8,@FAC,@ARG       Save in ARG for compare
       A286 5C,4A
[0895] A288 0F,78           XML  VPOP              Get l.h. arg back
[0896] A28A 0F,0A           XML  FCOMP             Compare operands
[0897] A28C 00              RTN
[0898]               * Initialize random number generator 
[0899] A28D 31,00,0A INTRND MOVE 10,G@X2SEED,V@RNDX2
       A290 A3,A0,A2
       A293 95
[0900] A294 00              RTN
[0901] A295 42,03,23 X2SEED BYTE >42,>03,>23,>15,>00 * =   33521, X2 INITIAL VAL
       A298 15,00
[0902] A29A 43,02,3E X1SEED BYTE >43,>02,>3E,>2A,>17 * = 2624223, X1 INITIAL VAL
       A29D 2A,17
[0903]               ***********************************************************
[0904]               *                                                         *
[0905]               * RXB PATCH REPLACEMENT CODE FOR RND WITH TI BASIC RND    *
[0906]               *                                                         *
[0907]               ***********************************************************
[0908]               *           PSEUDO-RANDOM NUMBER GENERATOR
[0909]               *      X(N+1) = (A*X(N)+C) MOD M;  RND = X/M
[0910]               *    WHERE:                 X = X2 * 1E7 + X1
[0911]               *                           A = A2 * 1E7 + A1
[0912]               *                           C = C2 * 1E7 + C1
[0913]               *                           M = 1E14
[0914]               * ASSUMPTIONS:
[0915]               *  (1) All numbers are integers; fractional parts are
[0916]               *      truncated
[0917]               *  (2) If the variables listed below start in the ranges

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0016 
EQUATES EXEC-359
[0918]               *     specified. They will also end in the ranges specified
[0919]               *
[0920]               * CONSTANTS: 0 <= A2 < 5E6 ; 0 <= C2 < 1E7
[0921]               *            0 <= A1 < 5E6 ; 0 <= C1 < 1E7
[0922]               * VARIABLES: 0 <= X2 < 1E7 ; 0 <= T1 <= 1E14 ; 0 <= T2 < 1E
[0923]               *            0 <= X1 < 1E7 ; 0 <= T3 <= 1E14 ; 0 <= T4 < 1E
[0924]               *
[0925]               *        STACK USAGE:
[0926]               *            CONSTANT REFS      CONTANT REFS    CONTANT REF
[0927]               * +---------+      IN/OUT            IN/OUT          IN/OUT
[0928]               * | STACK+4 | X2*A1(F)(H)       --    ----      --    ----
[0929]               * +---------+
[0930]               * | STACK+3 |   T2 (C)(J)       --    ----      --    ----
[0931]               * +---------+
[0932]               * | STACK+2 |   T1 (B)(D)   new X1   (E)(N)     --    ----
[0933]               * +---------+
[0934]               * | STACK+1 |old X1(A)(G)       T3   (K)(L) new X2   (M)(P)
[0935]               * +---------+
[0936]               ***********************************************************
[0937]               * COMPUTE NEW VALUE FOR X1, SAVE IT IN V@RNDX1
[0938]               *                             STACK
[0939]               *                               SREFS   FAC CONTENTS
[0940]               * NRND   MOVE 5,V@RNDX1,@FAC        FAC = X1
[0941]               *        MOVE 5,V@RNDX1,@FAC        fAC = X1
[0942]               *        CLR  @FAC5                 FAC = CLR
[0943]               *        DCLR @FAC6                 FAC = CLR
[0944]               *        XML  VPUSH          (A)    FAC = X1
[0945]               *        MOVE 8,G@RNDA1,@ARG        ARG = A1
[0946]               *        XML  FMUL                  FAC = X1*A1
[0947]               *        MOVE 8,G@RNDC1,@ARG        ARG = C1
[0948]               *        XML  FADD               T1=FAC = X1*A1+C1
[0949]               *        XML  VPUSH          (B)    FAC = T1
[0950]               *        MOVE 8,G@RNDEM,@ARG        ARG = 1/1E7
[0951]               *        XML  FMUL                  FAC = T1/1E7
[0952]               *        CALL GRINT              T2=FAC = INT(T1/1E7)
[0953]               *        XML  VPUSH          (C)    FAC = T2
[0954]               *        MOVE 8,G@RNDEP,@ARG        ARG = 1E7
[0955]               *        XML  FMUL                  FAC = T2*1E7
[0956]               *        DSUB 8,@VSPTR
[0957]               *        XML  SSUB           (D) X1=FAC = T1-T2*1E7
[0958]               *        MOVE 5,@FAC,V@RNDX1        FAC = X1 (new)
[0959]               *        XML  VPUSH          (E)    FAC = X1
[0960]               * COMPUTE NEW VALUE FOR X2, SAVE IT IN V@RNDX2
[0961]               *        MOVE 5,V@RNDX2,@FAC        FAC = X2
[0962]               *        CLR  @FAC5                 FAC = CLR
[0963]               *        DCLR @FAC6                 FAC = CLR
[0964]               *        MOVE 8,G@RNDA1,@ARG        ARG = A1
[0965]               *        XML  FMUL                  FAC = X2*A1
[0966]               *        DADD 8,@VSPTR
[0967]               *        XML  VPUSH          (F)    FAC = X2*A1
[0968]               *        DSUB 24,@VSPTR
[0969]               *        XML  VPOP           (G)    FAC = X1
[0970]               *        DADD 32,@VSPTR
[0971]               *        MOVE 8,G@RNDA2,@ARG        ARG = A2
[0972]               *        XML  FMUL                  FAC = X1*A2
[0973]               *        XML  SADD           (H)    FAC = X2*A1+X1*A2
[0974]               *        MOVE 8,G@RNDC2,@ARG        ARG = C2
[0975]               *        XML  FADD                  FAC = X2*A1+X1*A2
[0976]               *        XML  SADD           (J) T3=FAC = X2*A1+X1*A2
[0977]               *        DSUB 16,@VSPTR
[0978]               *        XML  VPUSH          (K)    FAC = T3
[0979]               *        MOVE 8,G@RNDEM,@ARG        ARG = 1/1E7
[0980]               *        XML  FMUL                  FAC = T3/1E7
[0981]               *        CALL GRINT              T4=FAC = INT(T3/1E7)

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0017 
EQUATES EXEC-359
[0982]               *        MOVE 8,G@RNDEP,@ARG        ARG = 1E7
[0983]               *        XML  FMUL                  FAC = T4*1E7
[0984]               *        XML  SSUB           (L) X2=FAC = T3-T4*1E7
[0985]               *        MOVE 5,@FAC,V@RNDX2        FAC = X2 (new)
[0986]               * COMPUTE NEW VALUE FOR RND, LEAVE IT IN FAC
[0987]               *        MOVE 8,G@RNDEM,@ARG        ARG = 1/1E7
[0988]               *        XML  FMUL                  FAC = X2/1E7
[0989]               *       XML  VPUSH          (M)    FAC = X2/1E7
[0990]               *        DADD 8,@VSPTR
[0991]               *        XML  VPOP           (N)    FAC = X1
[0992]               *        XML  FMUL                  FAC = X1/1E7
[0993]               *        XML  FMUL                  FAC = X1/1E14
[0994]               *        XML  SADD           (P)RND=FAC = (X2/1E7)+(X1/1E14
[0995]               *        XML  CONT
[0996]               ***********************************************************
[0997]               * CONSTANTS FOR THE RANDOM NUMBER ROUTINE
[0998]               * RNDA2  BYTE >43,>01,>2B,>59,>52,>00,>00,>00 * = 1438982
[0999]               * RNDA1  BYTE >42,>2A,>08,>15,>00,>00,>00,>00 * = 0420821
[1000]               * RNDC2  BYTE >43,>02,>0B,>20,>30,>00,>00,>00 * = 2113248
[1001]               * RNDC1  BYTE >43,>06,>36,>05,>13,>00,>00,>00 * = 6540519
[1002] A29F 43,0A,00 RNDEP  BYTE >43,>0A,>00,>00,>00,>00,>00,>00 * = 1E7
       A2A2 00,00,00
       A2A5 00,00
[1003] A2A7 3C,0A,00 RNDEM  BYTE >3C,>0A,>00,>00,>00,>00,>00,>00 * = 1/1E7
       A2AA 00,00,00
       A2AD 00,00
[1004]               ***********************************************************
[1005]               * RXB BASIC RND REPLACEMENT FROM TI BASIC
[1006] A2AF BE,4A,3F NRND   ST   >3F,@FAC       * Exponent    
[1007] A2B2 BE,10,4B        ST   >4B,@VAR5      * Loop counter
[1008] A2B5 02,63    NRND1  RAND >63            * 0?
[1009] A2B7 8E,78           CZ   @RANDOM        * No, go on
[1010] A2B9 42,C5           BR   NRND3     
[1011] A2BB 92,4A           DEC  @FAC           * 0?
[1012] A2BD 8E,4A           CZ   @FAC           * End with 0
[1013] A2BF 62,D2           BS   NRND4          * Go on
[1014] A2C1 42,B5           BR   NRND1
[1015] A2C3 02,63    NRND2  RAND >63            * Till 100
[1016] A2C5 BC,90,10 NRND3  ST   @RANDOM,*VAR5  * All digits
       A2C8 78
[1017] A2C9 D6,10,51        CEQ  >51,@VAR5      * Till >8351
[1018] A2CC 62,D4           BS   NRND5 
[1019] A2CE 90,10           INC  @VAR5          * Increase loop counter
[1020] A2D0 42,C3           BR   NRND2 
[1021] A2D2 86,4B    NRND4  CLR  @FAC1          * Set 0
[1022] A2D4 0F,75    NRND5  XML  CONT
[1023]               ***********************************************************
[1024] A2D6 0F,79    STRFCH XML  PGMCHR
[1025] A2D8 0F,74           XML  PARSE
[1026] A2DA B6              BYTE RPARZ
[1027] A2DB 00              RTN
[1028] A2DC 06,A2,D6 STRGET CALL STRFCH
[1029] A2DF D6,4C,65        CEQ  >65,@FAC2
[1030] A2E2 4D,BE           BR   ERRSNM      * STRING NUM MISMATCH
[1031] A2E4 00              RTN
[1032] A2E5 06,A2,D6 NUMFCH CALL STRFCH
[1033] A2E8 D6,4C,65        CEQ  >65,@FAC2
[1034] A2EB 6D,BE           BS   ERRSNM      * STRING NUM MISMATCH
[1035] A2ED 00              RTN
[1036] A2EE 0F,12    CFIFCH XML  CFI
[1037] A2F0 D6,54,03        CEQ  >03,@FAC+10
[1038] A2F3 6D,EE           BS   ERRBV       * NUMERIC OVERFLOW
[1039] A2F5 00              RTN
[1040] A2F6 06,A3,6D GETNUM CALL SUBLP3

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0018 
EQUATES EXEC-359
[1041] A2F9 D6,42,B3        CEQ  >B3,@CHAT
[1042] A2FC 4D,BA           BR   ERRSYN
[1043] A2FE 00              RTN
[1044] A2FF 06,A2,F6 ROWCOL CALL GETNUM
[1045] A302 CF,4A,00        DCGT 24,@FAC
       A305 18
[1046] A306 6D,EE           BS   ERRBV
[1047] A308 93,4A           DDEC @FAC
[1048] A30A BC,02,7F        ST   @XPT,@MNUM
[1049] A30D BC,7E,4B        ST   @FAC1,@YPT
[1050] A310 06,A2,F6        CALL GETNUM
[1051] A313 CF,4A,00        DCGT 32,@FAC
       A316 20
[1052] A317 6D,EE           BS   ERRBV
[1053] A319 93,4A           DDEC @FAC
[1054] A31B BC,7F,4B        ST   @FAC1,@XPT
[1055] A31E 00              RTN
[1056] A31F 0F,79    NGOOD  XML  PGMCHR
[1057] A321 CA,42,80 NGOOD1 CHE  >80,@CHAT
[1058] A324 6D,BA           BS   ERRSYN         * ?
[1059] A326 06,A3,3A        CALL SNDER
[1060] A329 D6,4C,65        CEQ  >65,@FAC2
[1061] A32C 4D,BE           BR   ERRSNM         * STRING NUMBER MISMATCH
[1062] A32E BF,4A,00        DST  >001C,@FAC
       A331 1C
[1063] A332 BD,4E,1C        DST  @SREF,@FAC4
[1064] A335 BD,50,0C        DST  @BYTES,@FAC6
[1065] A338 43,43           BR   SNDASS
[1066] A33A 0F,7A    SNDER  XML  SYM
[1067] A33C 0F,7B           XML  SMB
[1068] A33E 0F,77           XML  VPUSH
[1069] A340 00              RTN
[1070] A341 0F,80    CIFSND XML  CIF
[1071] A343 0F,7C    SNDASS XML  ASSGNV
[1072] A345 00              RTN
[1073] A346 BC,00,7D GETLP  ST   @CB,@VAR0
[1074] A349 BC,01,7D        ST   @CB,@VARV
[1075] A34C A6,01,60        SUB  OFFSET,@VARV
[1076] A34F BC,E0,00        ST   @VARV,V@0(@STRPTR)
       A352 12,01
[1077] A354 91,12           DINC @STRPTR
[1078] A356 00              RTN
[1079] A357 BC,00,E0 PUTLP  ST   V@0(@FAC4),@VAR0
       A35A 00,4E
[1080] A35C A2,00,60        ADD  OFFSET,@VAR0
[1081] A35F 91,4E           DINC @FAC4
[1082] A361 00              RTN
[1083] A362 08       HFMT   FMT
[1084] A363 E0,00           DATA >E000
[1085] A365 FB              FEND
[1086] A366 00              RTN
[1087] A367 08       VFMT   FMT
[1088] A368 E0,00           DATA >E000
[1089] A36A 9E              BYTE >9E
[1090] A36B FB              FEND
[1091] A36C 00              RTN
[1092] A36D 06,A2,E5 SUBLP3 CALL NUMFCH
[1093] A370 06,A2,EE        CALL CFIFCH
[1094] A373 00              RTN
[1095] A374 86,4A    CLRFAC CLR  @FAC
[1096] A376 35,00,07        MOVE 7,@FAC,@FAC1
       A379 4B,4A
[1097] A37B 00              RTN
[1098]               ***********************************************************

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0019 
EQUATES EXEC-359
[1099]               *
[1100]               * RXB PATCH CODE TO RESET ADDRESS FOR NRNDMZ **************
[1101] A37C 05,A3,7F        B    NRNDMZ
[1102]               ***********************************************************
[1103]               *                   RANDOMIZE STATEMENT
[1104]               ***********************************************************
[1105] A37F 06,6A,78 NRNDMZ CALL CHKEND            Seed provider?
[1106] A382 63,C0           BS   RNDM1             No
[1107]               * RANDOMIZE given a see value
[1108]               * (99,000,000,000,001 possible starting positions)
[1109]               * (Place-value is ignored in the input number)
[1110] A384 0F,74           XML  PARSE             Parse the seed
[1111] A386 83              BYTE TREMZ           * Up to end of statement
[1112] A387 06,A3,ED        CALL CKSTNM
[1113] A38A 8F,4A           DCZ  @FAC              Check FAC for zero
[1114] A38C 63,B6           BS   GA3B6
[1115] A38E BE,4A,46        ST   >46,@FAC          0 < FAC < 1E14
[1116] A391 0F,77           XML  VPUSH             Let FAC = X2*1E7+X1
[1117] A393 31,00,08        MOVE 8,G@RNDEM,@ARG        ARG = 1/1E7
       A396 5C,A2,A7
[1118] A399 0F,08           XML  FMUL                  FAC = X2+X1/1E7
[1119] A39B 06,00,22        CALL GRINT                 FAC = X2
[1120] A39E 35,00,05        MOVE 5,@FAC,V@RNDX2        FAC = X2
       A3A1 A3,A0,4A
[1121] A3A4 31,00,08        MOVE 8,G@RNDEP,@ARG        ARG = 1E7
       A3A7 5C,A2,9F
[1122] A3AA 0F,08           XML  FMUL                  FAC = X2*1E7
[1123] A3AC 0F,0C           XML  SSUB                  FAC = X1
[1124] A3AE 35,00,05        MOVE 5,@FAC,V@RNDX1        FAC = X1
       A3B1 A3,A5,4A
[1125] A3B4 0F,75           XML  CONT                  FAC = X1
[1126] A3B6 BD,A3,A0 GA3B6  DST  @FAC,V@RNDX2          FAC = 0
       A3B9 4A
[1127] A3BA BD,A3,A5        DST  @FAC,V@RNDX1          FAC = 0
       A3BD 4A
[1128] A3BE 0F,75           XML  CONT
[1129]               * RANDOMIZE given number seed value (use GPL RAND function)
[1130]               * (16K possible starting positions)
[1131] A3C0 BF,4A,42 RNDM1  DST  >4201,@FAC            FAC = >4201
       A3C3 01
[1132] A3C4 86,4E           CLR  @FAC4                 FAC4= >00
[1133] A3C6 06,A3,D2        CALL RNDMZ
[1134] A3C9 03,A5           DATA RNDX1
[1135] A3CB 06,A3,D2        CALL RNDMZ             Set up seed
[1136] A3CE 03,A0           DATA RNDX2
[1137] A3D0 0F,75           XML  CONT              Continue on
[1138] A3D2 88,52    RNDMZ  FETCH @FAC8            Fetch address of seed (high b
[1139] A3D4 88,53           FETCH @FAC9            Fetch address of seed (low by
[1140] A3D6 02,63           RAND 99                GPL Randomize
[1141] A3D8 BC,4C,78        ST   @RANDOM,@FAC2     >00<=FAC+2<=FF
[1142] A3DB E6,4C,02        SRL  2,@FAC2           >00<=FAC+2<=3F
[1143] A3DE 02,63           RAND 99                GPL Randomize
[1144] A3E0 BC,4D,78        ST   @RANDOM,@FAC3     >00<=FAC+3<=FF
[1145] A3E3 E6,4D,02        SRL  2,@FAC3           >00<=FAC+3<=3F
[1146] A3E6 35,00,05        MOVE 5,@FAC,V*FAC8     Put in seed
       A3E9 B0,52,4A
[1147] A3EC 00              RTN
[1148] A3ED D6,4C,65 CKSTNM CEQ  >65,@FAC2
[1149] A3F0 6D,BE           BS   ERRSNM
[1150] A3F2 00              RTN
[1151] A3F3 40,01,00 FLT1   BYTE >40,>01,>00,>00,>00,>00,>00,>00
       A3F6 00,00,00
       A3F9 00,00
[1152]               ***********************************************************

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0020 
EQUATES EXEC-359
[1153]               *                 EXTENDED STRING PACKAGE
[1154]               * THE ROUTINES ARE:
[1155]               *  LITS05 - Move a string literal from the program to the
[1156]               *            string space
[1157]               *  INTARG - Checks that an argument is a numeric and
[1158]               *            converts it from floating point to an integer
[1159]               *  PUSSTR - Checks that an argument is a string and pushes
[1160]               *            it on the stack
[1161]               *  CONCAT - Concatenates 2 strings together
[1162]               *  SEG$   - Segments a string
[1163]               *  LEN    - Puts the length of a string in the FAC
[1164]               *  CHR$   - Converts an integer into its ASCII character
[1165]               *  STR$   - Converts a number into its string equivalent
[1166]               *  VAL    - Converts a string into its numeric equivalent
[1167]               *  POS    - Gives the position of one string within another
[1168]               *  RPT$   - Generates a single string with multiple copies
[1169]               *            of the original string
[1170]               *
[1171]               *      AN ENTRY IN THE FAC LOOKS LIKE:
[1172]               * +------------+-----+----+-------------+-----------------+
[1173]               * |addr of ptr | >65 | xx | addr of str | length of str   |
[1174]               * +------------+-----+----+-------------+-----------------+
[1175]               *     FAC       FAC2  FAC3   FAC4           FAC6
[1176]               ***********************************************************
[1177]               * Support routine for functions to build FAC entry
[1178] A3FB 86,50    LITS05 CLR  @FAC6             Need as a double-byte value
[1179] A3FD BD,0C,50        DST  @FAC6,@BYTES      LENGTH FOR GETSTR
[1180] A400 BC,52,80        ST   @RAMTOP,@FAC8     Copy ERAM flag for later
       A403 84
[1181] A404 0F,71    LITS07 XML  GETSTR            ALLOCATE STRING SPACE
[1182] A406 BF,4A,00 LITS08 DST  >001C,@FAC        SAVE ADDR OF STRING  (SREF)
       A409 1C
[1183] A40A BD,4E,1C        DST  @SREF,@FAC4       SAVE ADDR OF STRING
[1184] A40D BF,4C,65        DST  >6500,@FAC2       INDICATES A STRING CONSTANT
       A410 00
[1185]               *********** COPY STRING INTO STRING SPACE *****************
[1186] A411 8F,0C    LITS09 DCZ  @BYTES            If non-null string
[1187] A413 64,2B           BS   GA42B
[1188] A415 8E,52           CZ   @FAC8
[1189] A417 44,20           BR   GA420
[1190] A419 34,0C,B0        MOVE @BYTES,V*TEMP5,V*SREF
       A41C 1C,B0,66
[1191] A41F 00              RTN
[1192]               *                             Else source string in ERAM
[1193] A420 BD,56,0C GA420  DST  @BYTES,@FFF1      FFF1 : BYTE COUNT
[1194] A423 BD,58,1C        DST  @SREF,@EEE1       EEE1 : DESTINATION ADDR ON VD
[1195] A426 BD,54,66        DST  @TEMP5,@DDD1      DDD1 : Source addr in ERAM
[1196] A429 0F,8B           XML  GVWITE            Move data from ERAM to VDP
[1197] A42B 00       GA42B  RTN
[1198] A42C 86,52    LITS06 CLR  @FAC8             SET FLAG TO VDP
[1199] A42E 44,04           BR   LITS07            JUMP INTO CODE
[1200]               ***********************************************************
[1201]               * PUSSTR - Insures that the entry in the FAC is a string
[1202]               *           and pushes it onto the stack.
[1203]               ***********************************************************
[1204] A430 D6,4C,65 PUSSTR CEQ  >65,@FAC2
[1205] A433 4D,BE           BR   ERRSNM
[1206] A435 0F,77           XML  VPUSH             PUSH THE ARGUMENT
[1207] A437 00              RTN
[1208]               ***********************************************************
[1209]               * CONCAT - CONCATENATES TWO STRINGS TOGETHER
[1210]               *         INPUT  : FLOATING POINT ACCUMULATOR ENTRIES
[1211]               *         OUTPUT : CONCATENATED STRING AND (POSSIBLE)
[1212]               *                  ZEROED BACK-POINTERS FOR THE OLD STRINGS

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0021 
EQUATES EXEC-359
[1213]               *         USES   : TEMP2, TEMP4 AND TEMP5 AS TEMPORARIES
[1214]               ***********************************************************
[1215] A438 86,23    CONCAT CLR  @ERRCOD+1         CLEAR THE ERROR CODE
[1216] A43A 06,A4,30        CALL PUSSTR            Push the string & get next to
[1217] A43D 0F,74           XML  PARSE             GET THE R.H. ARGUMENT
[1218] A43F B8              BYTE CONCZ
[1219] A440 D6,4C,65        CEQ  >65,@FAC2         If not string - error
[1220] A443 4D,BE           BR   ERRSNM
[1221] A445 BD,0C,50        DST  @FAC6,@BYTES      GET R.H. LENGTH
[1222] A448 A1,0C,E0        DADD V@6(@VSPTR),@BYTES    ADD IN L.H. LENGTH
       A44B 06,6E
[1223] A44D C7,0C,00        DCH  255,@BYTES
       A450 FF
[1224] A451 44,5B           BR   GA45B
[1225] A453 BF,0C,00        DST  255,@BYTES        TRUNCATE IF TOO LONG
       A456 FF
[1226] A457 06,6A,82 WRNST1 CALL WARNZZ            Display warning
[1227] A45A 13              BYTE 19                * STRING TRUNCATED message
[1228] A45B BD,68,0C GA45B  DST  @BYTES,@TEMP6     Keep length for later
[1229] A45E 0F,77           XML  VPUSH
[1230] A460 0F,71           XML  GETSTR            Alloccate the result string
[1231] A462 0F,78           XML  VPOP              Retrieve R.H.
[1232] A464 35,00,08        MOVE 8,@FAC,@ARG
       A467 5C,4A
[1233] A469 0F,78           XML  VPOP              Retrieve L.H.
[1234] A46B BD,66,4E        DST  @FAC4,@TEMP5      Set ptr to L.H. ARG(for FREST
[1235] A46E BD,0C,50        DST  @FAC6,@BYTES      Length of L.H. ARG
[1236] A471 86,52           CLR  @FAC8             Force VDP mode
[1237] A473 06,A4,06        CALL LITS08            Set up FAC & copy L.H. ARG in
[1238] A476 8F,62           DCZ  @ARG6             If R.H. =0 don't copy
[1239] A478 64,8E           BS   CONC06
[1240] A47A BD,64,1C        DST  @SREF,@TEMP4      Get ptr to new string
[1241] A47D A1,64,50        DADD @FAC6,@TEMP4      Ptr to where 2nd string begin
[1242] A480 A5,68,50        DSUB @FAC6,@TEMP6      Length of 2nd string
[1243]               *                                      (possibly truncated)
[1244] A483 64,8E           BS   CONC06
[1245] A485 34,68,B0        MOVE @TEMP6,V*ARG4,V*TEMP4     Copy in 2nd string
       A488 64,B0,60
[1246]                
[1247] A48B A1,50,68        DADD @TEMP6,@FAC6      Add in length of 2nd ARG
[1248]               * NOTE: FAC6 already contained length of 1st ARG from the
[1249]               *       parse that was done on it
[1250] A48E 0F,75    CONC06 XML  CONT              Done.
[1251]               ***********************************************************
[1252]               * SEG$(A$,X,Y) - Extracts the desiginated string from A$.
[1253]               *     X specifies the character position within A$ at
[1254]               *     which the extraction begins. Y specifies the number
[1255]               *     of characters to extract.
[1256]               *     If X or Y is negative an error occurs. If X=0 an
[1257]               *     error occurs. If Y=0 or X > Y then a null string is
[1258]               *     is returned. If the ramaining length in A$ starting
[1259]               *     at the postion specified by X is less than the length
[1260]               *     specified by Y, then the remainder of A$ starting at
[1261]               *     position X is returned.
[1262]               *   INPUT - Control is turned over to SEG$ from PARSE. The
[1263]               *     only requirement is that a SEG$ was encountered.
[1264]               *   OUTPUT - The Floating Point Accumulator is set up with
[1265]               *     the header for the segmented string.
[1266]               *   USES - TEMP2 (Others in calls to GETSTR and LITS08)
[1267]               ***********************************************************
[1268] A490 06,AC,89 SEGZ01 CALL LPAR              Insure "(" parse and check ",
[1269] A493 06,A4,30        CALL PUSSTR            Push string and get next toke
[1270] A496 0F,7E           XML  SPEED             Get the position
[1271] A498 01              BYTE PARCOM       *     within the source string

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0022 
EQUATES EXEC-359
[1272] A499 06,A9,95        CALL INTARG            CHECK & CONVERT ARG TO INTEGE
[1273] A49C 8F,4A           DCZ  @FAC               CAN'T HAVE VALUE OF 0
[1274] A49E 6D,EE           BS   ERRBV
[1275] A4A0 0F,77           XML  VPUSH             PUSH THE ARG
[1276] A4A2 0F,74           XML  PARSE             Get extraction length
[1277] A4A4 B6              BYTE RPARZ
[1278] A4A5 0F,7E           XML  SPEED             Must have
[1279] A4A7 00              BYTE SYNCHK       *     ended on
[1280] A4A8 B6              BYTE RPARZ        *      a right parenthesis
[1281] A4A9 06,A9,95        CALL INTARG            CHECK & CONVERT ARG TO INTEGE
[1282] A4AC BD,5C,4A        DST  @FAC,@ARG         Move extraction length
[1283] A4AF 0F,78           XML  VPOP              Get position back
[1284] A4B1 BD,5E,4A        DST  @FAC,@ARG2        Move position
[1285] A4B4 0F,78           XML  VPOP              Retrieve source string
[1286] A4B6 BD,56,5E        DST  @ARG2,@TEMP2      Get position within string
[1287] A4B9 C5,56,50        DCH  @FAC6,@TEMP2      If position > length =>null
[1288] A4BC 64,EF           BS   SEGZ08
[1289] A4BE A1,56,5C        DADD @ARG,@TEMP2       Compute end of substring
[1290] A4C1 A5,56,50        DSUB @FAC6,@TEMP2      Compute length beyond end
[1291] A4C4 93,56           DDEC @TEMP2             string
[1292] A4C6 D3,56,00        DCGE 0,@TEMP2
       A4C9 00
[1293] A4CA 44,D4           BR   SEGZ06            Fine if substring is shorter
[1294] A4CC BD,5C,50        DST  @FAC6,@ARG        Else, truncate length of
[1295]               *                              substring
[1296] A4CF A5,5C,5E        DSUB @ARG2,@ARG        Subtract position from source
[1297]               *                              length
[1298] A4D2 91,5C           DINC @ARG              Increment to include last cha
[1299] A4D4 BD,0C,5C SEGZ06 DST  @ARG,@BYTES       # of bytes needed for substri
[1300] A4D7 0F,77           XML  VPUSH             Save source string entry
[1301] A4D9 0F,71           XML  GETSTR            ALLOCATE RESULT STRING
[1302] A4DB 0F,78           XML  VPOP              Restore source string entry
[1303] A4DD BD,66,4E        DST  @FAC4,@TEMP5      Pointer to source for FRESTR
[1304]               *                              LITS08
[1305] A4E0 A1,66,5E        DADD @ARG2,@TEMP5      Pointer to start of substring
[1306] A4E3 93,66           DDEC @TEMP5            Decrement since zero-based
[1307] A4E5 BD,50,0C        DST  @BYTES,@FAC6      Set length of string
[1308] A4E8 86,52           CLR  @FAC8             FORCE VDP MODE
[1309] A4EA 06,A4,06        CALL LITS08            Copy in & set up FAC
[1310] A4ED 0F,75           XML  CONT
[1311] A4EF 87,5C    SEGZ08 DCLR @ARG              Extract a null string
[1312] A4F1 44,D4           BR   SEGZ06            >>>JUMP ALWAYS<<<
[1313]               ***********************************************************
[1314]               * LEN(A$) - Calculate the length of a string and leave the
[1315]               *           result in the FAC.
[1316]               *  CONTROL - Turned over to NLEN from the parser.
[1317]               *  USES    - No temporaries.
[1318]               ***********************************************************
[1319] A4F3 06,A5,65 LEN01  CALL PARFF             Insure left parenthesis & par
[1320] A4F6 4D,BE           BR   ERRSNM             If not string value
[1321] A4F8 BD,4A,50        DST  @FAC6,@FAC        Length
[1322] A4FB 0F,80    LEN02  XML  CIF               Convert integer to floating p
[1323] A4FD 0F,75           XML  CONT
[1324]               ***********************************************************
[1325]               * CHR$(X) - Takes integer value X and converts the number
[1326]               *           into the ASCII representation for that number.
[1327]               *  CONTROL - Turned over to NCHR by the parser.
[1328]               *  OUTPUT  - FAC is set up with the string entry
[1329]               *  USES    - Uses temproraries when invoking LITS06(LITSTR)
[1330]               ***********************************************************
[1331] A4FF 06,A5,65 CHRZ01 CALL PARFF             Insure left parenthesis & par
[1332] A502 06,A9,95        CALL INTARG            Convert into integer
[1333] A505 BF,0C,00        DST  1,@BYTES          Create a length 1 string
       A508 01

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0023 
EQUATES EXEC-359
[1334] A509 BC,A3,78        ST   @FAC1,V@ONECHR    Move the value to VDP(for LIT
       A50C 4B
[1335] A50D BF,66,03        DST  ONECHR,@TEMP5     Address of character
       A510 78
[1336] A511 06,A4,2C        CALL LITS06            Create string and set up FAC
[1337] A514 BF,50,00        DST  1,@FAC6           Length of string
       A517 01
[1338] A518 0F,75           XML  CONT
[1339]               ***********************************************************
[1340]               * ASC(A$) - Takes the numeric value of the first character
[1341]               *           in A$.
[1342]               ***********************************************************
[1343] A51A 06,A5,65 ASC01  CALL PARFF             Insure left parenthesis & par
[1344] A51D 4D,BE           BR   ERRSNM             If not string
[1345] A51F 8E,51           CZ   @FAC7             Bad Argument?
[1346] A521 6D,EA           BS   ERRBA
[1347] A523 BC,4B,B0        ST   V*FAC4,@FAC1      Get the first character
       A526 4E
[1348] A527 86,4A           CLR  @FAC
[1349] A529 44,FB           BR   LEN02             USE COMMON CODE >>>JUMP ALWAY
[1350]               ***********************************************************
[1351]               * STR$(X) - Takes as its imput an integer X and converts it
[1352]               *           to its string representation.
[1353]               *  CONTROL - Turned over to STR$ by the parser.
[1354]               *  USES    - The usual temporaries used by string function
[1355]               *            when it calls LITS06. Uses the Roll-out area
[1356]               *            for a temporary storage area when allocating
[1357]               *            the result string.
[1358]               *  OUTPUT  - FAC is set up in the usual manner for a string
[1359]               ***********************************************************
[1360] A52B 06,A5,65 STRZ01 CALL PARFF             Insure left parenthesis & par
[1361] A52E 6D,BE           BS   ERRSNM             If not numeric-error
[1362] A530 86,55           CLR  @FAC11            Select XB floating type
[1363] A532 0F,73           XML  XCNS              Convert the number to string
[1364] A534 D6,90,55        CEQ  SPACE,*FAC11      If leading space
       A537 20
[1365] A538 45,3E           BR   GA53E
[1366] A53A 90,55           INC  @FAC11            Suppress it out
[1367] A53C 92,56           DEC  @FAC12            Shorten the length
[1368] A53E 86,0C    GA53E  CLR  @BYTES            Prepare for 2-byte value
[1369] A540 BC,0D,56        ST   @FAC12,@BYTES+1   Get length of string
[1370] A543 34,0C,A3        MOVE @BYTES,*FAC11,V@VROAZ    Put the string in VDP
       A546 C0,90,55
[1371] A549 BF,66,03        DST  VROAZ,@TEMP5      Copy-from address(for LITSTR)
       A54C C0
[1372] A54D 06,A4,2C        CALL LITS06            Allocate and set up FAC
[1373] A550 BD,50,0C        DST  @BYTES,@FAC6      Put in the length
[1374] A553 0F,75           XML  CONT
[1375]               ***********************************************************
[1376]               * VAL(A$) - Takes as its input a string, A$, and converts
[1377]               *           the string into a number if the string is a
[1378]               *           valid representation of a number.
[1379]               *  CONTROL - From the parser.
[1380]               *  OUTPUT  - FAC contains the floating point number.
[1381]               ***********************************************************
[1382] A555 06,A5,65 VAL01  CALL PARFF             Insure left parenthesis & par
[1383] A558 4D,BE           BR   ERRSNM             If not string - error
[1384] A55A 8E,51           CZ   @FAC7             Can't have null string
[1385] A55C 6D,EA           BS   ERRBA
[1386] A55E 06,A5,71        CALL VALCD             So bad argument error
[1387] A561 6D,EA           BS   ERRBA
[1388] A563 0F,75           XML  CONT
[1389]               * Short routine to parse a single argument enclosed in
[1390]               *  parenthesis for a function or a subprogram and set

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0024 
EQUATES EXEC-359
[1391]               *  condition based upon whether the value parsed was a
[1392]               *  string or a numeric.
[1393] A565 D6,42,B7 PARFF  CEQ  LPARZ,@CHAT
[1394] A568 4D,BA           BR   ERRSYN
[1395] A56A 0F,74           XML  PARSE
[1396] A56C FF              BYTE >FF               *
[1397] A56D D6,4C,65        CEQ  >65,@FAC2
[1398] A570 01              RTNC
[1399] A571 BD,66,4E VALCD  DST  @FAC4,@TEMP5      Pointer to string
[1400] A574 A1,66,50        DADD @FAC6,@TEMP5      Pointer to trailing length by
[1401] A577 BD,0C,50        DST  @FAC6,@BYTES      For suppressing trailing blan
[1402] A57A 91,0C           DINC @BYTES            Prepare for undue subtraction
[1403] A57C 93,66    GA57C  DDEC @TEMP5            Keep track of end of string
[1404] A57E 93,0C           DDEC @BYTES            Decrease length of string
[1405] A580 65,B9           BS   RTNSET            End up with empty string,
[1406] A582 D6,B0,66        CEQ  SPACE,V*TEMP5     Wild trailing blanks
       A585 20
[1407] A586 65,7C           BS   GA57C
[1408] A588 91,0C           DINC @BYTES            Allow for terminator
[1409] A58A 0F,77           XML  VPUSH             Save the ptr to the string
[1410] A58C 0F,71           XML  GETSTR            Get a new string
[1411] A58E 0F,78           XML  VPOP              Retrieve the ptr to the strin
[1412] A590 BD,66,4E        DST  @FAC4,@TEMP5      Get the ptr to the string
[1413] A593 86,52           CLR  @FAC8             Force VDP mode
[1414] A595 06,A4,11        CALL LITS09            Copy the string and set up FA
[1415] A598 A1,0C,1C        DADD @SREF,@BYTES      Point to the trailing length
[1416] A59B 93,0C           DDEC @BYTES            Point at the last character
[1417] A59D BE,B0,0C        ST   SPACE,V*BYTES     Put in the terminator
       A5A0 20
[1418] A5A1 BD,56,1C        DST  @SREF,@FAC12      Address for the conversion
[1419] A5A4 D6,B0,56 GA5A4  CEQ  SPACE,V*FAC12     While leading spaces
       A5A7 20
[1420] A5A8 45,AE           BR   GA5AE
[1421] A5AA 91,56           DINC @FAC12            Skip leading blank
[1422] A5AC 45,A4           BR   GA5A4
[1423] A5AE 86,4C    GA5AE  CLR  @FAC2             Get rid of string (in case=0)
[1424] A5B0 86,54           CLR  @FAC10            Assume no error
[1425] A5B2 0F,10           XML  CSNUM             Convert it
[1426] A5B4 D5,56,0C        DCEQ @BYTES,@FAC12     Convert all of it?
[1427] A5B7 68,F1           BS   WRNNO             Yes, check overflow & return
[1428] A5B9 D4,00,00 RTNSET CEQ  @VAR0,@VAR0       No, return with condition set
[1429] A5BC 01              RTNC
[1430]               ***********************************************************
[1431]               * POS(A$,B$,X) - Attempts to match the string, B$, in A$
[1432]               *    beginning at character # X in A$. If X is > LEN(A$), a
[1433]               *    match is not found or A$ is the null string then the
[1434]               *    returned value is 0. If B$ is the null string then the
[1435]               *    returned value is 1. Otherwise, the returned value is
[1436]               *    the column # of the 1st character matched in A$
[1437]               *  CONTROL - Fromn the parser. Returned through common code
[1438]               *            IN LEN.
[1439]               *  USES    - Not temporaries - Utilizes FAC and ARG.
[1440]               ***********************************************************
[1441] A5BD 06,AC,89 POS01  CALL LPAR              Insure "(", parse , insure ",
[1442] A5C0 06,A4,30        CALL PUSSTR            STACK THE STRING AND GET TOKE
[1443] A5C3 0F,7E           XML  SPEED             Parse the match string and
[1444] A5C5 01              BYTE PARCOM      *      insure end on comma
[1445] A5C6 06,A4,30        CALL PUSSTR            STACK THE STRING AND GET TOKE
[1446] A5C9 0F,74           XML  PARSE             Get position
[1447] A5CB B6              BYTE RPARZ
[1448] A5CC 0F,7E           XML  SPEED             Must have
[1449] A5CE 00              BYTE SYNCHK          *  ended on a
[1450] A5CF B6              BYTE RPARZ           *   right parenthesis
[1451] A5D0 06,A9,95        CALL INTARG            Check and convert it

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0025 
EQUATES EXEC-359
[1452] A5D3 8F,4A           DCZ  @FAC              Value out of range
[1453] A5D5 6D,EE           BS   ERRBV
[1454] A5D7 BD,0C,4A        DST  @FAC,@BYTES       Keep the offset
[1455] A5DA 93,0C           DDEC @BYTES            Correct for position 0
[1456] A5DC 0F,78           XML  VPOP              Get match string back
[1457] A5DE 35,00,08        MOVE 8,@FAC,@ARG       Put match in ARG
       A5E1 5C,4A
[1458] A5E3 0F,78           XML  VPOP              Get source back
[1459] A5E5 8E,51           CZ   @FAC7             If source null
[1460] A5E7 66,24           BS   POS12
[1461] A5E9 C4,51,0D        CH   @BYTES+1,@FAC7    OFFSET > LENGTH?
[1462] A5EC 46,24           BR   POS12             Yes, no match possible
[1463] A5EE 8E,63           CZ   @ARG7             If null string
[1464] A5F0 66,15           BS   POS06
[1465] A5F2 A1,4E,0C        DADD @BYTES,@FAC4      Adjust ptr for offset
[1466] A5F5 A4,51,0D        SUB  @BYTES+1,@FAC7    Adjust length
[1467] A5F8 C8,51,63 POS02  CHE  @ARG7,@FAC7       Enough space left for a match
[1468] A5FB 46,24           BR   POS12             No, no match possible
[1469] A5FD BD,4A,4E        DST  @FAC4,@FAC        Get first ARG
[1470] A600 BD,5C,60        DST  @ARG4,@ARG        Get second ARG
[1471] A603 BC,64,63        ST   @ARG7,@ARG8       And length of second
[1472] A606 D4,B0,5C POS04  CEQ  V*FAC,V*ARG       Compare the characters
       A609 B0,4A
[1473] A60B 46,1C           BR   POS10             Didn't match
[1474] A60D 91,4A           DINC @FAC              Next in source
[1475] A60F 91,5C           DINC @ARG              Next in match
[1476] A611 92,64           DEC  @ARG8             Reached end of match?
[1477] A613 46,06           BR   POS04             Not yet, so loop
[1478] A615 90,0D    POS06  INC  @BYTES+1          Matched! Correct for 1 index
[1479] A617 BD,4A,0C POS08  DST  @BYTES,@FAC       Character position of match
[1480] A61A 44,FB           BR   LEN02             Convert to floating point
[1481]               * NOTE: Utilizes the LEN code to do the conversion and
[1482]               *       finish up.
[1483] A61C 90,0D    POS10  INC  @BYTES+1          Step index of match character
[1484] A61E 92,51           DEC  @FAC7             Move 1 position down 1st
[1485] A620 91,4E           DINC @FAC4              Argument
[1486] A622 45,F8           BR   POS02             Try to match again
[1487]               * JUMP ALWAYS
[1488] A624 86,0D    POS12  CLR  @BYTES+1          NO MATCH POSSIBLE
[1489] A626 46,17           BR   POS08
[1490]               ***********************************************************
[1491]               * RPT$(A$,X) - Creates a string consisting of X copies of
[1492]               *              A$. If X is negative or non-numeric, an
[1493]               *              exception occurs. If A$ is not a string, an
[1494]               *              exception occurs.
[1495]               ***********************************************************
[1496] A628 06,AC,89 RPTZ01 CALL LPAR              Insure "(", parse, insure ","
[1497] A62B 06,A4,30        CALL PUSSTR            Insure a string and push it
[1498] A62E 0F,74           XML  PARSE             Parse second argument
[1499] A630 B6              BYTE RPARZ
[1500] A631 0F,7E           XML  SPEED             Must have
[1501] A633 00              BYTE SYNCHK       *     ended on a
[1502] A634 B6              BYTE RPARZ        *      right parenthesis
[1503] A635 06,A9,95        CALL INTARG            Check numeric and convert
[1504] A638 A9,4A,E0        DMUL V@6(@VSPTR),@FAC  Compute result length
       A63B 06,6E
[1505] A63D 8F,4B           DCZ  @FAC1
[1506] A63F 66,49           BS   GA649
[1507] A641 06,6A,82 WRNST2 CALL WARNZZ            Give truncation message
[1508] A644 13              BYTE 19                * STRING TRUNCATED message
[1509] A645 BF,4C,00        DST  255,@FAC2         Make it a maximum string
       A648 FF
[1510] A649 BD,0C,4C GA649  DST  @FAC2,@BYTES      Copy requested string length
[1511] A64C 0F,71           XML  GETSTR            Get the new string

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0026 
EQUATES EXEC-359
[1512] A64E 0F,78           XML  VPOP              Retrieve the original string
[1513]               * At this point BYTES should still contain the length
[1514] A650 BD,5C,50        DST  @FAC6,@ARG        Copy original length in ARG
[1515] A653 8F,0C           DCZ  @BYTES            Zero copies requested
[1516] A655 46,59           BR   GA659
[1517] A657 87,5C           DCLR @ARG              So we copy zero!!!!!!!
[1518] A659 C1,0C,5C GA659  DEX  @ARG,@BYTES       Original length to BYTE
[1519] A65C BD,66,4E        DST  @FAC4,@TEMP5      And also original start addr
[1520] A65F 86,52           CLR  @FAC8             Clear flag for LITS08
[1521] A661 06,A4,06        CALL LITS08            Create FAC and copy on copy
[1522]               * ARG contains total length now.
[1523] A664 BD,50,5C        DST  @ARG,@FAC6        Store new length
[1524] A667 A5,5C,0C RPTZ02 DSUB @BYTES,@ARG       Subtract one copy
[1525] A66A 8F,5C           DCZ  @ARG              <<<<<THE WAY OUT
[1526] A66C 66,84           BS   XMLCON
[1527] A66E A1,1C,0C        DADD @BYTES,@SREF      Compute new start address
[1528] A671 C5,0C,5C        DCH  @ARG,@BYTES
[1529] A674 46,79           BR   GA679
[1530] A676 BD,0C,5C        DST  @ARG,@BYTES       Truncate string
[1531] A679 34,0C,B0 GA679  MOVE @BYTES,V*TEMP5,V*SREF
       A67C 1C,B0,66
[1532] A67F 46,67           BR   RPTZ02
[1533]               **********************************************************
[1534]               ***********************************************************
[1535]               *                   TRACE STATEMENT
[1536]               ***********************************************************
[1537] A681 B6,45,10 NTRACE OR   >10,@FLAG         Set the trace bit
[1538] A684 0F,75    XMLCON XML  CONT              Continue on
[1539]               ***********************************************************
[1540]               *                 UNTRACE STATEMENT
[1541]               ***********************************************************
[1542] A686 B2,45,EF NUNTRC AND  >EF,@FLAG         Reset the trace bit
[1543] A689 0F,75           XML  CONT              Continue on
[1544]               ***********************************************************
[1545]               *          BREAK AND UNBREAK STATEMENTS
[1546]               ***********************************************************
[1547] A68B BE,5C,FF NBREAK ST   >FF,@ARG          BREAK flag
[1548] A68E 06,6A,78        CALL CHKEND            Check for end of statement
[1549] A691 46,A4           BR   LINEGP            If not goto LINEGP
[1550] A693 93,2C           DDEC @PGMPTR           Back up so CON will rescan en
[1551] A695 8E,44           CZ   @PRGFLG           Rative without line #
[1552] A697 41,27           BR   EXEC6C
[1553] A699 06,6A,84 ERROLP CALL ERRZZ             Only legal in a program
[1554] A69C 1B              BYTE 27
[1555] A69D 86,5C    NUNBRK CLR  @ARG              UNBREAK flag for common
[1556] A69F 06,6A,78        CALL CHKEND            Check for end of statement
[1557] A6A2 66,F7           BS   UNBK01            If end then goto UNBK01
[1558] A6A4 06,A8,D3 LINEGP CALL LINE              Get line #
[1559] A6A7 BD,5E,32        DST  @ENLN,@ARG2
[1560] A6AA A7,5E,00        DSUB >03,@ARG2         1st line #
       A6AD 03
[1561] A6AE C9,5E,30 LNGP1  DCHE @STLN,@ARG2       If line not found
[1562] A6B1 46,F1           BR   WRNLNF
[1563] A6B3 06,80,2E        CALL GRSUB3            Read line # of data from ERAM
[1564] A6B6 5E              BYTE >5E           *   (use GREAD1) or VDP
[1565]               * @ARG2: Source addr in ERAM/VDP, reset possible breakpoint
[1566] A6B7 D5,58,4A        DCEQ @FAC,@EEE1        If line found
[1567] A6BA 66,C2           BS   LNGP2
[1568] A6BC A7,5E,00        DSUB 4,@ARG2           Next line in VDP or ERAM
       A6BF 04
[1569] A6C0 46,AE           BR   LNGP1
[1570]               * JUMP ALWAYS
[1571] A6C2 8E,80,84 LNGP2  CZ   @RAMTOP           If ERAM exists
[1572] A6C5 66,DA           BS   GA6DA

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0027 
EQUATES EXEC-359
[1573] A6C7 B2,58,7F        AND  >7F,@EEE1         Assume UNBREAK flag
[1574] A6CA 8E,5C           CZ   @ARG              If BREAK flag
[1575] A6CC 66,D1           BS   GA6D1
[1576] A6CE B6,58,80        OR   >80,@EEE1         Set the breakpoint
[1577] A6D1 06,60,36 GA6D1  CALL GWSUB             Write a few bytes of data to
[1578]               *                              ERAM (use GWRITE)
[1579] A6D4 5E,58,01        BYTE >5E,>58,>01     * ARG2,EEE1,1
[1580]               *                            @ARG2: Destination addr on ERA
[1581]               *                            @EEE1: Data
[1582]               *                            1    : Byte count
[1583] A6D7 05,A6,E6        B    LNGP2B
[1584] A6DA B2,B0,5E GA6DA  AND  >7F,V*ARG2        Assume UNBREAK flag first
       A6DD 7F
[1585] A6DE 8E,5C           CZ   @ARG              If BREAK flag
[1586] A6E0 66,E6           BS   LNGP2B
[1587] A6E2 B6,B0,5E        OR   >80,V*ARG2        Set the breakpoint
       A6E5 80
[1588] A6E6 06,6A,78 LNGP2B CALL CHKEND            Check for end of statement
[1589] A6E9 66,FA           BS   LNGP4             If end then continue
[1590] A6EB 0F,7E           XML  SPEED             Must be
[1591] A6ED 00              BYTE SYNCHK         *     at a
[1592] A6EE B3              BYTE COMMAZ         *       comma now
[1593] A6EF 46,A4           BR   LINEGP
[1594]               * JUMP ALWAYS
[1595] A6F1 06,6A,82 WRNLNF CALL WARNZZ            Note: warning not error
[1596] A6F4 26              BYTE 38             *  'LINE NOT FOUND'
[1597] A6F5 46,E6           BR   LNGP2B            And contiue on
[1598]               * JUMP ALWAYS
[1599] A6F7 06,A6,FC UNBK01 CALL UBSUB             Clear all bkpt in line # tabl
[1600] A6FA 0F,75    LNGP4  XML  CONT              Contiue
[1601]               *     CLEAR ALL BREAKPOINTS
[1602] A6FC BD,52,30 UBSUB  DST  @STLN,@FAC8       END OF LINE # BUFFER
[1603] A6FF 06,A7,0C GA6FF  CALL UBSUB1            Reset one line # at a time
[1604] A702 A3,52,00        DADD 4,@FAC8           Got to the next line
       A705 04
[1605] A706 C5,52,32        DCH  @ENLN,@FAC8       End of table
[1606] A709 46,FF           BR   GA6FF
[1607] A70B 00              RTN
[1608] A70C 06,80,2E UBSUB1 CALL GRSUB3            Read the line # from ERAM/VDP
[1609]               *                             Reset possible bkpt too
[1610] A70F 52              BYTE >52            *  @FAC8: Source addr on ERAM/VD
[1611] A710 06,60,36        CALL GWSUB             Write a few bytes of data to
[1612]               *                              ERAM(use GWRITE) or VDP
[1613] A713 52,58,01        BYTE >52,>58,>01    *  FAC8,EEE1,1
[1614]               *                          @FAC8: Destination adr in ERAM/V
[1615]               *                          @EEE1: Data
[1616]               *                          1    : Byte count
[1617] A716 00              RTN
[1618]               ***********************************************************
[1619]               *                USER DEFINED FUNCTIONS
[1620]               * Subroutine to store away the information of the tokens in
[1621]               * a function reference, go into the 'DEF' statement,
[1622]               * calculate the value of the expression and then resume
[1623]               * execution of the user's program after the reference.
[1624]               * An entry in the FAC and on the stack for a function
[1625]               * reference looks like:
[1626]               * +--------+-----+---------------------+--------+---------+
[1627]               * | PGMPTR | >68 | string/numeric flag | SYMTAB | FREPTR  |
[1628]               * +--------+-----+---------------------+--------+---------+
[1629]               *  FAC      FAC2  FAC3                  FAC4     FAC6
[1630]               *
[1631]               * The 'PGMPTR' is where execution resumes after evaluating
[1632]               * the function. String (80)/numeric(00) flag is function
[1633]               * type. SYMTAB is the old symbol table pointer and FREPTR

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0028 
EQUATES EXEC-359
[1634]               * is the old free space pointer. These are restored after
[1635]               * the function is evaluated.
[1636]               ***********************************************************
[1637] A717 8E,44    UDF    CZ   @PRGFLG           If imperative
[1638] A719 47,20           BR   GA720
[1639] A71B 8E,80,85        CZ   @RAMTOP+1         And ERAM, error
[1640] A71E 46,99           BR   ERROLP
[1641] A720 86,51    GA720  CLR  @FAC7             Assume no args
[1642] A722 87,22           DCLR @ERRCOD           Clear the error code for cont
[1643] A724 86,5E           CLR  @ARG2             Safety for VPUSH
[1644] A726 86,4C           CLR  @FAC2             Sagety for VPUSH
[1645] A728 D6,42,B7        CEQ  LPARZ,@CHAT
[1646] A72B 47,3B           BR   GA73B
[1647] A72D 0F,77           XML  VPUSH             Save ptr to function definiti
[1648] A72F 0F,74           XML  PARSE             PARSE to get arg value
[1649] A731 FF              BYTE >FF
[1650] A732 35,00,08        MOVE 8,@FAC,@ARG       Save PARSE result
       A735 5C,4A
[1651] A737 0F,78           XML  VPOP              Get S.T. ptr to function defi
[1652] A739 90,51           INC  @FAC7             Indicate theat we have an arg
[1653] A73B BC,66,51 GA73B  ST   @FAC7,@TEMP5      Move the parmeter count
[1654] A73E BD,64,4A        DST  @FAC,@TEMP4       S.T. ptr to definition
[1655] A741 0F,77           XML  VPUSH             Allow room for UDF result
[1656] A743 35,00,08        MOVE 8,@ARG,@FAC       Retrieve parse result
       A746 4A,5C
[1657] A748 0F,77           XML  VPUSH             Save parse result
[1658] A74A BC,4C,B0        ST   V*TEMP4,@FAC2     Get S.T. declarations
       A74D 64
[1659] A74E BC,4D,4C        ST   @FAC2,@FAC3       Do this to save string bit
[1660]               * NOTE: THIS IS TO ALLOW THE CHECKING AFTER THE FUNCTION HA
[1661]               *       BEEN EVALUATED TO MAKE SURE THE FUNCTION
[1662]               *       TYPE (STRING/NUMERIC) MATCHES THE RESULT IT PRODUCE
[1663] A751 B2,4C,07        AND  >07,@FAC2         Mask all but # of parameters
[1664] A754 D4,4C,66        CEQ  @TEMP5,@FAC2
[1665] A757 4D,F2           BR   ERRIAL
[1666]               * Incorrect argument list error above.
[1667] A759 BD,4A,2C        DST  @PGMPTR,@FAC      Will resume execution here
[1668] A75C BE,4C,70        ST   >70,@FAC2         Entering parameter into symbo
[1669]               *                    table while in UDF statement executing
[1670] A75F B2,4D,80        AND  >80,@FAC3         Mask all but string bit
[1671] A762 A7,6E,00        DSUB 16,@VSPTR         Get below parse result
       A765 10
[1672]                
[1673] A766 BD,4E,3E        DST  @SYMTAB,@FAC4     Save current symbol table ptr
[1674] A769 BD,50,40        DST  @FREPTR,@FAC6     Save current free space ptr
[1675] A76C 0F,77           XML  VPUSH             Save the return info
[1676] A76E A3,6E,00        DADD 8,@VSPTR          Get back to parse result
       A771 08
[1677]               *********** SHIFT EXECUTION TO FUNCTION DEFINITION ********
[1678] A772 BD,2C,E0        DST  V@6(@TEMP4),@PGMPTR    Set text ptr to definiti
       A775 06,64
[1679] A777 0F,79           XML  PGMCHR            Get 1st character in the defi
[1680] A779 C6,73,A4        CH   >A4,@SUBSTK       Stack overflow
[1681] A77C 6D,CA           BS   ERRSO
[1682] A77E 35,00,18        MOVE 24,@VAR0,V@VROAZ  Roll out temporaries
       A781 A3,C0,00
[1683] A784 B6,45,08        OR   >08,@FLAG         Set function flag for ENTER
[1684] A787 BE,16,80        ST   >80,@XFLAG        Make calls look like ENTERX
[1685] A78A D6,42,BE        CEQ  EQUALZ,@CHAT
[1686] A78D 47,9C           BR   GA79C
[1687]               * NOTE: This is to keep the global/local variables correct
[1688]               *       the event that a function uses another function in
[1689]               *       its evaluation.
[1690] A78F 86,59           CLR  @FAC15            Create a dummy entry in table

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0029 
EQUATES EXEC-359
[1691] A791 06,6A,80        CALL ENT09              for no-paremter function
[1692] A794 97,2C           DDECT @PGMPTR          Back up to equal sign
[1693] A796 86,E0,02        CLR  V@2(@VSPTR)       This is to keep ASSGNV(called
       A799 6E
[1694]               *                              below) not to screw up in
[1695]               *                              case FAC2 happens to have a
[1696]               *                              value (greater) >65
[1697] A79A 47,9F           BR   GA79F
[1698] A79C 06,6A,7E GA79C  CALL ENTER             Enter the parameter
[1699] A79F 0F,79    GA79F  XML  PGMCHR            Get the '=' (Checked in PSCAN
[1700] A7A1 B2,45,F7        AND  >F7,@FLAG         Reset to normal ENTERs
[1701] A7A4 35,00,18        MOVE 24,V@VROAZ,@>8300
       A7A7 00,A3,C0
[1702] A7AA BE,EF,FF        ST   >68,V@-6(@VSPTR)  Correct stack entry ID
       A7AD FA,6E,68
[1703] A7B0 BD,E0,02        DST  V@SYMBOL,V@2(@SYMTAB)  Fudge link to
       A7B3 3E,A3,76
[1704]               *                                   get global values
[1705] A7B6 BD,4A,3E        DST  @SYMTAB,@FAC      Set up for SMB
[1706] A7B9 0F,7B           XML  SMB               Get value space
[1707] A7BB 35,00,08        MOVE 8,@FAC,@FAC8      Destination
       A7BE 52,4A
[1708] A7C0 0F,78           XML  VPOP              Get arg back
[1709] A7C2 35,00,08        MOVE 8,@FAC,@ARG       Argument value
       A7C5 5C,4A
[1710] A7C7 35,00,08        MOVE 8,@FAC8,@FAC      Destination
       A7CA 4A,52
[1711] A7CC 0F,77           XML  VPUSH             Push to destination
[1712] A7CE 35,00,08        MOVE 8,@ARG,@FAC       Argument value
       A7D1 4A,5C
[1713] A7D3 D6,4C,65        CEQ  >65,@FAC2         If a string
[1714] A7D6 47,E2           BR   GA7E2
[1715] A7D8 D7,4A,00        DCEQ >001C,@FAC        If not temp
       A7DB 1C
[1716] A7DC 67,E2           BS   GA7E2
[1717] A7DE BD,4E,B0        DST  V*FAC,@FAC4       Get new location of string
       A7E1 4A
[1718]               *                             Parameter was allocated in S.
[1719] A7E2 0F,79    GA7E2  XML  PGMCHR            Skip the '='
[1720] A7E4 0F,7C           XML  ASSGNV            Assign the value to the param
[1721] A7E6 0F,74           XML  PARSE             PARSE to end of function defi
[1722] A7E8 83              BYTE TREMZ
[1723]               **** CHECK FOR TYPE MATCH (STRING/STRING OR NUM/NUM)*******
[1724]               **** BETWEEN THE RESULT AND THE FUNCTION TYPE *************
[1725] A7E9 D6,4C,65        CEQ  >65,@FAC2         If result string
[1726] A7EC 47,F6           BR   GA7F6
[1727] A7EE 8E,E0,03        CZ   V@3(@VSPTR)       If functional
       A7F1 6E
[1728] A7F2 6D,BE           BS   ERRSNM
[1729] A7F4 47,FC           BR   GA7FC              not a string
[1730] A7F6 8E,E0,03 GA7F6  CZ   V@3(@VSPTR)       If functional
       A7F9 6E
[1731] A7FA 4D,BE           BR   ERRSNM
[1732]               ***** NOW RESTORE SYMBOL TABLE AND RESUME *****************
[1733]               ***** EXECUTION AT THE ORIGINAL LINE **********************
[1734] A7FC 06,A8,0A GA7FC  CALL DELINK            Delink the parameter entry
[1735] A7FF BD,2C,E0        DST  V@8(@VSPTR),@PGMPTR Manual pop to get ptr back
       A802 08,6E
[1736] A804 93,2C           DDEC @PGMPTR           Back up text pointer
[1737] A806 0F,79           XML  PGMCHR            Get next token
[1738] A808 0F,75           XML  CONT
[1739] A80A BD,66,3E DELINK DST  @SYMTAB,@TEMP5    Save addr of S.T. entry just
[1740]               *                             in case entry is a string
[1741]               *                             (must free the string)

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0030 
EQUATES EXEC-359
[1742] A80D 35,00,04        MOVE 4,V@4(@VSPTR),@SYMTAB  Restore old symbol table
       A810 3E,E0,04
       A813 6E
[1743]               *                             pointer and free space pointe
[1744]               *                             This handles the freeing of t
[1745]               *                             string value which was assign
[1746]               *                             to the parameter.
[1747] A814 D2,B0,66        CGE  0,V*TEMP5         If string parmeter
       A817 00
[1748] A818 68,4C           BS   GA84C
[1749] A81A BD,66,E0        DST  V@6(@TEMP5),@TEMP5 Where the string is
       A81D 06,66
[1750] A81F 8F,66           DCZ  @TEMP5            If non-null string
[1751] A821 68,33           BS   GA833
[1752] A823 BD,56,EF        DST  V@-3(@TEMP5),@TEMP2 Get backpointer
       A826 FF,FD,66
[1753] A829 C9,56,3E        DCHE @SYMTAB,@TEMP2    If not used
[1754] A82C 68,33           BS   GA833
[1755] A82E 87,EF,FF        DCLR V@-3(@TEMP5)      Free up the string
       A831 FD,66
[1756]               * This handles the special case of F$(X$)=X$
[1757]               * The result, which was permanent, must be made a temp.
[1758] A833 D6,4C,65 GA833  CEQ  >65,@FAC2         If string result
[1759] A836 48,4A           BR   GA84A
[1760] A838 C9,4A,3E        DCHE @SYMTAB,@FAC      If came from argument
[1761] A83B 68,4A           BS   GA84A
[1762] A83D 8F,4E           DCZ  @FAC4             If non-null
[1763] A83F 68,46           BS   GA846
[1764] A841 87,EF,FF        DCLR V@-3(@FAC4)       Clear the backpointer
       A844 FD,4E
[1765] A846 BF,4A,00 GA846  DST  >001C,@FAC        Make it a temp
       A849 1C
[1766] A84A 48,56    GA84A  BR   GA856             If numeric parameter
[1767] A84C 8E,80,84 GA84C  CZ   @RAMTOP           If ERAM exist
[1768] A84F 68,56           BS   GA856
[1769] A851 A3,80,86        DADD 8,@RAMFRE         Remove 8 bytes of value
       A854 00,08
[1770] A856 A7,6E,00 GA856  DSUB 8,@VSPTR          Trash the stack entry
       A859 08
[1771] A85A 00              RTN                    And retrun
[1772] A85B 0F,74    ATTNUT XML  PARSE
[1773] A85D B6              BYTE RPARZ
[1774] A85E 06,A3,ED        CALL CKSTNM            CHECK FOR NUMERIC OR STRING
[1775] A861 0F,7E           XML  SPEED             Insure argument is in
[1776] A863 02              BYTE RANGE          *   range of 0-30
[1777] A864 00              BYTE 0
[1778] A865 00,1E           DATA 30
[1779] A867 E6,4B,01        SRL  1,@FAC1           0,1 : 0000        ATTENUATION
[1780]               *                             2,3 : 0001
[1781]               *                             4,5 : 0010
[1782]               *                             6,7 : 0011        ETC...
[1783] A86A B6,4B,F0        OR   >F0,@FAC1         REGISTER BITS
[1784] A86D 00              RTN
[1785]               ***********************************************************
[1786]               * SUBROUTINE TO SET POINTER TO EACH DATUM
[1787]               ***********************************************************
[1788] A86E 93,36    DATAST DDEC @LNBUF            Point to 1st byte of line ptr
[1789] A870 06,80,2C        CALL GRSUB2            Read 2 bytes from VDP or ERAM
[1790] A873 36              BYTE LNBUF           *  (use GREAD1), @LNBUF: Source
[1791]               *                           *  address in ERAM or VDP
[1792] A874 BD,34,58        DST  @EEE1,@DATA       Put it in @DATA
[1793] A877 06,80,20        CALL SRDATA            Look for 'DATA' on the line
[1794] A87A 48,89           BR   DATST1            OK, FOUND ANOTHER 'DATA' STMT
[1795] A87C 97,36           DDECT @LNBUF           NO

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0031 
EQUATES EXEC-359
[1796] A87E D5,36,30        DCEQ  @STLN,@LNBUF
[1797] A881 68,87           BS   GA887
[1798] A883 93,36           DDEC @LNBUF            Point to 1st token address
[1799] A885 48,6E           BR   DATAST
[1800] A887 86,34    GA887  CLR  @DATA             Indicate no data
[1801] A889 00       DATST1 RTN
[1802]               ***********************************************************
[1803]               * Subroutine to get line number and goto routine to display
[1804]               * it on the screen.
[1805]               ***********************************************************
[1806] A88A 8E,80,89 ASC    CZ   @RAMFLG
[1807] A88D 48,97           BR   GA897
[1808] A88F BD,5E,EF        DST  V@-2(@EXTRAM),@ARG2   Get line # in
       A892 FF,FE,2E
[1809] A895 48,A5           BR   GA8A5
[1810] A897 BF,56,00 GA897  DST  2,@FFF1           @FFF1 : Byte count
       A89A 02
[1811] A89B BD,54,2E        DST  @EXTRAM,@DDD1     @DDD1 : Source addr in ERAM
[1812] A89E 97,54           DDECT @DDD1
[1813] A8A0 0F,8C           XML  GREAD1            Read data from ERAM
[1814] A8A2 BD,5E,58        DST  @EEE1,@ARG2       @EEE1 : Destination addr on C
[1815] A8A5 B2,5E,7F GA8A5  AND  >7F,@ARG2         Reset the breakpoint if any
[1816] A8A8 05,6A,7C        B    DISO
[1817]               ***********************************************************
[1818]               * Code to decode error returned from ALC
[1819]               ***********************************************************
[1820] A8AB 8A,22    ERORZ  CASE @ERRCOD           DECODE ERROR FROM INTERPRETER
[1821] A8AD 4D,BA           BR   ERRSYN            0 SYNTAX ERROR
[1822] A8AF 4D,C6           BR   ERRMEM            1 MEMORY FULL
[1823] A8B1 4D,EE           BR   ERRBV             2 BAD VALUE
[1824] A8B3 4D,E6           BR   ERRLNF            3 LINE NOT FOUND
[1825] A8B5 4D,BA           BR   ERRSYN            4 SYNTAX
[1826] A8B7 4D,E2           BR   ERRBS             5 BAD SUBSCRIPT
[1827] A8B9 4D,BE           BR   ERRSNM            6 STRING-NUMBER MISMATCH
[1828] A8BB 4D,CA           BR   ERRSO             7 STACK OVERFLOW
[1829] A8BD 4D,EA           BR   ERRBA             8 BAD ARGUMENT
[1830] A8BF 4D,DE           BR   ERRRWG            9 RETURN WITHOUT GOSUB
[1831] A8C1 4D,F2           BR   ERRIAL            A INCORRECT ARGUMENT LIST
[1832] A8C3 4D,D2           BR   ERRFNN            B FOR/NEXT NESTING
[1833] A8C5 4D,CE           BR   ERRNWF            C NEXT WITHOUT FOR
[1834] A8C7 4D,C2           BR   ERRMUV            D IMPROPERLY USED NAME
[1835] A8C9 4D,F2           BR   ERRIAL            E INCORRECT ARGUMENT LIST
[1836] A8CB 4D,DA           BR   ERRRSC            F RECURSIVE SUBPROGRAM CALL
[1837] A8CD 4D,F6           BR   ERRSNF           10 SUBPROGRAM NOT FOUND
[1838] A8CF 46,99           BR   ERROLP           11 ONLY LEGAL IN A PROGRAM
[1839] A8D1 4D,D6           BR   ERRSNS           12 MUST BE IN SUBPROGRAM
[1840]               ***********************************************************
[1841]               * SUBROUTINE TO GET LINE # FOLLOWING 'BREAK', 'UNBREAK',
[1842]               * 'RESTORE'
[1843]               ***********************************************************
[1844] A8D3 D6,42,C9 LINE   CEQ  LNZ,@CHAT         Should be line # reference
[1845] A8D6 4D,BA           BR   ERRSYN
[1846] A8D8 0F,79           XML  PGMCHR            Get high order line #
[1847] A8DA BC,4A,42        ST   @CHAT,@FAC        Build result in FAC, FAC1
[1848] A8DD 0F,79           XML  PGMCHR
[1849] A8DF BC,4B,42        ST   @CHAT,@FAC1       Low order line #
[1850] A8E2 0F,79           XML  PGMCHR            Get token following line #
[1851] A8E4 00              RTN
[1852] A8E5 86,54    CONV1  CLR  @FAC10
[1853] A8E7 0F,10           XML  CSNUM             Convert String to Number
[1854]               ***********************************************************
[1855] A8E9 BC,A3,BA        ST   @FAC10,V@CSNTP1
       A8EC 54
[1856] A8ED BD,A3,90        DST  @FAC12,V@CSNTMP Save those in temporary, becaus

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0032 
EQUATES EXEC-359
       A8F0 56
[1857]               *                            in ERROV : WARNING routine hav
[1858]               *                            FAC12 and FAC10 values changed
[1859]               ***********************************************************
[1860] A8F1 8E,54    WRNNO  CZ   @FAC10            Numeric overflow
[1861] A8F3 68,F9           BS   GA8F9
[1862] A8F5 06,6A,82        CALL WARNZZ
[1863] A8F8 02              BYTE 2
[1864] A8F9 00       GA8F9  RTN
[1865]               ***********************************************************
[1866]               *                SUBROUTINE FOR 'GCHAR'
[1867]               ***********************************************************
[1868] A8FA 06,AC,A9 GCHAR  CALL GPHV              Get X,Y values
[1869] A8FD 06,A9,DD GCHAR2 CALL NUMVAR            Get pointer to return variabl
[1870] A900 31,00,08        MOVE 8,G@FLT1,@FAC     Clear FAC
       A903 4A,A3,F3
[1871] A906 BC,4B,7D        ST   @CB,@FAC1         Get the character
[1872] A909 A6,4B,60        SUB  OFFSET,@FAC1      Remove screen offset
[1873] A90C CA,4B,64        CHE  100,@FAC1
[1874] A90F 49,19           BR   GA919
[1875] A911 C0,4C,4B        EX   @FAC1,@FAC2
[1876] A914 AE,4B,64        DIV  100,@FAC1
[1877] A917 90,4A           INC  @FAC
[1878] A919 0F,7C    GA919  XML  ASSGNV            Assign the value to the symbo
[1879]               * RXB PATCH CODE
[1880] A91B 5E,4D           BR   GCHARA
[1881]               ***********************************************************
[1882]               *               SUBROUTINE FOR 'COLOR'
[1883]               ***********************************************************
[1884] A91D 0F,7E    COLOR  XML  SPEED             Must be
[1885] A91F 00              BYTE SYNCHK        *     at a
[1886] A920 B7              BYTE LPARZ         *       left parenthesis
[1887]               * RXB PATCH CODE
[1888] A921 87,00    COL08  DCLR @VAR0             Clear ALL pointer
[1889] A923 D6,42,EC        CEQ  ALLZ,@CHAT        ALL?
[1890] A926 49,34           BR   COL09             No.
[1891] A928 BE,00,EC        ST   ALLZ,@VAR0        Yes, store it in pointer
[1892] A92B 87,4A           DCLR @FAC              Set 0
[1893] A92D 0F,79           XML  PGMCHR            Skip ALL token.
[1894] A92F 06,B1,AD        CALL COMMA2            Skip comma.
[1895] A932 49,52           BR   COL21             Start ALL RXB routine
[1896] A934 D6,42,FD COL09  CEQ  NUMBEZ,@CHAT      If sprite number specified
[1897] A937 49,49           BR   COL20
[1898] A939 06,AD,FA        CALL CHAR1             Check sprite number (SPNUM3)
[1899] A93C 06,A9,89 COL10  CALL SPCOL             Put the color in SAL
[1900] A93F D6,42,B3        CEQ  COMMAZ,@CHAT      More color changes
[1901] A942 4B,1A           BR   LNKRTN
[1902] A944 06,AD,FC        CALL CHAR2             Skip and get sprite number (S
[1903] A947 49,3C           BR   COL10
[1904]               * This part for regular color change routine
[1905] A949 0F,7E    COL20  XML  SPEED             Parse the character
[1906] A94B 01              BYTE PARCOM         *   set and insure a comma
[1907] A94C 0F,7E           XML  SPEED             Insure in range of
[1908] A94E 02              BYTE RANGE          *   0<= x <= 14
[1909]               * RXB PATCH CODE
[1910]               *      BYTE 0,0,14
[1911] A94F 00,00,10        BYTE 0,0,16
[1912] A952 A3,4A,08 COL21  DADD >080F,@FAC        Color table addr(>0810 - >081
       A955 0F
[1913] A956 0F,77           XML  VPUSH             Push table set address
[1914] A958 0F,7E           XML  SPEED             Parse the foreground color
[1915] A95A 01              BYTE PARCOM         *   and insure a comma
[1916] A95B 06,AC,A0        CALL RAN16             Error if >16 or <1
[1917] A95E BC,0E,4B        ST   @FAC1,@VAR4       Save it

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0033 
EQUATES EXEC-359
[1918] A961 E2,0E,04        SLL  4,@VAR4           Foreground color in 4 MSBits
[1919] A964 0F,74           XML  PARSE             Get background color
[1920] A966 B6              BYTE RPARZ
[1921] A967 06,AC,A0        CALL RAN16             Error if >16 or <1
[1922] A96A B4,0E,4B        OR   @FAC1,@VAR4       Background color in 4 LSBits
[1923] A96D 0F,78           XML  VPOP              Get color table address
[1924] A96F BC,B0,4A        ST   @VAR4,V*FAC       Load the colors into the tabl
       A972 0E
[1925]               * RXB PATCH CODE
[1926] A973 D6,00,EC        CEQ  ALLZ,@VAR0        ALL in pointer.
[1927] A976 49,80           BR   COL22             No.
[1928] A978 35,00,0E        MOVE 14,V*FAC,V@1(@FAC) Fill color table with values
       A97B E0,01,4A
       A97E B0,4A
[1929] A980 D6,42,B3 COL22  CEQ  COMMAZ,@CHAT      End of call. Go back.
[1930] A983 4B,1A           BR   LNKRTN
[1931] A985 0F,79           XML  PGMCHR            Skip ","
[1932] A987 49,21           BR   COL08             Take care of the next set
[1933]               *      CALL SPCOL -- Changes color of sprite.
[1934]               *                    Called also from SPRITE.
[1935] A989 0F,74    SPCOL  XML  PARSE
[1936] A98B B6              BYTE RPARZ          *  Get the color number
[1937] A98C 06,AC,A0        CALL RAN16             Check range 1 - 16
[1938] A98F BC,E0,03        ST   @FAC1,V@3(@SPSAL) Store in SAL
       A992 08,4B
[1939] A994 00              RTN
[1940]               ***********************************************************
[1941]               * INTARG - Insures that the value in FAC is a numeric,
[1942]               *          converts it to integer, issues error message if
[1943]               *          necessary or returns.
[1944]               ***********************************************************
[1945] A995 C6,4C,63 INTARG CH   >63,@FAC2         If string - error
[1946] A998 6D,BE           BS   ERRSNM
[1947] A99A 86,54           CLR  @FAC10            ASSUME NO ERROR OR WARNING
[1948] A99C 87,6C           DCLR @FPERAD
[1949] A99E 0F,12           XML  FLTINT
[1950] A9A0 8E,54           CZ   @FAC10            If error
[1951] A9A2 4D,EE           BR   ERRBV
[1952] A9A4 D2,4A,00        CGE  0,@FAC            Can't be < zero
[1953] A9A7 4D,EE           BR   ERRBV
[1954] A9A9 00              RTN
[1955]               * FAC IS SET UP WITH F.P. 1
[1956] A9AA BC,4B,00 JOYXY  ST   @VAR0,@FAC1
[1957] A9AD 8E,00           CZ   @VAR0             If <>0
[1958] A9AF 49,B5           BR   GA995
[1959] A9B1 86,4A           CLR  @FAC              (>0000000000000000)
[1960] A9B3 49,BD           BR   GA99D
[1961] A9B5 D2,00,00 GA995  CGE  0,@VAR0
[1962] A9B8 69,BD           BS   GA99D
[1963] A9BA BE,4A,BF        ST   >BF,@FAC
[1964] A9BD 0F,7C    GA99D  XML  ASSGNV            Assign the value
[1965] A9BF 00              RTN
[1966] A9C0 BC,00,4B        ST   @FAC1,@VAR0       Keyboard selection
[1967] A9C3 06,A9,DD        CALL NUMVAR            Get variable for key-code
[1968] A9C6 D6,42,B3        CEQ  COMMAZ,@CHAT      If not comma - error
[1969] A9C9 4D,BA           BR   ERRSYN
[1970] A9CB 0F,79           XML  PGMCHR            Get next character
[1971] A9CD 06,A9,DD        CALL NUMVAR            Get variable for key-status
[1972] A9D0 BC,74,00        ST   @VAR0,@KEYBD      Keyboard selection
[1973] A9D3 31,00,08        MOVE 8,G@FLT1,@FAC     Set up float
       A9D6 4A,A3,F3
[1974] A9D9 03              SCAN                   SCAN the keyboard
[1975] A9DA 86,74           CLR  @KEYBD            Clear the code(No affect on s
[1976] A9DC 01              RTNC                   Return scan condition code

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0034 
EQUATES EXEC-359
[1977] A9DD 0F,7A    NUMVAR XML  SYM               Get the symbol name
[1978] A9DF DA,B0,4A        CLOG >C0,V*FAC         Can't be string or function
       A9E2 C0
[1979] A9E3 4D,C2           BR   ERRMUV            It is, IMPROPERLY USED NAME E
[1980] A9E5 0F,7B           XML  SMB               Get value pointer
[1981] A9E7 0F,77           XML  VPUSH             Put on stack for ASSGNV
[1982] A9E9 00              RTN                    And return
[1983] A9EA 80,00,A0 ATTREG DATA >8000,>A000,>C000,
       A9ED 00,C0,00
[1984] A9F0 9F,BF,DF        BYTE >9F,>BF,>DF,>FF,>00,>06
       A9F3 FF,00,06
[1985] A9F6 D6,42,B7 COMB   CEQ  LPARZ,@CHAT       If not '(' - error
[1986] A9F9 4D,BA           BR   ERRSYN
[1987] A9FB 00              RTN
[1988] A9FC 35,00,08 SQUISH MOVE 8,V*FAC8,@FAC     Sneak it out
       A9FF 4A,B0,52
[1989] AA02 BD,58,6E        DST  @VSPTR,@FAC14     Now move stack to squish it
[1990] AA05 A5,58,52        DSUB @FAC8,@FAC14        out - # of bytes to move
[1991] AA08 6A,13           BS   SQU05             If none to move
[1992] AA0A 34,58,EF        MOVE @FAC14,V@8(@FAC8),V@-16(@FAC8)
       AA0D FF,F0,52
       AA10 E0,08,52
[1993] AA13 A7,6E,00 SQU05  DSUB 8,@VSPTR
       AA16 08
[1994] AA17 00              RTN
[1995]               ***********************************************************
[1996]               *                 SUBPROGRAM FOR CLEAR
[1997]               ***********************************************************
[1998] AA18 07,80    CLEAR  ALL  SPACE+OFFSET      Clear the screen
[1999] AA1A BE,7F,03        ST   3,@XPT            Initialize screen pointer
[2000] AA1D 4B,1E           BR   LNKRT2            Return to caller
[2001]               ***********************************************************
[2002]               *               SUBPROGRAM FOR VERSION
[2003]               ***********************************************************
[2004] AA1F 06,A9,F6 VERS   CALL COMB              Insure have left parenthesis
[2005] AA22 06,AD,AF        CALL ERRC05            Get symbol information
[2006]               *----------------------------------------------------------
[2007]               * Change version number to 110     6/16/1981
[2008] AA25 BF,4A,07        DST  2015,@FAC              8/17/2014
       AA28 DF
[2009] AA29 0F,80           XML  CIF               Convert to floating point
[2010]               *----------------------------------------------------------
[2011] AA2B 51,B8           BR   ASSRTN            Assign and return to caller
[2012]               * INIALIZATION DATA FOR SOUND
[2013] AA2D 42,0B,12 FLTS   BYTE >42,>0B,>12,>22,>00,>00,>00,>00
       AA30 22,00,00
       AA33 00,00
[2014] AA35 01,FF,01 SNDREG BYTE >01,>FF,>01,>04,>9F,>BF,>DF,>FF,>00
       AA38 04,9F,BF
       AA3B DF,FF,00
[2015]               ***********************************************************
[2016]               *                SUBPROGRAM FOR 'SOUND'
[2017]               * Builds 2 blocks in VDP RAM
[2018]               * 1st BLOCK : >01,<ATTENUATION FOR NOISE>,<INTERRUPT COUNT>
[2019]               * 2nd BLOCK : >04,>9F,>BF,>DF,>FF,>00
[2020]               ***********************************************************
[2021] AA3E D7,80,CC XSOUND DCEQ VRMSND,@>83CC     Insure previous sound started
       AA41 03,79
[2022] AA43 6A,3E           BS   XSOUND
[2023] AA45 31,00,09        MOVE 9,G@SNDREG,V@VRMSND
       AA48 A3,79,AA
       AA4B 35
[2024] AA4C 06,AC,89        CALL LPAR              Duration in milliseconds
[2025] AA4F D2,4A,00        CGE  0,@FAC            Don't wait for completion

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0035 
EQUATES EXEC-359
[2026] AA52 6A,59           BS   GAA39
[2027] AA54 83,4A           DNEG @FAC                of previous sound
[2028] AA56 87,80,CE        DCLR @PRTNFN           Make GPL interpeters stop pre
[2029] AA59 0F,7E    GAA39  XML  SPEED             Insure duration
[2030] AA5B 02              BYTE RANGE           *  is in range
[2031] AA5C 01              BYTE 1               *   of 1 - 4250
[2032] AA5D 10,9A           DATA 4250
[2033]               * Convert duration into 1/60s of a second
[2034] AA5F AB,4A,00        DMUL 6,@FAC            Duration * 6
       AA62 06
[2035] AA63 AF,4A,00        DDIV 100,@FAC          (duration * 6) / 100
       AA66 64
[2036] AA67 8E,4B           CZ   @FAC1             If duration =0
[2037] AA69 4A,6D           BR   GAA4D
[2038] AA6B 90,4B           INC  @FAC1             Set it to 1/60th of a second
[2039] AA6D BC,A3,7B GAA4D  ST   @FAC1,V@VRMSND+2    3rd byte of the 1st block
       AA70 4B
[2040]               *                          | INTERUPT COUNT
[2041]               ***********************************************************
[2042]               *      SOUND TABLE OF 10 BYTES IN CPU RAM (>00 - >09)
[2043]               * >00 - >05 : FREQUENCY CONTROL
[2044]               * >06 - >08 : ATTENUATION CONTROL
[2045]               * >09       : NOISE CONTROL(non-zero = noise encountered)
[2046]               * >0A       : POINTER FOR CURRENT FREQENCY CONTROL
[2047]               * >0B       : POINTER FOR CURRENT ATTENUATION CONTROL
[2048]               *                    >00 , >01 FOR REG 0;
[2049]               *                    >02 , >03 FOR REG 1;
[2050]               *                    >04 , >05 FOR REG 2;
[2051]               * REG0 : >8000, REG1 : >A000, REG3 : >C000
[2052]               * INITIALIZE ATTENUATION CONTROL
[2053]               * REG0 : >9F, REG1 : >BF, REG2 : >DF
[2054]               ***********************************************************
[2055] AA71 31,00,0C        MOVE 12,G@ATTREG,@>8300
       AA74 00,A9,EA
[2056] AA77 0F,7E    SOUND1 XML  SPEED             Parse the frequency value
[2057] AA79 01              BYTE PARCOM         *   and insure a comma
[2058] AA7A 06,A3,ED        CALL CKSTNM            Must be a numeric
[2059] AA7D D2,4A,00        CGE  0,@FAC            Noise if negative
[2060] AA80 4A,BF           BR   SOUND2
[2061] AA82 31,00,08        MOVE 8,G@FLTS,@ARG     Constant 111834
       AA85 5C,AA,2D
[2062] AA88 0F,09           XML  FDIV              P = 111834/FREQUENCY
[2063] AA8A 0F,7E           XML  SPEED             Insure in range
[2064] AA8C 02              BYTE RANGE
[2065] AA8D 03              BYTE 3               * Range: 3 - 1023
[2066] AA8E 03,FF           DATA 1023
[2067]               * GET THE 4 L.S.Bits BITS AND 6 M.S.Bits OF 'P'
[2068] AA90 EB,4A,00        DSRC 4,@FAC
       AA93 04
[2069] AA94 E6,4A,04        SRL  4,@FAC
[2070] AA97 B5,90,0A        DOR  @FAC,*STADDR  1st byte of frequency control byt
       AA9A 4A
[2071]               *                         BIT   7   6   5   4   3   2   1
[2072]               *                               1  <REG>    0  <L.S.B. 4 OF
[2073]               *                         2nd byte of frequency control byt
[2074]               *                               0   0   <M.S.B. 6 of 'P'
[2075] AA9B 94,0A           INCT @STADDR           Advance ponter for next time
[2076] AA9D 06,A8,5B        CALL ATTNUT            Get attenuation
[2077]               *                        BIT    7   6   5   4   3   2   1
[2078]               *                               1   <REG>   1   0   0   0
[2079] AAA0 B0,90,0B        AND  @FAC1,*VAR2         1   <REG>   1   <ATTN/2 DB>
       AAA3 4B
[2080] AAA4 90,0B           INC  @VAR2             Advance pointer for next time
[2081]               * CHECK FOR END OF SOUND CALL

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0036 
EQUATES EXEC-359
[2082] AAA6 D6,42,B6 SOUND3 CEQ  RPARZ,@CHAT       End of statement?
[2083] AAA9 6A,DD           BS   SOUND5
[2084] AAAB 0F,7E           XML  SPEED             If not right parenthesis
[2085] AAAD 00              BYTE SYNCHK        *    then must be at
[2086] AAAE B3              BYTE COMMAZ        *      a comma
[2087] AAAF D6,0A,06        CEQ  6,@STADDR         If not 3 regs yet
[2088] AAB2 4A,77           BR   SOUND1
[2089]               * 3 sound regs already - so must be noise control
[2090] AAB4 0F,7E           XML  SPEED             Get frequency (should be nois
[2091] AAB6 01              BYTE PARCOM        *     and insure a comma
[2092] AAB7 06,A3,ED        CALL CKSTNM            Must be a numeric value
[2093] AABA D2,4A,00        CGE  0,@FAC            If not noise-error
[2094] AABD 6D,EE           BS   ERRBV
[2095]               * NOISE CONTROL
[2096] AABF D6,09,FF SOUND2 CEQ  >FF,@>8309        * BAD ARGUMENT ERROR
[2097] AAC2 4D,EA           BR   ERRBA
[2098] AAC4 83,4A           DNEG @FAC              -(FREQUENCY)
[2099] AAC6 0F,7E           XML  SPEED             Insure in range
[2100] AAC8 02              BYTE RANGE         *    of 1 - 8
[2101] AAC9 01              BYTE 1             *
[2102] AACA 00,08           DATA 8
[2103] AACC 92,4B           DEC  @FAC1             0 - 7 (2nd BIT: 'T')
[2104]               *                                           OTH, 1ST BITS:
[2105] AACE BC,09,4B        ST   @FAC1,@>8309
[2106] AAD1 B6,09,E0        OR   >E0,@>8309        Noise control byte:
[2107]               *                        BIT  7   6   5   4   3   2   1   0
[2108]               *                             1   1   1   0   0  <T>  < S >
[2109]               * PUT ATTENUATION IN THE 2ND BYTE OF 1ST BLOCK
[2110] AAD4 06,A8,5B        CALL ATTNUT
[2111] AAD7 BC,A3,7A        ST   @FAC1,V@VRMSND+1
       AADA 4B
[2112]               *                             1   1   1   1   < ATTN/2  DB>
[2113] AADB 4A,A6           BR   SOUND3            Go check for end of list
[2114] AADD 86,10    SOUND5 CLR  @VAR5             Pointer to sound table
[2115] AADF 8E,80,CE SND05  CZ   @PRTNFN           Wait untild previous
[2116] AAE2 6A,EE           BS   SOUND6
[2117] AAE4 03              SCAN                   Is finished and
[2118] AAE5 4A,DF           BR   SND05              look for a break-key
[2119] AAE7 D6,75,02        CEQ  BREAK,@RKEY       If not break-key
[2120] AAEA 4A,DF           BR   SND05
[2121] AAEC 41,27           BR   EXEC6C            If BREAK-KEY encountered
[2122]               * LOAD SOUND TABLE
[2123] AAEE BC,81,00 SOUND6 ST   *VAR5,@>8400      SOUND ADDRESS PORT
       AAF1 90,10
[2124] AAF3 90,10           INC  @VAR5             Next byte in table
[2125] AAF5 D6,10,0A        CEQ  >0A,@VAR5         If not finished
[2126] AAF8 4A,EE           BR   SOUND6
[2127] AAFA BF,4A,03        DST  VRMSND,@FAC       Where the 2 blocks are
       AAFD 79
[2128] AAFE F6,4A,01        I/O  1,@FAC            Start sound from VDP list
[2129] AB01 4B,1A           BR   LNKRTN            Return to caller
[2130]               ***********************************************************
[2131]               *                SUBPROGRAM FOR 'HCHAR'
[2132]               ***********************************************************
[2133] AB03 06,AC,D6 HCHAR  CALL HVCHR             Get X, Y values character, #
[2134] AB06 8F,4A           DCZ  @FAC              If 0 characters
[2135] AB08 6B,12           BS   HCHAR2
[2136] AB0A 08,E0,00 HCHAR1 BYTE >08,>E0,>00,>FB  * FMT '@VAR0'   Display horizo
       AB0D FB
[2137] AB0E 93,4A           DDEC @FAC              Done yet?
[2138] AB10 4B,0A           BR   HCHAR1            No, finish it
[2139]               * RXB PATCH CODE
[2140] AB12 D6,42,B3 HCHAR2 CEQ  COMMAZ,@CHAT
[2141] AB15 6B,03           BS   HCHAR

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0037 
EQUATES EXEC-359
[2142] AB17 BC,7F,02 XPTRTN ST   @MNUM,@XPT        Restore X-pointer
[2143] AB1A 0F,7E    LNKRTN XML  SPEED             Must be at
[2144] AB1C 00              BYTE SYNCHK        *     a right
[2145] AB1D B6              BYTE RPARZ         *      parenthesis
[2146] AB1E 06,6A,78 LNKRT2 CALL CHKEND            Check end of statement
[2147] AB21 4D,BA           BR   ERRSYN            If not end-of-stmt , error
[2148] AB23 06,00,12        CALL RETURN            Return to caller
[2149]               ***********************************************************
[2150]               *                SUBPROGRAM FOR 'VCHAR'
[2151]               ***********************************************************
[2152] AB26 06,AC,D6 VCHAR  CALL HVCHR             Get X, Y values character, #
[2153] AB29 8F,4A           DCZ  @FAC              If 0 characters
[2154] AB2B 6B,3F           BS   VCHAR2
[2155] AB2D 08,E0,00 VCHAR1 BYTE >08,>E0,>00,>9E,>FB * FMT '@VAR0',>31 Display v
       AB30 9E,FB
[2156] AB32 93,4A           DDEC @FAC              Done yet?
[2157] AB34 6B,3F           BS   VCHAR2            Yes, return
[2158] AB36 8E,7E           CZ   @YPT              If not at start of colunm
[2159] AB38 4B,2D           BR   VCHAR1
[2160] AB3A 90,7F           INC  @XPT              Move X-ptr to right one colun
[2161] AB3C 05,AB,2D        B    VCHAR1
[2162]               * RXB PATCH CODE
[2163] AB3F D6,42,B3 VCHAR2 CEQ  COMMAZ,@CHAT
[2164] AB42 6B,26           BS   VCHAR
[2165] AB44 4B,17           BR   XPTRTN
[2166]               ***********************************************************
[2167]               *               SUBPROGRAM FOR 'CHAR'
[2168]               ***********************************************************
[2169] AB46 06,A9,F6 CHARLY CALL COMB
[2170] AB49 0F,79    CHAR5  XML  PGMCHR            Skip "(" or ","
[2171]               * RXB PATCH CODE
[2172] AB4B D6,42,EC        CEQ  ALLZ,@CHAT
[2173] AB4E 4B,5E           BR   GAB1F
[2174] AB50 0F,79           XML  PGMCHR
[2175] AB52 06,B1,AD        CALL COMMA2
[2176] AB55 BE,00,EC        ST   ALLZ,@VAR0
[2177] AB58 BF,4A,00        DST  32,@FAC
       AB5B 20
[2178] AB5C 4B,67           BR   GAB28
[2179] AB5E 0F,7E    GAB1F  XML  SPEED             Get the first value
[2180] AB60 01              BYTE PARCOM         *    and insure a comma
[2181] AB61 0F,7E           XML  SPEED             Insure in range
[2182] AB63 02              BYTE RANGE          *   of 32 - 143
[2183]               * RXB PATCH CODE
[2184] AB64 1E              BYTE 30
[2185] AB65 00,9F           DATA 159
[2186] AB67 E3,4A,00 GAB28  DSLL 3,@FAC            Convert chr number to address
       AB6A 03
[2187] AB6B A3,4A,03        DADD >0300,@FAC        CORRECT FOR OFFSET
       AB6E 00
[2188] AB6F BD,04,4A        DST  @FAC,@VARY        Save it
[2189] AB72 0F,74           XML  PARSE             Get string
[2190] AB74 B6              BYTE RPARZ
[2191] AB75 D6,4C,65        CEQ  >65,@FAC2         MUST BE STRING
[2192] AB78 4D,BE           BR   ERRSNM
[2193] AB7A 35,00,04        MOVE 4,@FAC4,@VAR5     VAR5 pointer to string value
       AB7D 10,4E
[2194]               * Start defining character description.
[2195]               *    VARY    Address of RAM for character description.
[2196]               *    VAR5    Pointer to string value.
[2197]               *    VAR7    Length of string value.
[2198]               *    VAR9    Temporary counter.
[2199]               *    VAR9+1  Temporary counter.
[2200] AB7F C7,12,00        DCH  64,@VAR7          Max 4 characters at a time

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0038 
EQUATES EXEC-359
       AB82 40
[2201] AB83 4B,89           BR   CHAR40
[2202] AB85 BF,12,00        DST  64,@VAR7          IGNORE THE EXCESSES
       AB88 40
[2203] AB89 CB,04,07 CHAR40 DCHE SPRVB,@VARY       Don't have space for
       AB8C FF
[2204] AB8D 6C,1F           BS   CHARL4
[2205] AB8F BE,4A,30        ST   ZERO,@FAC         Floating Point Accumulator (>
[2206] AB92 35,00,0F        MOVE 15,@FAC,@FAC1
       AB95 4B,4A
[2207] AB97 8F,12           DCZ  @VAR7             Fill with zero
[2208] AB99 6B,B8           BS   CHAR50
[2209] AB9B CB,12,00        DCHE 16,@VAR7
       AB9E 10
[2210] AB9F 6B,AA           BS   GAB6B
[2211] ABA1 34,12,4A        MOVE @VAR7,V*VAR5,@FAC Move whatever
       ABA4 B0,10
[2212] ABA6 87,12           DCLR @VAR7
[2213] ABA8 4B,B8           BR   CHAR50
[2214] ABAA 35,00,10 GAB6B  MOVE 16,V*VAR5,@FAC    Move one character
       ABAD 4A,B0,10
[2215] ABB0 A7,12,00        DSUB 16,@VAR7          Less num of bytes to move
       ABB3 10
[2216] ABB4 A3,10,00        DADD 16,@VAR5          Move pointer
       ABB7 10
[2217] ABB8 BE,14,4A CHAR50 ST   >4A,@VAR9         Move pointer (>4A=FAC)
[2218] ABBB BE,15,01        ST   1,@VAR9+1
[2219] ABBE 05,AB,C3        B    GAB84
[2220] ABC1 90,15    GAB82  INC  @VAR9+1
[2221] ABC3 CE,15,08 GAB84  CGT  8,@VAR9+1
[2222] ABC6 6C,02           BS   GABC3
[2223] ABC8 86,0C           CLR  @BYTES            Clear dot-building byte
[2224] ABCA E2,0C,04 CHARL2 SLL  4,@BYTES          For loop(2 chars per byte)
[2225] ABCD BC,5C,90        ST   *VAR9,@ARG
       ABD0 14
[2226] ABD1 CA,5C,30        CHE  ZERO,@ARG         If < 0
[2227] ABD4 4D,EE           BR   ERRBV
[2228] ABD6 CE,5C,39        CGT  NINE,@ARG         If in 0-9
[2229] ABD9 4B,E5           BR   CHARL3
[2230] ABDB CA,5C,41        CHE  A,@ARG            If > 9 but < A
[2231] ABDE 4D,EE           BR   ERRBV
[2232] ABE0 C6,5C,46        CH   F,@ARG            If > F
[2233] ABE3 6D,EE           BS   ERRBV
[2234] ABE5 A6,5C,30 CHARL3 SUB  ZERO,@ARG         Character - >30
[2235] ABE8 C6,5C,0A        CH   10,@ARG           If in A-F
[2236] ABEB 4B,F0           BR   GABB1
[2237] ABED A6,5C,07        SUB  7,@ARG            Correct for that too
[2238] ABF0 B4,0C,5C GABB1  OR   @ARG,@BYTES       Dot expression
[2239] ABF3 90,14           INC  @VAR9
[2240] ABF5 DA,14,01        CLOG 1,@VAR9           1st half of row finished?
[2241] ABF8 4B,CA           BR   CHARL2            Yes, do 2nd half
[2242]               *                              (each takes half byte)
[2243] ABFA BC,B0,04        ST   @BYTES,V*VARY     Load characters
       ABFD 0C
[2244] ABFE 91,04           DINC @VARY
[2245] AC00 4B,C1           BR   GAB82             Load characters on next row
[2246] AC02 8F,12    GABC3  DCZ  @VAR7             More char to describe
[2247] AC04 4B,89           BR   CHAR40
[2248]               * RXB PATCH CODE
[2249] AC06 D6,00,EC        CEQ  ALLZ,@VAR0
[2250] AC09 4C,1F           BR   CHARL4
[2251] AC0B 87,00           DCLR @VAR0
[2252] AC0D 35,00,08 CHRFIL MOVE 8,V@>0400,V@>0408(@VAR0)
       AC10 E4,08,00

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0039 
EQUATES EXEC-359
       AC13 A4,00
[2253] AC15 A3,00,00        DADD 8,@VAR0
       AC18 08
[2254] AC19 D7,00,02        DCEQ 94*8,@VAR0
       AC1C F0
[2255] AC1D 4C,0D           BR   CHRFIL
[2256] AC1F D6,42,B3 CHARL4 CEQ  COMMAZ,@CHAT      More specified?
[2257] AC22 6B,49           BS   CHAR5
[2258] AC24 4B,1A           BR   LNKRTN            Return
[2259]               ***********************************************************
[2260]               *              SUBPROGRAM FOR 'KEY'
[2261]               ***********************************************************
[2262] AC26 06,BE,A6 KEY    CALL SPAR              GET KEY UNIT
[2263]               * RXB PATCH LABEL ************
[2264] AC29 0F,7E    GABD1  XML  SPEED             Insure in range
[2265] AC2B 02              BYTE RANGE          *   of 0 - 5
[2266] AC2C 00              BYTE 0
[2267] AC2D 00,05           DATA 5
[2268] AC2F 06,BD,07        CALL KEYJOY            Get variables for code and st
[2269]               *                              and scan keyboard
[2270]               *                             KEYJOY returns key status
[2271] AC32 6C,3D           BS   KEY1B             KEY STATUS = 1
[2272] AC34 83,4A           DNEG @FAC              Assume status = -1
[2273] AC36 D6,75,FF        CEQ  >FF,@RKEY         But correct if = 0
[2274] AC39 4C,3D           BR   KEY1B
[2275] AC3B 87,4A           DCLR @FAC              KEY STATUS = 0
[2276] AC3D 0F,7C    KEY1B  XML  ASSGNV            Assign value in variable
[2277] AC3F BF,4A,40        DST  >4001,@FAC        Re-store F.P. 1 in FAC
       AC42 01
[2278] AC43 8E,75           CZ   @RKEY             If key-code = 0
[2279] AC45 6C,65           BS   KEY2
[2280] AC47 D6,75,FF        CEQ  >FF,@RKEY         No key depressed,
[2281] AC4A 6C,61           BS   KEY1C              key code assigned to -1
[2282]               * FORMAT FOR KEYCODES ABOVE 99 ADDED FOR 99/4A HIGHEST
[2283]               * KEYCODE (OTHER THAN >FF) IS >C6=198
[2284]               * 5/7/81
[2285] AC4C CA,75,64        CHE  100,@RKEY
[2286] AC4F 4C,5C           BR   GAC04
[2287] AC51 90,4A           INC  @FAC
[2288] AC53 A6,75,64        SUB  100,@RKEY
[2289] AC56 BC,4C,75        ST   @RKEY,@FAC2       FLOATING FORMAT (>4001__00000
[2290] AC59 05,AC,5F        B    GAC07
[2291] AC5C BC,4B,75 GAC04  ST   @RKEY,@FAC1       FLOATING FORMAT (>40__0000000
[2292] AC5F 4C,67    GAC07  BR   KEY2A
[2293] AC61 83,4A    KEY1C  DNEG @FAC              KEY CODE ASSIGNED TO -1
[2294] AC63 4C,67           BR   KEY2A
[2295] AC65 87,4A    KEY2   DCLR @FAC              (>000000000000000)
[2296] AC67 0F,7C    KEY2A  XML  ASSGNV            ASSIGN VALUE TO VARIABLE
[2297]               * RXB PATCH CODE *************
[2298]               *      BR   LNKRTN
[2299] AC69 5E,25           BR   SUBRTN
[2300]               ***********************************************************
[2301]               * RXB PATCH WAS    SUBPROGRAM FOR 'JOYSTICK'
[2302]               ***********************************************************
[2303] AC6B 06,BE,A6        CALL SPAR              KEY UNIT
[2304] AC6E 0F,7E           XML  SPEED             Insure in range
[2305] AC70 02              BYTE RANGE          *   of 1 - 4
[2306] AC71 01              BYTE 1
[2307] AC72 00,04           DATA 4
[2308] AC74 06,BD,07        CALL KEYJOY            GET VARIABLES FOR X, Y
[2309]               *                              AND SCAN KEYBOARD
[2310] AC77 BC,00,76        ST   @JOYY,@VAR0       JOYSTICK Y POSITION
[2311] AC7A 06,A9,AA        CALL JOYXY             -4 to +4
[2312] AC7D BF,4A,40        DST  >4001,@FAC        Re-store F.P. 1 in FAC

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0040 
EQUATES EXEC-359
       AC80 01
[2313] AC81 BC,00,77        ST   @JOYX,@VAR0       JOYSTICK X POSITION
[2314] AC84 06,A9,AA        CALL JOYXY             -4 to +4
[2315] AC87 4B,1A           BR   LNKRTN
[2316]               ***********************************************************
[2317]               * INSURE LEFT PARENTHESIS AND THEN PARSE TO A COMMA
[2318]               ***********************************************************
[2319]               * RXB PATCH CODE
[2320] AC89 D6,42,B3 LPAR   CEQ  COMMAZ,@CHAT
[2321] AC8C 6C,94           BS   CPAR
[2322] AC8E 0F,7E           XML  SPEED             Must be
[2323] AC90 00              BYTE SYNCHK          *  at a
[2324] AC91 B7              BYTE LPARZ           *    left parenthesis
[2325] AC92 4C,98           BR   GAC35
[2326] AC94 0F,7E    CPAR   XML  SPEED
[2327] AC96 00              BYTE SYNCHK
[2328] AC97 B3              BYTE COMMAZ
[2329]               * RXB PATCH LABEL ***********
[2330] AC98 0F,74    GAC35  XML  PARSE             Do the parse
[2331] AC9A B3              BYTE COMMAZ          * Stop on a comma
[2332] AC9B 0F,7E           XML  SPEED             Must be
[2333] AC9D 00              BYTE SYNCHK          *  at a
[2334] AC9E B3              BYTE COMMAZ          *   comma
[2335] AC9F 00              RTN
[2336]               ***********************************************************
[2337]               * SUBROUTINE FOR 'RANGE' USED IN ALL SOUND AND GRAPHICS
[2338]               ***********************************************************
[2339] ACA0 0F,7E    RAN16  XML  SPEED             Insure in range
[2340] ACA2 02              BYTE RANGE          *   of 1 to 16
[2341] ACA3 01              BYTE 1
[2342] ACA4 00,10           DATA 16
[2343] ACA6 92,4B           DEC  @FAC1             Adjust to internal range
[2344] ACA8 00              RTN
[2345]               ***********************************************************
[2346]               * SUBROUTINE TO GET ROW, COLUMN VALUES
[2347]               ***********************************************************
[2348]               * RXB PATCH CODE
[2349] ACA9 06,AC,89 GPHV   CALL LPAR              Insure '(', parse, insure ','
[2350]               * RXB PATCH CODE
[2351] ACAC 0F,7E    GPHVRC XML  SPEED             Insure in range
[2352] ACAE 02              BYTE RANGE           *  of 1 - 24
[2353] ACAF 01              BYTE 1
[2354] ACB0 00,18           DATA 24
[2355] ACB2 92,4B           DEC  @FAC1             Adjust to internal range
[2356] ACB4 BC,02,7F        ST   @XPT,@MNUM
[2357] ACB7 BC,7E,4B        ST   @FAC1,@YPT        Set row pointer
[2358] ACBA 0F,7E           XML  SPEED             Get column value
[2359] ACBC 01              BYTE PARCOM          *  and insure a comma
[2360] ACBD 0F,7E           XML  SPEED             Insure in range
[2361] ACBF 02              BYTE RANGE           *  of 1 to 32
[2362] ACC0 01              BYTE 1
[2363] ACC1 00,20           DATA 32
[2364] ACC3 92,4B           DEC  @FAC1             Internal range: 0 - 31
[2365] ACC5 BC,7F,4B        ST   @FAC1,@XPT        Set column pointer
[2366] ACC8 00              RTN
[2367]               *  Subroutine to control border color
[2368]               * Character background is also affected since transparent
[2369]               *  is used.
[2370] ACC9 06,A5,65 BORDER CALL PARFF             Insure '(' , and parse
[2371] ACCC 06,AC,A0        CALL RAN16             Check 1 - 16 & put in interna
[2372] ACCF 3D,00,01        MOVE 1,@FAC1,#7        Load VDP register
       ACD2 07,4B
[2373] ACD4 4B,1E           BR   LNKRT2            Return to XB program
[2374]               * Get ROW, COLUMN VALUES AND NUMBER OF CHARACTERS

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0041 
EQUATES EXEC-359
[2375] ACD6 06,AC,A9 HVCHR  CALL GPHV              Get X, Y VALUES
[2376] ACD9 0F,74           XML  PARSE
[2377] ACDB B6              BYTE RPARZ
[2378] ACDC 06,A9,95        CALL INTARG
[2379] ACDF A2,4B,60        ADD  OFFSET,@FAC1
[2380] ACE2 BC,00,4B        ST   @FAC1,@VAR0       SAVE THE CHARACTER
[2381] ACE5 BF,4A,00        DST  1,@FAC            ASSUME 1 CHARACTER
       ACE8 01
[2382] ACE9 D6,42,B6        CEQ  RPARZ,@CHAT       If not right parenthesis
[2383] ACEC 6C,F8           BS   GAC95
[2384] ACEE 0F,7E           XML  SPEED             Must be
[2385] ACF0 00              BYTE SYNCHK          *   at a
[2386] ACF1 B3              BYTE COMMAZ          *    comma
[2387] ACF2 0F,74           XML  PARSE             # OF CHARACTERS
[2388] ACF4 B6              BYTE RPARZ
[2389] ACF5 06,A9,95        CALL INTARG            FLOATING TO INTEGER
[2390] ACF8 00       GAC95  RTN
[2391]               ***********************************************************
[2392]               * ERRWXY - Is the subroutine for CALL ERR(W,X,Y,Z)
[2393]               *  The parameters indicate:
[2394]               *   W - The error code # of the error
[2395]               *   X - Indicates whether execution(-1) error or
[2396]               *       I/O (0-255) error on LUNO 0-255
[2397]               *   Y - Indicates the severity code of the error
[2398]               *   Z - Line number of the error
[2399]               *   ERR Can be called with 2 forms:
[2400]               *       CALL ERR(W,X,Y,Z) and CALL ERR(W,X)
[2401]               *   If ERR is called and no error has occured then all
[2402]               *   values returned are zero.
[2403]               ***********************************************************
[2404] ACF9 BD,52,6E ERRWXY DST  @VSPTR,@FAC8      Get a temp VSPTR
[2405] ACFC C5,52,24 GAC99  DCH  @STVSPT,@FAC8     While not a bottom of stack
[2406] ACFF 4D,33           BR   GACD0
[2407] AD01 BC,5C,E0        ST   V@2(@FAC8),@ARG   Keep ID code in ARG area
       AD04 02,52
[2408] AD06 D6,5C,69        CEQ  >69,@ARG          *** ERROR entry
[2409] AD09 4D,12           BR   GACAF
[2410] AD0B 06,A9,FC        CALL SQUISH            Squish it out of the stack
[2411] AD0E 0F,77           XML  VPUSH             Put permanent copy of error
[2412]               *                              entry on stack
[2413] AD10 4D,3F           BR   ERR10             Jump out now
[2414]               * Jump always
[2415] AD12 D6,5C,67 GACAF  CEQ  >67,@ARG          *** FOR entry
[2416] AD15 4D,1D           BR   GACBA
[2417] AD17 A7,52,00        DSUB 32,@FAC8          Skip it
       AD1A 20
[2418] AD1B 4D,31           BR   GACCE
[2419] AD1D D6,5C,66 GACBA  CEQ  >66,@ARG          *** GOSUB entry
[2420] AD20 4D,28           BR   GACC5
[2421] AD22 A7,52,00        DSUB 8,@FAC8           Skip it
       AD25 08
[2422] AD26 4D,31           BR   GACCE
[2423] AD28 D6,5C,6A GACC5  CEQ  >6A,@ARG          * SYNTAX ERROR
[2424] AD2B 4D,BA           BR   ERRSYN
[2425] AD2D A7,52,00        DSUB 16,@FAC8          Skip it
       AD30 10
[2426] AD31 4C,FC    GACCE  BR   GAC99
[2427] AD33 BF,4A,00 GACD0  DST  >0080,@FAC        No error entry there so
       AD36 80
[2428] AD37 BF,4C,69        DST  >6900,@FAC2        fake one
       AD3A 00
[2429] AD3B 87,4E           DCLR @FAC4
[2430] AD3D 87,50           DCLR @FAC6
[2431] AD3F 0F,77    ERR10  XML  VPUSH             Push the temporary entry on

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0042 
EQUATES EXEC-359
[2432]               *                              top of stack
[2433]               * Code to get "W" in
[2434] AD41 06,A9,F6        CALL COMB              Check for left parenthesis
[2435] AD44 06,AD,AF        CALL ERRC05            Pick up user's symbol
[2436] AD47 BC,4B,EF        ST   V@-8(@VSPTR),@FAC1 Get error code
       AD4A FF,F8,6E
[2437] AD4D 0F,80           XML  CIF               Convert it to floating
[2438] AD4F 0F,7C           XML  ASSGNV            Assign it
[2439]               * Code to get "X" in
[2440] AD51 06,AD,AA        CALL ERRCOM            Check syntax & get user's sym
[2441] AD54 DA,EF,FF        CLOG >80,V@-7(@VSPTR)  If execution
       AD57 F9,6E,80
[2442] AD5A 4D,66           BR   GAD03
[2443] AD5C 31,00,08        MOVE 8,G@FLT1,@FAC     Make it such
       AD5F 4A,A3,F3
[2444] AD62 83,4A           DNEG @FAC              Make it a negative
[2445] AD64 4D,6E           BR   GAD0B
[2446] AD66 BC,4B,EF GAD03  ST   V@-5(@VSPTR),@FAC1 Get I/O LUNO number
       AD69 FF,FB,6E
[2447] AD6C 0F,80           XML  CIF               Convert it to floating
[2448] AD6E 0F,7C    GAD0B  XML  ASSGNV
[2449]               * Code to get "Y" in
[2450] AD70 D6,42,B6        CEQ  RPARZ,@CHAT       If long form of CALL ERR
[2451] AD73 6D,A5           BS   GAD42
[2452] AD75 06,AD,AA        CALL ERRCOM            Check syntax & get user's sym
[2453] AD78 BC,4B,EF        ST   V@-7(@VSPTR),@FAC1 Get severity code
       AD7B FF,F9,6E
[2454] AD7E B2,4B,7F        AND  >7F,@FAC1         Reset execution  /  I/O flag
[2455] AD81 0F,80           XML  CIF               Convert it
[2456] AD83 0F,7C           XML  ASSGNV            Assign it
[2457]               * Code to get "Z" in
[2458] AD85 06,AD,AA        CALL ERRCOM            Check syntax & get symbol
[2459] AD88 BD,4C,EF        DST  V@-2(@VSPTR),@FAC2 Get line pointer
       AD8B FF,FE,6E
[2460] AD8E BD,4A,4C        DST  @FAC2,@FAC
[2461] AD91 8F,4C           DCZ  @FAC2             If line number exists
[2462] AD93 6D,A1           BS   GAD3E
[2463] AD95 97,4C           DDECT @FAC2            Point to the line #
[2464] AD97 06,60,34        CALL GRSUB1            Read line # (2 bytes) from VD
[2465]               *                              or ERAM (use GREAD)
[2466] AD9A 4C              BYTE >4C             * @FAC2: Source addr on ERAM/VD
[2467] AD9B BD,4A,50        DST  @EEE,@FAC         Put the line # in FAC
[2468] AD9E B2,4A,7F        AND  >7F,@FAC          Reset the breakpoint if any
[2469] ADA1 0F,80    GAD3E  XML  CIF               Convert it
[2470] ADA3 0F,7C           XML  ASSGNV            Assign it
[2471] ADA5 0F,78    GAD42  XML  VPOP              Trash the temporary entry
[2472] ADA7 05,AB,1A        B    LNKRTN            Return from subprogram
[2473]               * Must be long branch because of AND above
[2474] ADAA D6,42,B3 ERRCOM CEQ  COMMAZ,@CHAT      Check for comma
[2475] ADAD 4D,BA           BR   ERRSYN
[2476] ADAF 0F,79    ERRC05 XML  PGMCHR            Get the next character
[2477] ADB1 0F,7A           XML  SYM               Collect name & s.t. entry
[2478] ADB3 0F,7B           XML  SMB               Get value space
[2479] ADB5 0F,77           XML  VPUSH             Push it
[2480] ADB7 86,4A           CLR  @FAC              Set up for conversion
[2481] ADB9 00              RTN
[2482]               * CHANGE IN ADDRESS OF THE ERROR CALLS WILL AFFECT
[2483]               * THE FILE SUBS.....
[2484]               *     ERROR messages called from this file
[2485] ADBA 06,6A,84 ERRSYN CALL ERRZZ             * SYNTAX ERROR
[2486] ADBD 03              BYTE 3             *   (shared by SUBS)
[2487] ADBE 06,6A,84 ERRSNM CALL ERRZZ             * STRING-NUMBER MISMATCH
[2488] ADC1 07              BYTE 7             *   (shared by SUBS)
[2489] ADC2 06,6A,84 ERRMUV CALL ERRZZ             * IMPROPERLY USED NAME

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0043 
EQUATES EXEC-359
[2490] ADC5 09              BYTE 9
[2491] ADC6 06,6A,84 ERRMEM CALL ERRZZ             * MEMORY FULL
[2492] ADC9 0B              BYTE 11
[2493] ADCA 06,6A,84 ERRSO  CALL ERRZZ             * STACK OVERFLOW
[2494] ADCD 0C              BYTE 12
[2495] ADCE 06,6A,84 ERRNWF CALL ERRZZ             * NEXT WITHOUT FOR
[2496] ADD1 0D              BYTE 13
[2497] ADD2 06,6A,84 ERRFNN CALL ERRZZ             * FOR/NEXT NESTING
[2498] ADD5 0E              BYTE 14
[2499] ADD6 06,6A,84 ERRSNS CALL ERRZZ             * MUST BE IN SUBPROGRAM
[2500] ADD9 0F              BYTE 15
[2501] ADDA 06,6A,84 ERRRSC CALL ERRZZ             * RECURSIVE SUBPROGRAM CALL
[2502] ADDD 10              BYTE 16
[2503] ADDE 06,6A,84 ERRRWG CALL ERRZZ             * RETURN WITHOUT GOSUB
[2504] ADE1 12              BYTE 18
[2505] ADE2 06,6A,84 ERRBS  CALL ERRZZ             * BAD SUBSCRIPT
[2506] ADE5 14              BYTE 20
[2507] ADE6 06,6A,84 ERRLNF CALL ERRZZ             * LINE NOT FOUND
[2508] ADE9 16              BYTE 22
[2509] ADEA 06,6A,84 ERRBA  CALL ERRZZ             * BAD ARGUMENTS
[2510] ADED 1C              BYTE 28
[2511] ADEE 06,6A,84 ERRBV  CALL ERRZZ             * BAD VALUE
[2512] ADF1 1E              BYTE 30            *   (shared by SUBS)
[2513] ADF2 06,6A,84 ERRIAL CALL ERRZZ             * INCORRECT ARGUMENT LIST
[2514] ADF5 1F              BYTE 31            *   (shared by SUBS)
[2515] ADF6 06,6A,84 ERRSNF CALL ERRZZ             * SUBPROGRAM NOT FOUND
[2516] ADF9 25              BYTE 37
[2517]               * Other error messages appear in this program
[2518]               * ERRRDY      * READY                        DATA 0
[2519]               * ERRBRK      * BREAK POINT                  DATA 1
[2520]               * ERROLP      * ONLY LEGAL IN A PROGRAM      DATA 27
[2521]               *
[2522]               * WRNN01      * NUMERIC OVERFLOW             DATA 2
[2523]               * WRNS02
[2524]               * WRNST1      * STRING TRUNCATED             DATA 19
[2525]               * WRNST2
[2526]               * WRNLNF      * LINE NOT FOUND               DATA 38
[2527]               *
[2528]               ***********************************************************

RXB is always marked with a * RXB PATCH CODE (notes) *   

All the rest is original TI 990 GPL Source Code that runs on the Ryte Data GPL Assembler.



#44 ralphb OFFLINE  

ralphb

    Moonsweeper

  • Topic Starter
  • 414 posts
  • Location:Germany

Posted Thu Sep 24, 2015 11:27 AM

I've released a new version of the TI 99 Cross-Development Tools (xdt99), i.e., cross-assembler xas99, GPL assembler xga99, BASIC tool xbas99, disk manager xdm99, and CF-volume manager xvm99.

The suite now also includes the assembly and BASIC editor plugins for Emacs and IntelliJ IDEA previously discussed in this thread.  Of course the plugins work with other assemblers as well.

Most updates in this release apply to the xas99 cross-assembler. The assembler now supports list file generation similar to option L of the original Editor/Assembler.

Local labels declutter programs by providing easy jump targets:

.

clear_screen:
    li r0, 769
    li r1, >2000
!   dec r0
    blwp @vsbw
    jne -!          ; jumps to previous ! label
    rt

.

Local labels can also be named, e.g., !loop, and need not be unique.  (Thanks to Dexter for some suggestions!)

Macros allow you to define your own shorthand mnemonics for sequences of instructions:

.

    .defm hchari
    li r0, #1 * 32 + #2
    li r1, #3 << 8
    blwp @vsbw
    .endm
    .hchari 12, 16, '*'

.

The assembler can generate jumpstart disks that simplify and speed up the testing of the generated code in an emulator. For MESS, you'd type

.

> xas99.py --jumpstart myprog.a99
> mess64 ti99_4ae -cart jumpstart.rpk -flop1 myprog.dsk -peb ...

.

In the emulator, selecting the Jumpstart cartridge will automatically load and start the assembly program without any further interaction. This is very similar to using an XB-based loader, but more flexible and slightly faster in MESS (in Classic99 there is no real load time either way). You can also generate a classical XB-based loader.

Finally, a new Windows tutorial helps Windows users to setup xdt99 and guides you through working with assembly and BASIC programs using the command line.

You can download the latest release on GitHub.



#45 Asmusr OFFLINE  

Asmusr

    River Patroller

  • 2,303 posts
  • Location:Denmark

Posted Thu Sep 24, 2015 1:25 PM

Thanks for a great update. I just thought of a few things that could improve xas99 even further:

 

- A log2 function for keeping track of what your shift instructions do. E.g. if MAPWIDTH EQU 32 then SLA R1,LOG2(MAPWIDTH) would shift R1 left by log2(32)=5, i.e. multiply by 32.

- Support for the F18A GPU op-codes: CALL, RET, PUSH, POP, SLC, etc. 

- The ability to assemble code at one address destined for execution at another address. E.g. if to assemble F18A GPU code that will be copied from CPU RAM to VDP RAM and executed, or for assembling code in cartridge space that will be copied to and executed in CPU RAM. I'm thinking of a new ORG directive, e.g. XORG >1000 would assemble code for execution at address >1000.

 

Thanks,

Rasmus



#46 Willsy OFFLINE  

Willsy

    River Patroller

  • 2,965 posts
  • Location:Uzbekistan (no, really!)

Posted Fri Sep 25, 2015 3:06 AM

:thumbsup: Gonna use xas99 for my next project. I have a slightly different use case: Building multi-banked cartridges, but I already have some tools to convert a single object file (which has multiple AORG >6000 directives in it, one for each bank) into an appropriately padded totally raw binary file which is suitable for classic99/MESS rom cart images, or burning into an EPROM.

 

A nice feature would be a ROM_BANK <n> directive:

 

ROM_BANK 0

 

Internally, sets AORG to >6000

 

During the final file emit, ROM-BANK directives would pad the current memory image from the current PC address to 7FFF with zeros so that each rom bank is aligned on an 8K boundary. That's basically what my utilities do (that Tursi wrote for me years ago), but it does it by scanning the tags in the object file for an AORG.

 

Like I say, I have this issue covered, so it's not a big problem. But anything to shorten the toolchain is a good thing!



#47 Asmusr OFFLINE  

Asmusr

    River Patroller

  • 2,303 posts
  • Location:Denmark

Posted Fri Sep 25, 2015 1:06 PM

I think I may have found an issue with xas99: Look for the first occurrence of "PATTS" in the attached list files.  

WinAsm:
-------
237  A170 0224            AI   R4,PATTS                        * Add patterns base address
237  A172 A818  

...

1068            PATTS
1069  A817 0000        EVEN     *>>> Assembler Auto-Generated <<<
1070  A818 0000 BOXPAT DATA >0000,>0000,>0001,>8000

Xas99:
------ 
0237 A170 0224  22   AI R4,PATTS * Add patterns base address      
     A172 A817 

...

1067               *   Block patterns
1068               PATTS
1069 A818 0000     BOXPAT DATA >0000,>0000,>0001,>8000
Now PATTS is not aligned on a word boundary in the code, so both assemblers have correctly moved it to an even address, but Xas99 seems to have maintained the odd address in the reference. This also seems to be reflected in the object file that fails to load correctly.

Attached Files



#48 ralphb OFFLINE  

ralphb

    Moonsweeper

  • Topic Starter
  • 414 posts
  • Location:Germany

Posted Fri Sep 25, 2015 1:25 PM

I think I may have found an issue with xas99: Look for the first occurrence of "PATTS" in the attached list files.  ...

 

Now PATTS is not aligned on a word boundary in the code, so both assemblers have correctly moved it to an even address, but Xas99 seems to have maintained the odd address in the reference. This also seems to be reflected in the object file that fails to load correctly.

 

Hmm, unfortunately I cannot look into this right away, but I've written many tests for xas99 against the E/A assembler.

 

Try the attached assembly source that contains plenty of BYTEs and EVENs -- xas99 assembles just like the E/A assembler, whose output is on the disk image.  What does Winasm yield in this case?

 

Attached File  asdirs.asm   2.59KB   6 downloads

Attached File  asmsrcs.dsk   360KB   6 downloads



#49 Asmusr OFFLINE  

Asmusr

    River Patroller

  • 2,303 posts
  • Location:Denmark

Posted Fri Sep 25, 2015 2:06 PM

 

Hmm, unfortunately I cannot look into this right away, but I've written many tests for xas99 against the E/A assembler.

 

Try the attached assembly source that contains plenty of BYTEs and EVENs -- xas99 assembles just like the E/A assembler, whose output is on the disk image.  What does Winasm yield in this case?

 

attachicon.gifasdirs.asm

attachicon.gifasmsrcs.dsk

 

Lots of errors :-)

Attached Files



#50 HackMac OFFLINE  

HackMac

    Chopper Commander

  • 144 posts
  • Skywalker
  • Location:Germany

Posted Sat Sep 26, 2015 2:16 AM

:thumbsup: Gonna use xas99 for my next project. I have a slightly different use case: Building multi-banked cartridges, but I already have some tools to convert a single object file (which has multiple AORG >6000 directives in it, one for each bank) into an appropriately padded totally raw binary file which is suitable for classic99/MESS rom cart images, or burning into an EPROM.

 

I know it's a bit off topic, cause this is a xdt99 thread, but I get shot of my thoughts...

 

We should think about develop tools for TI-99/4A (or Geneve too). These systems are the only common platform we have. Not those systems running this ugly Windoof, Linux or OS X (or the thousands variations of emulators) are our targets. The TI-99/4A is our Holy Grail.

I like all your (disk/development) tools, don't get me wrong. Those software is the precondition for progressing. But we don't have to forget the real machine. All the ideas of everybody have to be integrated into it!

 

I see Ralphb, Rasmus and Willsy recently has good ideas. So Willsy refer an use case that is good enough for an integration in the developmet environment on the TI! I think all ideas are useful features for the Editor/Assembler. Specially a ROM banking feature that also works for the DSR will be a great thing. Perhaps we can also extend the object loader to handle object code files which are assembled with the new banking directives.

 

But I see the problem... all of us lives on our own isle and there is no real collaboration.

So there came out the question, why do Ralphb his own E/A for a TI-System that doesn't run on a TI? Why can't he contribute his ideas to the REA project and work on that project, for example?

That makes me very unhappy.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users