print_hi:
phb.q
sbs
and
mov b, d
mov (b),
inb
lea d, (sp+1)
mov f,
jsr print_hex
mov.q (b), (a)
mov.q (b+8), (a+8)
add b,
mov.w (b),
add b,
tba a
ads
plb.q
rts
print_lo:
pha.q
phb.q
phx.q
sbs
and
tab
lea d, (sp+1)
lea x, (sp+3)
@loop:
lea f, 2
mov s, b
jsr print_hex
mov.w (x), (a)
add x,
inb
cpb
bcs @end
@loop1:
mov (x),
inx
bra @loop
@end:
mov (x),
lea d, (sp+3)
lea s, (buffer)+y
jsr print_sfast
ads
plx.q
plb.q
pla.q
rts
print_chunk:
pha.q
phb.q
phx.q
phy.q
sbs
and
tab
mov x, d
mov y, s
lea d, (sp+1)
xor s, s
@loop:
lea f, 2
mov s, (y+b)
jsr print_hex
mov.w (x), (a)
add x,
inb
cpb
beq @end
mov (x),
inx
bra @loop
@end:
mov (x),
ads
ply.q
plx.q
plb.q
pla.q
rts
print_hex:
phb.q
phx.q
phy.q
lea b, hex_char
and f, f
set x, eq
mne f,
mov a, f
add a, d
@loop:
mov y, s
and y,
dec
mov (a), (b+y)
lsr s,
bne @loop1
@isauto:
and x, x
bne @end
@loop1:
cpx
sbc f,
mov y, f
or y, x
bne @loop
@end:
ply.q
plx.q
plb.q
rts
charcpy:
ldx idx3
sta strbuf, x
inc idx3
rts
strcmpg:
lea strcmp
mov.q d, ptr
bra gargs
strcaseg:
lea strcasecmp
mov.q d, ptr
bra gargs
gargs:
mov s, a
and
tab
jsr (e)
rts
strtoullg:
ldb.q ptr3
phb.q
pha
and
tab
jsr strtoull
tab
pla
pla.q
tba
pha.q
and
tab
pla.q
rts
isdelm2:
ldx
@loop:
ldb dtab2, x
beq @other
cmp b
beq @r1
inx
bra @loop
@other:
ldx
cmp
beq @r1
cmp
beq @r2
cmp
beq @r2
@r0:
lda
rts
@r1:
ldx
lda
rts
@r2:
lda
rts
isdelm:
ldx
@loop:
ldb dtab, x
beq @other
cmp b
beq @rshft
inx
bra @loop
@other:
ldx
cmp
beq @rshft
ldx
cmp
beq @rshft
ldx
@r0:
lda
rts
@rshft:
lda
phx
lsl sp+1
plx
ldx
rts
isesc:
ldy.w idx0
lda (ptr), y
cmp
bne @false
@dec:
dey
lda (ptr), y
iny
cmp
beq @false
lda
rts
@false:
and
rts
is_altok:
sec
sbc
and
cmp
bcc @r1
beq @r1
@r0:
lda
rts
@r1:
lda
rts
get_ptok:
ldx
jsr tolower
@loop:
ldb ptok_tab, x
beq @other
cmp b
beq @rtab
inx
bra @loop
@rtab:
txa
rts
@other:
tab
jsr isdigit
bne @rnum
tba
jsr islower
bne @ralph
lda
rts
@rnum:
lda
rts
@ralph:
lda
rts
get_ctrlidx:
sub
tax
and
cpx
lea ct_rtb, x
lcc (e)
leq (e)
cmp
leq
rts
findramend:
and
@loop:
mov a, (d)
mov (d),
cmp (d),
bne @moveback
mov (d), a
add.w d,
bra @loop
@moveback:
dec d
mov a, (d)
mov (d),
cmp (d),
bne @moveback
mov (d), a
@end:
mov a, d
rts
print_sfast:
pha.q
and
@loop:
inc
cmp (d+a-1),
beq @end
mov (s+a-1), (d+a-1)
mov scr, (d+a-1)
bra @loop
@end:
pla.q
rts