Move AVR assembler from B650 to B50

And move its doc to doc/asm.txt
This commit is contained in:
Virgil Dupras 2020-09-21 19:52:53 -04:00
parent b21be43535
commit faf088b397
15 changed files with 68 additions and 3 deletions

View File

@ -1,13 +1,13 @@
MASTER INDEX
005 Z80 assembler 030 8086 assembler
50-99 unused
050 AVR assembler 70-99 unused
100 Block editor 120 Visual Editor
160-259 unused 260 Cross compilation
280 Z80 boot code 350 Core words
410 PS/2 keyboard subsystem 420 SD Card subsystem
440-519 unused 520 Fonts
550-649 unused
650 AVR assembler 690 AVR SPI programmer
550-689 unused
690 AVR SPI programmer
700-799 unused
800 8086 boot code

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

@ -159,3 +159,68 @@ For jumps, it's special. 's' is SHORT, 'n' is NEAR, 'f' is FAR.
# 8086 Instructions list
TODO
# AVR assembler
Load with "50 LOAD". As with the Z80 assembler, it is incom-
plete.
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.
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 )
# AVR instructions list
OPRd (B53)
ASR COM DEC INC LAC LAS LAT LSR NEG POP PUSH
ROR SWAP XCH
OPRdRr (B54)
ADC ADD AND CP CPC CPSE EOR MOV MUL OR SBC
SUB
OPRdA (B54)
IN OUT
OPRdK (B55)
ANDI CPI LDI ORI SBCI SBR SUBI
OPAb (B55)
CBI SBI SBIC SBIS
OPNA (B56)
BREAK CL[C,H,I,N,S,T,V,Z] SE[C,H,I,N,S,T,V,Z] EIJMP ICALL
EICALL IJMP NOP RET RETI SLEEP WDR
OPb (B57)
BCLR BSET
OPRdb (B57)
BLD BST SBRC SBRS
Special (B57,B60)
CLR TST LSL LD ST
Flow (B58)
RJMP RCALL
BR[BC,BS,CC,CS,EQ,NE,GE,HC,HS,ID,IE,LO,LT,MI,PL,SH,TC,TS,VC,VS]
Flow macros (B61)
LBL! LBL, SKIP, TO, FLBL, FLBL! BEGIN, AGAIN? AGAIN, IF, THEN,