Search
lxdream.org :: lxdream/test/sh4/trapa.s
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/trapa.s
changeset 533:9764673fd4a5
author nkeynes
date Tue Nov 20 08:31:34 2007 +0000 (15 years ago)
permissions -rw-r--r--
last change Fix TRAPA (translator) and add test case
file annotate diff log raw
nkeynes@533
     1
.section .text
nkeynes@533
     2
.include "sh4/inc.s"
nkeynes@533
     3
nkeynes@533
     4
.global _test_trapa
nkeynes@533
     5
_test_trapa:	
nkeynes@533
     6
	start_test
nkeynes@533
     7
nkeynes@533
     8
test_trapa_1:
nkeynes@533
     9
	add #1, r12
nkeynes@533
    10
	expect_exc 0x00000160
nkeynes@533
    11
	trapa #42
nkeynes@533
    12
nkeynes@533
    13
test_trapa_1_pc:
nkeynes@533
    14
	assert_exc_caught test_trapa_str_k test_trapa_1_pc
nkeynes@533
    15
nkeynes@533
    16
	mov.l test_trapa_tra, r1
nkeynes@533
    17
	mov.l @r1, r2
nkeynes@533
    18
	mov #42, r0
nkeynes@533
    19
	shll r0
nkeynes@533
    20
	shll r0
nkeynes@533
    21
	cmp/eq r0, r2
nkeynes@533
    22
	bt test_trapa_end
nkeynes@533
    23
	fail test_trapa_str_k
nkeynes@533
    24
	bra test_trapa_end
nkeynes@533
    25
	nop
nkeynes@533
    26
		
nkeynes@533
    27
test_trapa_tra:
nkeynes@533
    28
	.long 0xFF000020
nkeynes@533
    29
	
nkeynes@533
    30
test_trapa_end:
nkeynes@533
    31
	end_test test_trapa_str_k
nkeynes@533
    32
nkeynes@533
    33
test_trapa_str_k:
nkeynes@533
    34
	.long test_trapa_str
nkeynes@533
    35
test_trapa_str:
nkeynes@533
    36
	.string "TRAPA"
.