avra: first steps

This commit is contained in:
Virgil Dupras 2020-05-16 09:51:02 -04:00
parent ed3bee787d
commit ee3407bf1c
9 changed files with 41 additions and 2 deletions

View File

@ -9,7 +9,7 @@ MASTER INDEX
490 TRS-80 Recipe 520 Fonts
550 TI-84+ Recipe 580 RC2014 Recipe
620 Sega Master System Recipe
650 AVR assembler

1
blk/650 Normal file
View File

@ -0,0 +1 @@
AVR assembler

1
blk/660 Normal file
View File

@ -0,0 +1 @@
1 5 LOADR+

8
blk/661 Normal file
View File

@ -0,0 +1,8 @@
VARIABLE ORG
: SPLITB
256 /MOD SWAP
;
: PC H@ ORG @ ;
( A, spits an assembled byte, A,, spits an assembled word
Both increase PC. To debug, change C, to .X )
: A, C, ; : A,, SPLITB A, A, ;

10
blk/662 Normal file
View File

@ -0,0 +1,10 @@
( 0000 000d dddd 0000 )
: OPRd CREATE , DOES> @ SWAP 4 LSHIFT OR A,, ;
0b1001010000000101 OPRd ASR, 0b1001010000000000 OPRd COM,
0b1001010000001010 OPRd DEC, 0b1001010000000011 OPRd INC,
0b1001001000000110 OPRd LAC, 0b1001001000000101 OPRd LAS,
0b1001001000000111 OPRd LAT,
0b1001010000000110 OPRd LSR, 0b1001010000000001 OPRd NEG,
0b1001000000001111 OPRd POP, 0b1001001000001111 OPRd PUSH,
0b1001010000000111 OPRd ROR, 0b1001010000000010 OPRd SWAP,
0b1001001000000100 OPRd XCH,

10
blk/663 Normal file
View File

@ -0,0 +1,10 @@
( 0000 00rd dddd rrrr )
: OPRdRr CREATE C, DOES> C@ ( rd rr op )
OVER 0x10 AND 3 RSHIFT OR ( rd rr op' )
2 PICK 0x10 AND 4 RSHIFT OR ( rd rr op' )
8 LSHIFT OR 0xff0f AND ( rd op' )
SWAP 0xf AND 4 LSHIFT OR A,, ;
0x1c OPRdRr ADC, 0x0c OPRdRr ADD, 0x20 OPRdRr AND,
0x14 OPRdRr CP, 0x04 OPRdRr CPC, 0x10 OPRdRr CPSE,
0x24 OPRdRr EOR, 0x2c OPRdRr MOV, 0x9c OPRdRr MUL,
0x28 OPRdRr OR, 0x08 OPRdRr SBC, 0x18 OPRdRr SUB,

7
blk/664 Normal file
View File

@ -0,0 +1,7 @@
( 0000 KKKK dddd KKKK )
: OPRdK CREATE C, DOES> C@ ( rd K op )
OVER 0xf0 AND 4 RSHIFT OR ( rd K op' )
ROT 5 LSHIFT ROT 0x0f AND OR ( op' rdK ) A, A, ;
0x70 OPRdK ANDI, 0x30 OPRdK CPI, 0x0e OPRdK LDI,
0x60 OPRdK ORI, 0x40 OPRdK SBCI, 0x60 OPRdK SBR,
0x50 OPRdK SUBI,

2
emul/avra.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
echo -e "660 LOAD H@ 256 /MOD 2 PC! 2 PC! \n$(cat -)\nH@ 256 /MOD 2 PC! 2 PC! " | ./stage

View File

@ -1,2 +1,2 @@
#!/bin/sh
echo "212 LOAD H@ 256 /MOD 2 PC! 2 PC! $(cat -) H@ 256 /MOD 2 PC! 2 PC!" | ./stage
echo -e "212 LOAD\nH@ 256 /MOD 2 PC! 2 PC!\n$(cat -)\nH@ 256 /MOD 2 PC! 2 PC! " | ./stage