Browse Source

avra: begin writing docs

master
Virgil Dupras 3 years ago
parent
commit
101193a78c
3 changed files with 26 additions and 2 deletions
  1. +2
    -2
      blk/201
  2. +15
    -0
      blk/650
  3. +9
    -0
      blk/651

+ 2
- 2
blk/201 View File

@@ -3,7 +3,7 @@ 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,".

The "argtype" prefix after each mnemonic is needed because the
The "argtype" suffix after each mnemonic is needed because the
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.
@@ -12,5 +12,5 @@ bit ops can affect SP, others, AF. If you use the wrong argu-
ment on the wrong op, you will affect the wrong register.

Mnemonics having only a single form, such as PUSH and POP,
don't have argtype prefixes.
don't have argtype suffixes.
(cont.)

+ 15
- 0
blk/650 View File

@@ -1 +1,16 @@
AVR assembler

This assembler works very much like Z80 assembler (B200) so
refer to this documentation first. Here, we document specifici-
ties.

All mnemonics in AVR have a single signature. Therefore, we
don't need any "argtype" suffixes.

Registers are referred to with consts R0-R31. There is
X, Y, Z, X+, Y+, Z+, X-, Y-, Z- for appropriate ops (LD, ST).
XL, XH, YL, YH, ZL, ZH are simple aliases to R26-R31.

Branching works differently. Instead of expecting a byte to be
written after the naked op, branching words expect a displace-
ment argument. (cont.)

+ 9
- 0
blk/651 View File

@@ -0,0 +1,9 @@
This is because there's bitwise ORing involved in the creation
of the final opcode, which makes z80a's approach impractical.

This makes labelling a bit different too. Instead of expecting
label words after the naked branching op, we rather have label
words expecting branching wordref as an argument. Examples:

L2 ' BRTS FLBL! ( branch forward to L2 )
L1 ' RJMP LBL, ( branch backward to L1 )

Loading…
Cancel
Save