mirror of
https://github.com/antoinevignau/source.git
synced 2025-01-06 01:31:57 +00:00
1 line
126 KiB
Plaintext
1 line
126 KiB
Plaintext
|
PRINT PUSH
PRINT OFF
**********************************************************************
*
* All.Macros
*
* This file contains all the tool macros and the utility macros
* that we use to build system tools and the ROM.
*
**********************************************************************
**********************************************************************
*
* OUR MACROS
*
* Macros used by the toolbox group in making system software.
*
* These include most of the M16.Utility macros by Lou Infeld,
* the dummy section macros by Steve Glass and Don Marsh and the
* PushPtr macro.
*
**********************************************************************
*************************************************************************
* *
* Apple //GS Utility Macros *
* by *
* Lou Infeld *
* *
* Copyright Apple Computer, Inc. 1986-1988 *
* All Rights Reserved *
* *
* Revision History *
* ---------------- *
* v1.0R1 (04/29/87) -- First Release *
* This file is a subset of the old *
* 'M16.Utility' *
* v2.0R1 (01/22/88) -- First AsmIIGS release *
* v2.0R2 (02/11/88) -- "writelin" renamed "writeline" *
* v2.0R3 (03/29/88) -- "|" added to pea instrs to avoid Assembler *
* warning *
* "pushlong" was incorrect if &offset was "s" *
* or not specified *
* v2.0R4 (04/14/88) -- "writestr" and "writeline" didn't restore *
* STRING setting *
* v2.0R5 (06/15/88) -- "pushlong" was incorrect for stack relative *
*
* (Long and Short Removed by SEG)
*************************************************************************
;...............................................................
;
; Pull 3 bytes from stack
;
; pull3 addr -- pulls bytes off stack and stores in 'loc'
;...............................................................
MACRO
pull3 &addr
pull1 &addr
pullword &addr+1
MEND
;...............................................................
;
; Pull 1 byte from stack
;
; pull1 loc -- pulls byte off stack and stores in 'loc'
; pull1 loc,x -- pulls byte off stack and stores in 'loc,x'
; pull1 -- pulls byte off stack and leaves in A
;...............................................................
MACRO
pull1 &addr,®
shortm
pullword &addr,®
longm
MEND
;...............................................................
;
; Push 1 byte onto stack
;
; push1 loc -- pushes byte onto stack from 'loc'
; push1 loc,x -- pushes byte onto stack from 'loc,x'
; push1 #n -- pushes constant #n onto stack
; push1 -- pushes byte onto stack (from A)
;...............................................................
MACRO
push1 &addr,®
shortm
pushword &addr,®
longm
MEND
;...............................................................
;
; Push 3 bytes onto stack
;
; push3 addr -- pushes bytes onto stack from 'loc'
; push3 addr,x -- pushes bytes onto stack from 'loc,x'
; push3 #n -- pushes constant #n onto stack
;...............................................................
MACRO
push3 &addr,®
IF ®<65>'' THEN
lda &addr+1,®
pha
phb
lda &addr,®
sta 1,s
ELSEIF &addr[1:1]='#' THEN
lda #&addr[2:255]>>8
pha
GOTO .a
ELSE
lda &addr+1
pha
.a phb
lda &addr
sta 1,s
ENDIF
MEND
;...............................................................
;
; Add 2 byte integers
;
; add loc1,loc2,loc3 - adds 'loc1' to 'loc2' and stores in 'loc3'
; add loc1,loc2 - adds 'loc1' to 'loc2' and leaves in A
; add ,loc2,loc3 - adds A with 'loc2' and stores in 'loc3'
;
; 'loc1' and 'loc2' can be constants
;...............................................................
MACRO
add &a1,&a2,&a3
IF &a1<61>'' THEN
lda
|