mirror of
https://github.com/antoinevignau/source.git
synced 2024-10-05 00:55:40 +00:00
1 line
16 KiB
Plaintext
1 line
16 KiB
Plaintext
|
; M16.MOVE <09>Converted APW macros
;---------------------------------------------------------------------------
; Move a word as a fixedpoint
;
MACRO
&lab MoveFixWord &from,&to
stz &to
moveword &from,&to+2
MEND
;--------------------------------------------------------------------------
; Move a 3 byte address
;
MACRO
&lab MoveAddr &from,&to
lclc &char
lclc &newfrom
&char setc &substr(&from,1,1)
IF &char<61>'#' GOTO .normal
&newfrom setc &substr(&from,2,&len(&from)-1)
moveword #<&newfrom,&to
moveword #>&newfrom,&to+1
mexit
.normal
moveword &from,&to
moveword &from+1,&to+1
MEND
;.........................................................................;
MACRO
&lab MoveX &from,&to
&lab ;
lclc &char
lclc &from1
lclc &to1
lclc &from2
lclc &to2
&from1 setc &concat(&from,'+4')
&to1 setc &concat(&to,'+4')
&from2 setc &concat(&from,'+8')
&to2 setc &concat(&to,'+8')
&char setc &substr(&from,&len(&from),1)
IF &char<61>']' GOTO .chk2
&from1 setc &concat(&from,':#4')
&from2 setc &concat(&from,':#8')
.chk2
&char setc &substr(&to,&len(&to),1)
IF &char<61>']' GOTO .domove
&to1 setc &concat(&to,':#4')
&to2 setc &concat(&to,':#8')
.domove
movelong &from,&to
movelong &from1,&to1
moveword &from2,&to2
MEND
;.........................................................................;
MACRO
&lab moverect &from,&to
&lab ;
lclc &char
lclc &from1
lclc &to1
&from1 setc &concat(&from,'+4')
&to1 setc &concat(&to,'+4')
&char setc &substr(&from,&len(&from),1)
IF &char<61>']' GOTO .chk2
&from1 setc &concat(&from,':#4')
.chk2
&char setc &substr(&to,&len(&to),1)
IF &char<61>']' GOTO .domove
&to1 setc &concat(&to,':#4')
.domove
movelong &from,&to
movelong &from1,&to1
MEND
;.........................................................................;
MACRO
&lab movel &from,&to
&lab ;
movelong &from,&to
MEND
MACRO
&lab movew &from,&to
&lab ;
moveword &from,&to
MEND
MACRO
&lab moveb &from,&to
&lab ;
movebyte &from,&to
MEND
MACRO
&lab mover &from,&to
&lab
MoveRect &from,&to
MEND
;.........................................................................;
MACRO
&lab Movebyte &from,&to
&lab
lclc &newfrom
lcla &ppos
&newfrom setc &from
&ppos seta &pos('.',&newfrom)
IF &ppos=0 GOTO .noeval
eval &newfrom
&newfrom setc 'a'
.noeval
shortm
MoveWord &newfrom,&to
longm
MEND
;.........................................................................;
MACRO
&lab MoveLong &from,&to
&lab ;
lclc &newfrom
&newfrom setc &from
IF &newfrom<6F>'?' GOTO .notfromdc
&newfrom setc 'ax'
.notfromdc
IF &len(&newfrom)<29>&len(&to) GOTO .doreally
lcla &xxp
&xxp seta &pos(&to,&newfrom)
IF not (&xxp) GOTO .doreally
mexit
.doreally
IF &newfrom<6F>'s' GOTO .SCont1
pulllong &to
mexit
.SCont1
IF &to<74>'s' GOTO .SCont2
pushlong &newfrom
mexit
.SCont2
lclc &ldreg
lclc &char2
lclc &foo
&foo setc &substr(&newfrom,&len(&newfrom),1)
&char2 setc &substr(&newfrom,1,1)
IF (&to='ax') GOTO .dorpax
IF (&to='ay') GOTO .dorpay
IF (&to='xy') GOTO .dorpxy
GOTO .doreally2
.dorpax
IF (&newfrom='xy') GOTO .doxy2ax
IF (&newfrom='ay') GOTO .doay2ax
GOTO .dorpax2
.doxy2ax
txa
.d
|