assembler - use named tool macros

This commit is contained in:
Kelvin Sherlock 2020-01-05 19:10:27 -05:00
parent 1fe4590e2c
commit a0bc5de359
6 changed files with 173 additions and 147 deletions

View File

@ -20,7 +20,7 @@ asm php
:getlen pha
pha
psl filehandle
tll $1802
_GetHandleSize
plx
ply
jcs :incerr
@ -876,7 +876,7 @@ printline php
pha
_QATabToCol
psl #opcode
tll $1c0c
_WriteString
lda tabs+2
and #$ff
pha
@ -887,7 +887,7 @@ printline php
dec linebuff
rep $20
psl #linebuff
tll $1c0c
_WriteString
:comment rep $30
lda tabs+3
and #$ff
@ -895,7 +895,7 @@ printline php
_QATabToCol
:comment1 rep $30
psl #comment
tll $1c0c
_WriteString
:xit rep $30
jsr printcycles
lda #$0d
@ -1260,7 +1260,7 @@ getmemory
pha
pea $8000 ;locked page aligned
psl #$00
tll $0902
_NewHandle
plx
ply
bcc :m1out
@ -1294,7 +1294,7 @@ getmemory
pha
pea $8000 ;locked page aligned no bank cross
psl #$00
tll $0902
_NewHandle
plx
ply
bcc :m2out
@ -1328,7 +1328,7 @@ getmemory
pha
pea $8000
psl #$00
tll $0902
_NewHandle
plx
ply
bcc :m3out
@ -1362,8 +1362,8 @@ getmemory
sec
ror :purgeflag
pea $00
tll $1302 ;purgeall
tll $1f02 ;compactmem
_PurgeAll
_CompactMem
clc
rts
:psec sec
@ -1374,15 +1374,15 @@ disposemem php
ldal userid
ora #memid
pha
_disposeall
_DisposeAll
ldal userid
ora #putid
pha
_disposeall
_DisposeAll
ldal userid
ora #useid
pha
_disposeall
_DisposeAll
plp
rts
@ -1605,7 +1605,7 @@ inclablect php
pha
pea $8004 ;page aligned/locked
psl #$00
tll $0902
_NewHandle
plx
ply
jcs :sec

View File

@ -162,13 +162,13 @@ dskop php
pha
lda objhdl
pha
_hunlock
_HUnlock
psl #dskobjsize+1
lda objhdl+2
pha
lda objhdl
pha
tll $1902 ;set handlesize
_SetHandleSize
lda #dskobjsize
sta objsize
lda objhdl+2
@ -177,7 +177,7 @@ dskop php
lda objhdl
sta workspace
pha
_hlock
_HLock
ldy #$02
lda [workspace]
sta objzpptr
@ -841,7 +841,7 @@ putop php
lda userid
ora #putid
pha
_disposeall
_DisposeAll
sec
ror :purgeflag
lda #$0000
@ -877,7 +877,7 @@ putop php
lda putbuffer+2,x
sta workspace+2
pha
_hlock
_HLock
plx
lda fileptr
sta putbuffer+4,x
@ -898,7 +898,7 @@ putop php
psl #$00
pei workspace+2
pei workspace
tll $1802 ;gethandlesize
_GetHandleSize
plx
ply
cpx #$00
@ -1009,7 +1009,7 @@ useop php
lda usebuffer+2,x
sta workspace+2
pha
_hlock
_HLock
plx
lda fileptr
sta usebuffer+4,x
@ -1030,7 +1030,7 @@ useop php
psl #$00
pei workspace+2
pei workspace
tll $1802 ;gethandlesize
_GetHandleSize
plx
ply
cpx #$00
@ -1110,7 +1110,7 @@ putend php
phx
pei workspace+2
pei workspace
_hunlock
_HUnlock
plx
lda putbuffer+4,x
sta fileptr

View File

@ -729,7 +729,7 @@ dodiv php
pha
lda xreg
pha
tll $0d0b
_LongDivide
pla
sta xreg
pla
@ -765,7 +765,7 @@ domod php
pha
lda xreg
pha
tll $0d0b
_LongDivide
pla
pla
pla

View File

@ -76,7 +76,7 @@ start php
lda userid
ora #asmmemid
pha
_disposeall
_DisposeAll
pla
pld
plb
@ -328,7 +328,7 @@ printdec php
psl #:str
pea #11
pea $00
tll $270b
_Long2Dec
sep $30
ldy #$00
ldx #$00
@ -347,7 +347,7 @@ printdec php
rep $30
jsr drawchar
* pha
* tll $180c
* _WriteChar
sep $30
plx
ply

View File

