tisc

tiny instruction set computer
Log | Files | Refs | README

test_compare.tac (520B)


      1 # This program tests the compare modes set by sop_*
      2 # If we end up jumping to the loop tag, we've failed the test
      3 start:  li 255
      4         mov GRA GRB
      5         sop_xor
      6         cmp GRA GRB
      7         jmp next0
      8         jmp loop
      9 next0:  li 0
     10         cmp GRA GRB
     11         jmp loop
     12         jmp next1
     13 next1:  sop_and
     14         cmp GRA GRB
     15         jmp next2
     16         jmp loop
     17 next2:  sop_sub
     18         cmp GRA GRB
     19         jmp next3
     20         jmp loop
     21 next3:  sop_add
     22         cin GRA GRA
     23         cmp GRA GRB
     24 loop:   jmp loop
     25         jmp start