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

View File

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

View File

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

View File

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

View File

@ -1,134 +1,160 @@
_DisposeAll MAC _DisposeAll MAC
tll $1102 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 _Long2Dec MAC
tll $2002 tll $270B
<<< <<<
_HUnlock MAC _LongDivide MAC
tll $2202 tll $D0B
<<< <<<
_SANEFP816 MAC _SANEFP816 MAC
tll $90A tll $90A
<<< <<<
_SANEDecStr816 MAC _SANEDecStr816 MAC
tll $A0A tll $A0A
<<< <<<
FOPRF MAC ;call FP FOPRF MAC ;call FP
PEA ]1 PEA ]1
_SANEFP816 _SANEFP816
<<< <<<
FOPRD MAC ;call DecStr FOPRD MAC ;call DecStr
PEA ]1 PEA ]1
_SANEDecStr816 _SANEDecStr816
<<< <<<
FDEC2X MAC FDEC2X MAC
FOPRF $009 FOPRF $009
<<< <<<
FPSTR2DEC MAC ;pascal string to decimal record FPSTR2DEC MAC ;pascal string to decimal record
FOPRD 0 FOPRD 0
<<< <<<
_setmark MAC
jsl $e100a8
da $16
adrl ]1
<<<
_getmark MAC
jsl $e100a8
da $17
adrl ]1
<<<
_getprefix MAC _setmark MAC
jsl $e100a8 jsl $e100a8
da $0a da $16
adrl ]1 adrl ]1
<<< <<<
_create MAC _getmark MAC
jsl $e100a8 jsl $e100a8
da $01 da $17
adrl ]1 adrl ]1
<<< <<<
_setfileinfo MAC _getprefix MAC
jsl $e100a8 jsl $e100a8
da $05 da $0a
adrl ]1 adrl ]1
<<< <<<
_getfileinfo MAC
jsl $e100a8
da $06
adrl ]1
<<<
_open MAC _create MAC
jsl $e100a8 jsl $e100a8
da $10 da $01
adrl ]1 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 _setfileinfo MAC
sec jsl $e100a8
rts da $05
<<< adrl ]1
<<<
_getfileinfo MAC
jsl $e100a8
da $06
adrl ]1
<<<
opco mac _open MAC
db $c9 ; cmp # jsl $e100a8
usr ]1 da $10
bne nope adrl ]1
ldx #]2 <<<
ldy #]3 _write MAC
clc jsl $e100a8
rts 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 nope
<<< <<<
opcl mac opcl mac
if $=]1 if $=]1
else else
opco ]1;]2;]3 opco ]1;]2;]3
fin fin
sec sec
rts rts
<<< <<<
opcx mac opcx mac
db $c9 ; cmp # db $c9 ; cmp #
usr ]1 usr ]1
bne nope bne nope
ldx #]2 ldx #]2
ldy #^]2 ldy #^]2
clc clc
rts rts
nope nope
<<< <<<
opcxl mac opcxl mac
opcx ]1;]2 opcx ]1;]2
sec sec
rts rts
<<< <<<

View File

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