Browse Source

reindented BASIC_C64, KERNAL_C64 and DOS_1540 to approximate the LST output of the assembler

sed -e "s/^[ 	]//" | # remove leading spaces and tabs
sed -E -e "s/^(ADC|AND|ASL|BCC|BCS|BEQ|BIT|BMI|BNE|BPL|BRK|BVC|BVS|CLC|CLD|CLI|CLV|CMP|CPX|CPY|DEC|DEX|DEY|EOR|INC|INX|INY|JMP|JSR|LDA|LDX|LDY|LSR|NOP|ORA|PHA|PHP|PLA|PLP|ROL|ROR|RTI|RTS|SBC|SEC|SED|SEI|STA|STX|STY|TAX|TAY|TSX|TXA|TXS|TYA|\.[A-Z]*)[[:>:]]/	\1/" | # insert tab before mnemo
sed -E -e "s/^\*/	*/" | # insert tab before mnemo
sed -E -e "s/^([A-Z][A-Z0-9]*)  */\1	/" | # insert tab after label

sed -e "s/^\([A-Z0-9]*	[^;][^;][^;]\) ;/\1             ;/" |
sed -e "s/^\([A-Z0-9]*	[^;][^;][^;][^;]\) ;/\1            ;/" |
sed -e "s/^\([A-Z0-9]*	[^;][^;][^;][^;][^;]\) ;/\1           ;/" |
sed -e "s/^\([A-Z0-9]*	[^;][^;][^;][^;][^;][^;]\) ;/\1          ;/" |
sed -e "s/^\([A-Z0-9]*	[^;][^;][^;][^;][^;][^;][^;]\) ;/\1         ;/" |
sed -e "s/^\([A-Z0-9]*	[^;][^;][^;][^;][^;][^;][^;][^;]\) ;/\1        ;/" |
sed -e "s/^\([A-Z0-9]*	[^;][^;][^;][^;][^;][^;][^;][^;][^;]\) ;/\1       ;/" |
sed -e "s/^\([A-Z0-9]*	[^;][^;][^;][^;][^;][^;][^;][^;][^;][^;]\) ;/\1      ;/" |
sed -e "s/^\([A-Z0-9]*	[^;][^;][^;][^;][^;][^;][^;][^;][^;][^;][^;]\) ;/\1     ;/" |
sed -e "s/^\([A-Z0-9]*	[^;][^;][^;][^;][^;][^;][^;][^;][^;][^;][^;][^;]\) ;/\1    ;/" |
sed -e "s/^\([A-Z0-9]*	[^;][^;][^;][^;][^;][^;][^;][^;][^;][^;][^;][^;][^;]\) ;/\1   ;/" |
sed -e "s/^\([A-Z0-9]*	[^;][^;][^;][^;][^;][^;][^;][^;][^;][^;][^;][^;][^;][^;]\) ;/\1  ;/" |

sed -e "s/^	.PAG/.PAG/" |
sed -e "s/^	.SKI/.SKI/" |
sed -e "s/^	.END/.END/" |
sed -e "s/^	.LIB/.LIB/" |
sed -e "s/^	.FIL/.FIL/" |
sed -e "s/^	.OPT/.OPT/"
master
Michael Steil 2 years ago
parent
commit
cbb39a14f6
100 changed files with 7398 additions and 7398 deletions
  1. +160
    -160
      BASIC_C64/code1
  2. +171
    -171
      BASIC_C64/code10
  3. +167
    -167
      BASIC_C64/code11
  4. +152
    -152
      BASIC_C64/code12
  5. +151
    -151
      BASIC_C64/code13
  6. +206
    -206
      BASIC_C64/code14
  7. +156
    -156
      BASIC_C64/code15
  8. +162
    -162
      BASIC_C64/code16
  9. +159
    -159
      BASIC_C64/code17
  10. +124
    -124
      BASIC_C64/code18
  11. +211
    -211
      BASIC_C64/code19
  12. +158
    -158
      BASIC_C64/code2
  13. +142
    -142
      BASIC_C64/code20
  14. +142
    -142
      BASIC_C64/code21
  15. +148
    -148
      BASIC_C64/code22
  16. +77
    -77
      BASIC_C64/code23
  17. +19
    -19
      BASIC_C64/code24
  18. +118
    -118
      BASIC_C64/code25
  19. +190
    -190
      BASIC_C64/code26
  20. +137
    -137
      BASIC_C64/code3
  21. +141
    -141
      BASIC_C64/code4
  22. +147
    -147
      BASIC_C64/code5
  23. +144
    -144
      BASIC_C64/code6
  24. +141
    -141
      BASIC_C64/code7
  25. +144
    -144
      BASIC_C64/code8
  26. +198
    -198
      BASIC_C64/code9
  27. +114
    -114
      BASIC_C64/declare
  28. +107
    -107
      BASIC_C64/init
  29. +243
    -243
      BASIC_C64/token2
  30. +125
    -125
      BASIC_C64/tokens
  31. +100
    -100
      BASIC_C64/trig
  32. +33
    -33
      DOS_1540/addfil
  33. +58
    -58
      DOS_1540/addrel
  34. +11
    -11
      DOS_1540/allromcheck
  35. +15
    -15
      DOS_1540/autoit
  36. +133
    -133
      DOS_1540/block
  37. +3
    -3
      DOS_1540/chksum
  38. +41
    -41
      DOS_1540/close
  39. +11
    -11
      DOS_1540/common
  40. +30
    -30
      DOS_1540/copall
  41. +20
    -20
      DOS_1540/copset
  42. +4
    -4
      DOS_1540/dos
  43. +88
    -88
      DOS_1540/dskint.sf
  44. +3
    -3
      DOS_1540/duplct
  45. +1
    -1
      DOS_1540/echksm
  46. +12
    -12
      DOS_1540/equate
  47. +26
    -26
      DOS_1540/equate.sf
  48. +2
    -2
      DOS_1540/erom
  49. +78
    -78
      DOS_1540/erproc
  50. +53
    -53
      DOS_1540/fndrel
  51. +59
    -59
      DOS_1540/frets
  52. +4
    -4
      DOS_1540/getact
  53. +26
    -26
      DOS_1540/i_odef
  54. +32
    -32
      DOS_1540/i_odef.sf
  55. +21
    -21
      DOS_1540/idle
  56. +37
    -37
      DOS_1540/idle...sf
  57. +43
    -43
      DOS_1540/ieee
  58. +54
    -54
      DOS_1540/ieee...sf
  59. +81
    -81
      DOS_1540/im
  60. +58
    -58
      DOS_1540/init
  61. +8
    -8
      DOS_1540/irq
  62. +80
    -80
      DOS_1540/jobs
  63. +90
    -90
      DOS_1540/jobs...sf
  64. +14
    -14
      DOS_1540/lcc.bingcr
  65. +43
    -43
      DOS_1540/lcc.cntrl
  66. +2
    -2
      DOS_1540/lcc.conhdr
  67. +35
    -35
      DOS_1540/lcc.end
  68. +71
    -71
      DOS_1540/lcc.fmt1
  69. +47
    -47
      DOS_1540/lcc.fmt2
  70. +26
    -26
      DOS_1540/lcc.fmt3
  71. +26
    -26
      DOS_1540/lcc.fmt4
  72. +81
    -81
      DOS_1540/lcc.gcrbin
  73. +14
    -14
      DOS_1540/lcc.i_o
  74. +13
    -13
      DOS_1540/lcc.init
  75. +35
    -35
      DOS_1540/lcc.read
  76. +48
    -48
      DOS_1540/lcc.seek
  77. +15
    -15
      DOS_1540/lcc.util
  78. +35
    -35
      DOS_1540/lcc.var
  79. +58
    -58
      DOS_1540/lcc.wrt
  80. +5
    -5
      DOS_1540/leds
  81. +121
    -121
      DOS_1540/lookup
  82. +18
    -18
      DOS_1540/lstdir
  83. +77
    -77
      DOS_1540/m.l.ieee
  84. +25
    -25
      DOS_1540/map
  85. +57
    -57
      DOS_1540/master
  86. +77
    -77
      DOS_1540/master.gerry
  87. +75
    -75
      DOS_1540/master.sf
  88. +15
    -15
      DOS_1540/memrw
  89. +39
    -39
      DOS_1540/new
  90. +28
    -28
      DOS_1540/newss
  91. +8
    -8
      DOS_1540/nulbuf
  92. +40
    -40
      DOS_1540/opchnl
  93. +91
    -91
      DOS_1540/open
  94. +74
    -74
      DOS_1540/parsex
  95. +121
    -121
      DOS_1540/ramvar
  96. +113
    -113
      DOS_1540/ramvar.sf
  97. +32
    -32
      DOS_1540/record
  98. +34
    -34
      DOS_1540/rel1
  99. +16
    -16
      DOS_1540/rel2
  100. +0
    -0
      DOS_1540/rel3

