antoine-source/appleworksgs/IW.CL/Src/all.macros

1 line
126 KiB
Plaintext
Raw Normal View History

2023-03-04 02:45:20 +00:00
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,&reg shortm pullword &addr,&reg 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,&reg shortm pushword &addr,&reg 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,&reg IF &reg<65>'' THEN lda &addr+1,&reg pha phb lda &addr,&reg 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