80-Bus News

  

May–June 1984, Volume 3, Issue 3











Page 28 of 51











Dis-assembly of NASCOM ROM BASIC Ver 4.7                PAGE    100

FF02 D5         LINTBF: PUSH    DE              ; Line length to BC
FF03 C1                 POP     BC
FF04 03                 INC     BC              ; Length +1
FF05 116110             LD      DE,BUFFER       ; Input buffer
FF08 E1                 POP     HL              ; Line start
FF09 C5                 PUSH    BC              ; Save length
FF0A EDB0               LDIR                    ; Move line to buffer
FF0C 3E00               LD      A,0
FF0E 12                 LD      (DE),A          ; Mark end of buffer with 00
FF0F C1                 POP     BC              ; Restore buffer length
FF10 41                 LD      B,C             ; Length returned in B
FF11 216010             LD      HL,BUFFER-1     ; Point to start of buffer-1
FF14 C9                 RET

FF15 CD90E6     GETXYA: CALL    CHKSYN          ; Make sure "(" follows
FF18 28                 DEFB    "("
FF19 CD41ED             CALL    GETNUM          ; Get a number
FF1C CD8BE9             CALL    DEINT           ; Get integer -32768 to 32767
FF1F D5                 PUSH    DE              ; Save "X"
FF20 CD90E6             CALL    CHKSYN          ; Make sure "," follows
FF23 2C                 DEFB    ","
FF24 CD41ED             CALL    GETNUM          ; Get a number
FF27 CD90E6             CALL    CHKSYN          ; Make sure ")" follows
FF2A 29                 DEFB    ")"
FF2B CD8BE9             CALL    DEINT           ; Get integer -32768 to 32767
FF2E E5                 PUSH    HL              ; Save code string address
FF2F FDE1               POP     IY              ; In IY
FF31 CD96FF             CALL    XYPOS           ; Address and bit mask
FF34 F5                 PUSH    AF              ; Save mask
FF35 CDC2FF             CALL    ADJCOL          ; Adjust column
FF38 CD11FE             CALL    SCRADR          ; Get VDU address
FF3B F1                 POP     AF              ; Restore bit mask
FF3C 06C0               LD      B,11000000B     ; Block graphics base
FF3E B0                 OR      B               ; Set bits 7 & 6
FF3F C9                 RET

FF40 CD15FF     SETB:   CALL    GETXYA          ; Get co-ords and VDU address
FF43 F5                 PUSH    AF              ; Save bit mask
FF44 7E                 LD      A,(HL)          ; Get character from screen
FF45 FEC0               CP      11000000B       ; Is it a block graphic?
FF47 D250FF             JP      NC,SETOR        ; Yes - OR new bit
FF4A F1                 POP     AF              ; Restore bit mask
FF4B 77         PUTBIT: LD      (HL),A          ; Put character on screen
FF4C FDE5       RESCSA: PUSH    IY              ; Restore code string address
FF4E E1                 POP     HL              ; From IY
FF4F C9                 RET

FF50 C1         SETOR:  POP     BC              ; Restore bit mask
FF51 B0                 OR      B               ; Merge the bits
FF52 C34BFF             JP      PUTBIT          ; Save on screen
Dis-assembly of NASCOM ROM BASIC Ver 4.7                PAGE    101

FF55 CD15FF     RESETB: CALL    GETXYA          ; Get co-ords and VDU address
FF58 F5                 PUSH    AF              ; Save bit mask
FF59 7E                 LD      A,(HL)          ; Get byte from screen
FF5A FEC0               CP      11000000B       ; Is it a block graphic?
FF5C DA75FF             JP      C,NORES         ; No - Leave it
FF5F 063F               LD      B,00111111B     ; Six bits per block
FF61 A0                 AND     B               ; Clear bits 7 & 6
FF62 C1                 POP     BC              ; Get bit mask
FF63 A0                 AND     B               ; Test for common bit
FF64 CA4CFF             JP      Z,RESCSA        ; None - Leave it
FF67 7E                 LD      A,(HL)          ; Get byte from screen
FF68 E63F               AND     00111111B       ; Isolate bit
FF6A A8                 XOR     B               ; Clear that bit
FF6B FEC0               CP      11000000B       ; Is it a graphic blank?
FF6D C24BFF             JP      NZ,PUTBIT       ; No - Save character
FF70 3E20               LD      A," "           ; Put a space there
FF72 C34BFF             JP      PUTBIT          ; Save the space

FF75 C1         NORES:  POP     BC              ; Drop bit mask
FF76 C34CFF             JP      RESCSA          ; Restore code string address

FF79 CD15FF     POINTB: CALL    GETXYA          ; Get co-ords and VDU address
FF7C 46                 LD      B,(HL)          ; Get character from screen
FF7D CDEDFF             CALL    TSTBIT          ; Test if bit is set
FF80 C291FF             JP      NZ,POINT0       ; Different - Return zero
FF83 3E00               LD      A,0
FF85 0601               LD      B,1             ; Integer AB = 1
FF87 E1         POINTX: POP     HL              ; Drop return
FF88 FDE5               PUSH    IY              ; PUSH code string address
FF8A 111DEE             LD      DE,RETNUM       ; To return a number
FF8D D5                 PUSH    DE              ; Save for return
FF8E C3F2F0             JP      ABPASS          ; Return integer AB

FF91 0600       POINT0: LD      B,0             ; Set zero
FF93 C387FF             JP      POINTX          ; Return value

FF96 C1         XYPOS:  POP     BC              ; Get return address
FF97 E1                 POP     HL              ; Get column
FF98 E5                 PUSH    HL              ; And re-save
FF99 C5                 PUSH    BC              ; Put back return address
FF9A 7D                 LD      A,L             ; Get column
FF9B 0601               LD      B,00000001B     ; 2 bits per character
FF9D A0                 AND     B               ; Odd or even bit
FF9E F5                 PUSH    AF              ; Save it
FF9F D5                 PUSH    DE              ; Get row
FFA0 E1                 POP     HL              ; to HL
FFA1 110000             LD      DE,0            ; Zero line count
FFA4 010300             LD      BC,3            ; 3 blocks per line
FFA7 23                 INC     HL
FFA8 ED42       DIV3LP: SBC     HL,BC           ; Subtract 3
FFAA 13                 INC     DE              ; Count the subtractions
FFAB CAB1FF             JP      Z,DIV3EX        ; Exactly - Exit
FFAE F2A8FF             JP      P,DIV3LP        ; More to do

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 28 of 51