+ 160
- 160
BASIC_C64/code1 View File

@@ -1,173 +1,173 @@
.PAG 'CODE1'
OMERR LDX #ERROM
ERROR JMP (IERROR)
NERROX TXA
ASL A
TAX
LDA ERRTAB-2,X
STA INDEX1
LDA ERRTAB-1,X
STA INDEX1+1
JSR CLSCHN
LDA #0
STA CHANNL
ERRCRD JSR CRDO
JSR OUTQST
LDY #0
GETERR LDA (INDEX1)Y
PHA
AND #127
JSR OUTDO
INY
PLA
BPL GETERR
JSR STKINI
LDA #<ERR
LDY #>ERR
ERRFIN JSR STROUT
LDY CURLIN+1
INY
BEQ READYX
JSR INPRT
OMERR LDX #ERROM
ERROR JMP (IERROR)
NERROX TXA
ASL A
TAX
LDA ERRTAB-2,X
STA INDEX1
LDA ERRTAB-1,X
STA INDEX1+1
JSR CLSCHN
LDA #0
STA CHANNL
ERRCRD JSR CRDO
JSR OUTQST
LDY #0
GETERR LDA (INDEX1)Y
PHA
AND #127
JSR OUTDO
INY
PLA
BPL GETERR
JSR STKINI
LDA #<ERR
LDY #>ERR
ERRFIN JSR STROUT
LDY CURLIN+1
INY
BEQ READYX
JSR INPRT
.SKI 5
READYX LDA #<REDDY
LDY #>REDDY
JSR STROUT
LDA #$80 ;DIRECT MESSAGES ON
JSR SETMSG ;FROM KERNAL
READYX LDA #<REDDY
LDY #>REDDY
JSR STROUT
LDA #$80 ;DIRECT MESSAGES ON
JSR SETMSG ;FROM KERNAL
.SKI 5
MAIN JMP (IMAIN)
NMAIN JSR INLIN
STX TXTPTR
STY TXTPTR+1
JSR CHRGET
TAX
BEQ MAIN
LDX #255
STX CURLIN+1
BCC MAIN1
JSR CRUNCH
JMP GONE
MAIN1 JSR LINGET
JSR CRUNCH
STY COUNT
JSR FNDLIN
BCC NODEL
LDY #1
LDA (LOWTR)Y
STA INDEX1+1
LDA VARTAB
STA INDEX1
LDA LOWTR+1
STA INDEX2+1
LDA LOWTR
DEY
SBC (LOWTR)Y
CLC
ADC VARTAB
STA VARTAB
STA INDEX2
LDA VARTAB+1
ADC #255
STA VARTAB+1
SBC LOWTR+1
TAX
SEC
LDA LOWTR
SBC VARTAB
TAY
BCS QDECT1
INX
DEC INDEX2+1
QDECT1 CLC
ADC INDEX1
BCC MLOOP
DEC INDEX1+1
CLC
MLOOP LDA (INDEX1)Y
STA (INDEX2)Y
INY
BNE MLOOP
INC INDEX1+1
INC INDEX2+1
DEX
BNE MLOOP
NODEL JSR RUNC
JSR LNKPRG
LDA BUF
BEQ MAIN
CLC
LDA VARTAB
STA HIGHTR
ADC COUNT
STA HIGHDS
LDY VARTAB+1
STY HIGHTR+1
BCC NODELC
INY
NODELC STY HIGHDS+1
JSR BLTU
LDA LINNUM
LDY LINNUM+1
STA BUF-2
STY BUF-1
LDA STREND
LDY STREND+1
STA VARTAB
STY VARTAB+1
LDY COUNT
DEY
STOLOP LDA BUF-4,Y
STA (LOWTR)Y
DEY
BPL STOLOP
FINI JSR RUNC
JSR LNKPRG
JMP MAIN
LNKPRG LDA TXTTAB
LDY TXTTAB+1
STA INDEX
STY INDEX+1
CLC
CHEAD LDY #1
LDA (INDEX)Y
BEQ LNKRTS
LDY #4
CZLOOP INY
LDA (INDEX)Y
BNE CZLOOP
INY
TYA
ADC INDEX
TAX
LDY #0
STA (INDEX)Y
LDA INDEX+1
ADC #0
INY
STA (INDEX)Y
STX INDEX
STA INDEX+1
BCC CHEAD
LNKRTS RTS
MAIN JMP (IMAIN)
NMAIN JSR INLIN
STX TXTPTR
STY TXTPTR+1
JSR CHRGET
TAX
BEQ MAIN
LDX #255
STX CURLIN+1
BCC MAIN1
JSR CRUNCH
JMP GONE
MAIN1 JSR LINGET
JSR CRUNCH
STY COUNT
JSR FNDLIN
BCC NODEL
LDY #1
LDA (LOWTR)Y
STA INDEX1+1
LDA VARTAB
STA INDEX1
LDA LOWTR+1
STA INDEX2+1
LDA LOWTR
DEY
SBC (LOWTR)Y
CLC
ADC VARTAB
STA VARTAB
STA INDEX2
LDA VARTAB+1
ADC #255
STA VARTAB+1
SBC LOWTR+1
TAX
SEC
LDA LOWTR
SBC VARTAB
TAY
BCS QDECT1
INX
DEC INDEX2+1
QDECT1 CLC
ADC INDEX1
BCC MLOOP
DEC INDEX1+1
CLC
MLOOP LDA (INDEX1)Y
STA (INDEX2)Y
INY
BNE MLOOP
INC INDEX1+1
INC INDEX2+1
DEX
BNE MLOOP
NODEL JSR RUNC
JSR LNKPRG
LDA BUF
BEQ MAIN
CLC
LDA VARTAB
STA HIGHTR
ADC COUNT
STA HIGHDS
LDY VARTAB+1
STY HIGHTR+1
BCC NODELC
INY
NODELC STY HIGHDS+1
JSR BLTU
LDA LINNUM
LDY LINNUM+1
STA BUF-2
STY BUF-1
LDA STREND
LDY STREND+1
STA VARTAB
STY VARTAB+1
LDY COUNT
DEY
STOLOP LDA BUF-4,Y
STA (LOWTR)Y
DEY
BPL STOLOP
FINI JSR RUNC
JSR LNKPRG
JMP MAIN
LNKPRG LDA TXTTAB
LDY TXTTAB+1
STA INDEX
STY INDEX+1
CLC
CHEAD LDY #1
LDA (INDEX)Y
BEQ LNKRTS
LDY #4
CZLOOP INY
LDA (INDEX)Y
BNE CZLOOP
INY
TYA
ADC INDEX
TAX
LDY #0
STA (INDEX)Y
LDA INDEX+1
ADC #0
INY
STA (INDEX)Y
STX INDEX
STA INDEX+1
BCC CHEAD
LNKRTS RTS
.SKI 5
;FUNCTION TO GET A LINE ONE CHARACTER AT
;A TIME FROM THE INPUT CHANNEL AND
;BUILD IT IN THE INPUT BUFFER.
;
INLIN LDX #0
INLIN LDX #0
;
INLINC JSR INCHR
CMP #13 ;A CARRIAGE RETURN?
BEQ FININ1 ;YES...DONE BUILD
INLINC JSR INCHR
CMP #13 ;A CARRIAGE RETURN?
BEQ FININ1 ;YES...DONE BUILD
;
STA BUF,X ;PUT IT AWAY
INX
CPX #BUFLEN ;MAX CHARACTER LINE?
BCC INLINC ;NO...O.K.
STA BUF,X ;PUT IT AWAY
INX
CPX #BUFLEN ;MAX CHARACTER LINE?
BCC INLINC ;NO...O.K.
;
LDX #ERRLS ;STRING TOO LONG ERROR
JMP ERROR
LDX #ERRLS ;STRING TOO LONG ERROR
JMP ERROR
;
FININ1 JMP FININL
FININ1 JMP FININL
.END

