wip! pushpop bal tests
This commit is contained in:
parent
3382fc1700
commit
31a4ca9d2c
2 changed files with 39 additions and 0 deletions
|
|
@ -52,6 +52,10 @@
|
|||
excp UND
|
||||
.endm
|
||||
|
||||
.macro FAIL
|
||||
br .fail
|
||||
.endm
|
||||
|
||||
.macro FAIL_HANDLER
|
||||
.fail:
|
||||
movw $1, r0
|
||||
|
|
|
|||
35
tests/tcg/cr16c/test10-pushpop.S
Normal file
35
tests/tcg/cr16c/test10-pushpop.S
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#include "macros.inc"
|
||||
|
||||
.global _start
|
||||
|
||||
.text
|
||||
_start:
|
||||
/* Initialize registers */
|
||||
RESET
|
||||
|
||||
movd $0x4000, (sp)
|
||||
begin:
|
||||
/** BAL **/
|
||||
bal (ra), sub1
|
||||
|
||||
movw $0x1234, r1
|
||||
movw $0x4242, r2
|
||||
bal (ra), sub2
|
||||
EXPECT 0x1234, r1
|
||||
EXPECT 0x4242, r2
|
||||
|
||||
ENDING
|
||||
FAIL_HANDLER
|
||||
|
||||
sub1:
|
||||
jump (ra) /* should return */
|
||||
FAIL
|
||||
|
||||
|
||||
sub2:
|
||||
PUSH $0x2, r1, ra
|
||||
movw $-1, r1
|
||||
movw $-1, r2
|
||||
POPRET $0x2, r1, ra /* should return */
|
||||
FAIL
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue