A2osX/SCMASM.31/SCMASM.S.NEWQ.txt

130 lines
2.9 KiB
Plaintext
Raw Normal View History

NEW
AUTO 3,1
*--------------------------------------
* Y = MESSAGE NUMBER
*--------------------------------
QT.OUT
TXA
PHA
LDX #0
CLC
*---Search for message #---------
.2 JSR GET.NEXT.NYBBLE
BNE .4
.3 JSR GET.NEXT.NYBBLE
BEQ .3
BNE .2
.4 EOR #$0F
BNE .2
DEY
BNE .2
*---Print the message------------
.5 JSR GET.NEXT.NYBBLE
TAY
LDA FIRST.TABLE,Y
BNE .6 ...FREQUENT CHAR
JSR GET.NEXT.NYBBLE
TAY
LDA SECOND.TABLE,Y
BNE .6 ...TWO NYBBLE CHAR
JSR GET.NEXT.NYBBLE
TAY
LDA THIRD.TABLE,Y
.6 BPL .7 ...END OF MESSAGE
PHP
JSR MY.COUT
PLP
BMI .5 ...NEXT CHAR, ALWAYS
.7 PLA ...YES
TAX
RTS
*--------------------------------
GET.NEXT.NYBBLE
LDA MESSAGES,X
BCS .1 2ND NYBBLE
LSR 1ST NYBBLE
LSR
LSR
LSR
SEC
RTS
.1 INX
AND #$0F
CLC
RTS
*--------------------------------
FIRST.TABLE .HS 00
.AS -/ABCDEILMNORST /
.HS 7F
SECOND.TABLE .HS 00
.AS -/FGPUXY$.*:?52/
.HS 878D
THIRD.TABLE .AS -/.HJKQVWZ>1-...../
*--------------------------------
MESSAGES
.AC 0
.AC 1/ABCDEILMNORST %/
.AC 2/FGPUXY$.*:?52!#/
.AC 3/HJKQVWZ>1-...../
*--------------------------------
.MA QT
QN. .SE QN.+1
]1 .EQ QN.
.AC /]2/
.EM
QN. .SE 0
*--------------------------------
.AC "%" ELIMINATE QT# 0
>QT QSC,"S-C MACRO ASSEMBLER %"
>QT QST,"SYMBOL TABLE%"
>QT QSTARS,"#***!! %"
>QT QSRCPRG,"#SOURCE PROGRAM: $%"
>QT QSYMTBL,"# SYMBOL TABLE: $%"
>QT QERROR," ERROR#%"
>QT PAGEQT," PAGE %"
>QT QREPPRMT,"#REPLACE? %"
>QT QERRCNT," ERRORS IN ASSEMBLY#%"
>QT QBLOADB," LOAD %"
>QT QDELOR,"DELETE ORIGINAL? %"
>QT QMEMPRO,"MEM PROTECT%"
>QT QMEMFL,"MEM FULL%"
>QT QSYNX,"SYNTAX%"
>QT QER1,"NO LABEL%"
>QT QER2,"BAD OPCODE%"
>QT QER3,"RANGE%"
>QT QER4,"EXTRA DEFINITION%"
>QT QER5,"BAD ADDRESS%"
>QT QER6,"UNDEF LABEL%"
>QT QER7,"BAD SYMBOL%"
>QT QER8,"VALUE > 255%"
>QT QER9,"NO NORMAL LABEL%"
>QT QNIN,"NESTED .IN%"
>QT QERDO,"MISSING .DO%"
>QT QERDO2,".DO NEST TOO DEEP%"
>QT QSTRLNG,"KEY TOO LONG%"
>QT QNONAM,"NO MACRO NAME%"
>QT QREPLNG,"REPLACE TOO LONG%"
>QT QERR.MACRO,"UNDEF MACRO%"
.AC "%" FLUSH LAST BYTE
*--------------------------------
.DO 0
T
LDA #1
STA 0
.1 LDA 0
JSR $FDDA
LDY 0
JSR PRINT.QUOTATION
JSR $FD8E
INC 0
LDA 0
CMP #$20
BCC .1
RTS
.FIN
*--------------------------------------
MAN
SAVE usr/src/scmasm.31/scmasm.s.newq
LOAD usr/src/scmasm.31/scmasm.s
ASM