+ 171
- 171
BASIC_C64/code10 View File

@@ -1,181 +1,181 @@
.PAG 'CODE10'
.PAG 'CODE10'
;TEST POINTER TO VARIABLE TO SEE
;IF CONSTANT IS CONTAINED IN BASIC.
;ARRAY VARIABLES HAVE ZEROES PLACED
;IN RAM. UNDEFINED SIMPLE VARIABLES
;HAVE POINTER T ZERO IN BASIC.
;
TSTROM SEC
LDA FACMO
SBC #<ROMLOC
LDA FACLO
SBC #>ROMLOC
BCC TSTR10
TSTROM SEC
LDA FACMO
SBC #<ROMLOC
LDA FACLO
SBC #>ROMLOC
BCC TSTR10
;
LDA #<INITAT
SBC FACMO
LDA #>INITAT
SBC FACLO
LDA #<INITAT
SBC FACMO
LDA #>INITAT
SBC FACLO
;
TSTR10 RTS
TSTR10 RTS
.SKI 5
ISVAR JSR PTRGET
ISVRET STA FACMO
STY FACMO+1
LDX VARNAM
LDY VARNAM+1
LDA VALTYP
BEQ GOOO
LDA #0
STA FACOV
JSR TSTROM ;SEE IF AN ARRAY
BCC STRRTS ;DON'T TEST ST(I),TI(I)
CPX #'T
BNE STRRTS
CPY #$C9
BNE STRRTS
JSR GETTIM
STY TENEXP
DEY
STY FBUFPT
LDY #6
STY DECCNT
LDY #FDCEND-FOUTBL
JSR FOUTIM
JMP TIMSTR
STRRTS RTS
GOOO BIT INTFLG
BPL GOOOOO
LDY #0
LDA (FACMO)Y
TAX
INY
LDA (FACMO)Y
TAY
TXA
JMP GIVAYF
GOOOOO JSR TSTROM ;SEE IF ARRAY
BCC GOMOVF ;DON'T TEST ST(I),TI(I)
CPX #'T
BNE QSTATV
CPY #'I
BNE GOMOVF
JSR GETTIM
TYA
LDX #160
JMP FLOATB
GETTIM JSR RDTIM
STX FACMO
STY FACMOH
STA FACLO
LDY #0
STY FACHO
RTS
QSTATV CPX #'S
BNE GOMOVF
CPY #'T
BNE GOMOVF
JSR READST
JMP FLOAT
GOMOVF LDA FACMO
LDY FACMO+1
JMP MOVFM
ISFUN ASL A
PHA
TAX
JSR CHRGET
CPX #LASNUM+LASNUM-255
BCC OKNORM
JSR CHKOPN
JSR FRMEVL
JSR CHKCOM
JSR CHKSTR
PLA
TAX
LDA FACMO+1
PHA
LDA FACMO
PHA
TXA
PHA
JSR GETBYT
PLA
TAY
TXA
PHA
JMP FINGO
OKNORM JSR PARCHK
PLA
TAY
FINGO LDA FUNDSP-ONEFUN-ONEFUN+256,Y
STA JMPER+1
LDA FUNDSP-ONEFUN-ONEFUN+257,Y
STA JMPER+2
JSR JMPER
JMP CHKNUM
OROP LDY #255
.BYT $2C
ANDOP LDY #0
STY COUNT
JSR AYINT
LDA FACMO
EOR COUNT
STA INTEGR
LDA FACLO
EOR COUNT
STA INTEGR+1
JSR MOVFA
JSR AYINT
LDA FACLO
EOR COUNT
AND INTEGR+1
EOR COUNT
TAY
LDA FACMO
EOR COUNT
AND INTEGR
EOR COUNT
JMP GIVAYF
DOREL JSR CHKVAL
BCS STRCMP
LDA ARGSGN
ORA #127
AND ARGHO
STA ARGHO
LDA #<ARGEXP
LDY #>ARGEXP
JSR FCOMP
TAX
JMP QCOMP
STRCMP LDA #0
STA VALTYP
DEC OPMASK
JSR FREFAC
STA DSCTMP
STX DSCTMP+1
STY DSCTMP+2
LDA ARGMO
LDY ARGMO+1
JSR FRETMP
STX ARGMO
STY ARGMO+1
TAX
SEC
SBC DSCTMP
BEQ STASGN
LDA #1
BCC STASGN
LDX DSCTMP
LDA #$FF
STASGN STA FACSGN
LDY #255
INX
NXTCMP INY
DEX
BNE GETCMP
LDX FACSGN
QCOMP BMI DOCMP
CLC
BCC DOCMP
GETCMP LDA (ARGMO)Y
ISVAR JSR PTRGET
ISVRET STA FACMO
STY FACMO+1
LDX VARNAM
LDY VARNAM+1
LDA VALTYP
BEQ GOOO
LDA #0
STA FACOV
JSR TSTROM ;SEE IF AN ARRAY
BCC STRRTS ;DON'T TEST ST(I),TI(I)
CPX #'T
BNE STRRTS
CPY #$C9
BNE STRRTS
JSR GETTIM
STY TENEXP
DEY
STY FBUFPT
LDY #6
STY DECCNT
LDY #FDCEND-FOUTBL
JSR FOUTIM
JMP TIMSTR
STRRTS RTS
GOOO BIT INTFLG
BPL GOOOOO
LDY #0
LDA (FACMO)Y
TAX
INY
LDA (FACMO)Y
TAY
TXA
JMP GIVAYF
GOOOOO JSR TSTROM ;SEE IF ARRAY
BCC GOMOVF ;DON'T TEST ST(I),TI(I)
CPX #'T
BNE QSTATV
CPY #'I
BNE GOMOVF
JSR GETTIM
TYA
LDX #160
JMP FLOATB
GETTIM JSR RDTIM
STX FACMO
STY FACMOH
STA FACLO
LDY #0
STY FACHO
RTS
QSTATV CPX #'S
BNE GOMOVF
CPY #'T
BNE GOMOVF
JSR READST
JMP FLOAT
GOMOVF LDA FACMO
LDY FACMO+1
JMP MOVFM
ISFUN ASL A
PHA
TAX
JSR CHRGET
CPX #LASNUM+LASNUM-255
BCC OKNORM
JSR CHKOPN
JSR FRMEVL
JSR CHKCOM
JSR CHKSTR
PLA
TAX
LDA FACMO+1
PHA
LDA FACMO
PHA
TXA
PHA
JSR GETBYT
PLA
TAY
TXA
PHA
JMP FINGO
OKNORM JSR PARCHK
PLA
TAY
FINGO LDA FUNDSP-ONEFUN-ONEFUN+256,Y
STA JMPER+1
LDA FUNDSP-ONEFUN-ONEFUN+257,Y
STA JMPER+2
JSR JMPER
JMP CHKNUM
OROP LDY #255
.BYT $2C
ANDOP LDY #0
STY COUNT
JSR AYINT
LDA FACMO
EOR COUNT
STA INTEGR
LDA FACLO
EOR COUNT
STA INTEGR+1
JSR MOVFA
JSR AYINT
LDA FACLO
EOR COUNT
AND INTEGR+1
EOR COUNT
TAY
LDA FACMO
EOR COUNT
AND INTEGR
EOR COUNT
JMP GIVAYF
DOREL JSR CHKVAL
BCS STRCMP
LDA ARGSGN
ORA #127
AND ARGHO
STA ARGHO
LDA #<ARGEXP
LDY #>ARGEXP
JSR FCOMP
TAX
JMP QCOMP
STRCMP LDA #0
STA VALTYP
DEC OPMASK
JSR FREFAC
STA DSCTMP
STX DSCTMP+1
STY DSCTMP+2
LDA ARGMO
LDY ARGMO+1
JSR FRETMP
STX ARGMO
STY ARGMO+1
TAX
SEC
SBC DSCTMP
BEQ STASGN
LDA #1
BCC STASGN
LDX DSCTMP
LDA #$FF
STASGN STA FACSGN
LDY #255
INX
NXTCMP INY
DEX
BNE GETCMP
LDX FACSGN
QCOMP BMI DOCMP
CLC
BCC DOCMP
GETCMP LDA (ARGMO)Y
.END

