1 # Structured control flow using break/loop rather than jump. 2 # 3 # To run (on Linux): 4 # $ ./translate_subx init.linux [012]*.subx subx-params.subx braces.subx 5 # $ mv a.elf braces 6 # 7 # Example 1: 8 # $ cat x.subx 9 # { 10 # 7c/jump-if-< break/disp8 11 # 74/jump-if-= loop/disp8 12 # } 13 # $ cat x.subx |braces 14 # @loop1: 15 # 7c/jump-if-< @break1/disp8 16 # 74/jump-if-= @loop1/disp8 17 # @break1: 18 # 19 # Example 2: 20 # $ cat x.subx 21 # { 22 # 7c/jump-if-< break/disp8 23 # } 24 # { 25 # 74/jump-if-= loop/disp8 26 # } 27 # $ cat x.subx |braces 28 # @loop1: 29 # 7c/jump-if-< @break1/disp8 30 # @break1: 31 # @loop2: 32 # 74/jump-if-= @loop2/disp8 33 # @break2: 34 # 35 # Example 3: 36 # $ cat x.subx 37 # { 38 # { 39 # 74/jump-if-= loop/disp8 40 # } 41 # 7c/jump-if-< loop/disp8 42 # } 43 # $ cat x.subx |braces 44 # @loop1: 45 # @loop2: 46 # 74/jump-if-= @loop2/disp8 47 # @break2: 48 # 7c/jump-if-< @loop1/disp8 49 # @break1: 50 51 == code 52 53 Entry: # run tests if necessary, a REPL if not 54 # . prologue 55 89/<- %ebp 4/r32/esp 56 # initialize heap 57 (generated by cgit-pink 1.4.1-2-gfad0 (git 2.36.2.497.gbbea4dcf42) at 2025-01-16 07:59:22 +0000