Files
Shawn Quick dfcaae62dd Add qlink, the disk tools, and a bootable ProDOS 8 image.
Move the assembler to src/qasm. qlink links OMF 1.0 and 2.0 from a script. makeBin flattens a load file, qomf dumps OMF, and qpro builds ProDOS volumes. APW and MPW assemble through the ORCA front end. Relocatable modules emit OMF objects. Listings stay off unless -l is set.

make boot assembles the GS/OS 6.0.1 ProDOS 8 kernel and BASIC.SYSTEM into an 800K volume. BASIC.SYSTEM accepts ls and pfx, and its splash reports PRODOS BASIC 2.0, copyright 1983-2026. IIGS.601.SRC is the source and the BASIC.SYSTEM oracle that image is built from.
2026-10-16 14:41:55 -07:00

1 line
8.7 KiB
Plaintext

***************************************************************
*
* TextEdit.macros
*
* New file 26-Sep-90
* Dave Lyons
*
* Copyright Apple Computer, Inc 1990
* All Rights Reserved
*
***************************************************************
*
* We're moving to a standardized all.macros file that contains
* just the M16.xxx files, so here are the macros that Text Edit
* needs that aren't in there.
*
***************************************************************
****************************************************************
*
* macro for derefing a handle
*
****************************************************************
;---------------------------------------------------------
MACRO
Deref &handle,&ptr,&flags
IF &flags<>'Y=2' THEN
ldy #2
ENDIF
IF &handle=&ptr THEN
lda [&handle],y
tax
lda [&handle]
sta &ptr
stx &ptr+2
ELSEIF &ptr='PUSH' THEN
lda [&handle],y
pha
lda [&handle]
pha
ELSE
lda [&handle],y
sta &ptr+2
lda [&handle]
sta &ptr
ENDIF
MEND
****************************************************************
* Dave's macro file.
*
*
*
* 13 Dec 88 David Good
*
* Cleaned up for release as a standard include file. Removed
* old aliases and changed the tab stops
*
*
*
* 20 Jan 89 David Good
*
* Added code to addl to check for the 2nd parameter being a
* constant
*
****************************************************************
;---------------------------------------------------------
MACRO
OptionBreak &A
pha
lda >$00C061
and #$0080
beq @1
brk &A
@1 pla
MEND
;---------------------------------------------------------
;;; 1/8/92 JCM - I'm now using PROCNAME instead of ROUTINE so we can generate real
;;; GSBug-style inline function names, so this is now obsolete.
;;;
;;; MACRO
;;;&lab Routine &A
;;;&lab PROC &A
;;; IF DebugFlag<>0 THEN
;;; jml @1
;;; dc.b '&lab',0
;;;@1
;;; ENDIF
;;; MEND
;;;
;---------------------------------------------------------------
****************************************************************
*
* macros for branching on conditions that take more than one
* instruction. macros for LONG conditional branching
*
****************************************************************
;---------------------------------------------------------
MACRO
ble &A
blt &A
beq &A
MEND
;---------------------------------------------------------
MACRO
bgt &A
beq @dontTake
bge &A
@dontTake
MEND
;---------------------------------------------------------
MACRO
bcsl &A
bcc @dontTake
brl &A
@dontTake
MEND
;---------------------------------------------------------
MACRO
bccl &A
bcs @dontTake
brl &A
@dontTake
MEND
;---------------------------------------------------------
MACRO
beql &A
bne @dontTake
brl &A
@dontTake
MEND
;---------------------------------------------------------
MACRO
bnel &A
beq @dontTake
brl &A
@dontTake
MEND
;---------------------------------------------------------
MACRO
bltl &A
bge @dontTake
brl &A
@dontTake
MEND
;---------------------------------------------------------
MACRO
bgel &A
blt @dontTake
brl &A
@dontTake
MEND
;---------------------------------------------------------
MACRO
bmil &A
bpl @dontTake
brl &A
@dontTake
MEND
;---------------------------------------------------------
MACRO
bpll &A
bmi @dontTake
brl &A
@dontTake
MEND
;---------------------------------------------------------
MACRO
blel &A
blt @takeBranch
bne @dontTake
@takeBranch brl &A
@dontTake
MEND
;---------------------------------------------------------
MACRO
bgtl &A
blt @dontTake
beq @dontTake
brl &A
@dontTake
MEND
;---------------------------------------------------------
****************************************************************
*
* macros for pushing things on the stack in a way that saves
* bytes
*
****************************************************************
;---------------------------------------------------------
MACRO
PushLongSpace
pha
pha
MEND
;---------------------------------------------------------
MACRO
PushWordSpace
pha
MEND
;---------------------------------------------------------
MACRO
PushAX
phx
pha
MEND
;---------------------------------------------------------
MACRO
PullAX
pla
plx
MEND
;---------------------------------------------------------
MACRO
PushZPtr &A
pea $0000
tdc
clc
adc #&A
pha
MEND
;---------------------------------------------------------
MACRO
PushZLong &A
pei &A+2
pei &A
MEND
;---------------------------------------------------------
MACRO
PushZWord &A
pei &A
MEND
;---------------------------------------------------------------
****************************************************************
*
* macros that use A and X to do four byte operations
*
****************************************************************
;---------------------------------------------------------
MACRO
ldaxZPtr &A
ldx #0
tdc
clc
adc #&A
MEND
;---------------------------------------------------------
MACRO
ldax &addr,&regs
IF &addr[1:1]='#' THEN
lda #&addr[2:255]
ldx #&addr[2:255]>>16
ELSEIF &addr[1:1]='[' THEN
IF &regs='y' THEN
lda &addr,y
pha
iny
iny
lda &addr,y
tax
pla
ELSE
ldy #&regs+2
lda &addr,y
tax
ldy #&regs
lda &addr,y
ENDIF
ELSEIF &regs='s' THEN
lda &addr+2,s
tax
lda &addr,s
ELSEIF &regs='' THEN
lda &addr
ldx &addr+2
ELSE
lda &addr+2,&offset
pha
lda &addr,&offset
plx
ENDIF
MEND
;---------------------------------------------------------
MACRO
stax &addr,&regs
IF &addr[1:1]='[' THEN
IF &regs='y' THEN
sta &addr,y
iny
iny
txa
sta &addr,y
ELSE
ldy #&regs
sta &addr,y
txa
ldy #&regs+2
sta &addr,y
ENDIF
ELSEIF &regs='s' THEN
sta &addr,s
txa
sta &addr+2,s
ELSEIF &regs='' THEN
sta &addr
stx &addr+2
ELSE
sta &addr,&offset
txa
sta &addr+2,&offset
ENDIF
MEND
;---------------------------------------------------------
MACRO
cmpl &A,&B
IF &B='' THEN
cpx &A+2
bne @1
cmp &A
ELSE
lda &A+2
cmp &B+2
bne @1
lda &A
cmp &B
ENDIF
@1
MEND
;---------------------------------------------------------
MACRO
incl &A
IF &A='a' THEN
inc a
bne @1
inx
ELSE
inc &A
bne @1
inc &A+2
ENDIF
@1
MEND
;---------------------------------------------------------
MACRO
decl &A
IF &A='a' THEN
cmp #0
bne @1
dex
@1 dec a
ELSE
lda &A
bne @2
dec &A+2
@2 dec &A
ENDIF
MEND
;---------------------------------------------------------
MACRO
stzl &A
stz &A
stz &A+2
MEND
;---------------------------------------------------------
MACRO
subl &A,&B,&C
lda &A
sec
sbc &B
sta &C
lda &A+2
sbc &B+2
sta &C+2
MEND
;---------------------------------------------------------
MACRO
addl &A,&B,&C
IF &C='' ** &B='' THEN
clc
adc &A
sta &A
bcc @1
inc &A+2
@1
ELSEIF &B[1:1]='#' THEN
lda &A
clc
adc #&B[2:255]
sta &C
lda &A+2
adc #&B[2:255]>>16
sta &C+2
ELSE
lda &A
clc
adc &B
sta &C
lda &A+2
adc &B+2
sta &C+2
ENDIF
MEND
;---------------------------------------------------------
MACRO
subw &A,&B,&C
lda &A
sec
sbc &B
sta &C
MEND
;---------------------------------------------------------
MACRO
addw &A,&B,&C
lda &A
clc
adc &B
sta &C
MEND
;---------------------------------------------------------
MACRO
mov &A,&B
lda &A
sta &B
MEND
;---------------------------------------------------------
MACRO
swap &A,&B
lda &A
pha
lda &B
sta &A
pla
sta &B
MEND
;---------------------------------------------------------
MACRO
swapl &A,&B
swap &A,&B
swap &A+2,&B+2
MEND
;---------------------------------------------------------
MACRO
movl &A,&B
mov &A,&B
mov &A+2,&B+2
MEND
;---------------------------------------------------------------
****************************************************************
*
* macros for determining the size of records
*
****************************************************************
;---------------------------------------------------------
MACRO
SizeOf &A
Fake&sysndx RECORD 0
a ds &A
b ds.b 1
ENDR
theSize set &concat('fake',&sysndx,'.b')
ENDM
;---------------------------------------------------------
MACRO
PushLongSizeOf &A
SizeOf &A
PushLong #theSize
ENDM
;---------------------------------------------------------
MACRO
PushWordSizeOf &A
SizeOf &A
PushWord #theSize
ENDM
;---------------------------------------------------------
MACRO
LDASizeOf &A
SizeOf &A
lda #theSize
ENDM
;---------------------------------------------------------
MACRO
LDAXSizeOf &A
SizeOf &A
ldax #theSize
ENDM
;---------------------------------------------------------