+ 167
- 167
BASIC_C64/code11 View File

@@ -1,171 +1,171 @@
.PAG 'CODE11'
CMP (DSCTMP+1)Y
BEQ NXTCMP
LDX #$FF
BCS DOCMP
LDX #1
DOCMP INX
TXA
ROL A
AND DOMASK
BEQ GOFLOT
LDA #$FF
GOFLOT JMP FLOAT
DIM3 JSR CHKCOM
DIM TAX
JSR PTRGT1
JSR CHRGOT
BNE DIM3
RTS
PTRGET LDX #0
JSR CHRGOT
PTRGT1 STX DIMFLG
PTRGT2 STA VARNAM
JSR CHRGOT
JSR ISLETC
BCS PTRGT3
INTERR JMP SNERR
PTRGT3 LDX #0
STX VALTYP
STX INTFLG
JSR CHRGET
BCC ISSEC
JSR ISLETC
BCC NOSEC
ISSEC TAX
EATEM JSR CHRGET
BCC EATEM
JSR ISLETC
BCS EATEM
NOSEC CMP #'$
BNE NOTSTR
LDA #$FF
STA VALTYP
BNE TURNON
NOTSTR CMP #'%
BNE STRNAM
LDA SUBFLG
BNE INTERR
LDA #128
STA INTFLG
ORA VARNAM
STA VARNAM
TURNON TXA
ORA #128
TAX
JSR CHRGET
STRNAM STX VARNAM+1
SEC
ORA SUBFLG
SBC #40
BNE *+5
JMP ISARY
LDY #0
STY SUBFLG
LDA VARTAB
LDX VARTAB+1
STXFND STX LOWTR+1
LOPFND STA LOWTR
CPX ARYTAB+1
BNE LOPFN
CMP ARYTAB
BEQ NOTFNS
LOPFN LDA VARNAM
CMP (LOWTR)Y
BNE NOTIT
LDA VARNAM+1
INY
CMP (LOWTR)Y
BEQ FINPTR
DEY
NOTIT CLC
LDA LOWTR
ADC #6+ADDPRC
BCC LOPFND
INX
BNE STXFND
ISLETC CMP #'A
BCC ISLRTS
SBC #$5B
SEC
SBC #@245
ISLRTS RTS
NOTFNS PLA
PHA
CMP (DSCTMP+1)Y
BEQ NXTCMP
LDX #$FF
BCS DOCMP
LDX #1
DOCMP INX
TXA
ROL A
AND DOMASK
BEQ GOFLOT
LDA #$FF
GOFLOT JMP FLOAT
DIM3 JSR CHKCOM
DIM TAX
JSR PTRGT1
JSR CHRGOT
BNE DIM3
RTS
PTRGET LDX #0
JSR CHRGOT
PTRGT1 STX DIMFLG
PTRGT2 STA VARNAM
JSR CHRGOT
JSR ISLETC
BCS PTRGT3
INTERR JMP SNERR
PTRGT3 LDX #0
STX VALTYP
STX INTFLG
JSR CHRGET
BCC ISSEC
JSR ISLETC
BCC NOSEC
ISSEC TAX
EATEM JSR CHRGET
BCC EATEM
JSR ISLETC
BCS EATEM
NOSEC CMP #'$
BNE NOTSTR
LDA #$FF
STA VALTYP
BNE TURNON
NOTSTR CMP #'%
BNE STRNAM
LDA SUBFLG
BNE INTERR
LDA #128
STA INTFLG
ORA VARNAM
STA VARNAM
TURNON TXA
ORA #128
TAX
JSR CHRGET
STRNAM STX VARNAM+1
SEC
ORA SUBFLG
SBC #40
BNE *+5
JMP ISARY
LDY #0
STY SUBFLG
LDA VARTAB
LDX VARTAB+1
STXFND STX LOWTR+1
LOPFND STA LOWTR
CPX ARYTAB+1
BNE LOPFN
CMP ARYTAB
BEQ NOTFNS
LOPFN LDA VARNAM
CMP (LOWTR)Y
BNE NOTIT
LDA VARNAM+1
INY
CMP (LOWTR)Y
BEQ FINPTR
DEY
NOTIT CLC
LDA LOWTR
ADC #6+ADDPRC
BCC LOPFND
INX
BNE STXFND
ISLETC CMP #'A
BCC ISLRTS
SBC #$5B
SEC
SBC #@245
ISLRTS RTS
NOTFNS PLA
PHA
ZZ6=ISVRET-1
CMP #<ZZ6
BNE NOTEVL
LDZR LDA #<ZERO
LDY #>ZERO
RTS
NOTEVL LDA VARNAM
LDY VARNAM+1
CMP #'T
BNE QSTAVR
CPY #@311
BEQ LDZR
CPY #@111
BNE QSTAVR
GOBADV JMP SNERR
CMP #<ZZ6
BNE NOTEVL
LDZR LDA #<ZERO
LDY #>ZERO
RTS
NOTEVL LDA VARNAM
LDY VARNAM+1
CMP #'T
BNE QSTAVR
CPY #@311
BEQ LDZR
CPY #@111
BNE QSTAVR
GOBADV JMP SNERR
QSTAVR
CMP #'S
BNE VAROK
CPY #'T
BEQ GOBADV
VAROK LDA ARYTAB
LDY ARYTAB+1
STA LOWTR
STY LOWTR+1
LDA STREND
LDY STREND+1
STA HIGHTR
STY HIGHTR+1
CLC
ADC #6+ADDPRC
BCC NOTEVE
INY
NOTEVE STA HIGHDS
STY HIGHDS+1
JSR BLTU
LDA HIGHDS
LDY HIGHDS+1
INY
STA ARYTAB
STY ARYTAB+1
LDY #0
LDA VARNAM
STA (LOWTR)Y
INY
LDA VARNAM+1
STA (LOWTR)Y
LDA #0
INY
STA (LOWTR)Y
INY
STA (LOWTR)Y
INY
STA (LOWTR)Y
INY
STA (LOWTR)Y
INY
STA (LOWTR)Y
FINPTR LDA LOWTR
CLC
ADC #2
LDY LOWTR+1
BCC FINNOW
INY
FINNOW STA VARPNT
STY VARPNT+1
RTS
FMAPTR LDA COUNT
ASL A
ADC #5
ADC LOWTR
LDY LOWTR+1
BCC JSRGM
INY
JSRGM STA ARYPNT
STY ARYPNT+1
RTS
CMP #'S
BNE VAROK
CPY #'T
BEQ GOBADV
VAROK LDA ARYTAB
LDY ARYTAB+1
STA LOWTR
STY LOWTR+1
LDA STREND
LDY STREND+1
STA HIGHTR
STY HIGHTR+1
CLC
ADC #6+ADDPRC
BCC NOTEVE
INY
NOTEVE STA HIGHDS
STY HIGHDS+1
JSR BLTU
LDA HIGHDS
LDY HIGHDS+1
INY
STA ARYTAB
STY ARYTAB+1
LDY #0
LDA VARNAM
STA (LOWTR)Y
INY
LDA VARNAM+1
STA (LOWTR)Y
LDA #0
INY
STA (LOWTR)Y
INY
STA (LOWTR)Y
INY
STA (LOWTR)Y
INY
STA (LOWTR)Y
INY
STA (LOWTR)Y
FINPTR LDA LOWTR
CLC
ADC #2
LDY LOWTR+1
BCC FINNOW
INY
FINNOW STA VARPNT
STY VARPNT+1
RTS
FMAPTR LDA COUNT
ASL A
ADC #5
ADC LOWTR
LDY LOWTR+1
BCC JSRGM
INY
JSRGM STA ARYPNT
STY ARYPNT+1
RTS
.END

