home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 97
/
097.d81
/
instr.s
< prev
next >
Wrap
Text File
|
2022-08-26
|
1KB
|
125 lines
open =$ffc0
readst =$ffb7
setlfs =$ffba
setnam =$ffbd
load =$ffd5
getin =$ffe4
clrchn =$ffcc
close =$ffc3 ;a
chrin =$ffcf
chkout =$ffc9 ;x
chkin =$ffc6 ;x
plot =$fff0
chrout =$ffd2
color'pointer =243
screen'line'pointer =209
print'number =$bdcd ;x,a
clear'line =59903
background =53281
border =53280
unlisten =$ffae
clall =$ffe7
loc1 =253
loc2 =$22
.org $cd00
.obj "instr cd00"
jmp start
jmp continue
start jsr get'string
stx loc1
sty loc1+1
sta len1
jsr get'string
sta len2
stx orig
sty orig+1
lda #0
sta 251
lda len2
sec
sbc len1
sta diff
lda len1
cmp len2
bcc search
rts
search ldy #0
loop lda (loc1),y
and #127
sta temp
lda (loc2),y
and #127
cmp temp
bne failed
iny
cpy len1
bcc loop
cmp temp
beq +
rts
+ lda loc2
sec
sbc orig
clc
adc #1
sta 251
cmp len2
bcc +
beq +
lda #0
sta 251
+ lda loc2
sta storage
lda loc2+1
sta storage+1
stx tempx
rts
failed dex
bne +
rts
+ inc loc2
bne +
inc loc2+1
+ ldy #0
jmp loop
continue lda #0
sta 251
lda storage
sta loc2
lda storage+1
sta loc2+1
ldx tempx
bne failed
rts
;***** get string from BASIC ****
get'string jsr $aefd
jsr $ad9e
jsr $b6a3
ldx $22
ldy $23
rts
len1 .byt 0
len2 .byt 0
temp .byt 0
diff .byt 0
orig .word 0
storage .byt 0,0
tempx .byt 0