mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-05 10:04:48 +00:00
127 lines
3.1 KiB
Plaintext
127 lines
3.1 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
*--------------------------------------
|
||
*--------------------------------
|
||
* PRINT SYMBOL TABLE IN ALPHABETICAL ORDER
|
||
*--------------------------------
|
||
SYMBOLS
|
||
STPRNT LDY #2 SKIP OVER .TF PSEUDO-SYMBOLS
|
||
.1 STY PNTR
|
||
LDA HSHTBL,Y
|
||
STA STPNTR
|
||
LDA HSHTBL+1,Y
|
||
BEQ .5
|
||
STA STPNTR+1
|
||
*---PRINT VALUE AND DASH---------
|
||
.2 LDY #2 POINT AT VALUE
|
||
.25 >SYM LDA,STPNTR
|
||
STA SYM.VALUE-2,Y SAVE FOR LOCAL OFFSETS
|
||
INY
|
||
CPY #6
|
||
BCC .25
|
||
LDY #3
|
||
.26 LDA SYM.VALUE,Y
|
||
BNE .27 ...NON-ZERO BYTE
|
||
JSR SPC
|
||
JSR SPC
|
||
DEY
|
||
BNE .26 ...UNTIL LAST BYTE
|
||
.27 LDA SYM.VALUE,Y
|
||
JSR MON.PHEX
|
||
DEY
|
||
BPL .27 ...INCLUDE LAST BYTE
|
||
JSR P.DASH
|
||
JSR SPC
|
||
*---PRINT NAME-------------------
|
||
LDY #6
|
||
>SYM LDA,STPNTR GET NAME LENGTH
|
||
PHA SAVE AGAIN FOR LOCAL LABELS FLAG
|
||
AND #$3F ISOLATE LENGTH
|
||
TAX
|
||
.3 INY
|
||
>SYM LDA,STPNTR
|
||
JSR CHO
|
||
DEX
|
||
BNE .3
|
||
*---CHECK FOR LOCAL LABELS-------
|
||
PLA GET LENGTH AND FLAGS
|
||
BMI .6 LOCAL LABELS
|
||
*---NEXT LABEL-------------------
|
||
.4 JSR CRLF.WITH.PAGING
|
||
LDY #1 POINT AT POINTER
|
||
>SYM LDA,STPNTR
|
||
PHA
|
||
DEY
|
||
>SYM LDA,STPNTR
|
||
STA STPNTR
|
||
PLA
|
||
STA STPNTR+1
|
||
BNE .2 NEXT SYMBOL IN THIS CHAIN, IF ANY
|
||
.5 LDY PNTR
|
||
INY
|
||
INY
|
||
CPY #54 # BYTES IN HASH POINTER TABLE
|
||
BNE .1
|
||
RTS
|
||
*---PRINT LOCAL LABELS-----------
|
||
.6 AND #$3F POINT AT FIRST LOCAL LABEL
|
||
CLC
|
||
ADC #7
|
||
TAY
|
||
LDA #1 FORCE CRLF BEFORE 1ST LABEL
|
||
STA EMIT.COLUMN
|
||
.7 >SYM LDA,STPNTR
|
||
BEQ .4 END OF LOCALS
|
||
AND #$7F ISOLATE NAME
|
||
PHA SAVE NAME OF SYMBOL
|
||
STY YSAVE SAVE POINTER
|
||
DEC EMIT.COLUMN
|
||
BNE .9 ...UNLESS NEED A NEW LINE
|
||
JSR CRLF.WITH.PAGING CLOBBERS Y-REG IF FORMFEED
|
||
LDY #8
|
||
.81 JSR SPC
|
||
DEY
|
||
BNE .81
|
||
LDY #7 ...SEVEN PER LINE
|
||
LDA SYM.VALUE+2
|
||
BEQ .82
|
||
LDY #5 ...FIVE PER LINE
|
||
.82 STY EMIT.COLUMN
|
||
.9 JSR SPC
|
||
JSR SPC
|
||
LDA #CHR.PERIOD
|
||
JSR CHO
|
||
PLA GET NAME
|
||
STA CURRENT.LINE.NUMBER
|
||
LDA #0
|
||
STA CURRENT.LINE.NUMBER+1
|
||
LDX #1 ONLY TWO DIGITS
|
||
LDA #$40 PRINT ONLY, DO NOT STORE IN WBUF
|
||
JSR CONVERT.LINE.NUMBER
|
||
LDA #'=' EQUAL SIGN
|
||
JSR CHO
|
||
LDY YSAVE GET VALUE OF SYMBOL
|
||
INY
|
||
>SYM LDA,STPNTR
|
||
CLC
|
||
ADC SYM.VALUE
|
||
PHA
|
||
LDA SYM.VALUE+1
|
||
ADC #0
|
||
PHA
|
||
LDA SYM.VALUE+2
|
||
ADC #0
|
||
BEQ .10 PRINT ONLY TWO BYTES
|
||
JSR MON.PHEX
|
||
.10 PLA
|
||
JSR MON.PHEX
|
||
PLA
|
||
JSR MON.PHEX
|
||
INY
|
||
BNE .7 ...ALWAYS
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE usr/src/scmasm.30/scmasm.s.psym
|
||
LOAD usr/src/scmasm.30/scmasm.s
|
||
ASM
|