What is GASP?
In some cases, you can simply use the C preprocessor, or a generalized
preprocessor like M4; but this can be awkward, since none of these things are designed with
assembly in mind.
GASP fills this need. It is expressly designed to provide the facilities you need
with hand-coded assembly code. Implementing it as a preprocessor, rather than
part of the assembler, allows the maximum flexibility: you can use it with
hand-coded assembly, without paying a penalty of added complexity in the assembler
you use for compiler output.
What follows is an example of input to give the flavor of GASP.
count .ASSIGNA \from
! save r\from..r\to
.AWHILE \&count LE \to
mov r\&count,@-sp
count .ASSIGNA \&count + 1
.AENDW
.ENDM
saveregs from=12
bar: mov #H’dead+10,r0
foo .SDATAC “hello”<10>
.END
mov r12,@-sp
mov r13,@-sp
mov r14,@-sp
bar: mov #57005+10,r0
foo: .byte 6,104,101,108,108,111,10