@, &, $, {, and } don't need to be escaped.

This commit is contained in:
Anthony J. Bentley
2018-07-28 00:03:36 -06:00
parent e771d60ec0
commit 4fc1e41b16

View File

@@ -202,7 +202,7 @@ HINT: If you think this is a lot of typing for doing a simple
type thing you can quite easily write an intelligent macro (called type thing you can quite easily write an intelligent macro (called
.Ic ORG .Ic ORG
for example) that uses for example) that uses
.Ic \@ .Ic @
for the section name and determines for the section name and determines
correct section type etc as arguments for correct section type etc as arguments for
.Ic SECTION . .Ic SECTION .
@@ -452,17 +452,17 @@ LoopyMacro: MACRO
This is fine. This is fine.
That is, if you only use the macro once per scope. That is, if you only use the macro once per scope.
To get around this problem there is a special label string equate called To get around this problem there is a special label string equate called
.Ic \[rs]\@ .Ic \[rs]@
that you can append to your labels and it will then expand to a unique string. that you can append to your labels and it will then expand to a unique string.
.Pp .Pp
.Ic \[rs]\@ .Ic \[rs]@
also works in REPT-blocks should you have any loops there. also works in REPT-blocks should you have any loops there.
.Bd -literal -offset indent .Bd -literal -offset indent
LoopyMacro: MACRO LoopyMacro: MACRO
xor a,a xor a,a
\&.loop\[rs]\@ ld [hl+],a \&.loop\[rs]@ ld [hl+],a
dec c dec c
jr nz,.loop\[rs]\@ jr nz,.loop\[rs]@
ENDM ENDM
.Ed .Ed
.Pp .Pp
@@ -495,9 +495,9 @@ LoopyMacro: MACRO
ld hl,\[rs]1 ld hl,\[rs]1
ld c,\[rs]2 ld c,\[rs]2
xor a,a xor a,a
\&.loop\[rs]\@ ld [hl+],a \&.loop\[rs]@ ld [hl+],a
dec c dec c
jr nz,.loop\[rs]\@ jr nz,.loop\[rs]@
ENDM ENDM
.Ed .Ed
.Pp .Pp
@@ -599,7 +599,7 @@ The following symbols are defined by the assembler:
.Pp .Pp
.Bl -column -offset indent ".Sy String" ".Sy String" ".Sy String" .Bl -column -offset indent ".Sy String" ".Sy String" ".Sy String"
.It Sy Type Ta Sy Name Ta Ta Sy Contents .It Sy Type Ta Sy Name Ta Ta Sy Contents
.It Ic EQU Ta Ic \@ Ta Ta PC value .It Ic EQU Ta Ic @ Ta Ta PC value
.It Ic EQU Ta Ic _PI Ta Ta Fixed point \[*p] .It Ic EQU Ta Ic _PI Ta Ta Fixed point \[*p]
.It Ic SET Ta Ic _RS Ta Ta _RS Counter .It Ic SET Ta Ic _RS Ta Ta _RS Counter
.It Ic EQU Ta Ic _NARG Ta Ta Number of arguments passed to macro .It Ic EQU Ta Ic _NARG Ta Ta Number of arguments passed to macro
@@ -795,7 +795,7 @@ ANGLE SET ANGLE+256.0
.Ic REPT .Ic REPT
is also very useful in recursive macros and, as in macros, you can also use the is also very useful in recursive macros and, as in macros, you can also use the
special label operator special label operator
.Ic \[rs]\@ . .Ic \[rs]@ .
REPT-blocks can be nested. REPT-blocks can be nested.
.Ss Aborting the assembly process .Ss Aborting the assembly process
.Ic FAIL .Ic FAIL
@@ -883,11 +883,11 @@ There are a number of numeric formats.
.Pp .Pp
.Bl -dash -compact .Bl -dash -compact
.It .It
Hexadecimal: \(Do0123456789ABCDEF. Case-insensitive Hexadecimal: $0123456789ABCDEF. Case-insensitive
.It .It
Decimal: 0123456789 Decimal: 0123456789
.It .It
Octal: \*(Am01234567 Octal: &01234567
.It .It
Binary: %01 Binary: %01
.It .It
@@ -1001,16 +1001,16 @@ can use within a string:
.It Li \[rs]\[rs] Ta Backslash .It Li \[rs]\[rs] Ta Backslash
.It Li \[rs]" Ta Double quote .It Li \[rs]" Ta Double quote
.It Li \[rs], Ta Comma .It Li \[rs], Ta Comma
.It Li \[rs]\[lC] Ta Curly bracket left .It Li \[rs]{ Ta Curly bracket left
.It Li \[rs]\[rC] Ta Curly bracket right .It Li \[rs]} Ta Curly bracket right
.It Li \[rs]n Ta Newline ($0A) .It Li \[rs]n Ta Newline ($0A)
.It Li \[rs]t Ta Tab ($09) .It Li \[rs]t Ta Tab ($09)
.It Li \[rs]1 - \[rs]9 Ta Macro argument (Only the body of a macros) .It Li \[rs]1 - \[rs]9 Ta Macro argument (Only the body of a macros)
.It Li \[rs]\@ Ta Label name suffix (Only in the body of macros and repts) .It Li \[rs]@ Ta Label name suffix (Only in the body of macros and repts)
.El .El
.Pp .Pp
A funky feature is A funky feature is
.Sy \[lC]symbol\[rC] .Sy {symbol}
withing a string. withing a string.
This will examine the type of the symbol and insert its value accordingly. This will examine the type of the symbol and insert its value accordingly.
If symbol is a string symbol, the symbols value is simply copied. If symbol is a string symbol, the symbols value is simply copied.
@@ -1018,11 +1018,11 @@ If it's a numeric symbol, the value is converted to hexadecimal notation and
inserted as a string. inserted as a string.
.Pp .Pp
HINT: The HINT: The
.Sy \[lC]symbol\[rC] .Sy {symbol}
construct can also be used outside strings. construct can also be used outside strings.
The symbol's value is again inserted as a string. The symbol's value is again inserted as a string.
This is just a short way of doing This is just a short way of doing
.Dq \[lC]symbol\[rC] . .Dq {symbol} .
.Pp .Pp
Whenever the macro-language expects a string you can actually use a string Whenever the macro-language expects a string you can actually use a string
expression. expression.
@@ -1079,9 +1079,9 @@ There are a few other functions that do various useful things:
.Pp .Pp
.Bl -column ".Sy String" ".Sy String" .Bl -column ".Sy String" ".Sy String"
.It Sy Name Ta Ta Ta Sy Operation .It Sy Name Ta Ta Ta Sy Operation
.It Li BANK(\@/str/lbl) Ta Returns a bank number. .It Li BANK(@/str/lbl) Ta Returns a bank number.
If the argument is the symbol If the argument is the symbol
.Ic \@, .Ic @ ,
this function returns the bank of the current section. this function returns the bank of the current section.
If the argument is a string, it returns the bank of the section that has that If the argument is a string, it returns the bank of the section that has that
name. name.