mirror of
https://github.com/nathanriggs/AppleIIAsm-Collection.git
synced 2024-12-02 12:52:03 +00:00
c8cac53c5e
Massive updates that changes the way most subroutines are handled. Major bugfixes, various utilities added, started higher-level libraries.
80 lines
1.5 KiB
Plaintext
80 lines
1.5 KiB
Plaintext
SUBPOS
|
|
PLA
|
|
STA RETADR
|
|
PLA
|
|
STA RETADR+1
|
|
PLA
|
|
STA ADDR2
|
|
PLA
|
|
STA ADDR2+1
|
|
PLA
|
|
STA ADDR1
|
|
PLA
|
|
STA ADDR1+1
|
|
LDA RETADR+1
|
|
PHA
|
|
LDA RETADR
|
|
PHA
|
|
:POS
|
|
LDY #0
|
|
LDA (ADDR1),Y
|
|
BEQ :NOTFND
|
|
STA :SLEN
|
|
LDA (ADDR2),Y
|
|
BEQ :NOTFND
|
|
STA :SUBLEN
|
|
LDA :SUBLEN
|
|
CMP :SLEN
|
|
BEQ :LENOK
|
|
BCS :NOTFND
|
|
|
|
:LENOK
|
|
LDA #1
|
|
STA :SINDEX
|
|
|
|
LDA :SLEN
|
|
|
|
SEC
|
|
SBC :SUBLEN
|
|
STA :SCOUNT
|
|
INC :SCOUNT
|
|
:SLP1
|
|
LDA :SINDEX
|
|
STA :SIDX
|
|
LDA #1
|
|
STA :SUBIDX
|
|
:CMPLP
|
|
LDY :SIDX
|
|
LDA (ADDR1),Y
|
|
LDY :SUBIDX
|
|
CMP (ADDR2),Y
|
|
BNE :SLP2
|
|
LDY :SUBIDX
|
|
CPY :SUBLEN
|
|
BEQ :FOUND
|
|
INY
|
|
STY :SUBIDX
|
|
INC :SIDX
|
|
JMP :CMPLP
|
|
:SLP2
|
|
INC :SINDEX
|
|
DEC :SCOUNT
|
|
BNE :SLP1
|
|
BEQ :NOTFND
|
|
:FOUND
|
|
LDA :SINDEX
|
|
JMP :EXIT
|
|
:NOTFND
|
|
LDA #0
|
|
:EXIT
|
|
STA RETURN
|
|
LDY #1
|
|
STY RETLEN
|
|
RTS
|
|
:SLEN DS 1
|
|
:SUBLEN DS 1
|
|
:SINDEX DS 1
|
|
:SUBIDX DS 1
|
|
:SCOUNT DS 1
|
|
:SIDX DS 1
|