AppleIIAsm-Collection/source/disk5_strings/T.MIN.SUB.STRCOMP
nathanriggs c8cac53c5e Rev 0.4 updates
Massive updates that changes the way most subroutines are handled. Major bugfixes, various utilities added, started higher-level libraries.
2019-04-26 18:49:10 -04:00

48 lines
876 B
Plaintext

STRCMP
PLA
STA RETADR
PLA
STA RETADR+1
PLA
STA ADDR2
PLA
STA ADDR2+1
PLA
STA ADDR1
PLA
STA ADDR1+1
LDY #0
LDA (ADDR1),Y
CMP (ADDR2),Y
BCC :BEGCMP
LDA (ADDR2),Y
:BEGCMP
TAX
BEQ :TSTLEN
LDY #1
:CMPLP
LDA (ADDR1),Y
CMP (ADDR2),Y
BNE :EXIT
INY
DEX
BNE :CMPLP
:TSTLEN
LDY #0
LDA (ADDR1),Y
CMP (ADDR2),Y
:EXIT
LDA RETADR+1
PHA
LDA RETADR
PHA
LDY #0
LDA (ADDR1),Y
TAX
LDA (ADDR2),Y
TAY
RTS