avra: add RJMP and RCALL

This commit is contained in:
Virgil Dupras 2020-05-17 10:13:43 -04:00
parent b5d42924ba
commit 212126d6d2
2 changed files with 9 additions and 1 deletions

View File

@ -1 +1 @@
1 7 LOADR+
1 8 LOADR+

8
blk/668 Normal file
View File

@ -0,0 +1,8 @@
( a -- k12, absolute addr a, relative to PC in a k12 addr )
: _r7ffc DUP 0x7ff > IF _oor THEN ;
: _raddr12
PC - DUP 0< IF 0x800 + _r7ffc 0x800 OR ELSE _r7ffc THEN ;
: RJMP ( a -- op ) _raddr12 0xc000 OR ;
: RCALL ( a -- op ) _raddr12 0xd000 OR ;
: RJMP, RJMP A,, ;
: RCALL, RCALL A,, ;