mirror of
https://github.com/marketideas/qasm.git
synced 2026-10-24 22:02:28 +00:00
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.
1 line
2.8 KiB
Plaintext
1 line
2.8 KiB
Plaintext
;---------------------------------------------------------------------------
|
|
;
|
|
; DSect Macros
|
|
;
|
|
; By Don Marsh and Steven Glass
|
|
; 11 Sep 87
|
|
;
|
|
; A series of macros to help in making equates. This is
|
|
; useful when you want to define a series of equates that
|
|
; relate to each other. For example, offsets on the stack,
|
|
; locations on direct page, offsets in a record.
|
|
;
|
|
; Normally you would do something like
|
|
;
|
|
; lab1 equ 0
|
|
; lab2 equ lab1+4
|
|
; lab3 equ lab2+2
|
|
; etc.
|
|
;
|
|
; These macros let you do the following
|
|
;
|
|
; DSECT 0
|
|
; lab1 long
|
|
; lab2 word
|
|
; lab3 long
|
|
;
|
|
; The macros do the equating and addition for you. They also make the
|
|
; code more readable.
|
|
;
|
|
; The macro GlobalDSECT makes the equates global rather than
|
|
; local.
|
|
;
|
|
; The macro DSectSize returns the current value of the
|
|
; dummy program counter that is being maintained.
|
|
;
|
|
; The macro DefineStack is like using DSECT 1.
|
|
;
|
|
;
|
|
; DSect &Value
|
|
;
|
|
; Begin local data section. This defines a dummy PC
|
|
; register which can be used in equates to avoid error-
|
|
; prone linked equates for setting up direct page or
|
|
; stack offsets. The dummy PC begins at &Value and
|
|
; is updated by the appropriate amount by the BYTE,
|
|
; WORD, LONG, and BLOCK macros.
|
|
;
|
|
MACRO
|
|
DSect &Value
|
|
DummyPC SET &Value
|
|
MEND
|
|
|
|
|
|
;
|
|
; DefineStack
|
|
;
|
|
; This is a specialized data section which defines
|
|
; a dummy PC starting at 1 in order to define a
|
|
; series of stack offsets using the BYTE, WORD,
|
|
; LONG, and BLOCK macros.
|
|
;
|
|
MACRO
|
|
DefineStack
|
|
DummyPC SET 1
|
|
MEND
|
|
|
|
;
|
|
; &lab byte
|
|
;
|
|
; Equate the given label with the current dummy
|
|
; PC (defined by DSect, GlobalDSect, or
|
|
; DefineStack), and update the dummy PC by the
|
|
; appropriate amount.
|
|
;
|
|
MACRO
|
|
&lab BYTE
|
|
&lab equ DummyPC
|
|
DummyPC SET DummyPC+1
|
|
MEND
|
|
|
|
;
|
|
; &lab word
|
|
;
|
|
; Equate the given label with the current dummy
|
|
; PC (defined by DSect, GlobalDSect, or
|
|
; DefineStack), and update the dummy PC by the
|
|
; appropriate amount.
|
|
;
|
|
MACRO
|
|
&lab WORD
|
|
&lab equ DummyPC
|
|
DummyPC SET DummyPC+2
|
|
MEXIT
|
|
MEND
|
|
|
|
;
|
|
; &lab long
|
|
;
|
|
; Equate the given label with the current dummy
|
|
; PC (defined by DSect, GlobalDSect, or
|
|
; DefineStack), and update the dummy PC by the
|
|
; appropriate amount.
|
|
;
|
|
MACRO
|
|
&lab LONG
|
|
&lab equ DummyPC
|
|
DummyPC SET DummyPC+4
|
|
MEND
|
|
|
|
;
|
|
; &lab block &size
|
|
;
|
|
; Equate the given label with the current dummy
|
|
; PC (defined by DSect, GlobalDSect, or
|
|
; DefineStack), and update the dummy PC by the
|
|
; appropriate amount (&size bytes).
|
|
;
|
|
MACRO
|
|
&lab BLOCK &Value
|
|
if &lab = '' goto .skiplab
|
|
&lab equ DummyPC
|
|
.skiplab
|
|
DummyPC SET DummyPC+&Value
|
|
MEND
|
|
|
|
;
|
|
; &lab DSectSize
|
|
;
|
|
; This macro equates the given label with the
|
|
; current dummy PC defined by the DSect,
|
|
; GlobalDSect, or DefineStack macros. This is
|
|
; useful for determing the size of data sections
|
|
; or parts of data sections.
|
|
;
|
|
MACRO
|
|
&lab DSectSize
|
|
&lab equ DummyPC
|
|
MEND
|
|
string C
|
|
|
|
|
|
|
|
|