Search
lxdream.org :: lxdream/test/sh4/inc.s :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/inc.s
changeset 233:f8333b94f503
prev231:a9e61a96a885
next357:3592a10b3242
author nkeynes
date Wed Sep 27 10:21:34 2006 +0000 (14 years ago)
permissions -rw-r--r--
last change Add user mode/system mode switch
Add undefined instruction tests
file annotate diff log raw
1.1 --- a/test/sh4/inc.s Tue Sep 26 11:05:38 2006 +0000
1.2 +++ b/test/sh4/inc.s Wed Sep 27 10:21:34 2006 +0000
1.3 @@ -140,6 +140,25 @@
1.4 addc r0, r0
1.5 .endm
1.6
1.7 +! Switch to user-mode
1.8 +.macro usermode
1.9 + stc sr, r0
1.10 + mov #64, r1
1.11 + mov #24, r2
1.12 + shld r2, r1
1.13 + not r1, r1
1.14 + and r0, r1
1.15 + ldc r1, sr
1.16 +.endm
1.17 +
1.18 +! Switch to system-mode
1.19 +! NB: implemented as a trap to the interrupt handler, as obviously
1.20 +! we can't just update SR...
1.21 +.macro systemmode
1.22 + trapa #42
1.23 + nop
1.24 +.endm
1.25 +
1.26 .macro clearbl
1.27 LOCAL L1
1.28 LOCAL L2
.