print_hi:
phb.q
sbs
and
mov b, d
mov (b),
inb
lea d, (sp+1)
mov f,
jsr print_hex
mov.q (b), (d)
mov.q (b+8), (d+8)
add b,
mov.w (b),
add b,
tba
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), (d)
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
tay
ldy
mov x, d
mov b, s
lea d, (sp+1)
@print_hex:
lda
mov f, a
dey
bng @end
mov.q s, (b)
jsr print_hex
add b,
@loop:
sub
mov.w (x), (d+a)
mov (x+2),
add x,
cmp
beq @print_hex
bra @loop
@end:
mov (x-1),
ads
ply.q
plx.q
plb.q
pla.q
rts
print_hex:
pha.q
phb.q
phx.q
phy.q
lea b, hex_char
mov a, f
set x, eq
lne
cmp
lcs
add d, a
@loop:
mov y, s
and y,
dec d
mov (d), (b+y)
lsr s,
bne @loop1
@isauto:
cpx
beq @end
@loop1:
dec
bne @loop
@end:
ply.q
plx.q
plb.q
pla.q
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:
cmp (d+a),
beq @end
mov (s+a), (d+a)
mov scr, (d+a)
inc
bra @loop
@end:
pla.q
rts