1# sh testcase for add $rm, $rn -*- Asm -*- 2# mach: all 3# as: -isa=shcompact 4# ld: -m shelf32 5 6 .include "compact/testutils.inc" 7 8 start 9init: 10 # Initialise some registers with values which help us to verify 11 # that the correct source registers are used by the ADD instruction. 12 mov #0, r0 13 mov #1, r1 14 mov #2, r2 15 mov #3, r3 16 mov #5, r5 17 mov #15, r15 18 19add: 20 # 0 + 0 = 0. 21 add r0, r0 22 assert r0, #0 23 24 # 0 + 1 = 1. 25 add r0, r1 26 assert r1, #1 27 28 # 1 + 2 = 3. 29 add r1, r2 30 assert r2, #3 31 32 # 3 + 5 = 8. 33 add r3, r5 34 assert r5, #8 35 36 # 8 + 8 = 16. 37 add r5, r5 38 assert r5, #16 39 40 # 15 + 1 = 16. 41 add r15, r1 42 assert r1, #16 43 44neg: 45 mov #1, r0 46 neg r0, r0 47 mov #2, r1 48 add r0, r1 49 assert r1, #1 50 51okay: 52 pass 53 54wrong: 55 fail 56