2020-04-19 20:36:13 -04:00
|
|
|
The following words allow you to assemble z80 binaries. Being
|
|
|
|
Forth words, opcode assembly is a bit different than with a
|
|
|
|
typical assembler. For example, what would traditionally be
|
|
|
|
"ld a, b" would become "A B LDrr,".
|
|
|
|
|
2020-06-28 06:57:59 -04:00
|
|
|
The "argtype" suffix after each mnemonic is needed because the
|
2020-06-27 22:01:56 -04:00
|
|
|
assembler doesn't auto-detect the op's form based on arguments.
|
|
|
|
It has to be explicitly specified. "r" is for 8-bit registers,
|
|
|
|
"d" for 16-bit ones, "i" for immediate, "c" is for conditions.
|
|
|
|
Be aware that "SP" and "AF" refer to the same value: some 16-
|
|
|
|
bit ops can affect SP, others, AF. If you use the wrong argu-
|
|
|
|
ment on the wrong op, you will affect the wrong register.
|
2020-04-27 15:04:37 -04:00
|
|
|
|
2020-06-27 22:01:56 -04:00
|
|
|
Mnemonics having only a single form, such as PUSH and POP,
|
2020-06-28 06:57:59 -04:00
|
|
|
don't have argtype suffixes.
|
2020-04-27 15:04:37 -04:00
|
|
|
(cont.)
|