subasm:
pha.q
des
and
lea d, (cmd_buf)
lea s, (sp+1)
jsr chk_shcmd
bne @cmd
jsr chk_cmd
bne @cmd
mov.q ptr, d
psh d
psh s
psh f
jsr lex
pul d
pul s
pul f
bra @end
@cmd:
mov s, (s)
cmp s,
bcs @end
lea b, cmd_srt
mov.w s, (b+2*s)
and
tab
jsr s
@end:
and
jsr update_ptr
tay
ins
pla.q
rts
chk_shcmd:
phb.q
lea b, sh_cmds
mov a, (d)
beq @false
cmp
beq @false
jsr tolower
@loop:
cmp (b),
beq @false
cmp a, (b)
beq @found
inb
bra @loop
@found:
sub.w b,
mov (s), b
mov a, (d+1)
beq @true
cmp
beq @true
@false:
and
bra @end
@true:
lda
@end:
plb.q
rts
chk_cmd:
phb.q
phx.q
phy.q
and
tab
mov x, s
mov y, d
lea s, cmds
@loop:
jsr strcasecmp
beq @true
inb
cpb
bcs @false
@getlen:
mov d, s
jsr strlen
mov d, y
inc
add s, a
bra @loop
@true:
lda
bra @end
@false:
lda
@end:
mov s, x
mov (s), b
and a, a
ply.q
plx.q
plb.q
rts
viewmem:
pha.q
phb.q
phx.q
sbs
and
tab
ldx.q prg_cnt
lda
sta scr_col
jsr update_pos
jsr print_lo
@loop:
lda
jsr print_char
lea d, (sp+1)
mov s, x
jsr print_hi
mov d, a
mov s, x
jsr print_chunk
lea d, (sp+1)
lea s, (buffer)+y
jsr print_sfast
inb
cpb
beq @end
add x,
and
bra @loop
@end:
lda
jsr print_char
ads
plx.q
plb.q
pla.q
rts
list:
nop
@end:
rts
asm:
nop
@end:
rts
help:
nop
@end:
rts
instruction:
nop
@end:
rts
run:
nop
@end:
rts
set_val:
nop
@end:
rts