80-Bus News


November–December 1983, Volume 2, Issue 6

Page 36 of 67

Dis-assembly of NASCOM ROM BASIC Ver 4.7                PAGE    48

EE33 0600       FNOFST: LD      B,0             ; Get address of function
EE35 07                 RLCA                    ; Double function offset
EE36 4F                 LD      C,A             ; BC = Offset in function table
EE37 C5                 PUSH    BC              ; Save adjusted token value
EE38 CD36E8             CALL    GETCHR          ; Get next character
EE3B 79                 LD      A,C             ; Get adjusted token value
EE3C FE22               CP      2*(ZPOINT-ZSGN) ; Adjusted "POINT" token?
EE3E CA79FF             JP      Z,POINTB        ; Yes - Do "POINT" (not POINTB)
EE41 FE2D               CP      2*(ZLEFT-ZSGN)-1; Adj' LEFT$,RIGHT$ or MID$ ?
EE43 DA5FEE             JP      C,FNVAL         ; No - Do function
EE46 CD56ED             CALL    OPNPAR          ; Evaluate expression  (X,...
EE49 CD90E6             CALL    CHKSYN          ; Make sure "," follows
EE4C 2C                 DEFB    ","
EE4D CD45ED             CALL    TSTSTR          ; Make sure it's a string
EE50 EB                 EX      DE,HL           ; Save code string address
EE51 2AE410             LD      HL,(FPREG)      ; Get address of string
EE54 E3                 EX      (SP),HL         ; Save address of string
EE55 E5                 PUSH    HL              ; Save adjusted token value
EE56 EB                 EX      DE,HL           ; Restore code string address
EE57 CD84F4             CALL    GETINT          ; Get integer 0-255
EE5A EB                 EX      DE,HL           ; Save code string address
EE5B E3                 EX      (SP),HL         ; Save integer,HL = adj' token
EE5C C367EE             JP      GOFUNC          ; Jump to string function

EE5F CD09EE     FNVAL:  CALL    EVLPAR          ; Evaluate expression
EE62 E3                 EX      (SP),HL         ; HL = Adjusted token value
EE63 111DEE             LD      DE,RETNUM       ; Return number from function
EE66 D5                 PUSH    DE              ; Save on stack
EE67 010FE1     GOFUNC: LD      BC,FNCTAB       ; Function routine addresses
EE6A 09                 ADD     HL,BC           ; Point to right address
EE6B 4E                 LD      C,(HL)          ; Get LSB of address
EE6C 23                 INC     HL              ;
EE6D 66                 LD      H,(HL)          ; Get MSB of address
EE6E 69                 LD      L,C             ; Address to HL
EE6F E9                 JP      (HL)            ; Jump to function

EE70 15         SGNEXP: DEC     D               ; Dee to flag negative exponent
EE71 FEAD               CP      ZMINUS          ; "-" token ?
EE73 C8                 RET     Z               ; Yes - Return
EE74 FE2D               CP      "-"             ; "-" ASCII ?
EE76 C8                 RET     Z               ; Yes - Return
EE77 14                 INC     D               ; Inc to flag positive exponent
EE78 FE2B               CP      "+"             ; "+" ASCII ?
EE7A C8                 RET     Z               ; Yes - Return
EE7B FEAC               CP      ZPLUS           ; "+" token ?
EE7D C8                 RET     Z               ; Yes - Return
EE7E 2B                 DEC     HL              ; DEC 'cos GETCHR INCs
EE7F C9                 RET                     ; Return "NZ"
Dis-assembly of NASCOM ROM BASIC Ver 4.7                PAGE    49

EE80 F6         POR:    DEFB    (OR n)          ; Flag "OR"
EE81 AF         PAND:   XOR     A               ; Flag "AND"
EE82 F5                 PUSH    AF              ; Save "AND" / "OR" flag
EE83 CD44ED             CALL    TSTNUM          ; Make sure it's a number
EE86 CD8BE9             CALL    DEINT           ; Get integer -32768 to 32767
EE89 F1                 POP     AF              ; Restore "AND" / "OR" flag
EE8A EB                 EX      DE,HL           ; <- Get last
EE8B C1                 POP     BC              ; <-  value
EE8C E3                 EX      (SP),HL         ; <-  from
EE8D EB                 EX      DE,HL           ; <-  stack
EE8E CD54F8             CALL    FPBCDE          ; Move last value to FPREG
EE91 F5                 PUSH    AF              ; Save "AND" / "OR" flag
EE92 CD8BE9             CALL    DEINT           ; Get integer -32768 to 32767
EE95 F1                 POP     AF              ; Restore "AND" / "OR" flag
EE96 C1                 POP     BC              ; Get value
EE97 79                 LD      A,C             ; Get LSB
EE98 21F1F0             LD      HL,ACPASS       ; Address of save AC as current
EE9B C2A3EE             JP      NZ,POR1         ; Jump if OR
EE9E A3                 AND     E               ; "AND" LSBs
EE9F 4F                 LD      C,A             ; Save LSB
EEA0 78                 LD      A,B             ; Get MBS
EEA1 A2                 AND     D               ; "AND" MSBs
EEA2 E9                 JP      (HL)            ; Save AC as current (ACPASS)

EEA3 B3         POR1:   OR      E               ; "OR" LSBs
EEA4 4F                 LD      C,A             ; Save LSB
EEA5 78                 LD      A,B             ; Get MSB
EEA6 B2                 OR      D               ; "OR" MSBs
EEA7 E9                 JP      (HL)            ; Save AC as current (ACPASS)

EEA8 21BAEE     TSTRED: LD      HL,CMPLOG       ; Logical compare routine
EEAB 3AAD10             LD      A,(TYPE)        ; Get data type
EEAE 1F                 RRA                     ; Carry set = string
EEAF 7A                 LD      A,D             ; Get last precedence value
EEB0 17                 RLA                     ; Times 2 plus carry
EEB1 5F                 LD      E,A             ; To E
EEB2 1664               LD      D,64H           ; Relational precedence
EEB4 78                 LD      A,B             ; Get current precedence
EEB5 BA                 CP      D               ; Compare with last
EEB6 D0                 RET     NC              ; Eval if last was rel' or log'
EEB7 C3BAED             JP      STKTHS          ; Stack this one and get next

This is an OCR’d version of the scanned page and likely contains recognition errors.

NASCOM ROM BASIC source code is available in ASM and LST file format.

Page 36 of 67