@ -1,134 +1,160 @@
_DisposeAll MAC
tll $1102
<<<
_DisposeAll MAC
tll $1102
<<<
_HLock MAC
tll $2002
<<<
_HUnlock MAC
tll $2202
<<<
_GetHandleSize MAC
tll $1802
<<<
_SetHandleSize MAC
tll $1902
<<<
_NewHandle MAC
tll $902
<<<
_ReadTimeHex MAC
tll $D03
<<<
_ReadAsciiTime MAC
tll $F03
<<<
_SysBeep MAC
tll $2C03
<<<
_HLock MAC
tll $2002
<<<
_HUnlock MAC
tll $2202
<<<
_Long2Dec MAC
tll $270B
<<<
_LongDivide MAC
tll $D0B
<<<
_SANEFP816 MAC
tll $90A
<<<
_SANEDecStr816 MAC
tll $A0A
<<<
_SANEFP816 MAC
tll $90A
<<<
_SANEDecStr816 MAC
tll $A0A
<<<
FOPRF MAC ;call FP
PEA ]1
_SANEFP816
<<<
FOPRD MAC ;call DecStr
PEA ]1
_SANEDecStr816
<<<
FOPRF MAC ;call FP
PEA ]1
_SANEFP816
<<<
FOPRD MAC ;call DecStr
PEA ]1
_SANEDecStr816
<<<
FDEC2X MAC
FOPRF $009
<<<
FPSTR2DEC MAC ;pascal string to decimal record
FOPRD 0
<<<
FDEC2X MAC
FOPRF $009
<<<
FPSTR2DEC MAC ;pascal string to decimal record
FOPRD 0
<<<
_setmark MAC
jsl $e100a8
da $16
adrl ]1
<<<
_getmark MAC
jsl $e100a8
da $17
adrl ]1
<<<
_getprefix MAC
jsl $e100a8
da $0a
adrl ]1
<<<
_setmark MAC
jsl $e100a8
da $16
adrl ]1
<<<
_create MAC
jsl $e100a8
da $01
adrl ]1
<<<
_getmark MAC
jsl $e100a8
da $17
adrl ]1
<<<
_setfileinfo MAC
jsl $e100a8
da $05
adrl ]1
<<<
_getfileinfo MAC
jsl $e100a8
da $06
adrl ]1
<<<
_getprefix MAC
jsl $e100a8
da $0a
adrl ]1
<<<
_open MAC
jsl $e100a8
da $10
adrl ]1
<<<
_write MAC
jsl $e100a8
da $13
adrl ]1
<<<
_close MAC
jsl $e100a8
da $14
adrl ]1
<<<
_seteof MAC
jsl $e100a8
da $18
adrl ]1
<<<
_create MAC
jsl $e100a8
da $01
adrl ]1
<<<
opno mac
sec
rts
<<<
_setfileinfo MAC
jsl $e100a8
da $05
adrl ]1
<<<
_getfileinfo MAC
jsl $e100a8
da $06
adrl ]1
<<<
opco mac
db $c9 ; cmp #
usr ]1
bne nope
ldx #]2
ldy #]3
clc
rts
_open MAC
jsl $e100a8
da $10
adrl ]1
<<<
_write MAC
jsl $e100a8
da $13
adrl ]1
<<<
_close MAC
jsl $e100a8
da $14
adrl ]1
<<<
_seteof MAC
jsl $e100a8
da $18
adrl ]1
<<<
opno mac
sec
rts
<<<
opco mac
db $c9 ; cmp #
usr ]1
bne nope
ldx #]2
ldy #]3
clc
rts
nope
<<<
<<<
opcl mac
if $=]1
else
opco ]1;]2;]3
fin
sec
rts
<<<
opcl mac
if $=]1
else
opco ]1;]2;]3
fin
sec
rts
<<<
opcx mac
db $c9 ; cmp #
usr ]1
bne nope
ldx #]2
ldy #^]2
clc
rts
opcx mac
db $c9 ; cmp #
usr ]1
bne nope
ldx #]2
ldy #^]2
clc
rts
nope
<<<
<<<
opcxl mac
opcx ]1;]2
sec
rts
<<<
opcxl mac
opcx ]1;]2
sec
rts
<<<

View File

@ -2350,7 +2350,7 @@ relop rep $30
pha
pea $8000 ;locked page aligned
psl #$00
tll $0902
_NewHandle
plx
ply
bcs :merr01
@ -3813,7 +3813,7 @@ datop rep $30
:dat2 lda passnum
beq :d29
psl #:buffer
tll $0F03
_ReadAsciiTime
:d29 ldy #$00
]lup lda :buffer,y
and #$7f
@ -3844,7 +3844,7 @@ datop rep $30
:dat4 lda passnum
beq :d49
psl #:buffer
tll $0F03
_ReadAsciiTime
:d49 ldy #$00
]lup lda :buffer,y
and #$7f
@ -3864,7 +3864,7 @@ datop rep $30
pha
pha
pha
tll $0d03
_ReadTimeHex
lda 1,s
jsr putbyte
pla
@ -3906,7 +3906,7 @@ datop rep $30
pha
pha
pha
tll $0d03
_ReadTimeHex
lda 1,s
and #$ff
jsr :num
@ -4297,7 +4297,7 @@ pauop sep $30
rts
mx %00
belop tll $2c03
belop _SysBeep
lda #$80
trb listflag+1
clc