+ 152
- 152
BASIC_C64/code12 View File

@@ -1,154 +1,154 @@
.PAG 'CODE12'
N32768 .BYT 144,128,0,0,0
FLPINT JSR AYINT
LDA FACMO
LDY FACLO
RTS
INTIDX JSR CHRGET
JSR FRMEVL
POSINT JSR CHKNUM
LDA FACSGN
BMI NONONO
AYINT LDA FACEXP
CMP #144
BCC QINTGO
LDA #<N32768
LDY #>N32768
JSR FCOMP
NONONO BNE FCERR
QINTGO JMP QINT
ISARY LDA DIMFLG
ORA INTFLG
PHA
LDA VALTYP
PHA
LDY #0
INDLOP TYA
PHA
LDA VARNAM+1
PHA
LDA VARNAM
PHA
JSR INTIDX
PLA
STA VARNAM
PLA
STA VARNAM+1
PLA
TAY
TSX
LDA 258,X
PHA
LDA 257,X
PHA
LDA INDICE
STA 258,X
LDA INDICE+1
STA 257,X
INY
JSR CHRGOT
CMP #44
BEQ INDLOP
STY COUNT
JSR CHKCLS
PLA
STA VALTYP
PLA
STA INTFLG
AND #127
STA DIMFLG
LDX ARYTAB
LDA ARYTAB+1
LOPFDA STX LOWTR
STA LOWTR+1
CMP STREND+1
BNE LOPFDV
CPX STREND
BEQ NOTFDD
LOPFDV LDY #0
LDA (LOWTR)Y
INY
CMP VARNAM
BNE NMARY1
LDA VARNAM+1
CMP (LOWTR)Y
BEQ GOTARY
NMARY1 INY
LDA (LOWTR)Y
CLC
ADC LOWTR
TAX
INY
LDA (LOWTR)Y
ADC LOWTR+1
BCC LOPFDA
BSERR LDX #ERRBS
.BYT $2C
FCERR LDX #ERRFC
ERRGO3 JMP ERROR
GOTARY LDX #ERRDD
LDA DIMFLG
BNE ERRGO3
JSR FMAPTR
LDA COUNT
LDY #4
CMP (LOWTR)Y
BNE BSERR
JMP GETDEF
NOTFDD JSR FMAPTR
JSR REASON
LDY #0
STY CURTOL+1
LDX #5
LDA VARNAM
STA (LOWTR)Y
BPL NOTFLT
DEX
NOTFLT INY
LDA VARNAM+1
STA (LOWTR)Y
BPL STOMLT
DEX
DEX
STOMLT STX CURTOL
LDA COUNT
INY
INY
INY
STA (LOWTR)Y
LOPPTA LDX #11
LDA #0
BIT DIMFLG
BVC NOTDIM
PLA
CLC
ADC #1
TAX
PLA
ADC #0
NOTDIM INY
STA (LOWTR)Y
INY
TXA
STA (LOWTR)Y
JSR UMULT
STX CURTOL
STA CURTOL+1
LDY INDEX
DEC COUNT
BNE LOPPTA
ADC ARYPNT+1
BCS OMERR1
STA ARYPNT+1
TAY
TXA
ADC ARYPNT
BCC GREASE
INY
BEQ OMERR1
GREASE JSR REASON
STA STREND
STY STREND+1
LDA #0
INC CURTOL+1
N32768 .BYT 144,128,0,0,0
FLPINT JSR AYINT
LDA FACMO
LDY FACLO
RTS
INTIDX JSR CHRGET
JSR FRMEVL
POSINT JSR CHKNUM
LDA FACSGN
BMI NONONO
AYINT LDA FACEXP
CMP #144
BCC QINTGO
LDA #<N32768
LDY #>N32768
JSR FCOMP
NONONO BNE FCERR
QINTGO JMP QINT
ISARY LDA DIMFLG
ORA INTFLG
PHA
LDA VALTYP
PHA
LDY #0
INDLOP TYA
PHA
LDA VARNAM+1
PHA
LDA VARNAM
PHA
JSR INTIDX
PLA
STA VARNAM
PLA
STA VARNAM+1
PLA
TAY
TSX
LDA 258,X
PHA
LDA 257,X
PHA
LDA INDICE
STA 258,X
LDA INDICE+1
STA 257,X
INY
JSR CHRGOT
CMP #44
BEQ INDLOP
STY COUNT
JSR CHKCLS
PLA
STA VALTYP
PLA
STA INTFLG
AND #127
STA DIMFLG
LDX ARYTAB
LDA ARYTAB+1
LOPFDA STX LOWTR
STA LOWTR+1
CMP STREND+1
BNE LOPFDV
CPX STREND
BEQ NOTFDD
LOPFDV LDY #0
LDA (LOWTR)Y
INY
CMP VARNAM
BNE NMARY1
LDA VARNAM+1
CMP (LOWTR)Y
BEQ GOTARY
NMARY1 INY
LDA (LOWTR)Y
CLC
ADC LOWTR
TAX
INY
LDA (LOWTR)Y
ADC LOWTR+1
BCC LOPFDA
BSERR LDX #ERRBS
.BYT $2C
FCERR LDX #ERRFC
ERRGO3 JMP ERROR
GOTARY LDX #ERRDD
LDA DIMFLG
BNE ERRGO3
JSR FMAPTR
LDA COUNT
LDY #4
CMP (LOWTR)Y
BNE BSERR
JMP GETDEF
NOTFDD JSR FMAPTR
JSR REASON
LDY #0
STY CURTOL+1
LDX #5
LDA VARNAM
STA (LOWTR)Y
BPL NOTFLT
DEX
NOTFLT INY
LDA VARNAM+1
STA (LOWTR)Y
BPL STOMLT
DEX
DEX
STOMLT STX CURTOL
LDA COUNT
INY
INY
INY
STA (LOWTR)Y
LOPPTA LDX #11
LDA #0
BIT DIMFLG
BVC NOTDIM
PLA
CLC
ADC #1
TAX
PLA
ADC #0
NOTDIM INY
STA (LOWTR)Y
INY
TXA
STA (LOWTR)Y
JSR UMULT
STX CURTOL
STA CURTOL+1
LDY INDEX
DEC COUNT
BNE LOPPTA
ADC ARYPNT+1
BCS OMERR1
STA ARYPNT+1
TAY
TXA
ADC ARYPNT
BCC GREASE
INY
BEQ OMERR1
GREASE JSR REASON
STA STREND
STY STREND+1
LDA #0
INC CURTOL+1
.END

