qemu/tests/lm32/test_add.S
<<
>>
Prefs
   1.include "macros.inc"
   2
   3start
   4
   5test_name ADD_1
   6mvi r1, 0
   7mvi r2, 0
   8add r3, r1, r2
   9check_r3 0
  10
  11test_name ADD_2
  12mvi r1, 0
  13mvi r2, 1
  14add r3, r1, r2
  15check_r3 1
  16
  17test_name ADD_3
  18mvi r1, 1
  19mvi r2, 0
  20add r3, r1, r2
  21check_r3 1
  22
  23test_name ADD_4
  24mvi r1, 1
  25mvi r2, -1
  26add r3, r1, r2
  27check_r3 0
  28
  29test_name ADD_5
  30mvi r1, -1
  31mvi r2, 1
  32add r3, r1, r2
  33check_r3 0
  34
  35test_name ADD_6
  36mvi r1, -1
  37mvi r2, 0
  38add r3, r1, r2
  39check_r3 -1
  40
  41test_name ADD_7
  42mvi r1, 0
  43mvi r2, -1
  44add r3, r1, r2
  45check_r3 -1
  46
  47test_name ADD_8
  48mvi r3, 2
  49add r3, r3, r3
  50check_r3 4
  51
  52test_name ADD_9
  53mvi r1, 4
  54mvi r3, 2
  55add r3, r1, r3
  56check_r3 6
  57
  58test_name ADD_10
  59mvi r1, 4
  60mvi r3, 2
  61add r3, r3, r1
  62check_r3 6
  63
  64test_name ADD_11
  65mvi r1, 4
  66add r3, r1, r1
  67check_r3 8
  68
  69test_name ADD_12
  70load r1 0x12345678
  71load r2 0xabcdef97
  72add r3, r1, r2
  73check_r3 0xbe02460f
  74
  75end
  76