1 # Just a test stub for mu-init.subx
3 # Try it out like this:
4 # $ ./translate_subx init.linux [0-9]*.subx mu-init.subx mu-init-test.subx
5 # $ ./a.elf # should run all tests
7 main: # args: (addr array (addr array byte)) -> result/ebx: int
15 8b/-> *(ebp+8) 6/r32/esi
17 # if (argc <= 1) break
18 81 7/subop/compare *esi 4/imm32
19 7e/jump-if-<= break/disp8
20 # if (argv[1] != "test") break
21 (string-equal? *(esi+8) "test") # => eax
22 3d/compare-eax-and 0/imm32
23 74/jump-if-= break/disp8
26 # return *Num-test-failures
27 8b/-> *Num-test-failures 3/r32/ebx
28 eb/jump $main:end/disp8