+ 151
- 151
BASIC_C64/code13 View File

@@ -1,153 +1,153 @@
.PAG 'CODE13'
LDY CURTOL
BEQ DECCUR
ZERITA DEY
STA (ARYPNT)Y
BNE ZERITA
DECCUR DEC ARYPNT+1
DEC CURTOL+1
BNE ZERITA
INC ARYPNT+1
SEC
LDA STREND
SBC LOWTR
LDY #2
STA (LOWTR)Y
LDA STREND+1
INY
SBC LOWTR+1
STA (LOWTR)Y
LDA DIMFLG
BNE DIMRTS
INY
GETDEF LDA (LOWTR)Y
STA COUNT
LDA #0
STA CURTOL
INLPNM STA CURTOL+1
INY
PLA
TAX
STA INDICE
PLA
STA INDICE+1
CMP (LOWTR)Y
BCC INLPN2
BNE BSERR7
INY
TXA
CMP (LOWTR)Y
BCC INLPN1
BSERR7 JMP BSERR
OMERR1 JMP OMERR
INLPN2 INY
INLPN1 LDA CURTOL+1
ORA CURTOL
CLC
BEQ ADDIND
JSR UMULT
TXA
ADC INDICE
TAX
TYA
LDY INDEX1
ADDIND ADC INDICE+1
STX CURTOL
DEC COUNT
BNE INLPNM
STA CURTOL+1
LDX #5
LDA VARNAM
BPL NOTFL1
DEX
NOTFL1 LDA VARNAM+1
BPL STOML1
DEX
DEX
STOML1 STX ADDEND
LDA #0
JSR UMULTD
TXA
ADC ARYPNT
STA VARPNT
TYA
ADC ARYPNT+1
STA VARPNT+1
TAY
LDA VARPNT
DIMRTS RTS
UMULT STY INDEX
LDA (LOWTR)Y
STA ADDEND
DEY
LDA (LOWTR)Y
UMULTD STA ADDEND+1
LDA #16
STA DECCNT
LDX #0
LDY #0
UMULTC TXA
ASL A
TAX
TYA
ROL A
TAY
BCS OMERR1
ASL CURTOL
ROL CURTOL+1
BCC UMLCNT
CLC
TXA
ADC ADDEND
TAX
TYA
ADC ADDEND+1
TAY
BCS OMERR1
UMLCNT DEC DECCNT
BNE UMULTC
UMLRTS RTS
FRE LDA VALTYP
BEQ NOFREF
JSR FREFAC
NOFREF JSR GARBA2
SEC
LDA FRETOP
SBC STREND
TAY
LDA FRETOP+1
SBC STREND+1
GIVAYF LDX #0
STX VALTYP
STA FACHO
STY FACHO+1
LDX #144
JMP FLOATS
POS SEC
JSR PLOT ;GET TAB POS IN .Y
SNGFLT LDA #0
BEQ GIVAYF
ERRDIR LDX CURLIN+1
INX
BNE DIMRTS
LDX #ERRID
.BYT $2C
ERRGUF LDX #ERRUF
JMP ERROR
DEF JSR GETFNM
JSR ERRDIR
JSR CHKOPN
LDA #128
STA SUBFLG
JSR PTRGET
JSR CHKNUM
JSR CHKCLS
LDA #$B2
JSR SYNCHR
PHA
LDA VARPNT+1
PHA
LDA VARPNT
PHA
LDA TXTPTR+1
LDY CURTOL
BEQ DECCUR
ZERITA DEY
STA (ARYPNT)Y
BNE ZERITA
DECCUR DEC ARYPNT+1
DEC CURTOL+1
BNE ZERITA
INC ARYPNT+1
SEC
LDA STREND
SBC LOWTR
LDY #2
STA (LOWTR)Y
LDA STREND+1
INY
SBC LOWTR+1
STA (LOWTR)Y
LDA DIMFLG
BNE DIMRTS
INY
GETDEF LDA (LOWTR)Y
STA COUNT
LDA #0
STA CURTOL
INLPNM STA CURTOL+1
INY
PLA
TAX
STA INDICE
PLA
STA INDICE+1
CMP (LOWTR)Y
BCC INLPN2
BNE BSERR7
INY
TXA
CMP (LOWTR)Y
BCC INLPN1
BSERR7 JMP BSERR
OMERR1 JMP OMERR
INLPN2 INY
INLPN1 LDA CURTOL+1
ORA CURTOL
CLC
BEQ ADDIND
JSR UMULT
TXA
ADC INDICE
TAX
TYA
LDY INDEX1
ADDIND ADC INDICE+1
STX CURTOL
DEC COUNT
BNE INLPNM
STA CURTOL+1
LDX #5
LDA VARNAM
BPL NOTFL1
DEX
NOTFL1 LDA VARNAM+1
BPL STOML1
DEX
DEX
STOML1 STX ADDEND
LDA #0
JSR UMULTD
TXA
ADC ARYPNT
STA VARPNT
TYA
ADC ARYPNT+1
STA VARPNT+1
TAY
LDA VARPNT
DIMRTS RTS
UMULT STY INDEX
LDA (LOWTR)Y
STA ADDEND
DEY
LDA (LOWTR)Y
UMULTD STA ADDEND+1
LDA #16
STA DECCNT
LDX #0
LDY #0
UMULTC TXA
ASL A
TAX
TYA
ROL A
TAY
BCS OMERR1
ASL CURTOL
ROL CURTOL+1
BCC UMLCNT
CLC
TXA
ADC ADDEND
TAX
TYA
ADC ADDEND+1
TAY
BCS OMERR1
UMLCNT DEC DECCNT
BNE UMULTC
UMLRTS RTS
FRE LDA VALTYP
BEQ NOFREF
JSR FREFAC
NOFREF JSR GARBA2
SEC
LDA FRETOP
SBC STREND
TAY
LDA FRETOP+1
SBC STREND+1
GIVAYF LDX #0
STX VALTYP
STA FACHO
STY FACHO+1
LDX #144
JMP FLOATS
POS SEC
JSR PLOT ;GET TAB POS IN .Y
SNGFLT LDA #0
BEQ GIVAYF
ERRDIR LDX CURLIN+1
INX
BNE DIMRTS
LDX #ERRID
.BYT $2C
ERRGUF LDX #ERRUF
JMP ERROR
DEF JSR GETFNM
JSR ERRDIR
JSR CHKOPN
LDA #128
STA SUBFLG
JSR PTRGET
JSR CHKNUM
JSR CHKCLS
LDA #$B2
JSR SYNCHR
PHA
LDA VARPNT+1
PHA
LDA VARPNT
PHA
LDA TXTPTR+1
.END

+ 206
- 206
BASIC_C64/code14 View File

@@ -1,208 +1,208 @@
.PAG 'CODE14'
PHA
LDA TXTPTR
PHA
JSR DATA
JMP DEFFIN
GETFNM LDA #FNTK
JSR SYNCHR
ORA #128
STA SUBFLG
JSR PTRGT2
STA DEFPNT
STY DEFPNT+1
JMP CHKNUM
FNDOER JSR GETFNM
LDA DEFPNT+1
PHA
LDA DEFPNT
PHA
JSR PARCHK
JSR CHKNUM
PLA
STA DEFPNT
PLA
STA DEFPNT+1
LDY #2
LDA (DEFPNT)Y
STA VARPNT
TAX
INY
LDA (DEFPNT)Y
BEQ ERRGUF
STA VARPNT+1
INY
DEFSTF LDA (VARPNT)Y
PHA
DEY
BPL DEFSTF
LDY VARPNT+1
JSR MOVMF
LDA TXTPTR+1
PHA
LDA TXTPTR
PHA
LDA (DEFPNT)Y
STA TXTPTR
INY
LDA (DEFPNT)Y
STA TXTPTR+1
LDA VARPNT+1
PHA
LDA VARPNT
PHA
JSR FRMNUM
PLA
STA DEFPNT
PLA
STA DEFPNT+1
JSR CHRGOT
BEQ *+5
JMP SNERR
PLA
STA TXTPTR
PLA
STA TXTPTR+1
DEFFIN LDY #0
PLA
STA (DEFPNT)Y
PLA
INY
STA (DEFPNT)Y
PLA
INY
STA (DEFPNT)Y
PLA
INY
STA (DEFPNT)Y
PLA
INY
STA (DEFPNT)Y
RTS
STRD JSR CHKNUM
LDY #0
JSR FOUTC
PLA
PLA
TIMSTR LDA #<LOFBUF
LDY #>LOFBUF
BEQ STRLIT
STRINI LDX FACMO
LDY FACMO+1
STX DSCPNT
STY DSCPNT+1
STRSPA JSR GETSPA
STX DSCTMP+1
STY DSCTMP+2
STA DSCTMP
RTS
STRLIT LDX #34
STX CHARAC
STX ENDCHR
STRLT2 STA STRNG1
STY STRNG1+1
STA DSCTMP+1
STY DSCTMP+2
LDY #255
STRGET INY
LDA (STRNG1)Y
BEQ STRFI1
CMP CHARAC
BEQ STRFIN
CMP ENDCHR
BNE STRGET
STRFIN CMP #34
BEQ STRFI2
STRFI1 CLC
STRFI2 STY DSCTMP
TYA
ADC STRNG1
STA STRNG2
LDX STRNG1+1
BCC STRST2
INX
STRST2 STX STRNG2+1
LDA STRNG1+1
BEQ STRCP
CMP #BUFPAG
BNE PUTNEW
STRCP TYA
JSR STRINI
LDX STRNG1
LDY STRNG1+1
JSR MOVSTR
PUTNEW LDX TEMPPT
CPX #TEMPST+STRSIZ+STRSIZ+STRSIZ
BNE PUTNW1
LDX #ERRST
ERRGO2 JMP ERROR
PUTNW1 LDA DSCTMP
STA 0,X
LDA DSCTMP+1
STA 1,X
LDA DSCTMP+2
STA 2,X
LDY #0
STX FACMO
STY FACMO+1
STY FACOV
DEY
STY VALTYP
STX LASTPT
INX
INX
INX
STX TEMPPT
RTS
GETSPA LSR GARBFL
TRYAG2 PHA
EOR #255
SEC
ADC FRETOP
LDY FRETOP+1
BCS TRYAG3
DEY
TRYAG3 CPY STREND+1
BCC GARBAG
BNE STRFRE
CMP STREND
BCC GARBAG
STRFRE STA FRETOP
STY FRETOP+1
STA FRESPC
STY FRESPC+1
TAX
PLA
RTS
GARBAG LDX #ERROM
LDA GARBFL
BMI ERRGO2
JSR GARBA2
LDA #128
STA GARBFL
PLA
BNE TRYAG2
GARBA2 LDX MEMSIZ
LDA MEMSIZ+1
FNDVAR STX FRETOP
STA FRETOP+1
LDY #0
STY GRBPNT+1
STY GRBPNT
LDA STREND
LDX STREND+1
STA GRBTOP
STX GRBTOP+1
LDA #<TEMPST
LDX #>TEMPST
STA INDEX1
STX INDEX1+1
TVAR CMP TEMPPT
BEQ SVARS
JSR DVAR
BEQ TVAR
SVARS LDA #6+ADDPRC
STA FOUR6
LDA VARTAB
LDX VARTAB+1
PHA
LDA TXTPTR
PHA
JSR DATA
JMP DEFFIN
GETFNM LDA #FNTK
JSR SYNCHR
ORA #128
STA SUBFLG
JSR PTRGT2
STA DEFPNT
STY DEFPNT+1
JMP CHKNUM
FNDOER JSR GETFNM
LDA DEFPNT+1
PHA
LDA DEFPNT
PHA
JSR PARCHK
JSR CHKNUM
PLA
STA DEFPNT
PLA
STA DEFPNT+1
LDY #2
LDA (DEFPNT)Y
STA VARPNT
TAX
INY
LDA (DEFPNT)Y
BEQ ERRGUF
STA VARPNT+1
INY
DEFSTF LDA (VARPNT)Y
PHA
DEY
BPL DEFSTF
LDY VARPNT+1
JSR MOVMF
LDA TXTPTR+1
PHA
LDA TXTPTR
PHA
LDA (DEFPNT)Y
STA TXTPTR
INY
LDA (DEFPNT)Y
STA TXTPTR+1
LDA VARPNT+1
PHA
LDA VARPNT
PHA
JSR FRMNUM
PLA
STA DEFPNT
PLA
STA DEFPNT+1
JSR CHRGOT
BEQ *+5
JMP SNERR
PLA
STA TXTPTR
PLA
STA TXTPTR+1
DEFFIN LDY #0
PLA
STA (DEFPNT)Y
PLA
INY
STA (DEFPNT)Y
PLA
INY
STA (DEFPNT)Y
PLA
INY
STA (DEFPNT)Y
PLA
INY
STA (DEFPNT)Y
RTS
STRD JSR CHKNUM
LDY #0
JSR FOUTC
PLA
PLA
TIMSTR LDA #<LOFBUF
LDY #>LOFBUF
BEQ STRLIT
STRINI LDX FACMO
LDY FACMO+1
STX DSCPNT
STY DSCPNT+1
STRSPA JSR GETSPA
STX DSCTMP+1
STY DSCTMP+2
STA DSCTMP
RTS
STRLIT LDX #34
STX CHARAC
STX ENDCHR
STRLT2 STA STRNG1
STY STRNG1+1
STA DSCTMP+1
STY DSCTMP+2
LDY #255
STRGET INY
LDA (STRNG1)Y
BEQ STRFI1
CMP CHARAC
BEQ STRFIN
CMP ENDCHR
BNE STRGET
STRFIN CMP #34
BEQ STRFI2
STRFI1 CLC
STRFI2 STY DSCTMP
TYA
ADC STRNG1
STA STRNG2
LDX STRNG1+1
BCC STRST2
INX
STRST2 STX STRNG2+1
LDA STRNG1+1
BEQ STRCP
CMP #BUFPAG
BNE PUTNEW
STRCP TYA
JSR STRINI
LDX STRNG1
LDY STRNG1+1
JSR MOVSTR
PUTNEW LDX TEMPPT
CPX #TEMPST+STRSIZ+STRSIZ+STRSIZ
BNE PUTNW1
LDX #ERRST
ERRGO2 JMP ERROR
PUTNW1 LDA DSCTMP
STA 0,X
LDA DSCTMP+1
STA 1,X
LDA DSCTMP+2
STA 2,X
LDY #0
STX FACMO
STY FACMO+1
STY FACOV
DEY
STY VALTYP
STX LASTPT
INX
INX
INX
STX TEMPPT
RTS
GETSPA LSR GARBFL
TRYAG2 PHA
EOR #255
SEC
ADC FRETOP
LDY FRETOP+1
BCS TRYAG3
DEY
TRYAG3 CPY STREND+1
BCC GARBAG
BNE STRFRE
CMP STREND
BCC GARBAG
STRFRE STA FRETOP
STY FRETOP+1
STA FRESPC
STY FRESPC+1
TAX
PLA
RTS
GARBAG LDX #ERROM
LDA GARBFL
BMI ERRGO2
JSR GARBA2
LDA #128
STA GARBFL
PLA
BNE TRYAG2
GARBA2 LDX MEMSIZ
LDA MEMSIZ+1
FNDVAR STX FRETOP
STA FRETOP+1
LDY #0
STY GRBPNT+1
STY GRBPNT
LDA STREND
LDX STREND+1
STA GRBTOP
STX GRBTOP+1
LDA #<TEMPST
LDX #>TEMPST
STA INDEX1
STX INDEX1+1
TVAR CMP TEMPPT
BEQ SVARS
JSR DVAR
BEQ TVAR
SVARS LDA #6+ADDPRC
STA FOUR6
LDA VARTAB
LDX VARTAB+1
.END

+ 156
- 156
BASIC_C64/code15 View File

@@ -1,158 +1,158 @@
.PAG 'CODE15'
STA INDEX1
STX INDEX1+1
SVAR CPX ARYTAB+1
BNE SVARGO
CMP ARYTAB
BEQ ARYVAR
SVARGO JSR DVARS
BEQ SVAR
ARYVAR STA ARYPNT
STX ARYPNT+1
LDA #STRSIZ
STA FOUR6
ARYVA2