summaryrefslogtreecommitdiff
path: root/test-suite/standalone/sassy
diff options
context:
space:
mode:
Diffstat (limited to 'test-suite/standalone/sassy')
-rw-r--r--test-suite/standalone/sassy/tests/aa2
-rw-r--r--test-suite/standalone/sassy/tests/aa.asm5
-rw-r--r--test-suite/standalone/sassy/tests/aa.scm5
-rw-r--r--test-suite/standalone/sassy/tests/allbin0 -> 2945 bytes
-rw-r--r--test-suite/standalone/sassy/tests/all.asm870
-rw-r--r--test-suite/standalone/sassy/tests/alubin0 -> 86 bytes
-rw-r--r--test-suite/standalone/sassy/tests/alu.asm25
-rw-r--r--test-suite/standalone/sassy/tests/alu.scm24
-rw-r--r--test-suite/standalone/sassy/tests/alu16bin0 -> 97 bytes
-rw-r--r--test-suite/standalone/sassy/tests/alu16.asm25
-rw-r--r--test-suite/standalone/sassy/tests/brt1
-rw-r--r--test-suite/standalone/sassy/tests/brt.scm4
-rw-r--r--test-suite/standalone/sassy/tests/btbin0 -> 50 bytes
-rw-r--r--test-suite/standalone/sassy/tests/bt.asm11
-rw-r--r--test-suite/standalone/sassy/tests/bt.scm10
-rw-r--r--test-suite/standalone/sassy/tests/bt16bin0 -> 54 bytes
-rw-r--r--test-suite/standalone/sassy/tests/bt16.asm11
-rw-r--r--test-suite/standalone/sassy/tests/byebin0 -> 1700 bytes
-rw-r--r--test-suite/standalone/sassy/tests/bye.scm19
-rwxr-xr-xtest-suite/standalone/sassy/tests/cellbin0 -> 704 bytes
-rw-r--r--test-suite/standalone/sassy/tests/cell.scm15
-rw-r--r--test-suite/standalone/sassy/tests/cmovcc1
-rw-r--r--test-suite/standalone/sassy/tests/cmovcc.asm33
-rw-r--r--test-suite/standalone/sassy/tests/cmovcc.scm35
-rw-r--r--test-suite/standalone/sassy/tests/cmpx1
-rw-r--r--test-suite/standalone/sassy/tests/cmpx.asm9
-rw-r--r--test-suite/standalone/sassy/tests/cmpx.scm8
-rw-r--r--test-suite/standalone/sassy/tests/cmpx161
-rw-r--r--test-suite/standalone/sassy/tests/cmpx16.asm9
-rwxr-xr-xtest-suite/standalone/sassy/tests/countbin0 -> 806 bytes
-rw-r--r--test-suite/standalone/sassy/tests/count.scm28
-rw-r--r--test-suite/standalone/sassy/tests/decincbin0 -> 12 bytes
-rw-r--r--test-suite/standalone/sassy/tests/decinc.asm9
-rw-r--r--test-suite/standalone/sassy/tests/decinc.scm9
-rw-r--r--test-suite/standalone/sassy/tests/decinc16bin0 -> 15 bytes
-rw-r--r--test-suite/standalone/sassy/tests/decinc16.asm9
-rw-r--r--test-suite/standalone/sassy/tests/doub-shift1
-rw-r--r--test-suite/standalone/sassy/tests/doub-shift.asm11
-rw-r--r--test-suite/standalone/sassy/tests/doub-shift.scm10
-rw-r--r--test-suite/standalone/sassy/tests/doub-shift161
-rw-r--r--test-suite/standalone/sassy/tests/doub-shift16.asm11
-rw-r--r--test-suite/standalone/sassy/tests/eip.scm18
-rwxr-xr-xtest-suite/standalone/sassy/tests/fac5bin0 -> 632 bytes
-rw-r--r--test-suite/standalone/sassy/tests/fac5.scm12
-rw-r--r--test-suite/standalone/sassy/tests/fp01
-rw-r--r--test-suite/standalone/sassy/tests/fp0.asm39
-rw-r--r--test-suite/standalone/sassy/tests/fp0.scm39
-rw-r--r--test-suite/standalone/sassy/tests/fp1bin0 -> 36 bytes
-rw-r--r--test-suite/standalone/sassy/tests/fp1.asm21
-rw-r--r--test-suite/standalone/sassy/tests/fp1.scm20
-rw-r--r--test-suite/standalone/sassy/tests/fp21
-rw-r--r--test-suite/standalone/sassy/tests/fp2.asm33
-rw-r--r--test-suite/standalone/sassy/tests/fp2.scm32
-rw-r--r--test-suite/standalone/sassy/tests/fp32
-rw-r--r--test-suite/standalone/sassy/tests/fp3.asm21
-rw-r--r--test-suite/standalone/sassy/tests/fp3.scm20
-rw-r--r--test-suite/standalone/sassy/tests/generate-nasm.scm224
-rw-r--r--test-suite/standalone/sassy/tests/generate-prim.scm161
-rw-r--r--test-suite/standalone/sassy/tests/hellobin0 -> 1757 bytes
-rw-r--r--test-suite/standalone/sassy/tests/hello.scm9
-rw-r--r--test-suite/standalone/sassy/tests/include.scm2
-rw-r--r--test-suite/standalone/sassy/tests/jcc1
-rw-r--r--test-suite/standalone/sassy/tests/jcc.asm33
-rw-r--r--test-suite/standalone/sassy/tests/jcc.scm32
-rw-r--r--test-suite/standalone/sassy/tests/jcc161
-rw-r--r--test-suite/standalone/sassy/tests/jcc16.asm33
-rw-r--r--test-suite/standalone/sassy/tests/jumpsbin0 -> 126 bytes
-rw-r--r--test-suite/standalone/sassy/tests/jumps.asm36
-rw-r--r--test-suite/standalone/sassy/tests/jumps.scm35
-rw-r--r--test-suite/standalone/sassy/tests/jumps16bin0 -> 133 bytes
-rw-r--r--test-suite/standalone/sassy/tests/jumps16.asm36
-rw-r--r--test-suite/standalone/sassy/tests/libgoodbye.scm6
-rw-r--r--test-suite/standalone/sassy/tests/libgoodbye.sobin0 -> 1481 bytes
-rw-r--r--test-suite/standalone/sassy/tests/libhello.scm30
-rw-r--r--test-suite/standalone/sassy/tests/libhello.sobin0 -> 2058 bytes
-rwxr-xr-xtest-suite/standalone/sassy/tests/liblocaldata3.sobin0 -> 1592 bytes
-rw-r--r--test-suite/standalone/sassy/tests/load1
-rw-r--r--test-suite/standalone/sassy/tests/load.asm9
-rw-r--r--test-suite/standalone/sassy/tests/load.scm9
-rw-r--r--test-suite/standalone/sassy/tests/load161
-rw-r--r--test-suite/standalone/sassy/tests/load16.asm9
-rwxr-xr-xtest-suite/standalone/sassy/tests/local-data-staticbin0 -> 819 bytes
-rw-r--r--test-suite/standalone/sassy/tests/localdata1.scm9
-rw-r--r--test-suite/standalone/sassy/tests/localdata2.scm34
-rw-r--r--test-suite/standalone/sassy/tests/localdata3.scm12
-rwxr-xr-xtest-suite/standalone/sassy/tests/localdata3.sobin0 -> 1604 bytes
-rwxr-xr-xtest-suite/standalone/sassy/tests/localdata4bin0 -> 1758 bytes
-rw-r--r--test-suite/standalone/sassy/tests/localdata4.scm37
-rw-r--r--test-suite/standalone/sassy/tests/mem-refbin0 -> 558 bytes
-rw-r--r--test-suite/standalone/sassy/tests/mem-ref.asm116
-rw-r--r--test-suite/standalone/sassy/tests/mem-ref.scm115
-rw-r--r--test-suite/standalone/sassy/tests/mem-ref16bin0 -> 784 bytes
-rw-r--r--test-suite/standalone/sassy/tests/mem-ref16.asm116
-rw-r--r--test-suite/standalone/sassy/tests/misc12
-rw-r--r--test-suite/standalone/sassy/tests/misc1.asm21
-rw-r--r--test-suite/standalone/sassy/tests/misc1.scm20
-rw-r--r--test-suite/standalone/sassy/tests/misc1162
-rw-r--r--test-suite/standalone/sassy/tests/misc116.asm21
-rw-r--r--test-suite/standalone/sassy/tests/misc2bin0 -> 315 bytes
-rw-r--r--test-suite/standalone/sassy/tests/misc2.asm111
-rw-r--r--test-suite/standalone/sassy/tests/misc2.scm110
-rw-r--r--test-suite/standalone/sassy/tests/misc216bin0 -> 353 bytes
-rw-r--r--test-suite/standalone/sassy/tests/misc216.asm111
-rw-r--r--test-suite/standalone/sassy/tests/misc3bin0 -> 33 bytes
-rw-r--r--test-suite/standalone/sassy/tests/misc3.asm14
-rw-r--r--test-suite/standalone/sassy/tests/misc3.scm14
-rw-r--r--test-suite/standalone/sassy/tests/mmx13
-rw-r--r--test-suite/standalone/sassy/tests/mmx.asm65
-rw-r--r--test-suite/standalone/sassy/tests/mmx.scm64
-rw-r--r--test-suite/standalone/sassy/tests/movx1
-rw-r--r--test-suite/standalone/sassy/tests/movx.asm9
-rw-r--r--test-suite/standalone/sassy/tests/movx.scm8
-rw-r--r--test-suite/standalone/sassy/tests/movx161
-rw-r--r--test-suite/standalone/sassy/tests/movx16.asm9
-rw-r--r--test-suite/standalone/sassy/tests/non1
-rw-r--r--test-suite/standalone/sassy/tests/non.asm74
-rw-r--r--test-suite/standalone/sassy/tests/non.scm73
-rw-r--r--test-suite/standalone/sassy/tests/non161
-rw-r--r--test-suite/standalone/sassy/tests/non16.asm74
-rw-r--r--test-suite/standalone/sassy/tests/plier1
-rw-r--r--test-suite/standalone/sassy/tests/plier.asm13
-rw-r--r--test-suite/standalone/sassy/tests/plier.scm12
-rw-r--r--test-suite/standalone/sassy/tests/plier161
-rw-r--r--test-suite/standalone/sassy/tests/plier16.asm13
-rw-r--r--test-suite/standalone/sassy/tests/prefixbin0 -> 29 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prefix.asm27
-rw-r--r--test-suite/standalone/sassy/tests/prefix.scm14
-rw-r--r--test-suite/standalone/sassy/tests/prefix16bin0 -> 37 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prefix16.asm27
-rw-r--r--test-suite/standalone/sassy/tests/prims/alt11
-rw-r--r--test-suite/standalone/sassy/tests/prims/alt1.scm18
-rw-r--r--test-suite/standalone/sassy/tests/prims/alt21
-rw-r--r--test-suite/standalone/sassy/tests/prims/alt2.scm16
-rw-r--r--test-suite/standalone/sassy/tests/prims/alt3bin0 -> 13 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/alt3.scm15
-rw-r--r--test-suite/standalone/sassy/tests/prims/alt41
-rw-r--r--test-suite/standalone/sassy/tests/prims/alt4.scm16
-rw-r--r--test-suite/standalone/sassy/tests/prims/begin11
-rw-r--r--test-suite/standalone/sassy/tests/prims/begin1.scm15
-rw-r--r--test-suite/standalone/sassy/tests/prims/begin21
-rw-r--r--test-suite/standalone/sassy/tests/prims/begin2.scm14
-rw-r--r--test-suite/standalone/sassy/tests/prims/begin31
-rw-r--r--test-suite/standalone/sassy/tests/prims/begin3.scm15
-rw-r--r--test-suite/standalone/sassy/tests/prims/begin41
-rw-r--r--test-suite/standalone/sassy/tests/prims/begin4.scm16
-rw-r--r--test-suite/standalone/sassy/tests/prims/begin51
-rw-r--r--test-suite/standalone/sassy/tests/prims/begin5.scm18
-rw-r--r--test-suite/standalone/sassy/tests/prims/esc1bin0 -> 33 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/esc1.scm32
-rw-r--r--test-suite/standalone/sassy/tests/prims/esc2bin0 -> 40 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/esc2.scm36
-rw-r--r--test-suite/standalone/sassy/tests/prims/esc3bin0 -> 31 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/esc3.scm16
-rw-r--r--test-suite/standalone/sassy/tests/prims/esc4bin0 -> 56 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/esc4.scm35
-rw-r--r--test-suite/standalone/sassy/tests/prims/esc5bin0 -> 40 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/esc5.scm35
-rw-r--r--test-suite/standalone/sassy/tests/prims/esc6bin0 -> 12 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/esc6.scm14
-rw-r--r--test-suite/standalone/sassy/tests/prims/esc71
-rw-r--r--test-suite/standalone/sassy/tests/prims/esc7.scm16
-rw-r--r--test-suite/standalone/sassy/tests/prims/exp-k11
-rw-r--r--test-suite/standalone/sassy/tests/prims/exp-k1.scm25
-rw-r--r--test-suite/standalone/sassy/tests/prims/exp-k21
-rw-r--r--test-suite/standalone/sassy/tests/prims/exp-k2.scm25
-rw-r--r--test-suite/standalone/sassy/tests/prims/exp-k31
-rw-r--r--test-suite/standalone/sassy/tests/prims/exp-k3.scm24
-rw-r--r--test-suite/standalone/sassy/tests/prims/exp-k41
-rw-r--r--test-suite/standalone/sassy/tests/prims/exp-k4.scm29
-rw-r--r--test-suite/standalone/sassy/tests/prims/if11
-rw-r--r--test-suite/standalone/sassy/tests/prims/if1.scm16
-rw-r--r--test-suite/standalone/sassy/tests/prims/if21
-rw-r--r--test-suite/standalone/sassy/tests/prims/if2.scm21
-rw-r--r--test-suite/standalone/sassy/tests/prims/if31
-rw-r--r--test-suite/standalone/sassy/tests/prims/if3.scm26
-rw-r--r--test-suite/standalone/sassy/tests/prims/if41
-rw-r--r--test-suite/standalone/sassy/tests/prims/if4.scm25
-rw-r--r--test-suite/standalone/sassy/tests/prims/inv11
-rw-r--r--test-suite/standalone/sassy/tests/prims/inv1.scm20
-rw-r--r--test-suite/standalone/sassy/tests/prims/inv21
-rw-r--r--test-suite/standalone/sassy/tests/prims/inv2.scm18
-rw-r--r--test-suite/standalone/sassy/tests/prims/inv31
-rw-r--r--test-suite/standalone/sassy/tests/prims/inv3.scm19
-rw-r--r--test-suite/standalone/sassy/tests/prims/inv41
-rw-r--r--test-suite/standalone/sassy/tests/prims/inv4.scm19
-rw-r--r--test-suite/standalone/sassy/tests/prims/inv51
-rw-r--r--test-suite/standalone/sassy/tests/prims/inv5.scm21
-rw-r--r--test-suite/standalone/sassy/tests/prims/inv61
-rw-r--r--test-suite/standalone/sassy/tests/prims/inv6.scm21
-rw-r--r--test-suite/standalone/sassy/tests/prims/iter11
-rw-r--r--test-suite/standalone/sassy/tests/prims/iter1.scm11
-rw-r--r--test-suite/standalone/sassy/tests/prims/iter21
-rw-r--r--test-suite/standalone/sassy/tests/prims/iter2.scm13
-rw-r--r--test-suite/standalone/sassy/tests/prims/iter31
-rw-r--r--test-suite/standalone/sassy/tests/prims/iter3.scm13
-rw-r--r--test-suite/standalone/sassy/tests/prims/iter41
-rw-r--r--test-suite/standalone/sassy/tests/prims/iter4.scm17
-rw-r--r--test-suite/standalone/sassy/tests/prims/iter5bin0 -> 262 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/iter5.scm89
-rw-r--r--test-suite/standalone/sassy/tests/prims/iter61
-rw-r--r--test-suite/standalone/sassy/tests/prims/iter6.scm41
-rw-r--r--test-suite/standalone/sassy/tests/prims/label11
-rw-r--r--test-suite/standalone/sassy/tests/prims/label1.scm13
-rw-r--r--test-suite/standalone/sassy/tests/prims/label21
-rw-r--r--test-suite/standalone/sassy/tests/prims/label2.scm15
-rw-r--r--test-suite/standalone/sassy/tests/prims/label3bin0 -> 24 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/label3.scm25
-rw-r--r--test-suite/standalone/sassy/tests/prims/label4bin0 -> 25 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/label4.scm50
-rw-r--r--test-suite/standalone/sassy/tests/prims/leap-mark11
-rw-r--r--test-suite/standalone/sassy/tests/prims/leap-mark1.scm10
-rw-r--r--test-suite/standalone/sassy/tests/prims/leap-mark21
-rw-r--r--test-suite/standalone/sassy/tests/prims/leap-mark2.scm19
-rw-r--r--test-suite/standalone/sassy/tests/prims/leap-mark3bin0 -> 37 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/leap-mark3.scm31
-rw-r--r--test-suite/standalone/sassy/tests/prims/locals1bin0 -> 13 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/locals1.scm17
-rw-r--r--test-suite/standalone/sassy/tests/prims/locals2bin0 -> 24 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/locals2.scm28
-rw-r--r--test-suite/standalone/sassy/tests/prims/locals3bin0 -> 24 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/locals3.scm25
-rw-r--r--test-suite/standalone/sassy/tests/prims/locals4bin0 -> 25 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/locals4.scm25
-rw-r--r--test-suite/standalone/sassy/tests/prims/locals5bin0 -> 26 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/locals5.scm44
-rw-r--r--test-suite/standalone/sassy/tests/prims/locals6bin0 -> 26 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/locals6.scm41
-rw-r--r--test-suite/standalone/sassy/tests/prims/locals7bin0 -> 24 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/locals7.scm25
-rw-r--r--test-suite/standalone/sassy/tests/prims/locals8bin0 -> 8 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/locals8.scm15
-rw-r--r--test-suite/standalone/sassy/tests/prims/seq11
-rw-r--r--test-suite/standalone/sassy/tests/prims/seq1.scm15
-rw-r--r--test-suite/standalone/sassy/tests/prims/seq21
-rw-r--r--test-suite/standalone/sassy/tests/prims/seq2.scm20
-rw-r--r--test-suite/standalone/sassy/tests/prims/seq31
-rw-r--r--test-suite/standalone/sassy/tests/prims/seq3.scm20
-rw-r--r--test-suite/standalone/sassy/tests/prims/while11
-rw-r--r--test-suite/standalone/sassy/tests/prims/while1.scm18
-rw-r--r--test-suite/standalone/sassy/tests/prims/while21
-rw-r--r--test-suite/standalone/sassy/tests/prims/while2.scm20
-rw-r--r--test-suite/standalone/sassy/tests/prims/while31
-rw-r--r--test-suite/standalone/sassy/tests/prims/while3.scm25
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-lose11
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-lose1.scm20
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-lose2bin0 -> 17 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-lose2.scm20
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-lose31
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-lose3.scm27
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win-lose1bin0 -> 19 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win-lose1.scm16
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win-lose2bin0 -> 25 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win-lose2.scm24
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win-lose3bin0 -> 33 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win-lose3.scm24
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win-lose41
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win-lose4.scm13
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win-lose5bin0 -> 17 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win-lose5.scm16
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win11
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win1.scm20
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win21
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win2.scm18
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win32
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win3.scm31
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win41
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win4.scm9
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win5bin0 -> 19 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims/with-win5.scm15
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16alt11
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16alt1.scm20
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16alt21
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16alt2.scm18
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16alt3bin0 -> 13 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16alt3.scm17
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16alt41
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16alt4.scm18
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16begin11
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16begin1.scm17
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16begin21
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16begin2.scm16
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16begin31
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16begin3.scm17
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16begin41
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16begin4.scm18
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16begin51
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16begin5.scm20
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16esc1bin0 -> 31 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16esc1.scm36
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16esc2bin0 -> 32 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16esc2.scm37
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16esc3bin0 -> 19 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16esc3.scm19
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16esc4bin0 -> 40 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16esc4.scm37
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16esc5bin0 -> 32 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16esc5.scm37
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16esc6bin0 -> 10 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16esc6.scm15
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16esc71
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16esc7.scm18
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16exp-k11
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16exp-k1.scm27
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16exp-k21
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16exp-k2.scm27
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16exp-k31
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16exp-k3.scm26
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16exp-k41
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16exp-k4.scm31
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16if11
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16if1.scm18
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16if21
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16if2.scm23
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16if31
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16if3.scm28
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16if41
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16if4.scm27
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16inv11
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16inv1.scm22
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16inv21
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16inv2.scm20
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16inv31
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16inv3.scm21
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16inv41
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16inv4.scm21
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16inv51
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16inv5.scm23
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16inv61
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16inv6.scm23
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16iter11
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16iter1.scm13
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16iter21
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16iter2.scm15
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16iter31
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16iter3.scm15
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16iter41
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16iter4.scm19
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16iter5bin0 -> 371 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16iter5.scm40
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16iter61
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16iter6.scm43
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16label11
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16label1.scm13
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16label21
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16label2.scm15
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16label3bin0 -> 20 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16label3.scm25
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16label4bin0 -> 19 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16label4.scm49
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16leap-mark11
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16leap-mark1.scm12
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16leap-mark21
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16leap-mark2.scm21
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16leap-mark3bin0 -> 33 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16leap-mark3.scm32
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16locals1bin0 -> 9 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16locals1.scm18
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16locals2bin0 -> 16 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16locals2.scm25
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16locals3bin0 -> 16 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16locals3.scm25
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16locals4bin0 -> 19 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16locals4.scm25
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16locals5bin0 -> 24 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16locals5.scm38
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16locals6bin0 -> 24 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16locals6.scm37
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16locals7bin0 -> 16 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16locals7.scm23
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16locals8bin0 -> 6 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16locals8.scm17
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16seq11
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16seq1.scm17
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16seq21
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16seq2.scm22
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16seq31
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16seq3.scm22
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16while11
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16while1.scm20
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16while21
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16while2.scm20
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16while31
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16while3.scm26
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-lose11
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-lose1.scm22
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-lose2bin0 -> 15 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-lose2.scm21
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-lose31
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-lose3.scm26
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win-lose1bin0 -> 15 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win-lose1.scm17
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win-lose2bin0 -> 21 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win-lose2.scm24
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win-lose3bin0 -> 25 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win-lose3.scm24
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win-lose41
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win-lose4.scm15
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win-lose51
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win-lose5.scm17
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win11
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win1.scm18
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win21
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win2.scm19
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win3bin0 -> 29 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win3.scm28
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win41
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win4.scm10
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win5bin0 -> 15 bytes
-rw-r--r--test-suite/standalone/sassy/tests/prims16/16with-win5.scm19
-rw-r--r--test-suite/standalone/sassy/tests/quick-elf.scm17
-rw-r--r--test-suite/standalone/sassy/tests/r-rm1
-rw-r--r--test-suite/standalone/sassy/tests/r-rm.asm5
-rw-r--r--test-suite/standalone/sassy/tests/r-rm.scm4
-rw-r--r--test-suite/standalone/sassy/tests/r-rm161
-rw-r--r--test-suite/standalone/sassy/tests/r-rm16.asm5
-rw-r--r--test-suite/standalone/sassy/tests/regenerate.scm2
-rw-r--r--test-suite/standalone/sassy/tests/ret1
-rw-r--r--test-suite/standalone/sassy/tests/ret.asm6
-rw-r--r--test-suite/standalone/sassy/tests/ret.scm5
-rw-r--r--test-suite/standalone/sassy/tests/ret161
-rw-r--r--test-suite/standalone/sassy/tests/ret16.asm6
-rw-r--r--test-suite/standalone/sassy/tests/rmbin0 -> 40 bytes
-rw-r--r--test-suite/standalone/sassy/tests/rm.asm8
-rw-r--r--test-suite/standalone/sassy/tests/rm.scm8
-rw-r--r--test-suite/standalone/sassy/tests/rm16bin0 -> 45 bytes
-rw-r--r--test-suite/standalone/sassy/tests/rm16.asm8
-rw-r--r--test-suite/standalone/sassy/tests/rm21
-rw-r--r--test-suite/standalone/sassy/tests/rm2.asm5
-rw-r--r--test-suite/standalone/sassy/tests/rm2.scm4
-rw-r--r--test-suite/standalone/sassy/tests/rm2161
-rw-r--r--test-suite/standalone/sassy/tests/rm216.asm5
-rw-r--r--test-suite/standalone/sassy/tests/run-tests.scm541
-rw-r--r--test-suite/standalone/sassy/tests/sect.scm9
-rw-r--r--test-suite/standalone/sassy/tests/segbin0 -> 36 bytes
-rw-r--r--test-suite/standalone/sassy/tests/seg.asm9
-rw-r--r--test-suite/standalone/sassy/tests/seg.scm8
-rw-r--r--test-suite/standalone/sassy/tests/seg16bin0 -> 48 bytes
-rw-r--r--test-suite/standalone/sassy/tests/seg16.asm9
-rw-r--r--test-suite/standalone/sassy/tests/setcc1
-rw-r--r--test-suite/standalone/sassy/tests/setcc.asm33
-rw-r--r--test-suite/standalone/sassy/tests/setcc.scm34
-rw-r--r--test-suite/standalone/sassy/tests/setcc161
-rw-r--r--test-suite/standalone/sassy/tests/setcc16.asm33
-rw-r--r--test-suite/standalone/sassy/tests/shiftbin0 -> 8 bytes
-rw-r--r--test-suite/standalone/sassy/tests/shift.asm5
-rw-r--r--test-suite/standalone/sassy/tests/shift.scm20
-rw-r--r--test-suite/standalone/sassy/tests/shift16bin0 -> 11 bytes
-rw-r--r--test-suite/standalone/sassy/tests/shift16.asm5
-rw-r--r--test-suite/standalone/sassy/tests/sse1bin0 -> 272 bytes
-rw-r--r--test-suite/standalone/sassy/tests/sse1.asm81
-rw-r--r--test-suite/standalone/sassy/tests/sse1.scm81
-rw-r--r--test-suite/standalone/sassy/tests/sse2bin0 -> 304 bytes
-rw-r--r--test-suite/standalone/sassy/tests/sse2.asm79
-rw-r--r--test-suite/standalone/sassy/tests/sse2.scm78
-rw-r--r--test-suite/standalone/sassy/tests/sse31
-rw-r--r--test-suite/standalone/sassy/tests/sse3.asm16
-rw-r--r--test-suite/standalone/sassy/tests/sse3.scm18
-rw-r--r--test-suite/standalone/sassy/tests/sysexitbin0 -> 612 bytes
-rw-r--r--test-suite/standalone/sassy/tests/sysexit.scm8
-rw-r--r--test-suite/standalone/sassy/tests/sysexit2.scm11
460 files changed, 7950 insertions, 0 deletions
diff --git a/test-suite/standalone/sassy/tests/aa b/test-suite/standalone/sassy/tests/aa
new file mode 100644
index 000000000..52628af8d
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/aa
@@ -0,0 +1,2 @@
+ี
+ิ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/aa.asm b/test-suite/standalone/sassy/tests/aa.asm
new file mode 100644
index 000000000..cfb4d7dab
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/aa.asm
@@ -0,0 +1,5 @@
+BITS 32
+section .text
+foo:
+aad
+aam 9
diff --git a/test-suite/standalone/sassy/tests/aa.scm b/test-suite/standalone/sassy/tests/aa.scm
new file mode 100644
index 000000000..f1c14e423
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/aa.scm
@@ -0,0 +1,5 @@
+(
+(aad)
+(aam 9)
+)
+
diff --git a/test-suite/standalone/sassy/tests/all b/test-suite/standalone/sassy/tests/all
new file mode 100644
index 000000000..f44fa957d
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/all
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/all.asm b/test-suite/standalone/sassy/tests/all.asm
new file mode 100644
index 000000000..97ca08acc
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/all.asm
@@ -0,0 +1,870 @@
+BITS 32
+section .text
+foo:
+loop foo
+loope foo, cx
+loopz foo, ecx
+loopne foo
+loopnz foo, cx
+jcxz foo
+jecxz foo
+call dword 0
+call word 0
+call dword 1000:1000
+call word 1000:1000
+call far dword [ecx]
+call far word [ecx]
+call ecx
+call dword [ecx]
+call cx
+call word [ecx]
+jmp dword 0
+jmp near dword 0
+jmp word 0
+jmp near word 0
+jmp dword 1000:1000
+jmp word 1000:1000
+jmp far dword [ecx]
+jmp far word [ecx]
+jmp ecx
+jmp dword [ecx]
+jmp cx
+jmp word [ecx]
+add eax, [ecx]
+add eax, [ebp]
+add eax, [esp]
+add eax, [100]
+add eax, [1600]
+add eax, [ecx*1]
+add eax, [ecx*2]
+add eax, [ecx*4]
+add eax, [ecx*8]
+add eax, [ebp*1]
+add eax, [ebp*2]
+add eax, [ebp*4]
+add eax, [ebp*8]
+add eax, [ecx+100]
+add eax, [ecx+1600]
+add eax, [ebp+100]
+add eax, [ebp+1600]
+add eax, [esp+100]
+add eax, [esp+1600]
+add eax, [100+ecx]
+add eax, [1600+ecx]
+add eax, [100+ebp]
+add eax, [1000+ebp+600]
+add eax, [100+esp]
+add eax, [1600+esp]
+add eax, [ecx+edx*1]
+add eax, [ebp*1+ecx]
+add eax, [ecx+edx*2]
+add eax, [ebp*2+ecx]
+add eax, [ecx+edx*4]
+add eax, [ebp*4+ecx]
+add eax, [ecx+edx*8]
+add eax, [ecx+ebp*8]
+add eax, [edx*1+ebp]
+add eax, [ebp+ebp*1]
+add eax, [ebp+edx*2]
+add eax, [ebp+ebp*2]
+add eax, [ebp+edx*4]
+add eax, [ebp*4+ebp]
+add eax, [ebp+edx*8]
+add eax, [ebp+ebp*8]
+add eax, [esp+edx*1]
+add eax, [esp+ebp*1]
+add eax, [esp+edx*2]
+add eax, [ebp*2+esp]
+add eax, [esp+edx*4]
+add eax, [esp+ebp*4]
+add eax, [esp+edx*8]
+add eax, [esp+ebp*8]
+add eax, [ecx*1+100]
+add eax, [ecx*2+100]
+add eax, [100+ecx*4]
+add eax, [ecx*8+100]
+add eax, [100+ebp*1]
+add eax, [ebp*2+100]
+add eax, [100+ebp*4]
+add eax, [ebp*8+100]
+add eax, [1600+ecx*1]
+add eax, [ecx*2+1600]
+add eax, [ecx*4+1600]
+add eax, [1600+ecx*8]
+add eax, [ebp*1+1600]
+add eax, [1600+ebp*2]
+add eax, [ebp*4+1600]
+add eax, [ebp*8+1600]
+add eax, [ecx+100+edx*1]
+add eax, [ecx+edx*2+100]
+add eax, [edx*4+ecx+100]
+add eax, [ecx+edx*8+100]
+add eax, [ecx+ebp*1+100]
+add eax, [ecx+ebp*2+100]
+add eax, [ecx+ebp*4+100]
+add eax, [100+ecx+ebp*8]
+add eax, [ebp+edx*1+100]
+add eax, [ebp+edx*2+100]
+add eax, [ebp+edx*4+100]
+add eax, [ebp+edx*8+100]
+add eax, [ebp+ebp*1+100]
+add eax, [100+ebp*2+ebp]
+add eax, [ebp+ebp*4+100]
+add eax, [ebp+ebp*8+100]
+add eax, [esp+edx*1+100]
+add eax, [esp+edx*2+100]
+add eax, [esp+edx*4+100]
+add eax, [esp+edx*8+100]
+add eax, [esp+ebp*1+100]
+add eax, [esp+ebp*2+100]
+add eax, [esp+ebp*4+100]
+add eax, [esp+ebp*8+100]
+add eax, [ecx+edx*1+1600]
+add eax, [ecx+edx*2+1600]
+add eax, [ecx+edx*4+1600]
+add eax, [ecx+edx*8+1600]
+add eax, [ecx+ebp*1+1600]
+add eax, [ecx+ebp*2+1600]
+add eax, [ecx+ebp*4+1600]
+add eax, [ecx+ebp*8+1600]
+add eax, [ebp+edx*1+1600]
+add eax, [ebp+edx*2+1600]
+add eax, [ebp+edx*4+1600]
+add eax, [ebp+edx*8+1600]
+add eax, [ebp+ebp*1+1600]
+add eax, [ebp+ebp*2+1600]
+add eax, [ebp+ebp*4+1600]
+add eax, [ebp+ebp*8+1600]
+add eax, [esp+edx*1+1600]
+add eax, [esp+edx*2+1600]
+add eax, [esp+edx*4+1600]
+add eax, [esp+edx*8+1600]
+add eax, [esp+ebp*1+1600]
+add eax, [esp+ebp*2+1600]
+add eax, [esp+ebp*4+1600]
+add eax, [esp+ebp*8+1600]
+aaa
+aas
+cbw
+cdq
+clc
+cld
+cli
+clts
+cmc
+cmpsb
+cmpsw
+cmpsd
+cpuid
+cwde
+cwd
+daa
+das
+hlt
+insb
+insw
+insd
+int3
+into
+invd
+iret
+iretw
+iretd
+lahf
+leave
+lodsb
+lodsw
+lodsd
+movsb
+movsw
+movsd
+nop
+outsb
+outsw
+outsd
+popa
+popaw
+popad
+popf
+popfw
+popfd
+pusha
+pushaw
+pushad
+pushf
+pushfw
+pushfd
+rdmsr
+rdpmc
+rdtsc
+rsm
+sahf
+scasb
+scasw
+scasd
+stc
+std
+sti
+stosb
+stosw
+stosd
+ud2
+wbinvd
+wrmsr
+xlat
+xlatb
+sysenter
+sysexit
+adc al, 100
+add ax, 1000
+and eax, 50000
+cmp bl, 100
+sbb cx, word 1000
+xor edx, dword 50000
+add cx, byte 100
+cmp edx, byte 100
+adc dword [eax+edx*4+100], dword 50000
+or dword [edx], byte 100
+sub word [eax+edx], word 1000
+and word [eax+edx], byte 100
+or byte [eax+edx*4+100], byte 100
+sbb bl, bl
+sub [ebx], bl
+xor cx, cx
+adc [eax+edx], cx
+add edx, edx
+and [eax+edx*4+100], edx
+cmp bl, [ebx]
+or cx, [eax+edx]
+sbb edx, [eax+edx*4+100]
+bt si, si
+btc [100+200+edx], si
+btr [8*eax], edi
+bts edi, edi
+bt si, 9
+btc word [100+200+edx], byte 9
+btr edi, 9
+bts dword [8*eax], byte 9
+rcl ebp, 1
+rcr dword [eax+1000], 1
+seto ah
+setno [eax+esi*1]
+setb ah
+setc [eax+esi*1]
+setnae ah
+setnb [eax+esi*1]
+setnc ah
+setae [eax+esi*1]
+sete ah
+setz [eax+esi*1]
+setne ah
+setnz [eax+esi*1]
+setbe ah
+setna [eax+esi*1]
+seta ah
+setnbe [eax+esi*1]
+sets ah
+setns [eax+esi*1]
+setp ah
+setpe [eax+esi*1]
+setnp ah
+setpo [eax+esi*1]
+setl ah
+setnge [eax+esi*1]
+setge ah
+setnl [eax+esi*1]
+setle ah
+setng [eax+esi*1]
+setnle ah
+setg [eax+esi*1]
+cmovo cx, bx
+cmovno bx, [edx+esi*4]
+cmovb edx, eax
+cmovc ebp, [esp+eax*4]
+cmovnae cx, bx
+cmovnb bx, [edx+esi*4]
+cmovnc edx, eax
+cmovae ebp, [esp+eax*4]
+cmove cx, bx
+cmovz bx, [edx+esi*4]
+cmovne edx, eax
+cmovnz ebp, [esp+eax*4]
+cmovbe cx, bx
+cmovna bx, [edx+esi*4]
+cmova edx, eax
+cmovnbe ebp, [esp+eax*4]
+cmovs cx, bx
+cmovns bx, [edx+esi*4]
+cmovp edx, eax
+cmovpe ebp, [esp+eax*4]
+cmovnp cx, bx
+cmovpo bx, [edx+esi*4]
+cmovl edx, eax
+cmovnge ebp, [esp+eax*4]
+cmovge cx, bx
+cmovnl bx, [edx+esi*4]
+cmovle edx, eax
+cmovng ebp, [esp+eax*4]
+cmovnle cx, bx
+cmovg bx, [edx+esi*4]
+dec dword [eax]
+inc word [eax]
+dec byte [eax]
+inc ch
+dec esp
+inc dx
+div dword [ebx]
+idiv word [ebx]
+mul byte [ebx]
+neg edi
+not edi
+div edi
+lds edi, [esi]
+les di, [esi]
+lea edi, [esi]
+lfs di, [esi]
+lgs edi, [esi]
+lss di, [esi]
+movsx ebp, ax
+movzx ebp, word [edi]
+movsx ebp, al
+movzx ebp, byte [edi]
+movsx bp, ah
+movzx bp, [edi]
+bsf bx, ax
+bsr bx, [eax]
+lar ebx, eax
+lsl ebx, [eax]
+invlpg [200+8*esi+esp+100]
+lgdt [200+8*esi+esp+100]
+sgdt [200+8*esi+esp+100]
+lidt [200+8*esi+esp+100]
+sidt [200+8*esi+esp+100]
+lldt sp
+sldt [esp]
+lmsw sp
+smsw [esp]
+ltr sp
+str [esp]
+verr sp
+verw [esp]
+aad
+aam 9
+ret
+retn 1000
+retf
+shld bx, ax, 9
+shrd [ebx], ax, 9
+shld ebx, eax, 9
+shrd [ebx], eax, 9
+shld bx, ax, cl
+shrd [ebx], ax, cl
+shld ebx, eax, cl
+shrd [ebx], eax, cl
+cmpxchg al, bh
+xadd [eax], bh
+cmpxchg ax, bx
+xadd [eax], bx
+cmpxchg eax, ebx
+xadd [eax], ebx
+arpl cx, bx
+arpl [ecx], bx
+bound ax, [edi]
+bound eax, [edi]
+bswap edx
+cmpxchg8b [edx+ecx]
+enter 1000, 100
+xchg ax, bx
+xchg bx, ax
+xchg eax, ebx
+xchg ebx, eax
+xchg al, ah
+xchg [ebx], ah
+xchg cx, bx
+xchg [ecx], bx
+xchg ecx, ebx
+xchg [ecx], ebx
+xchg al, [edi]
+xchg ax, [edi]
+xchg eax, [edi]
+in al, 9
+in ax, 9
+in eax, 9
+in al, dx
+in ax, dx
+in eax, dx
+out 9, al
+out 9, ax
+out 9, eax
+out dx, al
+out dx, ax
+out dx, eax
+int 128
+pop cx
+pop ecx
+pop dword [ecx]
+pop word [ecx]
+pop ds
+pop es
+pop ss
+pop fs
+pop gs
+push cx
+push edx
+push dword 100
+push word 100
+push byte 100
+push word [esi]
+push dword [esi]
+push cs
+push ds
+push es
+push ss
+push fs
+push gs
+imul ax, bx, word 100
+imul ax, [ebx], word 100
+imul ax, bx, byte 100
+imul ax, [ebx], byte 100
+imul eax, ebx, dword 100
+imul eax, [ebx], dword 100
+imul eax, ebx, byte 100
+imul eax, [ebx], byte 100
+imul eax, dword 100
+imul eax, byte 100
+imul ax, word 100
+imul ax, byte 100
+imul ax, bx
+imul ax, [ebx]
+imul eax, ebx
+imul eax, [ebx]
+imul al
+imul byte [eax]
+imul ax
+imul word [eax]
+imul eax
+imul dword [eax]
+test al, 9
+test ax, 9
+test eax, 9
+test bl, cl
+test [ebx], cl
+test bx, cx
+test [ebx], cx
+test ebx, ecx
+test [ebx], ecx
+test bl, 9
+test dword [ebx], 9
+test bx, 9
+test word [ebx], 9
+test ebx, 9
+test byte [ebx], 9
+mov bl, cl
+mov [edx], cl
+mov bx, dx
+mov [esi], dx
+mov ebx, edi
+mov [eax], edi
+mov bl, cl
+mov bl, [edx]
+mov bx, dx
+mov bx, [esi]
+mov ebx, edi
+mov ebx, [eax]
+mov bl, 9
+mov bx, 9
+mov ebx, 9
+mov [edx], byte 9
+mov [esi], word 9
+mov [eax], dword 9
+mov al, [9]
+mov ax, [9]
+mov eax, [9]
+mov [9], al
+mov [9], ax
+mov [9], eax
+mov bx, ds
+mov [esi], ss
+mov ebx, fs
+mov [eax], es
+mov gs, dx
+mov ds, [esi]
+mov fs, edi
+mov ss, [eax]
+mov ecx, cr2
+mov ecx, dr1
+mov cr0, edx
+mov dr0, edx
+jo near dword 0
+jno near word 0
+jb 0
+jc near dword 0
+jnae near word 0
+jnb 0
+jnc near dword 0
+jae near word 0
+je 0
+jz near dword 0
+jne near word 0
+jnz 0
+jbe near dword 0
+jna near word 0
+ja 0
+jnbe near dword 0
+js near word 0
+jns 0
+jp near dword 0
+jpe near word 0
+jnp 0
+jpo near dword 0
+jl near word 0
+jnge 0
+jge near dword 0
+jnl near word 0
+jle 0
+jng near dword 0
+jnle near word 0
+jg 0
+rep insd
+rep outsw
+rep lodsb
+rep stosd
+rep movsb
+repe cmpsb
+repz cmpsd
+repne scasd
+repnz scasb
+lock add byte [eax], 1
+lock dec dword [edx]
+lock xor [ecx], ecx
+fld1
+fldl2t
+fldl2e
+fldpi
+fldlg2
+fldln2
+fldz
+fsin
+fcos
+fsincos
+fptan
+fpatan
+f2xm1
+fyl2x
+fyl2xp1
+fincstp
+fdecstp
+finit
+fninit
+fclex
+fnclex
+fwait
+wait
+fnop
+fcompp
+fucompp
+ftst
+fxam
+fprem
+fprem1
+fabs
+fchs
+frndint
+fscale
+fsqrt
+fxtract
+fadd dword [eax]
+fsub qword [ebx]
+fsubr st0, st4
+fmul st7, st0
+fdiv dword [eax]
+fdivr qword [ebx]
+fdivrp st2, st0
+fdivp st2, st0
+fmulp st2, st0
+fsubp st3, st0
+fsubrp st2, st0
+faddp st4, st0
+fimul dword [eax]
+fiadd word [ebx]
+fidiv word [ebx]
+fidivr dword [eax]
+fisub word [ebx]
+fisubr dword [eax]
+fcmovb st0, st2
+fcmove st0, st3
+fcmovbe st0, st4
+fcmovu st0, st5
+fcmovnb st0, st6
+fcmovne st0, st7
+fcmovnbe st0, st1
+fcmovnu st0, st2
+fxch
+fucom st3
+fld tword [eax]
+fstp qword [ebx]
+fld dword [ecx]
+fstp st4
+fst dword [edx]
+fst qword [ebx]
+fst st3
+fild word [ebx]
+fistp dword [ebx]
+fild qword [ebx]
+fist word [ecx]
+ficom dword [ecx]
+ficomp word [ecx]
+fcomp dword [edi]
+fcom qword [edi]
+fcomp st0
+fcomi st0, st7
+fcomip st0, st6
+fucomi st0, st5
+fucomip st0, st4
+fbld tword [eax]
+fbstp tword [eax]
+fstcw word [ebx]
+fldcw word [ebx]
+fnstcw word [ebx]
+fstenv [eax]
+fnstenv [ebx]
+ffree st2
+fldenv [edx]
+fsave [edx]
+fnsave [edx]
+frstor [edx]
+fxsave [edx]
+fxrstor [edx]
+fstsw ax
+fstsw word [ebx]
+fnstsw ax
+fnstsw word [ebx]
+emms
+movd mm1, ebx
+movd mm1, [edx]
+movd ebx, mm1
+movd [edx], mm1
+movd xmm0, ebx
+movd xmm0, [edx]
+movd ebx, xmm0
+movd [edx], xmm0
+movq mm1, mm0
+movq mm1, [edx]
+movq mm0, mm1
+movq [edx], mm1
+movq xmm0, xmm1
+movq xmm0, [edx]
+movq xmm1, xmm0
+movq [edx], xmm0
+pand mm0, mm1
+pandn mm1, [edx]
+por xmm2, xmm3
+pxor xmm4, [ecx]
+packsswb mm0, mm1
+packssdw mm1, [edx]
+packuswb xmm2, xmm3
+punpckhbw xmm4, [ecx]
+punpckhwd mm0, mm1
+punpckhdq mm1, [edx]
+paddb xmm2, xmm3
+paddw xmm4, [ecx]
+paddd mm0, mm1
+paddsb mm1, [edx]
+paddsw xmm2, xmm3
+paddusb xmm4, [ecx]
+paddusw mm0, mm1
+psubb mm1, [edx]
+psubw xmm2, xmm3
+psubd xmm4, [ecx]
+psubsb mm0, mm1
+psubsw mm1, [edx]
+psubusb xmm2, xmm3
+psubusw xmm4, [ecx]
+pmullw mm0, mm1
+pmulhw mm1, [edx]
+pmaddwd xmm2, xmm3
+pcmpeqb xmm4, [ecx]
+pcmpeqw mm0, mm1
+pcmpeqd mm1, [edx]
+pcmpgtb xmm2, xmm3
+pcmpgtw xmm4, [ecx]
+pcmpgtd mm0, mm1
+punpcklbw mm2, mm3
+punpcklwd mm4, [ebx]
+punpckldq xmm5, xmm6
+punpcklbw xmm7, [edx]
+psrlw mm7, mm6
+psrld mm5, [edx]
+psrlq xmm7, xmm6
+psllw xmm5, [edx]
+pslld mm4, 100
+psllq xmm4, 100
+psraw mm7, mm6
+psrad mm5, [edx]
+movaps xmm5, xmm4
+movups xmm3, [edx]
+movaps [edx], xmm2
+movups xmm5, xmm4
+addps xmm3, xmm0
+subps xmm0, [edx]
+mulps xmm3, xmm0
+divps xmm0, [edx]
+rcpps xmm3, xmm0
+sqrtps xmm0, [edx]
+rsqrtps xmm3, xmm0
+maxps xmm0, [edx]
+minps xmm3, xmm0
+andps xmm0, [edx]
+andnps xmm3, xmm0
+orps xmm0, [edx]
+xorps xmm3, xmm0
+unpckhps xmm0, [edx]
+unpcklps xmm3, xmm0
+addss xmm0, xmm1
+subss xmm0, [eax]
+mulss xmm0, xmm1
+divss xmm0, [eax]
+rcpss xmm0, xmm1
+sqrtss xmm0, [eax]
+rsqrtss xmm0, xmm1
+maxss xmm0, [eax]
+minss xmm0, xmm1
+comiss xmm0, [eax]
+ucomiss xmm0, xmm1
+pavgb mm0, mm1
+pavgw mm2, [edx]
+pmaxub xmm3, xmm4
+pmaxsw xmm5, [edx]
+pminub mm0, mm1
+pminsw mm2, [edx]
+pmulhuw xmm3, xmm4
+psadbw xmm5, [edx]
+movhps xmm0, [edx]
+movlps [edx], xmm6
+movhlps xmm0, xmm1
+movlhps xmm1, xmm0
+shufps xmm0, xmm6, 10
+cmpps xmm5, [ecx], 20
+prefetcht0 [eax]
+prefetcht1 [eax]
+prefetcht2 [eax]
+prefetchnta [eax]
+sfence
+movntps [ecx], xmm3
+maskmovq mm3, mm4
+movntq [ebx], mm7
+pmovmskb eax, mm0
+pmovmskb ecx, xmm5
+pshufw mm0, mm1, 40
+pshufw mm0, [ebx], 30
+ldmxcsr [ebx]
+stmxcsr [edx]
+pinsrw mm1, eax, 4
+pinsrw mm0, [edx], 5
+pinsrw xmm4, ebx, 6
+pinsrw xmm3, [ecx], 7
+pextrw edx, mm3, 28
+pextrw esi, mm0, 14
+cvtsi2ss xmm3, edi
+cvtsi2ss xmm3, [edi]
+cvtpi2ps xmm4, mm2
+cvtpi2ps xmm4, [edi+100]
+movss xmm1, [edx]
+movss xmm1, xmm6
+movss [edx], xmm3
+movmskps ebx, xmm3
+cmpss xmm3, xmm4, 10
+cmpss xmm3, [edx], 20
+cvttss2si ebx, xmm3
+cvtss2si eax, [ecx]
+cvtps2pi mm3, xmm1
+cvttps2pi mm4, [edx]
+movapd xmm0, xmm1
+movupd xmm2, [edx]
+movdqa [eax], xmm3
+movdqu xmm0, xmm1
+movhpd xmm0, [ecx]
+movmskpd ebx, xmm4
+movlpd [ecx], xmm0
+movsd xmm5, xmm6
+movsd xmm7, [esi]
+movsd [esi], xmm7
+addpd xmm0, xmm1
+subpd xmm2, [ecx]
+mulpd xmm0, xmm1
+divpd xmm2, [ecx]
+sqrtpd xmm0, xmm1
+maxpd xmm2, [ecx]
+minpd xmm0, xmm1
+andpd xmm2, [ecx]
+andnpd xmm0, xmm1
+orpd xmm2, [ecx]
+xorpd xmm0, xmm1
+unpckhpd xmm2, [ecx]
+unpcklpd xmm0, xmm1
+cvtpd2dq xmm2, [ecx]
+cvttpd2dq xmm0, xmm1
+cvtdq2ps xmm2, [ecx]
+cvtps2dq xmm0, xmm1
+cvttps2dq xmm2, [ecx]
+cvtpd2ps xmm0, xmm1
+punpckhqdq xmm2, [ecx]
+punpcklqdq xmm0, xmm1
+addsd xmm2, xmm3
+subsd xmm4, [edi]
+mulsd xmm2, xmm3
+divsd xmm4, [edi]
+maxsd xmm2, xmm3
+minsd xmm4, [edi]
+sqrtsd xmm2, xmm3
+comisd xmm4, [edi]
+ucomisd xmm2, xmm3
+cvtdq2pd xmm4, [edi]
+cvtps2pd xmm2, xmm3
+cvtsd2ss xmm4, [edi]
+cmppd xmm0, xmm1, 10
+shufpd xmm2, [ebx], 20
+pshuflw xmm0, xmm1, 10
+pshufhw xmm2, [ebx], 20
+pshufd xmm0, xmm1, 10
+cmpsd xmm4, xmm5, 20
+cmpsd xmm6, [eax], 30
+cvttpd2pi mm0, xmm1
+cvtpd2pi mm0, [ebp]
+pause
+lfence
+mfence
+clflush [ebx]
+pmuludq mm0, mm1
+paddq mm0, [edx]
+psubq xmm3, xmm1
+pmuludq xmm3, [edx]
+maskmovdqu xmm1, xmm2
+movnti [edx], eax
+movq2dq xmm3, mm4
+movdq2q mm5, xmm7
+movntpd [eax], xmm3
+movntdq [ebx], xmm4
+pslldq xmm3, 20
+psrldq xmm3, 20
+cvtpi2pd xmm3, mm4
+cvtpi2pd xmm3, [ecx]
+cvtss2sd xmm3, xmm6
+cvtss2sd xmm3, [edx]
+cvtsd2si ecx, xmm3
+cvttsd2si edx, [edx]
+cvtsi2sd xmm3, eax
+cvtsi2sd xmm3, [eax]
+monitor
+mwait
+lddqu xmm0, [edx]
+movddup xmm0, xmm1
+addsubps xmm0, xmm1
+addsubpd xmm2, [edx]
+haddps xmm0, xmm1
+hsubps xmm2, [edx]
+haddpd xmm0, xmm1
+hsubpd xmm2, [edx]
+movshdup xmm0, xmm1
+movsldup xmm2, [edx]
+movddup xmm0, [edx]
diff --git a/test-suite/standalone/sassy/tests/alu b/test-suite/standalone/sassy/tests/alu
new file mode 100644
index 000000000..d0ca27e4b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/alu
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/alu.asm b/test-suite/standalone/sassy/tests/alu.asm
new file mode 100644
index 000000000..fbb9bf15b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/alu.asm
@@ -0,0 +1,25 @@
+BITS 32
+section .text
+foo:
+adc al, 100
+add ax, 1000
+and eax, 50000
+cmp bl, 100
+or cx, word 1000
+sbb edx, dword 50000
+sub cx, byte 100
+xor edx, byte 100
+adc dword [100+eax+edx*4], dword 50000
+add dword [edx], byte 100
+and word [eax+edx], word 1000
+cmp word [eax+edx], byte 100
+or byte [100+eax+edx*4], byte 100
+sbb bl, bl
+sub [ebx], bl
+xor cx, cx
+adc [eax+edx], cx
+add edx, edx
+and [100+eax+edx*4], edx
+cmp bl, [ebx]
+or cx, [eax+edx]
+sbb edx, [100+eax+edx*4]
diff --git a/test-suite/standalone/sassy/tests/alu.scm b/test-suite/standalone/sassy/tests/alu.scm
new file mode 100644
index 000000000..3c3308377
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/alu.scm
@@ -0,0 +1,24 @@
+(
+(adc al 100)
+(add ax 1000)
+(and eax 50000)
+(cmp bl 100)
+(or cx (word 1000))
+(sbb edx (dword 50000))
+(sub cx (byte 100))
+(xor edx (byte 100))
+(adc (dword (& eax (* edx 4) 100)) (dword 50000))
+(add (dword (& edx)) (byte 100))
+(and (word (& eax edx)) (word 1000))
+(cmp (word (& eax edx)) (byte 100))
+(or (byte (& eax (* edx 4) 100)) (byte 100))
+(sbb bl bl)
+(sub (& ebx) bl)
+(xor cx cx)
+(adc (& eax edx) cx)
+(add edx edx)
+(and (& eax (* edx 4) 100) edx)
+(cmp bl (& ebx))
+(or cx (& eax edx))
+(sbb edx (& eax (* edx 4) 100))
+)
diff --git a/test-suite/standalone/sassy/tests/alu16 b/test-suite/standalone/sassy/tests/alu16
new file mode 100644
index 000000000..03cc55b5f
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/alu16
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/alu16.asm b/test-suite/standalone/sassy/tests/alu16.asm
new file mode 100644
index 000000000..750150d21
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/alu16.asm
@@ -0,0 +1,25 @@
+BITS 16
+section .text
+foo:
+adc al, 100
+add ax, 1000
+and eax, 50000
+cmp bl, 100
+or cx, word 1000
+sbb edx, dword 50000
+sub cx, byte 100
+xor edx, byte 100
+adc dword [100+eax+edx*4], dword 50000
+add dword [edx], byte 100
+and word [eax+edx], word 1000
+cmp word [eax+edx], byte 100
+or byte [100+eax+edx*4], byte 100
+sbb bl, bl
+sub [ebx], bl
+xor cx, cx
+adc [eax+edx], cx
+add edx, edx
+and [100+eax+edx*4], edx
+cmp bl, [ebx]
+or cx, [eax+edx]
+sbb edx, [100+eax+edx*4]
diff --git a/test-suite/standalone/sassy/tests/brt b/test-suite/standalone/sassy/tests/brt
new file mode 100644
index 000000000..4c90f91c7
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/brt
@@ -0,0 +1 @@
+>…๙.ƒ๒ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/brt.scm b/test-suite/standalone/sassy/tests/brt.scm
new file mode 100644
index 000000000..31c957f2d
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/brt.scm
@@ -0,0 +1,4 @@
+(
+(brt (jnz 0))
+(brnt (jae 0))
+)
diff --git a/test-suite/standalone/sassy/tests/bt b/test-suite/standalone/sassy/tests/bt
new file mode 100644
index 000000000..cbac11b88
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/bt
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/bt.asm b/test-suite/standalone/sassy/tests/bt.asm
new file mode 100644
index 000000000..cc36979a9
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/bt.asm
@@ -0,0 +1,11 @@
+BITS 32
+section .text
+foo:
+bt si, si
+btc [dword 300+edx], si
+btr [8*eax], edi
+bts edi, edi
+bt si, 9
+btc word [dword 300+edx], byte 9
+btr edi, 9
+bts dword [8*eax], byte 9
diff --git a/test-suite/standalone/sassy/tests/bt.scm b/test-suite/standalone/sassy/tests/bt.scm
new file mode 100644
index 000000000..d81485c92
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/bt.scm
@@ -0,0 +1,10 @@
+(
+(bt si si)
+(btc (& 100 200 edx) si)
+(btr (& (* 8 eax)) edi)
+(bts edi edi)
+(bt si 9)
+(btc (word (& 100 200 edx)) (byte 9))
+(btr edi 9)
+(bts (dword (& (* 8 eax))) (byte 9))
+)
diff --git a/test-suite/standalone/sassy/tests/bt16 b/test-suite/standalone/sassy/tests/bt16
new file mode 100644
index 000000000..1d6a4ebb1
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/bt16
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/bt16.asm b/test-suite/standalone/sassy/tests/bt16.asm
new file mode 100644
index 000000000..3e2d749aa
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/bt16.asm
@@ -0,0 +1,11 @@
+BITS 16
+section .text
+foo:
+bt si, si
+btc [dword 300+edx], si
+btr [8*eax], edi
+bts edi, edi
+bt si, 9
+btc word [dword 300+edx], byte 9
+btr edi, 9
+bts dword [8*eax], byte 9
diff --git a/test-suite/standalone/sassy/tests/bye b/test-suite/standalone/sassy/tests/bye
new file mode 100644
index 000000000..a86c1d709
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/bye
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/bye.scm b/test-suite/standalone/sassy/tests/bye.scm
new file mode 100644
index 000000000..c2cc96778
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/bye.scm
@@ -0,0 +1,19 @@
+(export _global_offset_table_)
+(import a-string)
+(macro stdout 1)
+(macro write (lambda (fd buffer amount)
+ `(begin (mov ecx ,buffer)
+ (mov ebx ,fd)
+ (mov edx ,amount)
+ (mov eax ,4)
+ (int #x80))))
+(macro exit (lambda (exit-code)
+ `(begin (mov eax 1)
+ (mov ebx ,exit-code)
+ (int #x80))))
+(entry _start)
+(text (label _start get-got
+ (write stdout (& ebx (got a-string)) 9)
+ (exit 0)))
+
+
diff --git a/test-suite/standalone/sassy/tests/cell b/test-suite/standalone/sassy/tests/cell
new file mode 100755
index 000000000..2892e1efa
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/cell
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/cell.scm b/test-suite/standalone/sassy/tests/cell.scm
new file mode 100644
index 000000000..d7064ce75
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/cell.scm
@@ -0,0 +1,15 @@
+(macro define-cell
+ (lambda (name init)
+ `(begin (macro cell-tag "CELL")
+ (data (label ,name (dwords cell-tag ,init)))
+ (macro ,(string->symbol
+ (string-append (symbol->string name) "-ref"))
+ (& ,name 4)))))
+(define-cell foo 100)
+
+(entry _start)
+
+(text (label _start (mov ebx foo-ref)
+ (mov eax 1)
+ (int #x80)))
+
diff --git a/test-suite/standalone/sassy/tests/cmovcc b/test-suite/standalone/sassy/tests/cmovcc
new file mode 100644
index 000000000..ab1260599
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/cmovcc
@@ -0,0 +1 @@
+f@หfAฒBะB,„fBหfCฒCะC,„fDหfDฒEะE,„fFหfFฒGะG,„fHหfIฒJะJ,„fKหfKฒLะL,„fMหfMฒNะN,„fOหfOฒ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/cmovcc.asm b/test-suite/standalone/sassy/tests/cmovcc.asm
new file mode 100644
index 000000000..5c5e77b8e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/cmovcc.asm
@@ -0,0 +1,33 @@
+BITS 32
+section .text
+foo:
+cmovo cx, bx
+cmovno bx, [edx+esi*4]
+cmovb edx, eax
+cmovc ebp, [esp+eax*4]
+cmovnae cx, bx
+cmovnb bx, [edx+esi*4]
+cmovnc edx, eax
+cmovae ebp, [esp+eax*4]
+cmove cx, bx
+cmovz bx, [edx+esi*4]
+cmovne edx, eax
+cmovnz ebp, [esp+eax*4]
+cmovbe cx, bx
+cmovna bx, [edx+esi*4]
+cmova edx, eax
+cmovnbe ebp, [esp+eax*4]
+cmovs cx, bx
+cmovns bx, [edx+esi*4]
+cmovp edx, eax
+cmovpe ebp, [esp+eax*4]
+cmovnp cx, bx
+cmovpo bx, [edx+esi*4]
+cmovl edx, eax
+cmovnge ebp, [esp+eax*4]
+cmovge cx, bx
+cmovnl bx, [edx+esi*4]
+cmovle edx, eax
+cmovng ebp, [esp+eax*4]
+cmovnle cx, bx
+cmovg bx, [edx+esi*4]
diff --git a/test-suite/standalone/sassy/tests/cmovcc.scm b/test-suite/standalone/sassy/tests/cmovcc.scm
new file mode 100644
index 000000000..254ee59b0
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/cmovcc.scm
@@ -0,0 +1,35 @@
+(
+(cmovo cx bx)
+(cmovno bx (& edx (* esi 4)))
+(cmovb edx eax)
+(cmovc ebp (& esp (* eax 4)))
+(cmovnae cx bx)
+(cmovnb bx (& edx (* esi 4)))
+(cmovnc edx eax)
+(cmovae ebp (& esp (* eax 4)))
+(cmove cx bx)
+(cmovz bx (& edx (* esi 4)))
+(cmovne edx eax)
+(cmovnz ebp (& esp (* eax 4)))
+(cmovbe cx bx)
+(cmovna bx (& edx (* esi 4)))
+(cmova edx eax)
+(cmovnbe ebp (& esp (* eax 4)))
+(cmovs cx bx)
+(cmovns bx (& edx (* esi 4)))
+(cmovp edx eax)
+(cmovpe ebp (& esp (* eax 4)))
+(cmovnp cx bx)
+(cmovpo bx (& edx (* esi 4)))
+(cmovl edx eax)
+(cmovnge ebp (& esp (* eax 4)))
+(cmovge cx bx)
+(cmovnl bx (& edx (* esi 4)))
+(cmovle edx eax)
+(cmovng ebp (& esp (* eax 4)))
+(cmovnle cx bx)
+(cmovg bx (& edx (* esi 4)))
+)
+
+
+
diff --git a/test-suite/standalone/sassy/tests/cmpx b/test-suite/standalone/sassy/tests/cmpx
new file mode 100644
index 000000000..df3918141
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/cmpx
@@ -0,0 +1 @@
+ฐ๘ภ8fฑุfมฑุม \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/cmpx.asm b/test-suite/standalone/sassy/tests/cmpx.asm
new file mode 100644
index 000000000..71f733a06
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/cmpx.asm
@@ -0,0 +1,9 @@
+BITS 32
+section .text
+foo:
+cmpxchg al, bh
+xadd [eax], bh
+cmpxchg ax, bx
+xadd [eax], bx
+cmpxchg eax, ebx
+xadd [eax], ebx
diff --git a/test-suite/standalone/sassy/tests/cmpx.scm b/test-suite/standalone/sassy/tests/cmpx.scm
new file mode 100644
index 000000000..c9dc76056
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/cmpx.scm
@@ -0,0 +1,8 @@
+(
+(cmpxchg al bh)
+(xadd (& eax) bh)
+(cmpxchg ax bx)
+(xadd (& eax) bx)
+(cmpxchg eax ebx)
+(xadd (& eax) ebx)
+)
diff --git a/test-suite/standalone/sassy/tests/cmpx16 b/test-suite/standalone/sassy/tests/cmpx16
new file mode 100644
index 000000000..582930690
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/cmpx16
@@ -0,0 +1 @@
+ฐ๘gภ8ฑุgมfฑุfgม \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/cmpx16.asm b/test-suite/standalone/sassy/tests/cmpx16.asm
new file mode 100644
index 000000000..a654eb57b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/cmpx16.asm
@@ -0,0 +1,9 @@
+BITS 16
+section .text
+foo:
+cmpxchg al, bh
+xadd [eax], bh
+cmpxchg ax, bx
+xadd [eax], bx
+cmpxchg eax, ebx
+xadd [eax], ebx
diff --git a/test-suite/standalone/sassy/tests/count b/test-suite/standalone/sassy/tests/count
new file mode 100755
index 000000000..4dada3370
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/count
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/count.scm b/test-suite/standalone/sassy/tests/count.scm
new file mode 100644
index 000000000..6c44b8c26
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/count.scm
@@ -0,0 +1,28 @@
+(entry _start)
+
+(import exit mybuff)
+
+(export exit-code)
+
+(data (label exit-code (bytes 0)))
+
+(macro stdout 1)
+
+(macro write (lambda (fd buffer amount)
+ `(begin (mov ebx ,fd)
+ (mov ecx ,buffer)
+ (mov edx ,amount)
+ (mov eax ,4)
+ (int #x80))))
+
+(text
+ (label _start (mov ecx 0)
+ (mov eax "0")
+ (while (<= eax #\9)
+ (begin (push eax)
+ (mov (& mybuff) al)
+ (write stdout mybuff 1)
+ (pop eax)
+ (add eax 1)))
+ (jmp exit)))
+
diff --git a/test-suite/standalone/sassy/tests/decinc b/test-suite/standalone/sassy/tests/decinc
new file mode 100644
index 000000000..59125c2cf
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/decinc
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/decinc.asm b/test-suite/standalone/sassy/tests/decinc.asm
new file mode 100644
index 000000000..fdbd5fa49
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/decinc.asm
@@ -0,0 +1,9 @@
+BITS 32
+section .text
+foo:
+dec dword [eax]
+inc word [eax]
+dec byte [eax]
+inc ch
+dec esp
+inc dx
diff --git a/test-suite/standalone/sassy/tests/decinc.scm b/test-suite/standalone/sassy/tests/decinc.scm
new file mode 100644
index 000000000..f66d050b7
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/decinc.scm
@@ -0,0 +1,9 @@
+(
+(dec (dword (& eax)))
+(inc (word (& eax)))
+(dec (byte (& eax)))
+(inc ch)
+(dec esp)
+(inc dx)
+)
+
diff --git a/test-suite/standalone/sassy/tests/decinc16 b/test-suite/standalone/sassy/tests/decinc16
new file mode 100644
index 000000000..cf10d4586
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/decinc16
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/decinc16.asm b/test-suite/standalone/sassy/tests/decinc16.asm
new file mode 100644
index 000000000..02ccbb76f
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/decinc16.asm
@@ -0,0 +1,9 @@
+BITS 16
+section .text
+foo:
+dec dword [eax]
+inc word [eax]
+dec byte [eax]
+inc ch
+dec esp
+inc dx
diff --git a/test-suite/standalone/sassy/tests/doub-shift b/test-suite/standalone/sassy/tests/doub-shift
new file mode 100644
index 000000000..de8e6620d
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/doub-shift
@@ -0,0 +1 @@
+fคร fฌ คร ฌ fฅรfญฅรญ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/doub-shift.asm b/test-suite/standalone/sassy/tests/doub-shift.asm
new file mode 100644
index 000000000..0551fee48
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/doub-shift.asm
@@ -0,0 +1,11 @@
+BITS 32
+section .text
+foo:
+shld bx, ax, 9
+shrd [ebx], ax, 9
+shld ebx, eax, 9
+shrd [ebx], eax, 9
+shld bx, ax, cl
+shrd [ebx], ax, cl
+shld ebx, eax, cl
+shrd [ebx], eax, cl
diff --git a/test-suite/standalone/sassy/tests/doub-shift.scm b/test-suite/standalone/sassy/tests/doub-shift.scm
new file mode 100644
index 000000000..580ad9ee6
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/doub-shift.scm
@@ -0,0 +1,10 @@
+(
+(shld bx ax 9)
+(shrd (& ebx) ax 9)
+(shld ebx eax 9)
+(shrd (& ebx) eax 9)
+(shld bx ax cl)
+(shrd (& ebx) ax cl)
+(shld ebx eax cl)
+(shrd (& ebx) eax cl)
+)
diff --git a/test-suite/standalone/sassy/tests/doub-shift16 b/test-suite/standalone/sassy/tests/doub-shift16
new file mode 100644
index 000000000..31666f1d2
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/doub-shift16
@@ -0,0 +1 @@
+คร gฌ fคร gfฌ ฅรgญfฅรgfญ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/doub-shift16.asm b/test-suite/standalone/sassy/tests/doub-shift16.asm
new file mode 100644
index 000000000..b6ed696d3
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/doub-shift16.asm
@@ -0,0 +1,11 @@
+BITS 16
+section .text
+foo:
+shld bx, ax, 9
+shrd [ebx], ax, 9
+shld ebx, eax, 9
+shrd [ebx], eax, 9
+shld bx, ax, cl
+shrd [ebx], ax, cl
+shld ebx, eax, cl
+shrd [ebx], eax, cl
diff --git a/test-suite/standalone/sassy/tests/eip.scm b/test-suite/standalone/sassy/tests/eip.scm
new file mode 100644
index 000000000..21a2603b5
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/eip.scm
@@ -0,0 +1,18 @@
+*(call rel32)
+*(call rel16)
+*(call i16 i16
+*(call i16 i32
+*(call 'far m16
+*(call 'far m32
+(call r16)
+*(call m16)
+(call r32)
+*(call m32)
+
+jmp
+
+jcc
+
+loop
+
+jcxz/jecxz
diff --git a/test-suite/standalone/sassy/tests/fac5 b/test-suite/standalone/sassy/tests/fac5
new file mode 100755
index 000000000..1974086dc
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/fac5
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/fac5.scm b/test-suite/standalone/sassy/tests/fac5.scm
new file mode 100644
index 000000000..f79b5081c
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/fac5.scm
@@ -0,0 +1,12 @@
+(export _start)
+
+(text
+ (label _start
+ (mov eax 1)
+ (mov ecx 5)
+ (while (> ecx 0)
+ (begin (mul ecx)
+ (sub ecx 1))))
+ (mov ebx eax)
+ (mov eax 1)
+ (int #x80))
diff --git a/test-suite/standalone/sassy/tests/fp0 b/test-suite/standalone/sassy/tests/fp0
new file mode 100644
index 000000000..a29043d28
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/fp0
@@ -0,0 +1 @@
+ููููู่้๊๋์ูํู๎ููู๛ู๒ู๓ู๐ู๑ู๙ู๗ู๖›ใใ›โโ››ูะฺูู้ไูๅู๘ู๕ูแูเููู๚ู๔ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/fp0.asm b/test-suite/standalone/sassy/tests/fp0.asm
new file mode 100644
index 000000000..f1f4877cf
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/fp0.asm
@@ -0,0 +1,39 @@
+BITS 32
+section .text
+foo:
+fld1
+fldl2t
+fldl2e
+fldpi
+fldlg2
+fldln2
+fldz
+fsin
+fcos
+fsincos
+fptan
+fpatan
+f2xm1
+fyl2x
+fyl2xp1
+fincstp
+fdecstp
+finit
+fninit
+fclex
+fnclex
+fwait
+wait
+fnop
+fcompp
+fucompp
+ftst
+fxam
+fprem
+fprem1
+fabs
+fchs
+frndint
+fscale
+fsqrt
+fxtract
diff --git a/test-suite/standalone/sassy/tests/fp0.scm b/test-suite/standalone/sassy/tests/fp0.scm
new file mode 100644
index 000000000..ec9adafa1
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/fp0.scm
@@ -0,0 +1,39 @@
+(
+(fld1)
+(fldl2t)
+(fldl2e)
+(fldpi)
+(fldlg2)
+(fldln2)
+(fldz)
+(fsin)
+(fcos)
+(fsincos)
+(fptan)
+(fpatan)
+(f2xm1)
+(fyl2x)
+(fyl2xp1)
+(fincstp)
+(fdecstp)
+(finit)
+(fninit)
+(fclex)
+(fnclex)
+(fwait)
+(wait)
+(fnop)
+(fcompp)
+(fucompp)
+(ftst)
+(fxam)
+(fprem)
+(fprem1)
+(fabs)
+(fchs)
+(frndint)
+(fscale)
+(fsqrt)
+(fxtract)
+)
+ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/fp1 b/test-suite/standalone/sassy/tests/fp1
new file mode 100644
index 000000000..f928a75bc
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/fp1
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/fp1.asm b/test-suite/standalone/sassy/tests/fp1.asm
new file mode 100644
index 000000000..384bb750c
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/fp1.asm
@@ -0,0 +1,21 @@
+BITS 32
+section .text
+foo:
+fadd dword [eax]
+fsub qword [ebx]
+fsubr st0, st4
+fmul st7, st0
+fdiv dword [eax]
+fdivr qword [ebx]
+fdivrp st2, st0
+fdivp st2, st0
+fmulp st2, st0
+fsubp st3, st0
+fsubrp st2, st0
+faddp st4, st0
+fimul dword [eax]
+fiadd word [ebx]
+fidiv word [ebx]
+fidivr dword [eax]
+fisub word [ebx]
+fisubr dword [eax]
diff --git a/test-suite/standalone/sassy/tests/fp1.scm b/test-suite/standalone/sassy/tests/fp1.scm
new file mode 100644
index 000000000..8a70fd7f2
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/fp1.scm
@@ -0,0 +1,20 @@
+(
+(fadd (dword (& eax)))
+(fsub (qword (& ebx)))
+(fsubr st0 st4)
+(fmul st7 st0)
+(fdiv (dword (& eax)))
+(fdivr (qword (& ebx)))
+(fdivrp st2 st0)
+(fdivp st2 st0)
+(fmulp st2 st0)
+(fsubp st3 st0)
+(fsubrp st2 st0)
+(faddp st4 st0)
+(fimul (dword (& eax)))
+(fiadd (word (& ebx)))
+(fidiv (word (& ebx)))
+(fidivr (dword (& eax)))
+(fisub (word (& ebx)))
+(fisubr (dword (& eax)))
+)
diff --git a/test-suite/standalone/sassy/tests/fp2 b/test-suite/standalone/sassy/tests/fp2
new file mode 100644
index 000000000..2bcf538fd
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/fp2
@@ -0,0 +1 @@
+ฺยฺหฺิฺฦฯัฺูษใ(ููำ฿฿+฿ฺุุุ๗฿๖ํ฿์ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/fp2.asm b/test-suite/standalone/sassy/tests/fp2.asm
new file mode 100644
index 000000000..180a4dbfb
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/fp2.asm
@@ -0,0 +1,33 @@
+BITS 32
+section .text
+foo:
+fcmovb st0, st2
+fcmove st0, st3
+fcmovbe st0, st4
+fcmovu st0, st5
+fcmovnb st0, st6
+fcmovne st0, st7
+fcmovnbe st0, st1
+fcmovnu st0, st2
+fxch
+fucom st3
+fld tword [eax]
+fstp qword [ebx]
+fld dword [ecx]
+fstp st4
+fst dword [edx]
+fst qword [ebx]
+fst st3
+fild word [ebx]
+fistp dword [ebx]
+fild qword [ebx]
+fist word [ecx]
+ficom dword [ecx]
+ficomp word [ecx]
+fcomp dword [edi]
+fcom qword [edi]
+fcomp st0
+fcomi st0, st7
+fcomip st0, st6
+fucomi st0, st5
+fucomip st0, st4
diff --git a/test-suite/standalone/sassy/tests/fp2.scm b/test-suite/standalone/sassy/tests/fp2.scm
new file mode 100644
index 000000000..95fc13b2a
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/fp2.scm
@@ -0,0 +1,32 @@
+(
+(fcmovb st0 st2)
+(fcmove st0 st3)
+(fcmovbe st0 st4)
+(fcmovu st0 st5)
+(fcmovnb st0 st6)
+(fcmovne st0 st7)
+(fcmovnbe st0 st1)
+(fcmovnu st0 st2)
+(fxch)
+(fucom st3)
+(fld (tword (& eax)))
+(fstp (qword (& ebx)))
+(fld (dword (& ecx)))
+(fstp st4)
+(fst (dword (& edx)))
+(fst (qword (& ebx)))
+(fst st3)
+(fild (word (& ebx)))
+(fistp (dword (& ebx)))
+(fild (qword (& ebx)))
+(fist (word (& ecx)))
+(ficom (dword (& ecx)))
+(ficomp (word (& ecx)))
+(fcomp (dword (& edi)))
+(fcom (qword (& edi)))
+(fcomp st0)
+(fcomi st0 st7)
+(fcomip st0 st6)
+(fucomi st0 st5)
+(fucomip st0 st4)
+)
diff --git a/test-suite/standalone/sassy/tests/fp3 b/test-suite/standalone/sassy/tests/fp3
new file mode 100644
index 000000000..9d94f132b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/fp3
@@ -0,0 +1,2 @@
+฿ ฿0›ู;ู+ู;›ู0ู3ยู"›22"ฎฎ
+›฿เ›;฿เ; \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/fp3.asm b/test-suite/standalone/sassy/tests/fp3.asm
new file mode 100644
index 000000000..aa541ec75
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/fp3.asm
@@ -0,0 +1,21 @@
+BITS 32
+section .text
+foo:
+fbld tword [eax]
+fbstp tword [eax]
+fstcw word [ebx]
+fldcw word [ebx]
+fnstcw word [ebx]
+fstenv [eax]
+fnstenv [ebx]
+ffree st2
+fldenv [edx]
+fsave [edx]
+fnsave [edx]
+frstor [edx]
+fxsave [edx]
+fxrstor [edx]
+fstsw ax
+fstsw word [ebx]
+fnstsw ax
+fnstsw word [ebx]
diff --git a/test-suite/standalone/sassy/tests/fp3.scm b/test-suite/standalone/sassy/tests/fp3.scm
new file mode 100644
index 000000000..fdcac679c
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/fp3.scm
@@ -0,0 +1,20 @@
+(
+(fbld (tword (& eax)))
+(fbstp (tword (& eax)))
+(fstcw (word (& ebx)))
+(fldcw (word (& ebx)))
+(fnstcw (word (& ebx)))
+(fstenv (& eax))
+(fnstenv (& ebx))
+(ffree st2)
+(fldenv (& edx))
+(fsave (& edx))
+(fnsave (& edx))
+(frstor (& edx))
+(fxsave (& edx))
+(fxrstor (& edx))
+(fstsw ax)
+(fstsw (word (& ebx)))
+(fnstsw ax)
+(fnstsw (word (& ebx)))
+)
diff --git a/test-suite/standalone/sassy/tests/generate-nasm.scm b/test-suite/standalone/sassy/tests/generate-nasm.scm
new file mode 100644
index 000000000..baa924e39
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/generate-nasm.scm
@@ -0,0 +1,224 @@
+;loading this file populates the tests directory with .asm files and
+;calls nasm to assemble them
+
+;note: the files for seg.scm brt.scm isn't included with this
+
+; ,open c-system-function
+
+(define (andmap p lst)
+ (call-with-current-continuation
+ (lambda (lose)
+ (let iter ((lst lst))
+ (cond ((null? lst) '())
+ ((p (car lst)) => (lambda (this) (cons this (iter (cdr lst)))))
+ (else (lose #f)))))))
+
+(define opcode-files
+ (list
+ "tests/mem-ref.scm"
+ "tests/non.scm"
+ "tests/alu.scm"
+ "tests/bt.scm"
+ "tests/shift.scm"
+ "tests/setcc.scm"
+ "tests/cmovcc.scm"
+ "tests/decinc.scm"
+ "tests/plier.scm"
+ "tests/load.scm"
+ "tests/movx.scm"
+ "tests/r-rm.scm"
+ "tests/rm.scm"
+ "tests/rm2.scm"
+ "tests/aa.scm"
+ "tests/ret.scm"
+ "tests/doub-shift.scm"
+ "tests/cmpx.scm"
+ "tests/misc1.scm"
+ "tests/misc2.scm"
+ "tests/misc3.scm"
+ "tests/jcc.scm"
+ "tests/jumps.scm"
+ "tests/prefix.scm"
+ "tests/fp0.scm"
+ "tests/fp1.scm"
+ "tests/fp2.scm"
+ "tests/fp3.scm"
+ "tests/mmx.scm"
+ "tests/sse1.scm"
+ "tests/sse2.scm"
+ "tests/sse3.scm"
+ "tests/seg.scm"
+ ))
+
+(define opcode16-files
+ (list
+ "tests/alu.scm"
+ "tests/bt.scm"
+ "tests/cmpx.scm"
+ "tests/decinc.scm"
+ "tests/doub-shift.scm"
+ "tests/jcc.scm"
+ "tests/jumps.scm"
+ "tests/load.scm"
+ "tests/mem-ref.scm"
+ "tests/misc1.scm"
+ "tests/misc2.scm"
+ "tests/movx.scm"
+ "tests/non.scm"
+ "tests/plier.scm"
+ "tests/prefix.scm"
+ "tests/ret.scm"
+ "tests/rm2.scm"
+ "tests/rm.scm"
+ "tests/r-rm.scm"
+ "tests/setcc.scm"
+ "tests/shift.scm"
+ "tests/seg.scm"))
+
+(define (list-fill lst filler)
+ (cond ((null? lst) '())
+ ((null? (cdr lst)) lst)
+ (else (cons (car lst) (cons filler (list-fill (cdr lst) filler))))))
+
+(define (sassy->nasm file lst bits)
+ (with-output-to-file file
+ (lambda ()
+ (letrec
+ ((outs (lambda x (for-each display x) (newline)))
+ (i16 (meta-lambda
+ (or ,@num
+ ,@symb
+ (and 'word num)
+ (and 'word symb))))
+ (i32 (meta-lambda
+ (or ,@num
+ ,@symb
+ (and 'dword num)
+ (and 'dword symb))))
+ (prefix? (lambda (x)
+ (and (memq x '(rep repe repne repz repnz lock))
+ (symbol->string x))))
+
+ (a-sassy
+ (meta-lambda
+ (or
+ (and 'jmp num i32 (lambda (x y) (outs "jmp dword " x ":" y)))
+ (and 'jmp num i16 (lambda (x y) (outs "jmp word " x ":" y)))
+ (and 'call num i32 (lambda (x y) (outs "call dword " x ":" y)))
+ (and 'call num i16 (lambda (x y) (outs "call word " x ":" y)))
+ (and prefix? pair? (lambda (x y) (begin (outs x " ")
+ (a-sassy y))))
+ (and symb 'near rand (lambda (x y) (outs x " near " y)))
+ (and symb 'short rand (lambda (x y) (outs x " short " y)))
+ (and symb 'far rand (lambda (x y) (outs x " far " y)))
+ (and symb (lambda (x) (outs x)))
+ (and symb rand (lambda (x y) (outs x " " y)))
+ (and symb rand rand (lambda (x y z) (outs x " " y ", " z)))
+ (and symb rand rand rand (lambda (u v w x)
+ (outs u " " v ", " w ", " x))))))
+ (reg (lambda (x)
+ (and (memq x '(mm7 mm6 mm5 mm4 mm3 dr7 mm2 dr6 mm1 mm0 cr4
+ dr3 cr3 dr2 cr2 dr1 dr0 cr0 xmm7 xmm6
+ xmm5 xmm4 xmm3 xmm2 xmm1 xmm0 ss sp dx si
+ cx bx gs ax fs es ds cs bp dl cl bl al di
+ dh ch bh ah esp edx esi ecx ebx eax ebp
+ edi st7 st6 st5 st4 st3 st2 st1 st0))
+ (symbol->string x))))
+ (symb (lambda (x) (and (symbol? x) (not (reg x))
+ (symbol->string x))))
+ (num (lambda (x) (and (number? x) (number->string x))))
+ (segp (lambda (x)
+ (and (memq x '(cs ds ss es fs gs))
+ (string-append (symbol->string x) ":"))))
+ (skale
+ (meta-lambda
+ (or (and '* num reg (lambda (x y) (string-append x "*" y)))
+ (and '* reg num (lambda (x y) (string-append x "*" y))))))
+ (mem
+ (meta-lambda
+ (or
+ (and segp mem
+ (lambda (x y)
+ (if (and (> (string-length y) 7)
+ (string=? "[dword " (substring y 0 7)))
+ (string-append "[dword " x
+ (substring y 7 (string-length y)))
+ (string-append "[" x
+ (substring y 1 (string-length y))))))
+ (and '& __
+ (lambda x
+ (cond ((andmap (lambda (i) (or (num i) (symb i))) x) =>
+ (lambda (lst)
+ (apply string-append
+ "[dword "
+ (append (list-fill lst "+") (list "]")))))
+ (else
+ (let* ((nums (fold (lambda (f r)
+ (if (number? f)
+ (if (number? r)
+ (+ f r)
+ f)
+ r))
+ '()
+ x))
+ (dword (or (and (not (null? nums))
+ (not (u/s-byte nums)))
+ (any symb x)))
+ (itms (fold-right (lambda (x r)
+ (cond
+ ((or (reg x)
+ (skale x) (symb x))
+ => (lambda (i)
+ (cons i r)))
+ (else r)))
+ '()
+ x))
+ (lst (if (null? nums)
+ itms
+ (cons (number->string nums) itms))))
+ (if dword
+ (apply string-append
+ "[dword "
+ (append (list-fill lst "+")
+ (list "]")))
+ (apply string-append
+ "[" (append (list-fill lst "+")
+ (list "]")))
+ )))))))))
+ (sizer (lambda (x)
+ (and (memv x '(byte word dword qword tword dqword))
+ (symbol->string x))))
+ (rand
+ (meta-lambda
+ (or ,@reg
+ ,@num
+ ,@mem
+ ,@symb
+ (and sizer (or num mem reg symb)
+ (lambda (x y)
+ (string-append x " " y)))))))
+ (display bits)
+ (newline)
+ (display "section .text")
+ (newline)
+ (display "foo:")
+ (newline)
+ (for-each a-sassy lst)))))
+
+(define (gen-file x bits32?)
+ (let* ((nasm-asm (string-append
+ (substring x 0 (- (string-length x) 4))
+ (if bits32? ".asm" "16.asm")))
+ (nasm-out (string-append
+ (substring x 0 (- (string-length x) 4))
+ (if bits32? "" "16")))
+ (the-codes (with-input-from-file x (lambda () (read))))
+ (nasm-com (string-append "nasm -f bin " nasm-asm)))
+ (and (file-exists? nasm-asm) (delete-file nasm-asm))
+ (and (file-exists? nasm-out) (delete-file nasm-out))
+ (sassy->nasm nasm-asm the-codes (if bits32? "BITS 32" "BITS 16"))
+ (system nasm-com)))
+
+; (for-each (lambda (x) (gen-file x #t)) opcode-files)
+; (for-each (lambda (x) (gen-file x #f)) opcode16-files)
+
diff --git a/test-suite/standalone/sassy/tests/generate-prim.scm b/test-suite/standalone/sassy/tests/generate-prim.scm
new file mode 100644
index 000000000..a9dea4db2
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/generate-prim.scm
@@ -0,0 +1,161 @@
+;really these files should never be re-generated unless you're prepared
+;to inspect everyone of them for correctness. (Since they've already been inspected by hand).
+
+(define the-prims
+ (list "tests/prims/seq1.scm"
+ "tests/prims/seq2.scm"
+ "tests/prims/seq3.scm"
+ "tests/prims/alt1.scm"
+ "tests/prims/alt2.scm"
+ "tests/prims/alt3.scm"
+ "tests/prims/alt4.scm"
+ "tests/prims/begin1.scm"
+ "tests/prims/begin2.scm"
+ "tests/prims/begin3.scm"
+ "tests/prims/begin4.scm"
+ "tests/prims/begin5.scm"
+ "tests/prims/if1.scm"
+ "tests/prims/if2.scm"
+ "tests/prims/if3.scm"
+ "tests/prims/if4.scm"
+ "tests/prims/inv1.scm"
+ "tests/prims/inv2.scm"
+ "tests/prims/inv3.scm"
+ "tests/prims/inv4.scm"
+ "tests/prims/inv5.scm"
+ "tests/prims/inv6.scm"
+ "tests/prims/iter1.scm"
+ "tests/prims/iter2.scm"
+ "tests/prims/iter3.scm"
+ "tests/prims/iter4.scm"
+ "tests/prims/iter5.scm"
+ "tests/prims/iter6.scm"
+ "tests/prims/leap-mark1.scm"
+ "tests/prims/leap-mark2.scm"
+ "tests/prims/leap-mark3.scm"
+ "tests/prims/while1.scm"
+ "tests/prims/while2.scm"
+ "tests/prims/while3.scm"
+ "tests/prims/with-win1.scm"
+ "tests/prims/with-win2.scm"
+ "tests/prims/with-win3.scm"
+ "tests/prims/with-win4.scm"
+ "tests/prims/with-win5.scm"
+ "tests/prims/with-lose1.scm"
+ "tests/prims/with-lose2.scm"
+ "tests/prims/with-lose3.scm"
+ "tests/prims/with-win-lose1.scm"
+ "tests/prims/with-win-lose2.scm"
+ "tests/prims/with-win-lose3.scm"
+ "tests/prims/with-win-lose4.scm"
+ "tests/prims/with-win-lose5.scm"
+ "tests/prims/exp-k1.scm"
+ "tests/prims/exp-k2.scm"
+ "tests/prims/exp-k3.scm"
+ "tests/prims/exp-k4.scm"
+ "tests/prims/esc1.scm"
+ "tests/prims/esc2.scm"
+ "tests/prims/esc3.scm"
+ "tests/prims/esc4.scm"
+ "tests/prims/esc5.scm"
+ "tests/prims/esc6.scm"
+ "tests/prims/esc7.scm"
+ "tests/prims/label1.scm"
+ "tests/prims/label2.scm"
+ "tests/prims/label3.scm"
+ "tests/prims/label4.scm"
+ "tests/prims/locals1.scm"
+ "tests/prims/locals2.scm"
+ "tests/prims/locals3.scm"
+ "tests/prims/locals4.scm"
+ "tests/prims/locals5.scm"
+ "tests/prims/locals6.scm"
+ "tests/prims/locals7.scm"
+ "tests/prims/locals8.scm"
+ ))
+
+(define prims16
+ (list "tests/prims16/16seq1.scm"
+ "tests/prims16/16seq2.scm"
+ "tests/prims16/16seq3.scm"
+ "tests/prims16/16alt1.scm"
+ "tests/prims16/16alt2.scm"
+ "tests/prims16/16alt3.scm"
+ "tests/prims16/16alt4.scm"
+ "tests/prims16/16begin1.scm"
+ "tests/prims16/16begin2.scm"
+ "tests/prims16/16begin3.scm"
+ "tests/prims16/16begin4.scm"
+ "tests/prims16/16begin5.scm"
+ "tests/prims16/16if1.scm"
+ "tests/prims16/16if2.scm"
+ "tests/prims16/16if3.scm"
+ "tests/prims16/16if4.scm"
+ "tests/prims16/16inv1.scm"
+ "tests/prims16/16inv2.scm"
+ "tests/prims16/16inv3.scm"
+ "tests/prims16/16inv4.scm"
+ "tests/prims16/16inv5.scm"
+ "tests/prims16/16inv6.scm"
+ "tests/prims16/16iter1.scm"
+ "tests/prims16/16iter2.scm"
+ "tests/prims16/16iter3.scm"
+ "tests/prims16/16iter4.scm"
+ "tests/prims16/16iter5.scm"
+ "tests/prims16/16iter6.scm"
+ "tests/prims16/16leap-mark1.scm"
+ "tests/prims16/16leap-mark2.scm"
+ "tests/prims16/16leap-mark3.scm"
+ "tests/prims16/16while1.scm"
+ "tests/prims16/16while2.scm"
+ "tests/prims16/16while3.scm"
+ "tests/prims16/16with-win1.scm"
+ "tests/prims16/16with-win2.scm"
+ "tests/prims16/16with-win3.scm"
+ "tests/prims16/16with-win4.scm"
+ "tests/prims16/16with-win5.scm"
+ "tests/prims16/16with-lose1.scm"
+ "tests/prims16/16with-lose2.scm"
+ "tests/prims16/16with-lose3.scm"
+ "tests/prims16/16with-win-lose1.scm"
+ "tests/prims16/16with-win-lose2.scm"
+ "tests/prims16/16with-win-lose3.scm"
+ "tests/prims16/16with-win-lose4.scm"
+ "tests/prims16/16with-win-lose5.scm"
+ "tests/prims16/16exp-k1.scm"
+ "tests/prims16/16exp-k2.scm"
+ "tests/prims16/16exp-k3.scm"
+ "tests/prims16/16exp-k4.scm"
+ "tests/prims16/16esc1.scm"
+ "tests/prims16/16esc2.scm"
+ "tests/prims16/16esc3.scm"
+ "tests/prims16/16esc4.scm"
+ "tests/prims16/16esc5.scm"
+ "tests/prims16/16esc6.scm"
+ "tests/prims16/16esc7.scm"
+ "tests/prims16/16label1.scm"
+ "tests/prims16/16label2.scm"
+ "tests/prims16/16label3.scm"
+ "tests/prims16/16label4.scm"
+ "tests/prims16/16locals1.scm"
+ "tests/prims16/16locals2.scm"
+ "tests/prims16/16locals3.scm"
+ "tests/prims16/16locals4.scm"
+ "tests/prims16/16locals5.scm"
+ "tests/prims16/16locals6.scm"
+ "tests/prims16/16locals7.scm"
+ "tests/prims16/16locals8.scm"
+ ))
+
+
+(define (go-gen lst)
+ (for-each
+ (lambda (x)
+ (let ((outp (substring x 0 (- (string-length x) 4))))
+ (and (file-exists? outp)
+ (delete-file outp))
+ (sassy-make-bin outp (sassy x))))
+ lst))
+
+; (go-gen the-prims)
+; (go-gen prims16) \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/hello b/test-suite/standalone/sassy/tests/hello
new file mode 100644
index 000000000..d92f3c990
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/hello
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/hello.scm b/test-suite/standalone/sassy/tests/hello.scm
new file mode 100644
index 000000000..85ecb38b9
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/hello.scm
@@ -0,0 +1,9 @@
+(export _global_offset_table_)
+
+(import say-hello)
+
+(entry _start)
+
+(text (label _start (jmp (plt say-hello))))
+
+
diff --git a/test-suite/standalone/sassy/tests/include.scm b/test-suite/standalone/sassy/tests/include.scm
new file mode 100644
index 000000000..af199986d
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/include.scm
@@ -0,0 +1,2 @@
+(text (align 32)
+ (label foo (push eax)))
diff --git a/test-suite/standalone/sassy/tests/jcc b/test-suite/standalone/sassy/tests/jcc
new file mode 100644
index 000000000..df8011659
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/jcc
@@ -0,0 +1 @@
+€๚f๕‚๏‚้f‚ไƒƒุfƒำ„อ„วf…ย…ผ†ถf†ฑ‡ซ‡ฅfˆ ‰šŠ”fŠ‹‰‹ƒfŒ~ŒxrfmŽgŽaf\V \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/jcc.asm b/test-suite/standalone/sassy/tests/jcc.asm
new file mode 100644
index 000000000..0c7845688
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/jcc.asm
@@ -0,0 +1,33 @@
+BITS 32
+section .text
+foo:
+jo near dword foo
+jno near word foo
+jb 0
+jc near dword foo
+jnae near word foo
+jnb 0
+jnc near dword foo
+jae near word foo
+je 0
+jz near dword foo
+jne near word foo
+jnz 0
+jbe near dword foo
+jna near word foo
+ja 0
+jnbe near dword foo
+js near word foo
+jns 0
+jp near dword foo
+jpe near word foo
+jnp 0
+jpo near dword foo
+jl near word foo
+jnge 0
+jge near dword foo
+jnl near word foo
+jle 0
+jng near dword foo
+jnle near word foo
+jg 0
diff --git a/test-suite/standalone/sassy/tests/jcc.scm b/test-suite/standalone/sassy/tests/jcc.scm
new file mode 100644
index 000000000..bdef0ad6e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/jcc.scm
@@ -0,0 +1,32 @@
+(
+(jo near (dword foo))
+(jno near (word foo))
+(jb 0)
+(jc near (dword foo))
+(jnae near (word foo))
+(jnb 0)
+(jnc near (dword foo))
+(jae near (word foo))
+(je 0)
+(jz near (dword foo))
+(jne near (word foo))
+(jnz 0)
+(jbe near (dword foo))
+(jna near (word foo))
+(ja 0)
+(jnbe near (dword foo))
+(js near (word foo))
+(jns 0)
+(jp near (dword foo))
+(jpe near (word foo))
+(jnp 0)
+(jpo near (dword foo))
+(jl near (word foo))
+(jnge 0)
+(jge near (dword foo))
+(jnl near (word foo))
+(jle 0)
+(jng near (dword foo))
+(jnle near (word foo))
+(jg 0)
+)
diff --git a/test-suite/standalone/sassy/tests/jcc16 b/test-suite/standalone/sassy/tests/jcc16
new file mode 100644
index 000000000..983865714
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/jcc16
@@ -0,0 +1 @@
+f€๙๕‚๑f‚๊‚ๆƒโfƒƒื„ำf„ฬ…ศ…ฤf†ฝ†น‡ตf‡ฎˆช‰ฆfŠŸŠ›‹—f‹ŒŒŒˆf}ŽyfŽrnj \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/jcc16.asm b/test-suite/standalone/sassy/tests/jcc16.asm
new file mode 100644
index 000000000..860c05ac3
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/jcc16.asm
@@ -0,0 +1,33 @@
+BITS 16
+section .text
+foo:
+jo near dword foo
+jno near word foo
+jb 0
+jc near dword foo
+jnae near word foo
+jnb 0
+jnc near dword foo
+jae near word foo
+je 0
+jz near dword foo
+jne near word foo
+jnz 0
+jbe near dword foo
+jna near word foo
+ja 0
+jnbe near dword foo
+js near word foo
+jns 0
+jp near dword foo
+jpe near word foo
+jnp 0
+jpo near dword foo
+jl near word foo
+jnge 0
+jge near dword foo
+jnl near word foo
+jle 0
+jng near dword foo
+jnle near word foo
+jg 0
diff --git a/test-suite/standalone/sassy/tests/jumps b/test-suite/standalone/sassy/tests/jumps
new file mode 100644
index 000000000..9ea377c2b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/jumps
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/jumps.asm b/test-suite/standalone/sassy/tests/jumps.asm
new file mode 100644
index 000000000..3ee17e2a6
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/jumps.asm
@@ -0,0 +1,36 @@
+BITS 32
+section .text
+foo:
+loop foo
+loope foo, cx
+loopz foo, ecx
+loopne foo
+loopnz foo, cx
+jcxz foo
+jecxz foo
+call dword 0
+call word 0
+call dword 1000:1000
+call word 1000:1000
+call dword 1000:1000
+call word 1000:1000
+call far dword [ecx]
+call far word [ecx]
+call ecx
+call dword [ecx]
+call cx
+call word [ecx]
+jmp dword 0
+jmp near dword 0
+jmp word 0
+jmp near word 0
+jmp dword 1000:1000
+jmp word 1000:1000
+jmp dword 1000:foo
+jmp word 1000:foo
+jmp far dword [ecx]
+jmp far word [ecx]
+jmp ecx
+jmp dword [ecx]
+jmp cx
+jmp word [ecx]
diff --git a/test-suite/standalone/sassy/tests/jumps.scm b/test-suite/standalone/sassy/tests/jumps.scm
new file mode 100644
index 000000000..e0396e9a6
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/jumps.scm
@@ -0,0 +1,35 @@
+(
+(loop foo)
+(loope foo cx)
+(loopz foo ecx)
+(loopne foo)
+(loopnz foo cx)
+(jcxz foo)
+(jecxz foo)
+(call (dword 0))
+(call (word 0))
+(call 1000 (dword 1000))
+(call 1000 (word 1000))
+(call 1000 (dword 1000))
+(call 1000 (word 1000))
+(call far (dword (& ecx)))
+(call far (word (& ecx)))
+(call ecx)
+(call (dword (& ecx)))
+(call cx)
+(call (word (& ecx)))
+(jmp (dword 0))
+(jmp near (dword 0))
+(jmp (word 0))
+(jmp near (word 0))
+(jmp 1000 (dword 1000))
+(jmp 1000 (word 1000))
+(jmp 1000 (dword foo))
+(jmp 1000 (word foo))
+(jmp far (dword (& ecx)))
+(jmp far (word (& ecx)))
+(jmp ecx)
+(jmp (dword (& ecx)))
+(jmp cx)
+(jmp (word (& ecx)))
+)
diff --git a/test-suite/standalone/sassy/tests/jumps16 b/test-suite/standalone/sassy/tests/jumps16
new file mode 100644
index 000000000..e2c2c0e62
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/jumps16
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/jumps16.asm b/test-suite/standalone/sassy/tests/jumps16.asm
new file mode 100644
index 000000000..4e307aaeb
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/jumps16.asm
@@ -0,0 +1,36 @@
+BITS 16
+section .text
+foo:
+loop foo
+loope foo, cx
+loopz foo, ecx
+loopne foo
+loopnz foo, cx
+jcxz foo
+jecxz foo
+call dword 0
+call word 0
+call dword 1000:1000
+call word 1000:1000
+call dword 1000:1000
+call word 1000:1000
+call far dword [ecx]
+call far word [ecx]
+call ecx
+call dword [ecx]
+call cx
+call word [ecx]
+jmp dword 0
+jmp near dword 0
+jmp word 0
+jmp near word 0
+jmp dword 1000:1000
+jmp word 1000:1000
+jmp dword 1000:foo
+jmp word 1000:foo
+jmp far dword [ecx]
+jmp far word [ecx]
+jmp ecx
+jmp dword [ecx]
+jmp cx
+jmp word [ecx]
diff --git a/test-suite/standalone/sassy/tests/libgoodbye.scm b/test-suite/standalone/sassy/tests/libgoodbye.scm
new file mode 100644
index 000000000..eaa10d359
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/libgoodbye.scm
@@ -0,0 +1,6 @@
+(export _global_offset_table_)
+
+(data (label a-string (bytes "Goodbye." #\newline)))
+
+(export a-string)
+
diff --git a/test-suite/standalone/sassy/tests/libgoodbye.so b/test-suite/standalone/sassy/tests/libgoodbye.so
new file mode 100644
index 000000000..4536f6f03
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/libgoodbye.so
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/libhello.scm b/test-suite/standalone/sassy/tests/libhello.scm
new file mode 100644
index 000000000..d92a2219f
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/libhello.scm
@@ -0,0 +1,30 @@
+(export _global_offset_table_ say-hello the-string1)
+(import a-string)
+
+(data (label the-string1 (bytes "Hello "))
+ (label the-string2 (bytes "World." #\newline))
+ (label boxed-one (dwords (sym the-string1))))
+
+(macro stdout 1)
+
+(macro write (lambda (fd buffer amount)
+ `(begin (mov ecx ,buffer)
+ (mov ebx ,fd)
+ (mov edx ,amount)
+ (mov eax ,4)
+ (int #x80))))
+(text
+ (label exit (mov eax 1)
+ (mov ebx 0)
+ (int #x80))
+ (label say-hello get-got
+ (push ebx)
+ (lea eax (& ebx (got-offset boxed-one)))
+ (write stdout (& eax) 6)
+ (mov ebx (& esp))
+ (lea eax (& ebx (got-offset the-string2)))
+ (write stdout eax 7)
+ (mov ebx (& esp))
+ (write stdout (& ebx (got a-string)) 9)
+ (jmp exit)))
+
diff --git a/test-suite/standalone/sassy/tests/libhello.so b/test-suite/standalone/sassy/tests/libhello.so
new file mode 100644
index 000000000..103e9c3ef
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/libhello.so
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/liblocaldata3.so b/test-suite/standalone/sassy/tests/liblocaldata3.so
new file mode 100755
index 000000000..ac38cb6b9
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/liblocaldata3.so
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/load b/test-suite/standalone/sassy/tests/load
new file mode 100644
index 000000000..bc766c6be
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/load
@@ -0,0 +1 @@
+ล>fฤ>>fด>ต>fฒ> \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/load.asm b/test-suite/standalone/sassy/tests/load.asm
new file mode 100644
index 000000000..71f694cd1
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/load.asm
@@ -0,0 +1,9 @@
+BITS 32
+section .text
+foo:
+lds edi, [esi]
+les di, [esi]
+lea edi, [esi]
+lfs di, [esi]
+lgs edi, [esi]
+lss di, [esi]
diff --git a/test-suite/standalone/sassy/tests/load.scm b/test-suite/standalone/sassy/tests/load.scm
new file mode 100644
index 000000000..9be8d391a
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/load.scm
@@ -0,0 +1,9 @@
+(
+(lds edi (& esi))
+(les di (& esi))
+(lea edi (& esi))
+(lfs di (& esi))
+(lgs edi (& esi))
+(lss di (& esi))
+)
+
diff --git a/test-suite/standalone/sassy/tests/load16 b/test-suite/standalone/sassy/tests/load16
new file mode 100644
index 000000000..c2b70471e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/load16
@@ -0,0 +1 @@
+fgล>gฤ>fg>gด>fgต>gฒ> \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/load16.asm b/test-suite/standalone/sassy/tests/load16.asm
new file mode 100644
index 000000000..73550b499
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/load16.asm
@@ -0,0 +1,9 @@
+BITS 16
+section .text
+foo:
+lds edi, [esi]
+les di, [esi]
+lea edi, [esi]
+lfs di, [esi]
+lgs edi, [esi]
+lss di, [esi]
diff --git a/test-suite/standalone/sassy/tests/local-data-static b/test-suite/standalone/sassy/tests/local-data-static
new file mode 100755
index 000000000..361a6f1bd
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/local-data-static
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/localdata1.scm b/test-suite/standalone/sassy/tests/localdata1.scm
new file mode 100644
index 000000000..99eae79ee
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/localdata1.scm
@@ -0,0 +1,9 @@
+(export foo)
+
+(data
+ (label foo
+ (dwords "abcd" #\newline)
+ (locals (foo)
+ (label foo
+ (dwords "defg" #\newline foo)))
+ (dwords foo)))
diff --git a/test-suite/standalone/sassy/tests/localdata2.scm b/test-suite/standalone/sassy/tests/localdata2.scm
new file mode 100644
index 000000000..60d2cb995
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/localdata2.scm
@@ -0,0 +1,34 @@
+(import foo)
+
+(entry _start)
+
+(macro stdout 1)
+
+(text (label write ; fd buffer amount
+ (mov ebx (& esp 4))
+ (mov ecx (& esp 8))
+ (mov edx (& esp 12))
+ (mov eax 4)
+ (int #x80)
+ (ret)))
+
+(text (label exit
+ (mov eax 1)
+ (mov ebx 0)
+ (int #x80)))
+
+(text (label _start
+ (push 5) ;fd
+ (push foo) ;buffer
+ (push stdout) ;amount
+ (call write)
+ (add esp 12)
+ (push 5) ;fd
+ (push (& foo 16));buffer - in this case its the pointer to the local foo
+ (push stdout)
+ (call write)
+ (call exit)))
+
+
+
+
diff --git a/test-suite/standalone/sassy/tests/localdata3.scm b/test-suite/standalone/sassy/tests/localdata3.scm
new file mode 100644
index 000000000..74348d90b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/localdata3.scm
@@ -0,0 +1,12 @@
+(export _global_offset_table_ foo)
+
+(data
+ (label foo
+ (locals (foo)
+ (dwords "abcd" #\newline foo)
+ (label foo
+ (dwords "defg" #\newline)))))
+
+
+
+
diff --git a/test-suite/standalone/sassy/tests/localdata3.so b/test-suite/standalone/sassy/tests/localdata3.so
new file mode 100755
index 000000000..7052044b4
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/localdata3.so
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/localdata4 b/test-suite/standalone/sassy/tests/localdata4
new file mode 100755
index 000000000..05086755d
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/localdata4
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/localdata4.scm b/test-suite/standalone/sassy/tests/localdata4.scm
new file mode 100644
index 000000000..a8d6d619b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/localdata4.scm
@@ -0,0 +1,37 @@
+(export _global_offset_table_)
+
+(import foo)
+
+(entry _start)
+
+(macro stdout 1)
+
+(text (label write ; fd buffer amount
+ (mov ebx (& esp 4))
+ (mov ecx (& esp 8))
+ (mov edx (& esp 12))
+ (mov eax 4)
+ (int #x80)
+ (ret)))
+
+(text (label exit
+ (mov eax 1)
+ (mov ebx 0)
+ (int #x80)))
+
+(text (label _start
+ get-got
+ (push ebx)
+ (push 5)
+ (push (& ebx (got foo)))
+ (push stdout)
+ (call write)
+ (add esp 12)
+ (pop ebx)
+ (push 5) ;fd
+ (mov eax (& ebx (got foo)))
+ (add eax 8)
+ (push (& eax))
+ (push stdout)
+ (call write)
+ (call exit)))
diff --git a/test-suite/standalone/sassy/tests/mem-ref b/test-suite/standalone/sassy/tests/mem-ref
new file mode 100644
index 000000000..166496075
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/mem-ref
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/mem-ref.asm b/test-suite/standalone/sassy/tests/mem-ref.asm
new file mode 100644
index 000000000..e03d6bead
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/mem-ref.asm
@@ -0,0 +1,116 @@
+BITS 32
+section .text
+foo:
+add eax, [ecx]
+add eax, [ebp]
+add eax, [esp]
+add eax, [dword 100]
+add eax, [dword 1600]
+add eax, [ecx*1]
+add eax, [ecx*2]
+add eax, [ecx*4]
+add eax, [ecx*8]
+add eax, [ebp*1]
+add eax, [ebp*2]
+add eax, [ebp*4]
+add eax, [ebp*8]
+add eax, [100+ecx]
+add eax, [dword 1600+ecx]
+add eax, [100+ebp]
+add eax, [dword 1600+ebp]
+add eax, [100+esp]
+add eax, [dword 1600+esp]
+add eax, [100+ecx]
+add eax, [dword 1600+ecx]
+add eax, [100+ebp]
+add eax, [dword 1600+ebp]
+add eax, [100+esp]
+add eax, [dword 1600+esp]
+add eax, [ecx+edx*1]
+add eax, [ebp*1+ecx]
+add eax, [ecx+edx*2]
+add eax, [ebp*2+ecx]
+add eax, [ecx+edx*4]
+add eax, [ebp*4+ecx]
+add eax, [ecx+edx*8]
+add eax, [ecx+ebp*8]
+add eax, [edx*1+ebp]
+add eax, [ebp+ebp*1]
+add eax, [ebp+edx*2]
+add eax, [ebp+ebp*2]
+add eax, [ebp+edx*4]
+add eax, [ebp*4+ebp]
+add eax, [ebp+edx*8]
+add eax, [ebp+ebp*8]
+add eax, [esp+edx*1]
+add eax, [esp+ebp*1]
+add eax, [esp+edx*2]
+add eax, [ebp*2+esp]
+add eax, [esp+edx*4]
+add eax, [esp+ebp*4]
+add eax, [esp+edx*8]
+add eax, [esp+ebp*8]
+add eax, [100+ecx*1]
+add eax, [100+ecx*2]
+add eax, [100+ecx*4]
+add eax, [100+ecx*8]
+add eax, [100+ebp*1]
+add eax, [100+ebp*2]
+add eax, [100+ebp*4]
+add eax, [100+ebp*8]
+add eax, [dword 1600+ecx*1]
+add eax, [dword 1600+ecx*2]
+add eax, [dword 1600+ecx*4]
+add eax, [dword 1600+ecx*8]
+add eax, [dword 1600+ebp*1]
+add eax, [dword 1600+ebp*2]
+add eax, [dword 1600+ebp*4]
+add eax, [dword 1600+ebp*8]
+add eax, [100+ecx+edx*1]
+add eax, [100+ecx+edx*2]
+add eax, [100+edx*4+ecx]
+add eax, [100+ecx+edx*8]
+add eax, [100+ecx+ebp*1]
+add eax, [100+ecx+ebp*2]
+add eax, [100+ecx+ebp*4]
+add eax, [100+ecx+ebp*8]
+add eax, [100+ebp+edx*1]
+add eax, [100+ebp+edx*2]
+add eax, [100+ebp+edx*4]
+add eax, [100+ebp+edx*8]
+add eax, [100+ebp+ebp*1]
+add eax, [100+ebp*2+ebp]
+add eax, [100+ebp+ebp*4]
+add eax, [100+ebp+ebp*8]
+add eax, [100+esp+edx*1]
+add eax, [100+esp+edx*2]
+add eax, [100+esp+edx*4]
+add eax, [100+esp+edx*8]
+add eax, [100+esp+ebp*1]
+add eax, [100+esp+ebp*2]
+add eax, [100+esp+ebp*4]
+add eax, [100+esp+ebp*8]
+add eax, [dword 1600+ecx+edx*1]
+add eax, [dword 1600+ecx+edx*2]
+add eax, [dword 1600+ecx+edx*4]
+add eax, [dword 1600+ecx+edx*8]
+add eax, [dword 1600+ecx+ebp*1]
+add eax, [dword 1600+ecx+ebp*2]
+add eax, [dword 1600+ecx+ebp*4]
+add eax, [dword 1600+ecx+ebp*8]
+add eax, [dword 1600+ebp+edx*1]
+add eax, [dword 1600+ebp+edx*2]
+add eax, [dword 1600+ebp+edx*4]
+add eax, [dword 1600+ebp+edx*8]
+add eax, [dword 1600+ebp+ebp*1]
+add eax, [dword 1600+ebp+ebp*2]
+add eax, [dword 1600+ebp+ebp*4]
+add eax, [dword 1600+ebp+ebp*8]
+add eax, [dword 1600+esp+edx*1]
+add eax, [dword 1600+esp+edx*2]
+add eax, [dword 1600+esp+edx*4]
+add eax, [dword 1600+esp+edx*8]
+add eax, [dword 1600+esp+ebp*1]
+add eax, [dword 1600+esp+ebp*2]
+add eax, [dword 1600+esp+ebp*4]
+add eax, [dword 1600+esp+ebp*8]
diff --git a/test-suite/standalone/sassy/tests/mem-ref.scm b/test-suite/standalone/sassy/tests/mem-ref.scm
new file mode 100644
index 000000000..fe6e0c74a
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/mem-ref.scm
@@ -0,0 +1,115 @@
+(
+(add eax (& ecx))
+(add eax (& ebp))
+(add eax (& esp))
+(add eax (& #x64))
+(add eax (& #x640))
+(add eax (& (* ecx 1)))
+(add eax (& (* ecx 2)))
+(add eax (& (* ecx 4)))
+(add eax (& (* ecx 8)))
+(add eax (& (* ebp 1)))
+(add eax (& (* ebp 2)))
+(add eax (& (* ebp 4)))
+(add eax (& (* ebp 8)))
+(add eax (& ecx 100))
+(add eax (& ecx 1600))
+(add eax (& ebp 100))
+(add eax (& ebp 1600))
+(add eax (& esp 100))
+(add eax (& esp 1600))
+(add eax (& 100 ecx))
+(add eax (& 1600 ecx))
+(add eax (& 100 ebp))
+(add eax (& 1000 ebp 600))
+(add eax (& 100 esp))
+(add eax (& 1600 esp))
+(add eax (& ecx (* edx 1)))
+(add eax (& (* ebp 1) ecx))
+(add eax (& ecx (* edx 2)))
+(add eax (& (* ebp 2) ecx))
+(add eax (& ecx (* edx 4)))
+(add eax (& (* ebp 4) ecx))
+(add eax (& ecx (* edx 8)))
+(add eax (& ecx (* ebp 8)))
+(add eax (& (* edx 1) ebp))
+(add eax (& ebp (* ebp 1)))
+(add eax (& ebp (* edx 2)))
+(add eax (& ebp (* ebp 2)))
+(add eax (& ebp (* edx 4)))
+(add eax (& (* ebp 4) ebp))
+(add eax (& ebp (* edx 8)))
+(add eax (& ebp (* ebp 8)))
+(add eax (& esp (* edx 1)))
+(add eax (& esp (* ebp 1)))
+(add eax (& esp (* edx 2)))
+(add eax (& (* ebp 2) esp))
+(add eax (& esp (* edx 4)))
+(add eax (& esp (* ebp 4)))
+(add eax (& esp (* edx 8)))
+(add eax (& esp (* ebp 8)))
+(add eax (& (* ecx 1) 100))
+(add eax (& (* ecx 2) 100))
+(add eax (& 100 (* ecx 4)))
+(add eax (& (* ecx 8) 100))
+(add eax (& 100 (* ebp 1)))
+(add eax (& (* ebp 2) 100))
+(add eax (& 100 (* ebp 4)))
+(add eax (& (* ebp 8) 100))
+(add eax (& 1600 (* ecx 1)))
+(add eax (& (* ecx 2) 1600))
+(add eax (& (* ecx 4) 1600))
+(add eax (& 1600 (* ecx 8)))
+(add eax (& (* ebp 1) 1600))
+(add eax (& 1600 (* ebp 2)))
+(add eax (& (* ebp 4) 1600))
+(add eax (& (* ebp 8) 1600))
+(add eax (& ecx 100 (* edx 1)))
+(add eax (& ecx (* edx 2) 100))
+(add eax (& (* edx 4) ecx 100))
+(add eax (& ecx (* edx 8) 100))
+(add eax (& ecx (* ebp 1) 100))
+(add eax (& ecx (* ebp 2) 100))
+(add eax (& ecx (* ebp 4) 100))
+(add eax (& 100 ecx (* ebp 8)))
+(add eax (& ebp (* edx 1) 100))
+(add eax (& ebp (* edx 2) 100))
+(add eax (& ebp (* edx 4) 100))
+(add eax (& ebp (* edx 8) 100))
+(add eax (& ebp (* ebp 1) 100))
+(add eax (& 100 (* ebp 2) ebp))
+(add eax (& ebp (* ebp 4) 100))
+(add eax (& ebp (* ebp 8) 100))
+(add eax (& esp (* edx 1) 100))
+(add eax (& esp (* edx 2) 100))
+(add eax (& esp (* edx 4) 100))
+(add eax (& esp (* edx 8) 100))
+(add eax (& esp (* ebp 1) 100))
+(add eax (& esp (* ebp 2) 100))
+(add eax (& esp (* ebp 4) 100))
+(add eax (& esp (* ebp 8) 100))
+(add eax (& ecx (* edx 1) 1600))
+(add eax (& ecx (* edx 2) 1600))
+(add eax (& ecx (* edx 4) 1600))
+(add eax (& ecx (* edx 8) 1600))
+(add eax (& ecx (* ebp 1) 1600))
+(add eax (& ecx (* ebp 2) 1600))
+(add eax (& ecx (* ebp 4) 1600))
+(add eax (& ecx (* ebp 8) 1600))
+(add eax (& ebp (* edx 1) 1600))
+(add eax (& ebp (* edx 2) 1600))
+(add eax (& ebp (* edx 4) 1600))
+(add eax (& ebp (* edx 8) 1600))
+(add eax (& ebp (* ebp 1) 1600))
+(add eax (& ebp (* ebp 2) 1600))
+(add eax (& ebp (* ebp 4) 1600))
+(add eax (& ebp (* ebp 8) 1600))
+(add eax (& esp (* edx 1) 1600))
+(add eax (& esp (* edx 2) 1600))
+(add eax (& esp (* edx 4) 1600))
+(add eax (& esp (* edx 8) 1600))
+(add eax (& esp (* ebp 1) 1600))
+(add eax (& esp (* ebp 2) 1600))
+(add eax (& esp (* ebp 4) 1600))
+(add eax (& esp (* ebp 8) 1600))
+)
diff --git a/test-suite/standalone/sassy/tests/mem-ref16 b/test-suite/standalone/sassy/tests/mem-ref16
new file mode 100644
index 000000000..9cf340b9c
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/mem-ref16
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/mem-ref16.asm b/test-suite/standalone/sassy/tests/mem-ref16.asm
new file mode 100644
index 000000000..8e6d13634
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/mem-ref16.asm
@@ -0,0 +1,116 @@
+BITS 16
+section .text
+foo:
+add eax, [ecx]
+add eax, [ebp]
+add eax, [esp]
+add eax, [dword 100]
+add eax, [dword 1600]
+add eax, [ecx*1]
+add eax, [ecx*2]
+add eax, [ecx*4]
+add eax, [ecx*8]
+add eax, [ebp*1]
+add eax, [ebp*2]
+add eax, [ebp*4]
+add eax, [ebp*8]
+add eax, [100+ecx]
+add eax, [dword 1600+ecx]
+add eax, [100+ebp]
+add eax, [dword 1600+ebp]
+add eax, [100+esp]
+add eax, [dword 1600+esp]
+add eax, [100+ecx]
+add eax, [dword 1600+ecx]
+add eax, [100+ebp]
+add eax, [dword 1600+ebp]
+add eax, [100+esp]
+add eax, [dword 1600+esp]
+add eax, [ecx+edx*1]
+add eax, [ebp*1+ecx]
+add eax, [ecx+edx*2]
+add eax, [ebp*2+ecx]
+add eax, [ecx+edx*4]
+add eax, [ebp*4+ecx]
+add eax, [ecx+edx*8]
+add eax, [ecx+ebp*8]
+add eax, [edx*1+ebp]
+add eax, [ebp+ebp*1]
+add eax, [ebp+edx*2]
+add eax, [ebp+ebp*2]
+add eax, [ebp+edx*4]
+add eax, [ebp*4+ebp]
+add eax, [ebp+edx*8]
+add eax, [ebp+ebp*8]
+add eax, [esp+edx*1]
+add eax, [esp+ebp*1]
+add eax, [esp+edx*2]
+add eax, [ebp*2+esp]
+add eax, [esp+edx*4]
+add eax, [esp+ebp*4]
+add eax, [esp+edx*8]
+add eax, [esp+ebp*8]
+add eax, [100+ecx*1]
+add eax, [100+ecx*2]
+add eax, [100+ecx*4]
+add eax, [100+ecx*8]
+add eax, [100+ebp*1]
+add eax, [100+ebp*2]
+add eax, [100+ebp*4]
+add eax, [100+ebp*8]
+add eax, [dword 1600+ecx*1]
+add eax, [dword 1600+ecx*2]
+add eax, [dword 1600+ecx*4]
+add eax, [dword 1600+ecx*8]
+add eax, [dword 1600+ebp*1]
+add eax, [dword 1600+ebp*2]
+add eax, [dword 1600+ebp*4]
+add eax, [dword 1600+ebp*8]
+add eax, [100+ecx+edx*1]
+add eax, [100+ecx+edx*2]
+add eax, [100+edx*4+ecx]
+add eax, [100+ecx+edx*8]
+add eax, [100+ecx+ebp*1]
+add eax, [100+ecx+ebp*2]
+add eax, [100+ecx+ebp*4]
+add eax, [100+ecx+ebp*8]
+add eax, [100+ebp+edx*1]
+add eax, [100+ebp+edx*2]
+add eax, [100+ebp+edx*4]
+add eax, [100+ebp+edx*8]
+add eax, [100+ebp+ebp*1]
+add eax, [100+ebp*2+ebp]
+add eax, [100+ebp+ebp*4]
+add eax, [100+ebp+ebp*8]
+add eax, [100+esp+edx*1]
+add eax, [100+esp+edx*2]
+add eax, [100+esp+edx*4]
+add eax, [100+esp+edx*8]
+add eax, [100+esp+ebp*1]
+add eax, [100+esp+ebp*2]
+add eax, [100+esp+ebp*4]
+add eax, [100+esp+ebp*8]
+add eax, [dword 1600+ecx+edx*1]
+add eax, [dword 1600+ecx+edx*2]
+add eax, [dword 1600+ecx+edx*4]
+add eax, [dword 1600+ecx+edx*8]
+add eax, [dword 1600+ecx+ebp*1]
+add eax, [dword 1600+ecx+ebp*2]
+add eax, [dword 1600+ecx+ebp*4]
+add eax, [dword 1600+ecx+ebp*8]
+add eax, [dword 1600+ebp+edx*1]
+add eax, [dword 1600+ebp+edx*2]
+add eax, [dword 1600+ebp+edx*4]
+add eax, [dword 1600+ebp+edx*8]
+add eax, [dword 1600+ebp+ebp*1]
+add eax, [dword 1600+ebp+ebp*2]
+add eax, [dword 1600+ebp+ebp*4]
+add eax, [dword 1600+ebp+ebp*8]
+add eax, [dword 1600+esp+edx*1]
+add eax, [dword 1600+esp+edx*2]
+add eax, [dword 1600+esp+edx*4]
+add eax, [dword 1600+esp+edx*8]
+add eax, [dword 1600+esp+ebp*1]
+add eax, [dword 1600+esp+ebp*2]
+add eax, [dword 1600+esp+ebp*4]
+add eax, [dword 1600+esp+ebp*8]
diff --git a/test-suite/standalone/sassy/tests/misc1 b/test-suite/standalone/sassy/tests/misc1
new file mode 100644
index 000000000..108693f98
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/misc1
@@ -0,0 +1,2 @@
+fbbสว
+ศ่df“f“““†ฤ†#f‡หf‡‡ห‡†f‡‡ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/misc1.asm b/test-suite/standalone/sassy/tests/misc1.asm
new file mode 100644
index 000000000..cf5722b55
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/misc1.asm
@@ -0,0 +1,21 @@
+BITS 32
+section .text
+foo:
+bound ax, [edi]
+bound eax, [edi]
+bswap edx
+cmpxchg8b [edx+ecx]
+enter 1000, 100
+xchg ax, bx
+xchg bx, ax
+xchg eax, ebx
+xchg ebx, eax
+xchg al, ah
+xchg [ebx], ah
+xchg cx, bx
+xchg [ecx], bx
+xchg ecx, ebx
+xchg [ecx], ebx
+xchg al, [edi]
+xchg ax, [edi]
+xchg eax, [edi]
diff --git a/test-suite/standalone/sassy/tests/misc1.scm b/test-suite/standalone/sassy/tests/misc1.scm
new file mode 100644
index 000000000..07a9f0a22
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/misc1.scm
@@ -0,0 +1,20 @@
+(
+(bound ax (& edi))
+(bound eax (& edi))
+(bswap edx)
+(cmpxchg8b (& edx ecx))
+(enter 1000 100)
+(xchg ax bx)
+(xchg bx ax)
+(xchg eax ebx)
+(xchg ebx eax)
+(xchg al ah)
+(xchg (& ebx) ah)
+(xchg cx bx)
+(xchg (& ecx) bx)
+(xchg ecx ebx)
+(xchg (& ecx) ebx)
+(xchg al (& edi))
+(xchg ax (& edi))
+(xchg eax (& edi))
+)
diff --git a/test-suite/standalone/sassy/tests/misc116 b/test-suite/standalone/sassy/tests/misc116
new file mode 100644
index 000000000..6a4acfe3d
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/misc116
@@ -0,0 +1,2 @@
+gbfgbfสgว
+ศ่d““f“f“†ฤg†#‡หg‡f‡หfg‡g†g‡fg‡ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/misc116.asm b/test-suite/standalone/sassy/tests/misc116.asm
new file mode 100644
index 000000000..4e201ee1e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/misc116.asm
@@ -0,0 +1,21 @@
+BITS 16
+section .text
+foo:
+bound ax, [edi]
+bound eax, [edi]
+bswap edx
+cmpxchg8b [edx+ecx]
+enter 1000, 100
+xchg ax, bx
+xchg bx, ax
+xchg eax, ebx
+xchg ebx, eax
+xchg al, ah
+xchg [ebx], ah
+xchg cx, bx
+xchg [ecx], bx
+xchg ecx, ebx
+xchg [ecx], ebx
+xchg al, [edi]
+xchg ax, [edi]
+xchg eax, [edi]
diff --git a/test-suite/standalone/sassy/tests/misc2 b/test-suite/standalone/sassy/tests/misc2
new file mode 100644
index 000000000..ac84bbc25
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/misc2
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/misc2.asm b/test-suite/standalone/sassy/tests/misc2.asm
new file mode 100644
index 000000000..aadc298be
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/misc2.asm
@@ -0,0 +1,111 @@
+BITS 32
+section .text
+foo:
+in al, 9
+in ax, 9
+in eax, 9
+in al, dx
+in ax, dx
+in eax, dx
+out 9, al
+out 9, ax
+out 9, eax
+out dx, al
+out dx, ax
+out dx, eax
+int 128
+pop cx
+pop ecx
+pop dword [ecx]
+pop word [ecx]
+pop ds
+pop es
+pop ss
+pop fs
+pop gs
+push cx
+push edx
+push dword 100
+push word 100
+push byte 100
+push word [esi]
+push dword [esi]
+push cs
+push ds
+push es
+push ss
+push fs
+push gs
+imul ax, bx, word 100
+imul ax, [ebx], word 100
+imul ax, bx, byte 100
+imul ax, [ebx], byte 100
+imul eax, ebx, dword 100
+imul eax, [ebx], dword 100
+imul eax, ebx, byte 100
+imul eax, [ebx], byte 100
+imul eax, dword 100
+imul eax, byte 100
+imul ax, word 100
+imul ax, byte 100
+imul ax, bx
+imul ax, [ebx]
+imul eax, ebx
+imul eax, [ebx]
+imul al
+imul byte [eax]
+imul ax
+imul word [eax]
+imul eax
+imul dword [eax]
+test al, 9
+test ax, 9
+test eax, 9
+test bl, cl
+test [ebx], cl
+test bx, cx
+test [ebx], cx
+test ebx, ecx
+test [ebx], ecx
+test bl, 9
+test dword [ebx], 9
+test bx, 9
+test word [ebx], 9
+test ebx, 9
+test byte [ebx], 9
+mov bl, cl
+mov [edx], cl
+mov bx, dx
+mov [esi], dx
+mov ebx, edi
+mov [eax], edi
+mov bl, cl
+mov bl, [edx]
+mov bx, dx
+mov bx, [esi]
+mov ebx, edi
+mov ebx, [eax]
+mov bl, 9
+mov bx, 9
+mov ebx, 9
+mov [edx], byte 9
+mov [esi], word 9
+mov [eax], dword 9
+mov al, [dword 9]
+mov ax, [dword 9]
+mov eax, [dword 9]
+mov [dword 9], al
+mov [dword 9], ax
+mov [dword 9], eax
+mov bx, ds
+mov [esi], ss
+mov ebx, fs
+mov [eax], es
+mov gs, dx
+mov ds, [esi]
+mov fs, edi
+mov ss, [eax]
+mov ecx, cr2
+mov ecx, dr1
+mov cr0, edx
+mov dr0, edx
diff --git a/test-suite/standalone/sassy/tests/misc2.scm b/test-suite/standalone/sassy/tests/misc2.scm
new file mode 100644
index 000000000..d2464e716
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/misc2.scm
@@ -0,0 +1,110 @@
+(
+(in al 9)
+(in ax 9)
+(in eax 9)
+(in al dx)
+(in ax dx)
+(in eax dx)
+(out 9 al)
+(out 9 ax)
+(out 9 eax)
+(out dx al)
+(out dx ax)
+(out dx eax)
+(int #x80)
+(pop cx)
+(pop ecx)
+(pop (dword (& ecx)))
+(pop (word (& ecx)))
+(pop ds)
+(pop es)
+(pop ss)
+(pop fs)
+(pop gs)
+(push cx)
+(push edx)
+(push (dword 100))
+(push (word 100))
+(push (byte 100))
+(push (word (& esi)))
+(push (dword (& esi)))
+(push cs)
+(push ds)
+(push es)
+(push ss)
+(push fs)
+(push gs)
+(imul ax bx (word 100))
+(imul ax (& ebx) (word 100))
+(imul ax bx (byte 100))
+(imul ax (& ebx) (byte 100))
+(imul eax ebx (dword 100))
+(imul eax (& ebx) (dword 100))
+(imul eax ebx (byte 100))
+(imul eax (& ebx) (byte 100))
+(imul eax (dword 100))
+(imul eax (byte 100))
+(imul ax (word 100))
+(imul ax (byte 100))
+(imul ax bx)
+(imul ax (& ebx))
+(imul eax ebx)
+(imul eax (& ebx))
+(imul al)
+(imul (byte (& eax)))
+(imul ax)
+(imul (word (& eax)))
+(imul eax)
+(imul (dword (& eax)))
+(test al 9)
+(test ax 9)
+(test eax 9)
+(test bl cl)
+(test (& ebx) cl)
+(test bx cx)
+(test (& ebx) cx)
+(test ebx ecx)
+(test (& ebx) ecx)
+(test bl 9)
+(test (dword (& ebx)) 9)
+(test bx 9)
+(test (word (& ebx)) 9)
+(test ebx 9)
+(test (byte (& ebx)) 9)
+(mov bl cl)
+(mov (& edx) cl)
+(mov bx dx)
+(mov (& esi) dx)
+(mov ebx edi)
+(mov (& eax) edi)
+(mov bl cl)
+(mov bl (& edx))
+(mov bx dx)
+(mov bx (& esi))
+(mov ebx edi)
+(mov ebx (& eax))
+(mov bl 9)
+(mov bx 9)
+(mov ebx 9)
+(mov (& edx) (byte 9))
+(mov (& esi) (word 9))
+(mov (& eax) (dword 9))
+(mov al (& 9))
+(mov ax (& 9))
+(mov eax (& 9))
+(mov (& 9) al)
+(mov (& 9) ax)
+(mov (& 9) eax)
+(mov bx ds)
+(mov (& esi) ss)
+(mov ebx fs)
+(mov (& eax) es)
+(mov gs dx)
+(mov ds (& esi))
+(mov fs edi)
+(mov ss (& eax))
+(mov ecx cr2)
+(mov ecx dr1)
+(mov cr0 edx)
+(mov dr0 edx)
+)
diff --git a/test-suite/standalone/sassy/tests/misc216 b/test-suite/standalone/sassy/tests/misc216
new file mode 100644
index 000000000..0b481be55
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/misc216
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/misc216.asm b/test-suite/standalone/sassy/tests/misc216.asm
new file mode 100644
index 000000000..270bc34c1
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/misc216.asm
@@ -0,0 +1,111 @@
+BITS 16
+section .text
+foo:
+in al, 9
+in ax, 9
+in eax, 9
+in al, dx
+in ax, dx
+in eax, dx
+out 9, al
+out 9, ax
+out 9, eax
+out dx, al
+out dx, ax
+out dx, eax
+int 128
+pop cx
+pop ecx
+pop dword [ecx]
+pop word [ecx]
+pop ds
+pop es
+pop ss
+pop fs
+pop gs
+push cx
+push edx
+push dword 100
+push word 100
+push byte 100
+push word [esi]
+push dword [esi]
+push cs
+push ds
+push es
+push ss
+push fs
+push gs
+imul ax, bx, word 100
+imul ax, [ebx], word 100
+imul ax, bx, byte 100
+imul ax, [ebx], byte 100
+imul eax, ebx, dword 100
+imul eax, [ebx], dword 100
+imul eax, ebx, byte 100
+imul eax, [ebx], byte 100
+imul eax, dword 100
+imul eax, byte 100
+imul ax, word 100
+imul ax, byte 100
+imul ax, bx
+imul ax, [ebx]
+imul eax, ebx
+imul eax, [ebx]
+imul al
+imul byte [eax]
+imul ax
+imul word [eax]
+imul eax
+imul dword [eax]
+test al, 9
+test ax, 9
+test eax, 9
+test bl, cl
+test [ebx], cl
+test bx, cx
+test [ebx], cx
+test ebx, ecx
+test [ebx], ecx
+test bl, 9
+test dword [ebx], 9
+test bx, 9
+test word [ebx], 9
+test ebx, 9
+test byte [ebx], 9
+mov bl, cl
+mov [edx], cl
+mov bx, dx
+mov [esi], dx
+mov ebx, edi
+mov [eax], edi
+mov bl, cl
+mov bl, [edx]
+mov bx, dx
+mov bx, [esi]
+mov ebx, edi
+mov ebx, [eax]
+mov bl, 9
+mov bx, 9
+mov ebx, 9
+mov [edx], byte 9
+mov [esi], word 9
+mov [eax], dword 9
+mov al, [dword 9]
+mov ax, [dword 9]
+mov eax, [dword 9]
+mov [dword 9], al
+mov [dword 9], ax
+mov [dword 9], eax
+mov bx, ds
+mov [esi], ss
+mov ebx, fs
+mov [eax], es
+mov gs, dx
+mov ds, [esi]
+mov fs, edi
+mov ss, [eax]
+mov ecx, cr2
+mov ecx, dr1
+mov cr0, edx
+mov dr0, edx
diff --git a/test-suite/standalone/sassy/tests/misc3 b/test-suite/standalone/sassy/tests/misc3
new file mode 100644
index 000000000..fd2a874fd
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/misc3
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/misc3.asm b/test-suite/standalone/sassy/tests/misc3.asm
new file mode 100644
index 000000000..8653ceaa8
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/misc3.asm
@@ -0,0 +1,14 @@
+BITS 32
+section .text
+foo:
+arpl cx, bx
+arpl [ecx], bx
+rsm
+lldt sp
+sldt [esp]
+ltr sp
+str [esp]
+verr sp
+verw [esp]
+lar ebx, eax
+lsl ebx, [eax]
diff --git a/test-suite/standalone/sassy/tests/misc3.scm b/test-suite/standalone/sassy/tests/misc3.scm
new file mode 100644
index 000000000..82b135954
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/misc3.scm
@@ -0,0 +1,14 @@
+(
+(arpl cx bx)
+(arpl (& ecx) bx)
+(rsm)
+(lldt sp)
+(sldt (& esp))
+(ltr sp)
+(str (& esp))
+(verr sp)
+(verw (& esp))
+(lar ebx eax)
+(lsl ebx (& eax))
+)
+
diff --git a/test-suite/standalone/sassy/tests/mmx b/test-suite/standalone/sassy/tests/mmx
new file mode 100644
index 000000000..fa1c7adbb
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/mmx
@@ -0,0 +1,13 @@
+wnหn
+~ห~
+fnรfnf~รf~oศo
+oม
+๓~ม๓~๓~ศfึม฿
+f๋ำf๏!cมk
+fgำfh!iมj
+fำf!ม์
+fํำf!ม๘
+f๙ำf๚!่ม้
+fุำfู!ีมๅ
+f๕ำft!uมv
+fdำfe!fม`ำa#fb๎f`:ัา*fำf๑*r๔dfs๔dแโ* \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/mmx.asm b/test-suite/standalone/sassy/tests/mmx.asm
new file mode 100644
index 000000000..61e854c46
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/mmx.asm
@@ -0,0 +1,65 @@
+BITS 32
+section .text
+foo:
+emms
+movd mm1, ebx
+movd mm1, [edx]
+movd ebx, mm1
+movd [edx], mm1
+movd xmm0, ebx
+movd xmm0, [edx]
+movd ebx, xmm0
+movd [edx], xmm0
+movq mm1, mm0
+movq mm1, [edx]
+movq mm0, mm1
+movq [edx], mm1
+movq xmm0, xmm1
+movq xmm0, [edx]
+movq xmm1, xmm0
+movq [edx], xmm0
+pand mm0, mm1
+pandn mm1, [edx]
+por xmm2, xmm3
+pxor xmm4, [ecx]
+packsswb mm0, mm1
+packssdw mm1, [edx]
+packuswb xmm2, xmm3
+punpckhbw xmm4, [ecx]
+punpckhwd mm0, mm1
+punpckhdq mm1, [edx]
+paddb xmm2, xmm3
+paddw xmm4, [ecx]
+paddd mm0, mm1
+paddsb mm1, [edx]
+paddsw xmm2, xmm3
+paddusb xmm4, [ecx]
+paddusw mm0, mm1
+psubb mm1, [edx]
+psubw xmm2, xmm3
+psubd xmm4, [ecx]
+psubsb mm0, mm1
+psubsw mm1, [edx]
+psubusb xmm2, xmm3
+psubusw xmm4, [ecx]
+pmullw mm0, mm1
+pmulhw mm1, [edx]
+pmaddwd xmm2, xmm3
+pcmpeqb xmm4, [ecx]
+pcmpeqw mm0, mm1
+pcmpeqd mm1, [edx]
+pcmpgtb xmm2, xmm3
+pcmpgtw xmm4, [ecx]
+pcmpgtd mm0, mm1
+punpcklbw mm2, mm3
+punpcklwd mm4, [ebx]
+punpckldq xmm5, xmm6
+punpcklbw xmm7, [edx]
+psrlw mm7, mm6
+psrld mm5, [edx]
+psrlq xmm7, xmm6
+psllw xmm5, [edx]
+pslld mm4, 100
+psllq xmm4, 100
+psraw mm7, mm6
+psrad mm5, [edx]
diff --git a/test-suite/standalone/sassy/tests/mmx.scm b/test-suite/standalone/sassy/tests/mmx.scm
new file mode 100644
index 000000000..db7dfb328
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/mmx.scm
@@ -0,0 +1,64 @@
+(
+(emms)
+(movd mm1 ebx)
+(movd mm1 (& edx))
+(movd ebx mm1)
+(movd (& edx) mm1)
+(movd xmm0 ebx)
+(movd xmm0 (& edx))
+(movd ebx xmm0)
+(movd (& edx) xmm0)
+(movq mm1 mm0)
+(movq mm1 (& edx))
+(movq mm0 mm1)
+(movq (& edx) mm1)
+(movq xmm0 xmm1)
+(movq xmm0 (& edx))
+(movq xmm1 xmm0)
+(movq (& edx) xmm0)
+(pand mm0 mm1)
+(pandn mm1 (& edx))
+(por xmm2 xmm3)
+(pxor xmm4 (& ecx))
+(packsswb mm0 mm1)
+(packssdw mm1 (& edx))
+(packuswb xmm2 xmm3)
+(punpckhbw xmm4 (& ecx))
+(punpckhwd mm0 mm1)
+(punpckhdq mm1 (& edx))
+(paddb xmm2 xmm3)
+(paddw xmm4 (& ecx))
+(paddd mm0 mm1)
+(paddsb mm1 (& edx))
+(paddsw xmm2 xmm3)
+(paddusb xmm4 (& ecx))
+(paddusw mm0 mm1)
+(psubb mm1 (& edx))
+(psubw xmm2 xmm3)
+(psubd xmm4 (& ecx))
+(psubsb mm0 mm1)
+(psubsw mm1 (& edx))
+(psubusb xmm2 xmm3)
+(psubusw xmm4 (& ecx))
+(pmullw mm0 mm1)
+(pmulhw mm1 (& edx))
+(pmaddwd xmm2 xmm3)
+(pcmpeqb xmm4 (& ecx))
+(pcmpeqw mm0 mm1)
+(pcmpeqd mm1 (& edx))
+(pcmpgtb xmm2 xmm3)
+(pcmpgtw xmm4 (& ecx))
+(pcmpgtd mm0 mm1)
+(punpcklbw mm2 mm3)
+(punpcklwd mm4 (& ebx))
+(punpckldq xmm5 xmm6)
+(punpcklbw xmm7 (& edx))
+(psrlw mm7 mm6)
+(psrld mm5 (& edx))
+(psrlq xmm7 xmm6)
+(psllw xmm5 (& edx))
+(pslld mm4 100)
+(psllq xmm4 100)
+(psraw mm7 mm6)
+(psrad mm5 (& edx))
+)
diff --git a/test-suite/standalone/sassy/tests/movx b/test-suite/standalone/sassy/tests/movx
new file mode 100644
index 000000000..0713452b0
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/movx
@@ -0,0 +1 @@
+ฟ่ท/พ่ถ/fพ์fถ/ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/movx.asm b/test-suite/standalone/sassy/tests/movx.asm
new file mode 100644
index 000000000..e02f42fb3
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/movx.asm
@@ -0,0 +1,9 @@
+BITS 32
+section .text
+foo:
+movsx ebp, ax
+movzx ebp, word [edi]
+movsx ebp, al
+movzx ebp, byte [edi]
+movsx bp, ah
+movzx bp, [edi]
diff --git a/test-suite/standalone/sassy/tests/movx.scm b/test-suite/standalone/sassy/tests/movx.scm
new file mode 100644
index 000000000..263dac2b4
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/movx.scm
@@ -0,0 +1,8 @@
+(
+(movsx ebp ax)
+(movzx ebp (word (& edi)))
+(movsx ebp al)
+(movzx ebp (byte (& edi)))
+(movsx bp ah)
+(movzx bp (& edi))
+)
diff --git a/test-suite/standalone/sassy/tests/movx16 b/test-suite/standalone/sassy/tests/movx16
new file mode 100644
index 000000000..c7e60b667
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/movx16
@@ -0,0 +1 @@
+fฟ่fgท/fพ่fgถ/พ์gถ/ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/movx16.asm b/test-suite/standalone/sassy/tests/movx16.asm
new file mode 100644
index 000000000..51645b870
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/movx16.asm
@@ -0,0 +1,9 @@
+BITS 16
+section .text
+foo:
+movsx ebp, ax
+movzx ebp, word [edi]
+movsx ebp, al
+movzx ebp, byte [edi]
+movsx bp, ah
+movzx bp, [edi]
diff --git a/test-suite/standalone/sassy/tests/non b/test-suite/standalone/sassy/tests/non
new file mode 100644
index 000000000..d1fb96f52
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/non
@@ -0,0 +1 @@
+7?f˜™๘๚๕ฆfงงข˜f™'/๔lfmmฬฮฯfฯฯŸษฌfญญคfฅฅnfooafaaf`f``œfœœ231žฎfฏฏ๙๛ชfซซ  0ืื45 \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/non.asm b/test-suite/standalone/sassy/tests/non.asm
new file mode 100644
index 000000000..d81de30b6
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/non.asm
@@ -0,0 +1,74 @@
+BITS 32
+section .text
+foo:
+aaa
+aas
+cbw
+cdq
+clc
+cld
+cli
+clts
+cmc
+cmpsb
+cmpsw
+cmpsd
+cpuid
+cwde
+cwd
+daa
+das
+hlt
+insb
+insw
+insd
+int3
+into
+invd
+iret
+iretw
+iretd
+lahf
+leave
+lodsb
+lodsw
+lodsd
+movsb
+movsw
+movsd
+nop
+outsb
+outsw
+outsd
+popa
+popaw
+popad
+popf
+popfw
+popfd
+pusha
+pushaw
+pushad
+pushf
+pushfw
+pushfd
+rdmsr
+rdpmc
+rdtsc
+sahf
+scasb
+scasw
+scasd
+stc
+std
+sti
+stosb
+stosw
+stosd
+ud2
+wbinvd
+wrmsr
+xlat
+xlatb
+sysenter
+sysexit
diff --git a/test-suite/standalone/sassy/tests/non.scm b/test-suite/standalone/sassy/tests/non.scm
new file mode 100644
index 000000000..59722f3ef
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/non.scm
@@ -0,0 +1,73 @@
+(
+(aaa)
+(aas)
+(cbw)
+(cdq)
+(clc)
+(cld)
+(cli)
+(clts)
+(cmc)
+(cmpsb)
+(cmpsw)
+(cmpsd)
+(cpuid)
+(cwde)
+(cwd)
+(daa)
+(das)
+(hlt)
+(insb)
+(insw)
+(insd)
+(int3)
+(into)
+(invd)
+(iret)
+(iretw)
+(iretd)
+(lahf)
+(leave)
+(lodsb)
+(lodsw)
+(lodsd)
+(movsb)
+(movsw)
+(movsd)
+(nop)
+(outsb)
+(outsw)
+(outsd)
+(popa)
+(popaw)
+(popad)
+(popf)
+(popfw)
+(popfd)
+(pusha)
+(pushaw)
+(pushad)
+(pushf)
+(pushfw)
+(pushfd)
+(rdmsr)
+(rdpmc)
+(rdtsc)
+(sahf)
+(scasb)
+(scasw)
+(scasd)
+(stc)
+(std)
+(sti)
+(stosb)
+(stosw)
+(stosd)
+(ud2)
+(wbinvd)
+(wrmsr)
+(xlat)
+(xlatb)
+(sysenter)
+(sysexit)
+) \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/non16 b/test-suite/standalone/sassy/tests/non16
new file mode 100644
index 000000000..e62b8c1ff
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/non16
@@ -0,0 +1 @@
+7?˜f™๘๚๕ฆงfงขf˜™'/๔lmfmฬฮฯฯfฯŸษฌญfญคฅfฅnofoaafaf``f`œœfœ231žฎฏfฏ๙๛ชซfซ  0ืื45 \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/non16.asm b/test-suite/standalone/sassy/tests/non16.asm
new file mode 100644
index 000000000..3b470640b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/non16.asm
@@ -0,0 +1,74 @@
+BITS 16
+section .text
+foo:
+aaa
+aas
+cbw
+cdq
+clc
+cld
+cli
+clts
+cmc
+cmpsb
+cmpsw
+cmpsd
+cpuid
+cwde
+cwd
+daa
+das
+hlt
+insb
+insw
+insd
+int3
+into
+invd
+iret
+iretw
+iretd
+lahf
+leave
+lodsb
+lodsw
+lodsd
+movsb
+movsw
+movsd
+nop
+outsb
+outsw
+outsd
+popa
+popaw
+popad
+popf
+popfw
+popfd
+pusha
+pushaw
+pushad
+pushf
+pushfw
+pushfd
+rdmsr
+rdpmc
+rdtsc
+sahf
+scasb
+scasw
+scasd
+stc
+std
+sti
+stosb
+stosw
+stosd
+ud2
+wbinvd
+wrmsr
+xlat
+xlatb
+sysenter
+sysexit
diff --git a/test-suite/standalone/sassy/tests/plier b/test-suite/standalone/sassy/tests/plier
new file mode 100644
index 000000000..33c6942e1
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/plier
@@ -0,0 +1 @@
+๗3f๗;๖#๖๐f๗๘๗โ๗฿๗ื๗f๗ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/plier.asm b/test-suite/standalone/sassy/tests/plier.asm
new file mode 100644
index 000000000..33ce1e9d5
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/plier.asm
@@ -0,0 +1,13 @@
+BITS 32
+section .text
+foo:
+div dword [ebx]
+idiv word [ebx]
+mul byte [ebx]
+div al
+idiv ax
+mul edx
+neg edi
+not edi
+neg dword [ecx]
+not word [eax]
diff --git a/test-suite/standalone/sassy/tests/plier.scm b/test-suite/standalone/sassy/tests/plier.scm
new file mode 100644
index 000000000..1ebe8259b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/plier.scm
@@ -0,0 +1,12 @@
+(
+(div (dword (& ebx)))
+(idiv (word (& ebx)))
+(mul (byte (& ebx)))
+(div al)
+(idiv ax)
+(mul edx)
+(neg edi)
+(not edi)
+(neg (dword (& ecx)))
+(not (word (& eax)))
+)
diff --git a/test-suite/standalone/sassy/tests/plier16 b/test-suite/standalone/sassy/tests/plier16
new file mode 100644
index 000000000..475902ae7
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/plier16
@@ -0,0 +1 @@
+fg๗3g๗;g๖#๖๐๗๘f๗โf๗฿f๗ืfg๗g๗ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/plier16.asm b/test-suite/standalone/sassy/tests/plier16.asm
new file mode 100644
index 000000000..b0601ab3f
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/plier16.asm
@@ -0,0 +1,13 @@
+BITS 16
+section .text
+foo:
+div dword [ebx]
+idiv word [ebx]
+mul byte [ebx]
+div al
+idiv ax
+mul edx
+neg edi
+not edi
+neg dword [ecx]
+not word [eax]
diff --git a/test-suite/standalone/sassy/tests/prefix b/test-suite/standalone/sassy/tests/prefix
new file mode 100644
index 000000000..ba3c43154
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prefix
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prefix.asm b/test-suite/standalone/sassy/tests/prefix.asm
new file mode 100644
index 000000000..731bcad82
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prefix.asm
@@ -0,0 +1,27 @@
+BITS 32
+section .text
+foo:
+rep
+insd
+rep
+outsw
+rep
+lodsb
+rep
+stosd
+rep
+movsb
+repe
+cmpsb
+repz
+cmpsd
+repne
+scasd
+repnz
+scasb
+lock
+add byte [eax], 1
+lock
+dec dword [edx]
+lock
+xor [ecx], ecx
diff --git a/test-suite/standalone/sassy/tests/prefix.scm b/test-suite/standalone/sassy/tests/prefix.scm
new file mode 100644
index 000000000..2bfe6c014
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prefix.scm
@@ -0,0 +1,14 @@
+(
+(rep (insd))
+(rep (outsw))
+(rep (lodsb))
+(rep (stosd))
+(rep (movsb))
+(repe (cmpsb))
+(repz (cmpsd))
+(repne (scasd))
+(repnz (scasb))
+(lock (add (byte (& eax)) 1))
+(lock (dec (dword (& edx))))
+(lock (xor (& ecx) ecx))
+)
diff --git a/test-suite/standalone/sassy/tests/prefix16 b/test-suite/standalone/sassy/tests/prefix16
new file mode 100644
index 000000000..2b87a3a78
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prefix16
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prefix16.asm b/test-suite/standalone/sassy/tests/prefix16.asm
new file mode 100644
index 000000000..e142fe0b7
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prefix16.asm
@@ -0,0 +1,27 @@
+BITS 16
+section .text
+foo:
+rep
+insd
+rep
+outsw
+rep
+lodsb
+rep
+stosd
+rep
+movsb
+repe
+cmpsb
+repz
+cmpsd
+repne
+scasd
+repnz
+scasb
+lock
+add byte [eax], 1
+lock
+dec dword [edx]
+lock
+xor [ecx], ecx
diff --git a/test-suite/standalone/sassy/tests/prims/alt1 b/test-suite/standalone/sassy/tests/prims/alt1
new file mode 100644
index 000000000..fe93a43c6
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/alt1
@@ -0,0 +1 @@
+๋ ๋๋๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/alt1.scm b/test-suite/standalone/sassy/tests/prims/alt1.scm
new file mode 100644
index 000000000..c9dc3d4f6
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/alt1.scm
@@ -0,0 +1,18 @@
+(text
+ (seq (nop)
+ (alt (nop)
+ (nop)
+ (nop)
+ (inv (nop)))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 EB09 jmp short 0xd
+; 00000004 90 nop
+; 00000005 EB06 jmp short 0xd
+; 00000007 90 nop
+; 00000008 EB03 jmp short 0xd
+; 0000000A 90 nop
+; 0000000B EB01 jmp short 0xe
+; 0000000D 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/alt2 b/test-suite/standalone/sassy/tests/prims/alt2
new file mode 100644
index 000000000..1f00723a2
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/alt2
@@ -0,0 +1 @@
+๋}๋} \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/alt2.scm b/test-suite/standalone/sassy/tests/prims/alt2.scm
new file mode 100644
index 000000000..d0ce9420a
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/alt2.scm
@@ -0,0 +1,16 @@
+(text
+ (seq (nop)
+ (alt (nop)
+ ge!
+ (nop)
+ (inv ge!))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 EB07 jmp short 0xb
+; 00000004 7D05 jnl 0xb
+; 00000006 90 nop
+; 00000007 EB02 jmp short 0xb
+; 00000009 7D01 jnl 0xc
+; 0000000B 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/alt3 b/test-suite/standalone/sassy/tests/prims/alt3
new file mode 100644
index 000000000..886733710
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/alt3
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/alt3.scm b/test-suite/standalone/sassy/tests/prims/alt3.scm
new file mode 100644
index 000000000..13af1975b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/alt3.scm
@@ -0,0 +1,15 @@
+(text
+ (seq (if (= ecx 0)
+ (alt z! z!)
+ (nop))
+ (nop)))
+
+; 00000000 83F900 cmp cx,byte +0x0
+; 00000003 7506 jnz 0xb
+; 00000005 7405 jz 0xc
+; 00000007 7403 jz 0xc
+; 00000009 EB02 jmp short 0xd
+; 0000000B 90 nop
+; 0000000C 90 nop
+
+
diff --git a/test-suite/standalone/sassy/tests/prims/alt4 b/test-suite/standalone/sassy/tests/prims/alt4
new file mode 100644
index 000000000..a6cf68c85
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/alt4
@@ -0,0 +1 @@
+๋}๋| \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/alt4.scm b/test-suite/standalone/sassy/tests/prims/alt4.scm
new file mode 100644
index 000000000..78a795229
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/alt4.scm
@@ -0,0 +1,16 @@
+(text
+ (seq (nop)
+ (alt (nop)
+ ge!
+ (nop)
+ ge!)
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 EB07 jmp short 0xb
+; 00000004 7D05 jnl 0xb
+; 00000006 90 nop
+; 00000007 EB02 jmp short 0xb
+; 00000009 7C01 jl 0xc
+; 0000000B 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/begin1 b/test-suite/standalone/sassy/tests/prims/begin1
new file mode 100644
index 000000000..f0140b145
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/begin1
@@ -0,0 +1 @@
+๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/begin1.scm b/test-suite/standalone/sassy/tests/prims/begin1.scm
new file mode 100644
index 000000000..9d1a62b05
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/begin1.scm
@@ -0,0 +1,15 @@
+(text
+ (begin (nop)
+ (seq (nop)
+ (begin (nop)
+ (inv (nop)))
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 90 nop
+; 00000003 90 nop
+; 00000004 EB01 jmp short 0x7
+; 00000006 90 nop
+; 00000007 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/begin2 b/test-suite/standalone/sassy/tests/prims/begin2
new file mode 100644
index 000000000..6076321e1
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/begin2
@@ -0,0 +1 @@
+u \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/begin2.scm b/test-suite/standalone/sassy/tests/prims/begin2.scm
new file mode 100644
index 000000000..5e4889592
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/begin2.scm
@@ -0,0 +1,14 @@
+(text
+ (begin (nop)
+ (seq (nop)
+ (begin (nop)
+ z!)
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 90 nop
+; 00000003 7501 jnz 0x6
+; 00000005 90 nop
+; 00000006 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/begin3 b/test-suite/standalone/sassy/tests/prims/begin3
new file mode 100644
index 000000000..c4d342828
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/begin3
@@ -0,0 +1 @@
+๋t \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/begin3.scm b/test-suite/standalone/sassy/tests/prims/begin3.scm
new file mode 100644
index 000000000..9a8353a87
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/begin3.scm
@@ -0,0 +1,15 @@
+(text
+ (begin (nop)
+ (alt (nop)
+ (begin (nop)
+ z!)
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 EB04 jmp short 0x8
+; 00000004 90 nop
+; 00000005 7401 jz 0x8
+; 00000007 90 nop
+; 00000008 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/begin4 b/test-suite/standalone/sassy/tests/prims/begin4
new file mode 100644
index 000000000..76ad18872
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/begin4
@@ -0,0 +1 @@
+๋u \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/begin4.scm b/test-suite/standalone/sassy/tests/prims/begin4.scm
new file mode 100644
index 000000000..a8b4ab3c9
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/begin4.scm
@@ -0,0 +1,16 @@
+(text
+ (begin (nop)
+ (alt (nop)
+ (begin (nop)
+ (inv z!))
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 EB04 jmp short 0x8
+; 00000004 90 nop
+; 00000005 7501 jnz 0x8
+; 00000007 90 nop
+; 00000008 90 nop
+
diff --git a/test-suite/standalone/sassy/tests/prims/begin5 b/test-suite/standalone/sassy/tests/prims/begin5
new file mode 100644
index 000000000..4a8138156
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/begin5
@@ -0,0 +1 @@
+ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/begin5.scm b/test-suite/standalone/sassy/tests/prims/begin5.scm
new file mode 100644
index 000000000..72a8c0922
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/begin5.scm
@@ -0,0 +1,18 @@
+(text
+ (begin (nop)
+ (inv (alt z!
+ l!
+ a!))
+ (nop)))
+
+;The arguments to a begin always take as their win and lose the
+;following arg in the sequence, except for the last, which takes
+;begin's win and lose. Since the assertions only generate jcc's, they
+;would all be jcc's to the last (nop). But it happens that the last
+;(nop) is the instruction following the a! assertion. But a jmp to the
+;next instruction is really doing nothing at all, so it may be
+;eliminated. But then the l! assertion is in the same circumstance,
+;and so on. Hence:
+
+; 00000000 90 nop
+; 00000001 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/esc1 b/test-suite/standalone/sassy/tests/prims/esc1
new file mode 100644
index 000000000..7cbd24df0
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/esc1
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/esc1.scm b/test-suite/standalone/sassy/tests/prims/esc1.scm
new file mode 100644
index 000000000..8a02d9c76
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/esc1.scm
@@ -0,0 +1,32 @@
+(text
+ (label foo (ret))
+ (label bar (ret))
+ (begin
+ (esc ((push $win))
+ (alt
+ (with-win foo
+ (seq (= eax 3)
+ (= ebx 2)
+ (push eax)
+ (push ebx)))
+ (with-win bar
+ (seq (push ebx)
+ (push eax)))))
+ (nop)
+ (nop)))
+
+; 00000000 C3 ret
+; 00000001 C3 ret
+; 00000002 681F000000 push dword 0x1f
+; 00000007 83F803 cmp eax,byte +0x3
+; 0000000A 750C jnz 0x18
+; 0000000C 83FB02 cmp ebx,byte +0x2
+; 0000000F 7507 jnz 0x18
+; 00000011 50 push eax
+; 00000012 53 push ebx
+; 00000013 E9E8FFFFFF jmp 0x0
+; 00000018 53 push ebx
+; 00000019 50 push eax
+; 0000001A E9E2FFFFFF jmp 0x1
+; 0000001F 90 nop
+; 00000020 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/esc2 b/test-suite/standalone/sassy/tests/prims/esc2
new file mode 100644
index 000000000..43bef5952
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/esc2
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/esc2.scm b/test-suite/standalone/sassy/tests/prims/esc2.scm
new file mode 100644
index 000000000..07179ec21
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/esc2.scm
@@ -0,0 +1,36 @@
+(text
+ (label foo (ret))
+ (label bar (ret))
+ (seq (nop)
+ (esc ((push $win)
+ (mov edx $lose))
+ (alt
+ (with-win foo
+ (seq (= eax 3)
+ (= ebx 2)
+ (push eax)
+ (push ebx)))
+ (with-win bar
+ (seq (mov esp edx)
+ (push ebx)
+ (push eax)))))
+ (nop)))
+
+; 00000000 C3 ret
+; 00000001 C3 ret
+; 00000002 90 nop
+; 00000003 6827000000 push dword 0x27
+; 00000008 BA28000000 mov edx,0x28
+; 0000000D 83F803 cmp eax,byte +0x3
+; 00000010 750C jnz 0x1e
+; 00000012 83FB02 cmp ebx,byte +0x2
+; 00000015 7507 jnz 0x1e
+; 00000017 50 push eax
+; 00000018 53 push ebx
+; 00000019 E9E2FFFFFF jmp 0x0
+; 0000001E 89D4 mov esp,edx
+; 00000020 53 push ebx
+; 00000021 50 push eax
+; 00000022 E9DAFFFFFF jmp 0x1
+; 00000027 90 nop
+
diff --git a/test-suite/standalone/sassy/tests/prims/esc3 b/test-suite/standalone/sassy/tests/prims/esc3
new file mode 100644
index 000000000..bbfb274a5
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/esc3
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/esc3.scm b/test-suite/standalone/sassy/tests/prims/esc3.scm
new file mode 100644
index 000000000..d77ea46bc
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/esc3.scm
@@ -0,0 +1,16 @@
+(text
+ (begin (push $eip)
+ (push $win)
+ (push $lose))
+ (seq (push $eip)
+ (push $win)
+ (push $lose)
+ (nop)))
+
+; 00000000 6805000000 push dword 0x5
+; 00000005 680A000000 push dword 0xa
+; 0000000A 680F000000 push dword 0xf
+; 0000000F 6814000000 push dword 0x14
+; 00000014 6819000000 push dword 0x19
+; 00000019 681F000000 push dword 0x1f
+; 0000001E 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/esc4 b/test-suite/standalone/sassy/tests/prims/esc4
new file mode 100644
index 000000000..6a6d22348
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/esc4
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/esc4.scm b/test-suite/standalone/sassy/tests/prims/esc4.scm
new file mode 100644
index 000000000..378beefd2
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/esc4.scm
@@ -0,0 +1,35 @@
+(text
+ (begin (call $eip)
+ (call $win)
+ (call $lose))
+ (seq (jmp $eip)
+ (jmp $win)
+ (jmp $lose)
+ (nop))
+ (seq (jmp short $eip)
+ (jmp short $win)
+ (jmp short $lose)
+ (nop))
+ (alt (jmp $win)
+ (jmp $lose)
+ (nop)
+ (nop)))
+
+; 00000000 E800000000 call 0x5
+; 00000005 E800000000 call 0xa
+; 0000000A E800000000 call 0xf
+; 0000000F E900000000 jmp 0x14
+; 00000014 E900000000 jmp 0x19
+; 00000019 E901000000 jmp 0x1f
+; 0000001E 90 nop
+; 0000001F EB00 jmp short 0x21
+; 00000021 EB00 jmp short 0x23
+; 00000023 EB01 jmp short 0x26
+; 00000025 90 nop
+; 00000026 E90D000000 jmp 0x38
+; 0000002B EB0B jmp short 0x38
+; 0000002D E902000000 jmp 0x34
+; 00000032 EB04 jmp short 0x38
+; 00000034 90 nop
+; 00000035 EB01 jmp short 0x38
+; 00000037 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/esc5 b/test-suite/standalone/sassy/tests/prims/esc5
new file mode 100644
index 000000000..1f5ebdfc5
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/esc5
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/esc5.scm b/test-suite/standalone/sassy/tests/prims/esc5.scm
new file mode 100644
index 000000000..2f2946635
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/esc5.scm
@@ -0,0 +1,35 @@
+(text
+ (label foo (ret))
+ (label bar (ret))
+ (seq (nop)
+ (esc ((jmp $win)
+ (jmp $lose))
+ (alt
+ (with-win foo
+ (seq (= eax 3)
+ (= ebx 2)
+ (push eax)
+ (push ebx)))
+ (with-win bar
+ (seq (mov esp edx)
+ (push ebx)
+ (push eax)))))
+ (nop)))
+
+; 00000000 C3 ret
+; 00000001 C3 ret
+; 00000002 90 nop
+; 00000003 E91F000000 jmp 0x27
+; 00000008 E91B000000 jmp 0x28
+; 0000000D 83F803 cmp eax,byte +0x3
+; 00000010 750C jnz 0x1e
+; 00000012 83FB02 cmp ebx,byte +0x2
+; 00000015 7507 jnz 0x1e
+; 00000017 50 push eax
+; 00000018 53 push ebx
+; 00000019 E9E2FFFFFF jmp 0x0
+; 0000001E 89D4 mov esp,edx
+; 00000020 53 push ebx
+; 00000021 50 push eax
+; 00000022 E9DAFFFFFF jmp 0x1
+; 00000027 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/esc6 b/test-suite/standalone/sassy/tests/prims/esc6
new file mode 100644
index 000000000..495ad8116
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/esc6
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/esc6.scm b/test-suite/standalone/sassy/tests/prims/esc6.scm
new file mode 100644
index 000000000..b94e6f9dd
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/esc6.scm
@@ -0,0 +1,14 @@
+(text
+ (iter (seq (nop)
+ (nop)
+ (jnz $lose)
+ (nop)
+ (nop))))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 0F8504000000 jnz near 0xc
+; 00000008 90 nop
+; 00000009 90 nop
+; 0000000A EBF4 jmp short 0x0
+ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/esc7 b/test-suite/standalone/sassy/tests/prims/esc7
new file mode 100644
index 000000000..86ff7bc5e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/esc7
@@ -0,0 +1 @@
+ut๘๋๖ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/esc7.scm b/test-suite/standalone/sassy/tests/prims/esc7.scm
new file mode 100644
index 000000000..d23f7f523
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/esc7.scm
@@ -0,0 +1,16 @@
+(text
+ (iter (seq (nop)
+ (nop)
+ (jnz short $lose)
+ (nop)
+ (nop)
+ (je short $win))))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 7506 jnz 0xa
+; 00000004 90 nop
+; 00000005 90 nop
+; 00000006 74F8 jz 0x0
+; 00000008 EBF6 jmp short 0x0
+ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/exp-k1 b/test-suite/standalone/sassy/tests/prims/exp-k1
new file mode 100644
index 000000000..cd617b311
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/exp-k1
@@ -0,0 +1 @@
+ut \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/exp-k1.scm b/test-suite/standalone/sassy/tests/prims/exp-k1.scm
new file mode 100644
index 000000000..902a09065
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/exp-k1.scm
@@ -0,0 +1,25 @@
+(macro seq-k (lambda tests
+ (cond ((null? tests) '$win)
+ ((null? (cdr tests)) (car tests))
+ (else `(with-win (seq-k ,@(cdr tests))
+ ,(car tests))))))
+(text
+ (begin (nop)
+ (nop)
+ (seq-k (nop)
+ (nop)
+ z!
+ (nop)
+ (inv z!)
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 90 nop
+; 00000003 90 nop
+; 00000004 7504 jnz 0xa
+; 00000006 90 nop
+; 00000007 7401 jz 0xa
+; 00000009 90 nop
+; 0000000A 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/exp-k2 b/test-suite/standalone/sassy/tests/prims/exp-k2
new file mode 100644
index 000000000..c3e2ac2c0
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/exp-k2
@@ -0,0 +1 @@
+๋t}๋๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/exp-k2.scm b/test-suite/standalone/sassy/tests/prims/exp-k2.scm
new file mode 100644
index 000000000..65bc20a67
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/exp-k2.scm
@@ -0,0 +1,25 @@
+(macro inv-k (lambda (itm)
+ `(with-win-lose $lose $win
+ ,itm)))
+
+(text
+ (alt (if (seq (inv-k (nop))
+ (inv-k z!)
+ (inv-k (inv (nop)))
+ (inv-k ge!))
+ (inv-k (nop))
+ (nop))
+ (nop)))
+
+; should be the same as inv4.scm (de Morgan)
+
+; 00000000 90 nop
+; 00000001 EB08 jmp short 0xb
+; 00000003 7406 jz 0xb
+; 00000005 90 nop
+; 00000006 7D03 jnl 0xb
+; 00000008 90 nop
+; 00000009 EB03 jmp short 0xe
+; 0000000B 90 nop
+; 0000000C EB01 jmp short 0xf
+; 0000000E 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/exp-k3 b/test-suite/standalone/sassy/tests/prims/exp-k3
new file mode 100644
index 000000000..76ad18872
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/exp-k3
@@ -0,0 +1 @@
+๋u \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/exp-k3.scm b/test-suite/standalone/sassy/tests/prims/exp-k3.scm
new file mode 100644
index 000000000..bd4ce3628
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/exp-k3.scm
@@ -0,0 +1,24 @@
+(macro begin-k (lambda body-tail
+ (if (null? (cdr body-tail))
+ (car body-tail)
+ `(with-win (begin-k ,@(cdr body-tail))
+ (with-lose $win
+ ,(car body-tail))))))
+
+
+(text
+ (begin-k (nop)
+ (alt (nop)
+ (begin-k (nop)
+ (inv z!))
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 EB04 jmp short 0x8
+; 00000004 90 nop
+; 00000005 7501 jnz 0x8
+; 00000007 90 nop
+; 00000008 90 nop
+
diff --git a/test-suite/standalone/sassy/tests/prims/exp-k4 b/test-suite/standalone/sassy/tests/prims/exp-k4
new file mode 100644
index 000000000..9e722fd9b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/exp-k4
@@ -0,0 +1 @@
+u๋ ~๋{๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/exp-k4.scm b/test-suite/standalone/sassy/tests/prims/exp-k4.scm
new file mode 100644
index 000000000..02fe7add2
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/exp-k4.scm
@@ -0,0 +1,29 @@
+(macro if-k (lambda (test conseq altern)
+ `(with-win-lose ,conseq ,altern
+ ,test)))
+
+(text
+ (seq (nop)
+ (if-k (seq (nop) z!)
+ (inv (nop))
+ (if-k g!
+ (nop)
+ (if-k p!
+ (nop)
+ (nop))))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 7503 jnz 0x7
+; 00000004 90 nop
+; 00000005 EB0C jmp short 0x13
+; 00000007 7E03 jng 0xc
+; 00000009 90 nop
+; 0000000A EB06 jmp short 0x12
+; 0000000C 7B03 jpo 0x11
+; 0000000E 90 nop
+; 0000000F EB01 jmp short 0x12
+; 00000011 90 nop
+; 00000012 90 nop
+
diff --git a/test-suite/standalone/sassy/tests/prims/if1 b/test-suite/standalone/sassy/tests/prims/if1
new file mode 100644
index 000000000..7ecc60012
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/if1
@@ -0,0 +1 @@
+tv๋๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/if1.scm b/test-suite/standalone/sassy/tests/prims/if1.scm
new file mode 100644
index 000000000..20941e001
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/if1.scm
@@ -0,0 +1,16 @@
+(text
+ (seq (nop)
+ (if (alt z! a!)
+ (nop)
+ (inv (nop)))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 7402 jz 0x5
+; 00000003 7603 jna 0x8
+; 00000005 90 nop
+; 00000006 EB03 jmp short 0xb
+; 00000008 90 nop
+; 00000009 EB01 jmp short 0xc
+; 0000000B 90 nop
+
diff --git a/test-suite/standalone/sassy/tests/prims/if2 b/test-suite/standalone/sassy/tests/prims/if2
new file mode 100644
index 000000000..2d8ada333
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/if2
@@ -0,0 +1 @@
+tw๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/if2.scm b/test-suite/standalone/sassy/tests/prims/if2.scm
new file mode 100644
index 000000000..fa7960910
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/if2.scm
@@ -0,0 +1,21 @@
+(text
+ (seq (nop)
+ (if (seq (nop)
+ (inv (alt z! a!)))
+ (inv (nop))
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 7405 jz 0x9
+; 00000004 7703 ja 0x9
+; 00000006 90 nop
+; 00000007 EB02 jmp short 0xb
+; 00000009 90 nop
+; 0000000A 90 nop
+
+;Causing the consequent (first) arm of the if to lose cause the whole
+;if to lose, and thus the outer seq to lose.
+
+
diff --git a/test-suite/standalone/sassy/tests/prims/if3 b/test-suite/standalone/sassy/tests/prims/if3
new file mode 100644
index 000000000..a459c239b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/if3
@@ -0,0 +1 @@
+u๋~๋{๋v \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/if3.scm b/test-suite/standalone/sassy/tests/prims/if3.scm
new file mode 100644
index 000000000..2ef4af1fc
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/if3.scm
@@ -0,0 +1,26 @@
+(text
+ (seq (nop)
+ (if (seq (nop) z!)
+ (inv (nop))
+ (if g!
+ (nop)
+ (if p!
+ (nop)
+ (seq a! (nop)))))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 7503 jnz 0x7
+; 00000004 90 nop
+; 00000005 EB0E jmp short 0x15
+; 00000007 7E03 jng 0xc
+; 00000009 90 nop
+; 0000000A EB08 jmp short 0x14
+; 0000000C 7B03 jpo 0x11
+; 0000000E 90 nop
+; 0000000F EB03 jmp short 0x14
+; 00000011 7602 jna 0x15
+; 00000013 90 nop
+; 00000014 90 nop
+
diff --git a/test-suite/standalone/sassy/tests/prims/if4 b/test-suite/standalone/sassy/tests/prims/if4
new file mode 100644
index 000000000..9e722fd9b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/if4
@@ -0,0 +1 @@
+u๋ ~๋{๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/if4.scm b/test-suite/standalone/sassy/tests/prims/if4.scm
new file mode 100644
index 000000000..ca3aa1471
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/if4.scm
@@ -0,0 +1,25 @@
+(text
+ (seq (nop)
+ (if (seq (nop) z!)
+ (inv (nop))
+ (if g!
+ (nop)
+ (if p!
+ (nop)
+ (nop))))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 7503 jnz 0x7
+; 00000004 90 nop
+; 00000005 EB0C jmp short 0x13
+; 00000007 7E03 jng 0xc
+; 00000009 90 nop
+; 0000000A EB06 jmp short 0x12
+; 0000000C 7B03 jpo 0x11
+; 0000000E 90 nop
+; 0000000F EB01 jmp short 0x12
+; 00000011 90 nop
+; 00000012 90 nop
+
diff --git a/test-suite/standalone/sassy/tests/prims/inv1 b/test-suite/standalone/sassy/tests/prims/inv1
new file mode 100644
index 000000000..015f131dc
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/inv1
@@ -0,0 +1 @@
+u}w \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/inv1.scm b/test-suite/standalone/sassy/tests/prims/inv1.scm
new file mode 100644
index 000000000..ec790397f
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/inv1.scm
@@ -0,0 +1,20 @@
+(text
+ (seq (nop)
+ (inv (seq z!
+ l!
+ a!))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 7504 jnz 0x7
+; 00000003 7D02 jnl 0x7
+; 00000005 7701 ja 0x8
+; 00000007 90 nop
+
+;In order for the outer seq to win all its arguments must win.
+;In order for the inv to win its argument must lose.
+;The argument to inv is seq, so far a seq to lose any one of its args must lose.
+;The first two args are assertions, they lose if their opposite is true, and if their opposite is true the inv wins, hence the jcc's to 0x7.
+;The last arg, also an assertion, wins if it is true, but in that case the inv will lose, causing the outer seq to lose, hance the jcc to 0x8, past everything.
+
+
diff --git a/test-suite/standalone/sassy/tests/prims/inv2 b/test-suite/standalone/sassy/tests/prims/inv2
new file mode 100644
index 000000000..783318320
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/inv2
@@ -0,0 +1 @@
+t|w \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/inv2.scm b/test-suite/standalone/sassy/tests/prims/inv2.scm
new file mode 100644
index 000000000..e649cf181
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/inv2.scm
@@ -0,0 +1,18 @@
+(text
+ (seq (nop)
+ (inv (alt z!
+ l!
+ a!))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 7405 jz 0x8
+; 00000003 7C03 jl 0x8
+; 00000005 7701 ja 0x8
+; 00000007 90 nop
+
+;In order for the outer seq to win its arguments must win. In order
+;for the inv to win its argument must lose. It's argument is alt, and
+;for an alt to lose all its arguments must lose. Therefore if any of
+;its arguments win, the inv will lose as will the outer seq. Hence the
+;jcc's past everything.
diff --git a/test-suite/standalone/sassy/tests/prims/inv3 b/test-suite/standalone/sassy/tests/prims/inv3
new file mode 100644
index 000000000..581ae8c71
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/inv3
@@ -0,0 +1 @@
+u๋}๋๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/inv3.scm b/test-suite/standalone/sassy/tests/prims/inv3.scm
new file mode 100644
index 000000000..e60c6c9cd
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/inv3.scm
@@ -0,0 +1,19 @@
+(text
+ (alt (if (inv (seq (nop)
+ z!
+ (inv (nop))
+ ge!))
+ (inv (nop))
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 7505 jnz 0x8
+; 00000003 90 nop
+; 00000004 EB02 jmp short 0x8
+; 00000006 7D03 jnl 0xb
+; 00000008 90 nop
+; 00000009 EB03 jmp short 0xe
+; 0000000B 90 nop
+; 0000000C EB01 jmp short 0xf
+; 0000000E 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/inv4 b/test-suite/standalone/sassy/tests/prims/inv4
new file mode 100644
index 000000000..c3e2ac2c0
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/inv4
@@ -0,0 +1 @@
+๋t}๋๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/inv4.scm b/test-suite/standalone/sassy/tests/prims/inv4.scm
new file mode 100644
index 000000000..b0c4ee922
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/inv4.scm
@@ -0,0 +1,19 @@
+(text
+ (alt (if (inv (alt (nop)
+ z!
+ (inv (nop))
+ ge!))
+ (inv (nop))
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 EB08 jmp short 0xb
+; 00000003 7406 jz 0xb
+; 00000005 90 nop
+; 00000006 7D03 jnl 0xb
+; 00000008 90 nop
+; 00000009 EB03 jmp short 0xe
+; 0000000B 90 nop
+; 0000000C EB01 jmp short 0xf
+; 0000000E 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/inv5 b/test-suite/standalone/sassy/tests/prims/inv5
new file mode 100644
index 000000000..581ae8c71
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/inv5
@@ -0,0 +1 @@
+u๋}๋๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/inv5.scm b/test-suite/standalone/sassy/tests/prims/inv5.scm
new file mode 100644
index 000000000..3ead1fd44
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/inv5.scm
@@ -0,0 +1,21 @@
+(text
+ (alt (if (alt (inv (nop))
+ (inv z!)
+ (inv (inv (nop)))
+ (inv ge!))
+ (inv (nop))
+ (nop))
+ (nop)))
+
+; should be the same as inv3.scm, (de Morgan)
+
+; 00000000 90 nop
+; 00000001 7505 jnz 0x8
+; 00000003 90 nop
+; 00000004 EB02 jmp short 0x8
+; 00000006 7D03 jnl 0xb
+; 00000008 90 nop
+; 00000009 EB03 jmp short 0xe
+; 0000000B 90 nop
+; 0000000C EB01 jmp short 0xf
+; 0000000E 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/inv6 b/test-suite/standalone/sassy/tests/prims/inv6
new file mode 100644
index 000000000..c3e2ac2c0
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/inv6
@@ -0,0 +1 @@
+๋t}๋๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/inv6.scm b/test-suite/standalone/sassy/tests/prims/inv6.scm
new file mode 100644
index 000000000..5868e0bf5
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/inv6.scm
@@ -0,0 +1,21 @@
+(text
+ (alt (if (seq (inv (nop))
+ (inv z!)
+ (inv (inv (nop)))
+ (inv ge!))
+ (inv (nop))
+ (nop))
+ (nop)))
+
+; should be the same as inv4.scm (de Morgan)
+
+; 00000000 90 nop
+; 00000001 EB08 jmp short 0xb
+; 00000003 7406 jz 0xb
+; 00000005 90 nop
+; 00000006 7D03 jnl 0xb
+; 00000008 90 nop
+; 00000009 EB03 jmp short 0xe
+; 0000000B 90 nop
+; 0000000C EB01 jmp short 0xf
+; 0000000E 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/iter1 b/test-suite/standalone/sassy/tests/prims/iter1
new file mode 100644
index 000000000..9602d9f55
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/iter1
@@ -0,0 +1 @@
+tv๋๘ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/iter1.scm b/test-suite/standalone/sassy/tests/prims/iter1.scm
new file mode 100644
index 000000000..e884a8e6c
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/iter1.scm
@@ -0,0 +1,11 @@
+(text
+ (iter (seq (nop)
+ (alt z! a!)
+ (nop))))
+
+; 00000000 90 nop
+; 00000001 7402 jz 0x5
+; 00000003 7603 jna 0x8
+; 00000005 90 nop
+; 00000006 EBF8 jmp short 0x0
+
diff --git a/test-suite/standalone/sassy/tests/prims/iter2 b/test-suite/standalone/sassy/tests/prims/iter2
new file mode 100644
index 000000000..405e230ae
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/iter2
@@ -0,0 +1 @@
+uv}๘ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/iter2.scm b/test-suite/standalone/sassy/tests/prims/iter2.scm
new file mode 100644
index 000000000..766337a8c
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/iter2.scm
@@ -0,0 +1,13 @@
+(text
+ (iter
+ (seq (nop)
+ (seq z! a!)
+ (nop)
+ ge!)))
+
+; 00000000 90 nop
+; 00000001 7505 jnz 0x8
+; 00000003 7603 jna 0x8
+; 00000005 90 nop
+; 00000006 7DF8 jnl 0x0
+
diff --git a/test-suite/standalone/sassy/tests/prims/iter3 b/test-suite/standalone/sassy/tests/prims/iter3
new file mode 100644
index 000000000..d3adf99ef
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/iter3
@@ -0,0 +1 @@
+๋uw๙๋๖}๔ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/iter3.scm b/test-suite/standalone/sassy/tests/prims/iter3.scm
new file mode 100644
index 000000000..1c1329269
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/iter3.scm
@@ -0,0 +1,13 @@
+(text
+ (iter (alt (nop)
+ (seq z! a!)
+ (nop)
+ ge!)))
+
+; 00000000 90 nop
+; 00000001 EBFD jmp short 0x0
+; 00000003 7502 jnz 0x7
+; 00000005 77F9 ja 0x0
+; 00000007 90 nop
+; 00000008 EBF6 jmp short 0x0
+; 0000000A 7DF4 jnl 0x0
diff --git a/test-suite/standalone/sassy/tests/prims/iter4 b/test-suite/standalone/sassy/tests/prims/iter4
new file mode 100644
index 000000000..5979312ca
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/iter4
@@ -0,0 +1 @@
+๋u๋๙t} \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/iter4.scm b/test-suite/standalone/sassy/tests/prims/iter4.scm
new file mode 100644
index 000000000..8feeb6f27
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/iter4.scm
@@ -0,0 +1,17 @@
+(text
+ (iter (alt (nop)
+ (iter (seq (nop)
+ (nop)
+ z!
+ (nop)))
+ (iter (inv (alt z!
+ l!))))))
+; 00000000 90 nop
+; 00000001 EBFD jmp short 0x0
+; 00000003 90 nop
+; 00000004 90 nop
+; 00000005 7503 jnz 0xa
+; 00000007 90 nop
+; 00000008 EBF9 jmp short 0x3
+; 0000000A 7402 jz 0xe
+; 0000000C 7DFC jnl 0xa
diff --git a/test-suite/standalone/sassy/tests/prims/iter5 b/test-suite/standalone/sassy/tests/prims/iter5
new file mode 100644
index 000000000..be9fb363f
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/iter5
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/iter5.scm b/test-suite/standalone/sassy/tests/prims/iter5.scm
new file mode 100644
index 000000000..d35aa49b9
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/iter5.scm
@@ -0,0 +1,89 @@
+(text
+ (begin
+ (iter
+ (alt (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (zero? eax)))
+ (iter
+ (alt (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (zero? eax)))))
+
+;testing multi-pass iter for jump sizes
+
+; 00000000 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 0000000B EBF3 jmp short 0x0
+; 0000000D 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 00000018 EBE6 jmp short 0x0
+; 0000001A 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 00000025 EBD9 jmp short 0x0
+; 00000027 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 00000032 EBCC jmp short 0x0
+; 00000034 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 0000003F EBBF jmp short 0x0
+; 00000041 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 0000004C EBB2 jmp short 0x0
+; 0000004E 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 00000059 EBA5 jmp short 0x0
+; 0000005B 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 00000066 EB98 jmp short 0x0
+; 00000068 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 00000073 EB8B jmp short 0x0
+; 00000075 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 00000080 E97BFFFFFF jmp 0x0
+; 00000085 85C0 test eax,eax
+; 00000087 0F8473FFFFFF jz near 0x0
+; 0000008D 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 00000098 EBF3 jmp short 0x8d
+; 0000009A 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 000000A5 EBE6 jmp short 0x8d
+; 000000A7 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 000000B2 EBD9 jmp short 0x8d
+; 000000B4 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 000000BF EBCC jmp short 0x8d
+; 000000C1 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 000000CC EBBF jmp short 0x8d
+; 000000CE 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 000000D9 EBB2 jmp short 0x8d
+; 000000DB 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 000000E6 EBA5 jmp short 0x8d
+; 000000E8 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 000000F3 EB98 jmp short 0x8d
+; 000000F5 818491E8030000E8 add dword [ecx+edx*4+0x3e8],0x3e8
+; -030000
+; 00000100 EB8B jmp short 0x8d
+; 00000102 85C0 test eax,eax
+; 00000104 7487 jz 0x8d
diff --git a/test-suite/standalone/sassy/tests/prims/iter6 b/test-suite/standalone/sassy/tests/prims/iter6
new file mode 100644
index 000000000..fcbdd1a48
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/iter6
@@ -0,0 +1 @@
+[ƒ๛t๚[ƒ๛t๚ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/iter6.scm b/test-suite/standalone/sassy/tests/prims/iter6.scm
new file mode 100644
index 000000000..4ed439a28
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/iter6.scm
@@ -0,0 +1,41 @@
+(text
+ (iter
+ (begin (iter (seq (pop ebx)
+ (= ebx 2)))
+ (iter (seq (pop ebx)
+ (= ebx 3))))))
+
+; 00000000 5B pop ebx
+; 00000001 83FB02 cmp ebx,byte +0x2
+; 00000004 74FA jz 0x0
+; 00000006 5B pop ebx
+; 00000007 83FB03 cmp ebx,byte +0x3
+; 0000000A 74FA jz 0x6
+
+; Why it makes sense that the outer loop doesn't loop:
+; Iter can never win, it can only loop forever or lose, in which case
+; the loop is exited. The begin wins or loses depending on its last
+; tail. In this case, the last tail can never win, since it's an iter,
+; but it can lose. But if it loses, the whole begin loses, in which
+; case the outer iter loses and is exited.
+
+; In this case, you can put '(seq) as the last item of the
+; begin. Since '(seq) always wins, the begin always wins and the outer
+; loop never exits, so the last jmp will be generated:
+
+; (text
+; (iter
+; (begin (iter (seq (pop ebx)
+; (= ebx 2)))
+; (iter (seq (pop ebx)
+; (= ebx 3)))
+; (seq))))
+
+; 00000000 5B pop ebx
+; 00000001 83FB02 cmp ebx,byte +0x2
+; 00000004 74FA jz 0x0
+; 00000006 5B pop ebx
+; 00000007 83FB03 cmp ebx,byte +0x3
+; 0000000A 74FA jz 0x6
+; 0000000C EBF2 jmp short 0x0
+
diff --git a/test-suite/standalone/sassy/tests/prims/label1 b/test-suite/standalone/sassy/tests/prims/label1
new file mode 100644
index 000000000..cf0708fa6
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/label1
@@ -0,0 +1 @@
+u้๘ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/label1.scm b/test-suite/standalone/sassy/tests/prims/label1.scm
new file mode 100644
index 000000000..fe9f5240e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/label1.scm
@@ -0,0 +1,13 @@
+(text
+ (label foo (seq (nop)
+ (label bar z!)
+ (nop)))
+ (jmp bar))
+
+; foo
+; 00000000 90 nop
+; bar
+; 00000001 7501 jnz 0x4
+; 00000003 90 nop
+; 00000004 E9F8FFFFFF jmp 0x1 ; (jmp bar)
+
diff --git a/test-suite/standalone/sassy/tests/prims/label2 b/test-suite/standalone/sassy/tests/prims/label2
new file mode 100644
index 000000000..40c1cd3fe
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/label2
@@ -0,0 +1 @@
+๋๛้๗ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/label2.scm b/test-suite/standalone/sassy/tests/prims/label2.scm
new file mode 100644
index 000000000..1c7c21f19
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/label2.scm
@@ -0,0 +1,15 @@
+(text
+ (iter (begin
+ (nop)
+ (label foo (nop))
+ (nop)))
+ (jmp foo))
+
+; 00000000 90 nop
+; foo:
+; 00000001 90 nop
+; 00000002 90 nop
+; 00000003 EBFB jmp short 0x0
+; 00000005 E9F7FFFFFF jmp 0x1 ; jmp foo
+
+
diff --git a/test-suite/standalone/sassy/tests/prims/label3 b/test-suite/standalone/sassy/tests/prims/label3
new file mode 100644
index 000000000..4cdfeb960
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/label3
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/label3.scm b/test-suite/standalone/sassy/tests/prims/label3.scm
new file mode 100644
index 000000000..16854ae97
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/label3.scm
@@ -0,0 +1,25 @@
+(text
+ (with-win-lose foo bar
+ (zero? eax))
+ (nop)
+ (nop)
+ (nop)
+ (seq (label bar
+ (inv (iter (seq (dec eax)
+ (inc ecx)
+ (>= eax 0)))))
+ (label foo (push ecx))))
+
+; 00000000 85C0 test eax,eax
+; 00000002 0F840F000000 jz near 0x17
+; 00000008 E903000000 jmp 0x10
+; 0000000D 90 nop
+; 0000000E 90 nop
+; 0000000F 90 nop
+; bar:
+; 00000010 48 dec eax
+; 00000011 41 inc ecx
+; 00000012 83F800 cmp eax,byte +0x0
+; 00000015 7DF9 jnl 0x10
+; foo:
+; 00000017 51 push ecx
diff --git a/test-suite/standalone/sassy/tests/prims/label4 b/test-suite/standalone/sassy/tests/prims/label4
new file mode 100644
index 000000000..909860bef
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/label4
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/label4.scm b/test-suite/standalone/sassy/tests/prims/label4.scm
new file mode 100644
index 000000000..7fbb9dca5
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/label4.scm
@@ -0,0 +1,50 @@
+; local labels via brute force renaming
+
+(! (begin (define my-gensym ; assuming eval allows non-expressions (eg define)
+ (let ((count 1))
+ (lambda ()
+ (let ((new (string->symbol (string-append
+ "_label"
+ (number->string count)))))
+ (set! count (+ count 1))
+ new))))
+ 'void))
+
+(macro my-local (lambda (name . body)
+ (define new-sym (my-gensym))
+ ; do the substitution manually,
+ ; instead of relying on a macro to do it,
+ ; because 'direcs' is a directive
+ ; and we want to be able use this in a nested context
+ (define (deep-replace new old lst)
+ (cond ((pair? lst) (map (lambda (x)
+ (deep-replace new old x))
+ lst))
+ ((eqv? old lst) new)
+ (else lst)))
+ `(label ,new-sym ,@(deep-replace new-sym name body))))
+
+
+(text
+ (label foo (ret))
+
+ (seq (= ecx "DOIT")
+ (my-local foo
+ (pop eax)
+ (cmp eax 0)
+ (jnz foo)))
+ (nop)
+ (jmp foo))
+
+; foo:
+; 00000000 C3 ret
+; 00000001 81F9444F4954 cmp ecx,0x54494f44
+; 00000007 750A jnz 0x13
+
+; _label1:
+; 00000009 58 pop eax
+; 0000000A 83F800 cmp eax,byte +0x0
+; 0000000D 0F85F6FFFFFF jnz near 0x9
+; 00000013 90 nop
+; 00000014 E9E7FFFFFF jmp 0x0
+
diff --git a/test-suite/standalone/sassy/tests/prims/leap-mark1 b/test-suite/standalone/sassy/tests/prims/leap-mark1
new file mode 100644
index 000000000..3df256f90
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/leap-mark1
@@ -0,0 +1 @@
+๋YH…ภu๚ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/leap-mark1.scm b/test-suite/standalone/sassy/tests/prims/leap-mark1.scm
new file mode 100644
index 000000000..21e125003
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/leap-mark1.scm
@@ -0,0 +1,10 @@
+(text
+ (while (inv (zero? eax))
+ (seq (pop ecx)
+ (dec eax))))
+
+; 00000000 EB02 jmp short 0x4
+; 00000002 59 pop ecx
+; 00000003 48 dec eax
+; 00000004 85C0 test eax,eax
+; 00000006 75FA jnz 0x2
diff --git a/test-suite/standalone/sassy/tests/prims/leap-mark2 b/test-suite/standalone/sassy/tests/prims/leap-mark2
new file mode 100644
index 000000000..e5631d947
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/leap-mark2
@@ -0,0 +1 @@
+๋๋๋t๖ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/leap-mark2.scm b/test-suite/standalone/sassy/tests/prims/leap-mark2.scm
new file mode 100644
index 000000000..51579c064
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/leap-mark2.scm
@@ -0,0 +1,19 @@
+(text
+ (leap (iter
+ (seq (nop)
+ (mark
+ (leap (seq (nop)
+ (mark
+ (leap (seq (nop)
+ (mark (seq (nop) z!))))))))))))
+
+;confusing but correct.
+
+; 00000000 EB07 jmp short 0x9
+; 00000002 90 nop
+; 00000003 EB04 jmp short 0x9
+; 00000005 90 nop
+; 00000006 EB01 jmp short 0x9
+; 00000008 90 nop
+; 00000009 90 nop
+; 0000000A 74F6 jz 0x2
diff --git a/test-suite/standalone/sassy/tests/prims/leap-mark3 b/test-suite/standalone/sassy/tests/prims/leap-mark3
new file mode 100644
index 000000000..ccc006daf
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/leap-mark3
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/leap-mark3.scm b/test-suite/standalone/sassy/tests/prims/leap-mark3.scm
new file mode 100644
index 000000000..302d8c68f
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/leap-mark3.scm
@@ -0,0 +1,31 @@
+(text
+ (label foo
+ (leap
+ (iter (seq (push edx)
+ (if (= eax 3)
+ (alt (seq (pop ecx) z!)
+ (seq (push ebx) z! (mark (pop ebx)))
+ (seq (mov edx 3)))
+ (seq (= edx 4) (jmp foo)))
+ (push edx))))))
+
+;hmm...
+
+
+; 00000000 EB0C jmp short 0xe
+; 00000002 52 push edx
+; 00000003 83F803 cmp eax,byte +0x3
+; 00000006 7510 jnz 0x18
+; 00000008 59 pop ecx
+; 00000009 7417 jz 0x22
+; 0000000B 53 push ebx
+; 0000000C 7503 jnz 0x11
+; 0000000E 5B pop ebx
+; 0000000F EB11 jmp short 0x22
+; 00000011 BA03000000 mov edx,0x3
+; 00000016 EB0A jmp short 0x22
+; 00000018 83FA04 cmp edx,byte +0x4
+; 0000001B 7508 jnz 0x25
+; 0000001D E9DEFFFFFF jmp 0x0
+; 00000022 52 push edx
+; 00000023 EBDD jmp short 0x2
diff --git a/test-suite/standalone/sassy/tests/prims/locals1 b/test-suite/standalone/sassy/tests/prims/locals1
new file mode 100644
index 000000000..44dd392d8
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/locals1
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/locals1.scm b/test-suite/standalone/sassy/tests/prims/locals1.scm
new file mode 100644
index 000000000..607903a1f
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/locals1.scm
@@ -0,0 +1,17 @@
+(text
+ (locals (bar quux)
+ (nop)
+ (label bar
+ (push quux)
+ (nop))
+ (label quux
+ (push bar)
+ (nop))))
+
+; 00000000 90 nop
+; 00000001 6807000000 push dword 0x7
+; 00000006 90 nop
+; 00000007 6801000000 push dword 0x1
+; 0000000C 90 nop
+
+
diff --git a/test-suite/standalone/sassy/tests/prims/locals2 b/test-suite/standalone/sassy/tests/prims/locals2
new file mode 100644
index 000000000..c71619d40
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/locals2
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/locals2.scm b/test-suite/standalone/sassy/tests/prims/locals2.scm
new file mode 100644
index 000000000..734d31fb1
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/locals2.scm
@@ -0,0 +1,28 @@
+(text
+ (nop)
+ (label bar
+ (push quux))
+ (locals (bar quux)
+ (nop)
+ (label bar
+ (push quux)
+ (nop))
+ (label quux
+ (push bar)
+ (nop)))
+ (label quux (push bar)))
+
+; 00000000 90 nop
+; bar:
+; 00000001 6813000000 push dword 0x13 ; push quux
+; 00000006 90 nop
+; local bar:
+; 00000007 680D000000 push dword 0xd ; push local quux
+; 0000000C 90 nop
+; local quux:
+; 0000000D 6807000000 push dword 0x7 ; push local bar
+; 00000012 90 nop
+; quux:
+; 00000013 6801000000 push dword 0x1 ; push bar
+
+
diff --git a/test-suite/standalone/sassy/tests/prims/locals3 b/test-suite/standalone/sassy/tests/prims/locals3
new file mode 100644
index 000000000..0e6e55a2f
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/locals3
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/locals3.scm b/test-suite/standalone/sassy/tests/prims/locals3.scm
new file mode 100644
index 000000000..379d95417
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/locals3.scm
@@ -0,0 +1,25 @@
+(text
+ (nop)
+ (label bar (jmp quux))
+ (locals (bar quux)
+ (nop)
+ (label bar
+ (jmp quux)
+ (nop))
+ (label quux
+ (jmp bar)
+ (nop)))
+ (label quux (jmp bar)))
+
+; 00000000 90 nop
+; bar:
+; 00000001 E90D000000 jmp 0x13 ; jmp quux
+; 00000006 90 nop
+; local bar:
+; 00000007 E901000000 jmp 0xd ; jmp local quux
+; 0000000C 90 nop
+; local quux:
+; 0000000D E9F5FFFFFF jmp 0x7 ; jmp local bar
+; 00000012 90 nop
+; quux:
+; 00000013 E9E9FFFFFF jmp 0x1 ; jmp bar
diff --git a/test-suite/standalone/sassy/tests/prims/locals4 b/test-suite/standalone/sassy/tests/prims/locals4
new file mode 100644
index 000000000..909860bef
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/locals4
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/locals4.scm b/test-suite/standalone/sassy/tests/prims/locals4.scm
new file mode 100644
index 000000000..63b4da298
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/locals4.scm
@@ -0,0 +1,25 @@
+(text
+ (label foo (ret))
+
+ (seq (= ecx "DOIT")
+ (locals (foo)
+ (label foo
+ (with-win foo
+ (seq (pop eax)
+ (cmp eax 0)
+ nz!)))))
+
+ (nop)
+ (jmp foo))
+
+; foo:
+; 00000000 C3 ret
+; 00000001 81F9444F4954 cmp ecx,0x54494f44
+; 00000007 750A jnz 0x13
+
+; local foo:
+; 00000009 58 pop eax
+; 0000000A 83F800 cmp eax,byte +0x0
+; 0000000D 0F85F6FFFFFF jnz near 0x9
+; 00000013 90 nop
+; 00000014 E9E7FFFFFF jmp 0x0
diff --git a/test-suite/standalone/sassy/tests/prims/locals5 b/test-suite/standalone/sassy/tests/prims/locals5
new file mode 100644
index 000000000..8e606fafc
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/locals5
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/locals5.scm b/test-suite/standalone/sassy/tests/prims/locals5.scm
new file mode 100644
index 000000000..b7e312fe9
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/locals5.scm
@@ -0,0 +1,44 @@
+(macro my-while
+ (lambda (test . body)
+ `(locals (loop)
+ (label loop
+ (with-win (jmp short loop)
+ (seq ,test
+ (begin ,@body)))))))
+
+(text
+ (label loop
+
+ (nop)
+
+ (my-while (< eax 10)
+ (pop ebx)
+ (add eax ebx)))
+
+ (my-while (> ecx 1000)
+ (pop ebx)
+ (sub ecx ebx))
+
+ (jmp short loop))
+
+; loop:
+; 00000000 90 nop
+
+; local loop (#1):
+; 00000001 83F80A cmp eax,byte +0xa
+; 00000004 7D05 jnl 0xb
+; 00000006 5B pop ebx
+; 00000007 01D8 add eax,ebx
+; 00000009 EBF6 jmp short 0x1
+
+; local loop (#2):
+; 0000000B 81F9E8030000 cmp ecx,0x3e8
+; 00000011 7E05 jng 0x18
+; 00000013 5B pop ebx
+; 00000014 29D9 sub ecx,ebx
+; 00000016 EBF3 jmp short 0xb
+
+; 00000018 EBE6 jmp short 0x0
+
+
+
diff --git a/test-suite/standalone/sassy/tests/prims/locals6 b/test-suite/standalone/sassy/tests/prims/locals6
new file mode 100644
index 000000000..8e606fafc
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/locals6
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/locals6.scm b/test-suite/standalone/sassy/tests/prims/locals6.scm
new file mode 100644
index 000000000..9b03a15a1
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/locals6.scm
@@ -0,0 +1,41 @@
+(macro my-while
+ (lambda (test . body)
+ `(locals (loop)
+ (label loop
+ (with-win (jmp short loop)
+ (seq ,test
+ (begin ,@body)))))))
+
+(text
+ (label loop
+
+ (nop)
+
+ (my-while (< eax 10)
+ (pop ebx)
+ (add eax ebx)))
+
+ (my-while (> ecx 1000)
+ (pop ebx)
+ (sub ecx ebx))
+
+ (jmp short loop))
+
+; loop:
+; 00000000 90 nop
+
+; local loop (#1):
+; 00000001 83F80A cmp eax,byte +0xa
+; 00000004 7D05 jnl 0xb
+; 00000006 5B pop ebx
+; 00000007 01D8 add eax,ebx
+; 00000009 EBF6 jmp short 0x1
+
+; local loop (#2):
+; 0000000B 81F9E8030000 cmp ecx,0x3e8
+; 00000011 7E05 jng 0x18
+; 00000013 5B pop ebx
+; 00000014 29D9 sub ecx,ebx
+; 00000016 EBF3 jmp short 0xb
+
+; 00000018 EBE6 jmp short 0x0
diff --git a/test-suite/standalone/sassy/tests/prims/locals7 b/test-suite/standalone/sassy/tests/prims/locals7
new file mode 100644
index 000000000..0e6e55a2f
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/locals7
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/locals7.scm b/test-suite/standalone/sassy/tests/prims/locals7.scm
new file mode 100644
index 000000000..35c67306a
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/locals7.scm
@@ -0,0 +1,25 @@
+(text
+ (nop)
+ (label bar (jmp quux))
+ (locals (bar quux)
+ (nop)
+ (label bar)
+ (jmp quux)
+ (nop)
+ (label quux)
+ (jmp bar)
+ (nop))
+ (label quux (jmp bar)))
+
+; 00000000 90 nop
+; bar:
+; 00000001 E90D000000 jmp 0x13 ; jmp quux
+; 00000006 90 nop
+; local bar:
+; 00000007 E901000000 jmp 0xd ; jmp local quux
+; 0000000C 90 nop
+; local quux:
+; 0000000D E9F5FFFFFF jmp 0x7 ; jmp local bar
+; 00000012 90 nop
+; quux:
+; 00000013 E9E9FFFFFF jmp 0x1 ; jmp bar
diff --git a/test-suite/standalone/sassy/tests/prims/locals8 b/test-suite/standalone/sassy/tests/prims/locals8
new file mode 100644
index 000000000..93e272aa0
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/locals8
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/locals8.scm b/test-suite/standalone/sassy/tests/prims/locals8.scm
new file mode 100644
index 000000000..f2fbfc6c6
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/locals8.scm
@@ -0,0 +1,15 @@
+; testing out skipping of undefined declarations
+
+(text
+ (label bar
+ (nop))
+ (locals (bar quux)
+ (nop)
+ (label quux)
+ (jmp bar)
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 E900000000 jmp 0x7
+; 00000007 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/seq1 b/test-suite/standalone/sassy/tests/prims/seq1
new file mode 100644
index 000000000..d335cc333
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/seq1
@@ -0,0 +1 @@
+๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/seq1.scm b/test-suite/standalone/sassy/tests/prims/seq1.scm
new file mode 100644
index 000000000..cdf307bd4
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/seq1.scm
@@ -0,0 +1,15 @@
+(text
+ (seq (nop)
+ (nop)
+ (seq (nop)
+ (inv (nop))
+ (nop))
+ (seq (nop))))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 90 nop
+; 00000003 90 nop
+; 00000004 EB02 jmp short 0x8
+; 00000006 90 nop
+; 00000007 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/seq2 b/test-suite/standalone/sassy/tests/prims/seq2
new file mode 100644
index 000000000..6037d7912
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/seq2
@@ -0,0 +1 @@
+ut \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/seq2.scm b/test-suite/standalone/sassy/tests/prims/seq2.scm
new file mode 100644
index 000000000..56ff7c9fa
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/seq2.scm
@@ -0,0 +1,20 @@
+(text
+ (seq (nop)
+ (nop)
+ (seq (nop)
+ (nop)
+ z!
+ (nop)
+ (inv z!)
+ (nop))
+ (seq (nop))))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 90 nop
+; 00000003 90 nop
+; 00000004 7505 jnz 0xb
+; 00000006 90 nop
+; 00000007 7402 jz 0xb
+; 00000009 90 nop
+; 0000000A 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/seq3 b/test-suite/standalone/sassy/tests/prims/seq3
new file mode 100644
index 000000000..cd617b311
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/seq3
@@ -0,0 +1 @@
+ut \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/seq3.scm b/test-suite/standalone/sassy/tests/prims/seq3.scm
new file mode 100644
index 000000000..c8fdf27ac
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/seq3.scm
@@ -0,0 +1,20 @@
+(text
+ (begin (nop)
+ (nop)
+ (seq (nop)
+ (nop)
+ z!
+ (nop)
+ (inv z!)
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 90 nop
+; 00000003 90 nop
+; 00000004 7504 jnz 0xa
+; 00000006 90 nop
+; 00000007 7401 jz 0xa
+; 00000009 90 nop
+; 0000000A 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/while1 b/test-suite/standalone/sassy/tests/prims/while1
new file mode 100644
index 000000000..e65aa0026
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/while1
@@ -0,0 +1 @@
+๋[Xƒ๛uƒ๘t๔R๋Q \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/while1.scm b/test-suite/standalone/sassy/tests/prims/while1.scm
new file mode 100644
index 000000000..10b4a55f1
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/while1.scm
@@ -0,0 +1,18 @@
+(text
+ (if (while (= eax 3)
+ (seq (pop ebx)
+ (pop eax)
+ (= ebx 2)))
+ (push edx)
+ (push ecx)))
+
+; 00000000 EB07 jmp short 0x9
+; 00000002 5B pop ebx
+; 00000003 58 pop eax
+; 00000004 83FB02 cmp ebx,byte +0x2
+; 00000007 7508 jnz 0x11
+; 00000009 83F803 cmp eax,byte +0x3
+; 0000000C 74F4 jz 0x2
+; 0000000E 52 push edx
+; 0000000F EB01 jmp short 0x12
+; 00000011 51 push ecx
diff --git a/test-suite/standalone/sassy/tests/prims/while2 b/test-suite/standalone/sassy/tests/prims/while2
new file mode 100644
index 000000000..dc703a96e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/while2
@@ -0,0 +1 @@
+๋[Xƒ๛uƒ๘u๔R๋Q \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/while2.scm b/test-suite/standalone/sassy/tests/prims/while2.scm
new file mode 100644
index 000000000..5f86baa2e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/while2.scm
@@ -0,0 +1,20 @@
+(text
+ (if (until (= eax 3)
+ (seq (pop ebx)
+ (pop eax)
+ (= ebx 2)))
+ (push edx)
+ (push ecx)))
+
+
+; 00000000 EB07 jmp short 0x9
+; 00000002 5B pop ebx
+; 00000003 58 pop eax
+; 00000004 83FB02 cmp ebx,byte +0x2
+; 00000007 7508 jnz 0x11
+; 00000009 83F803 cmp eax,byte +0x3
+; 0000000C 75F4 jnz 0x2
+; 0000000E 52 push edx
+; 0000000F EB01 jmp short 0x12
+; 00000011 51 push ecx
+
diff --git a/test-suite/standalone/sassy/tests/prims/while3 b/test-suite/standalone/sassy/tests/prims/while3
new file mode 100644
index 000000000..cc379fc48
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/while3
@@ -0,0 +1 @@
+๋ [ƒ๛tุ๋๖ยƒ๚|๏ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/while3.scm b/test-suite/standalone/sassy/tests/prims/while3.scm
new file mode 100644
index 000000000..d292ba337
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/while3.scm
@@ -0,0 +1,25 @@
+(text
+ (while (< edx 20)
+ (begin
+ (iter (seq (pop ebx)
+ (!= ebx 4)
+ (add eax ebx)))
+ (add edx eax))))
+
+; iter is sometimes better for inner loops, since both
+; while and until always generate a jmp at their start
+; to the test (the test is placed after their body).
+; When while or until start the body of an outer while/until
+; that means a jmp or jcc to a jmp will be generated.
+; Using iter for the inner loop fixes this.
+
+; 00000000 EB0C jmp short 0xe
+; 00000002 5B pop ebx
+; 00000003 83FB04 cmp ebx,byte +0x4
+; 00000006 7404 jz 0xc
+; 00000008 01D8 add eax,ebx
+; 0000000A EBF6 jmp short 0x2
+; 0000000C 01C2 add edx,eax
+; 0000000E 83FA14 cmp edx,byte +0x14
+; 00000011 7CEF jl 0x2
+
diff --git a/test-suite/standalone/sassy/tests/prims/with-lose1 b/test-suite/standalone/sassy/tests/prims/with-lose1
new file mode 100644
index 000000000..884fbd2d7
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-lose1
@@ -0,0 +1 @@
+รtw๚{๗้๐ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/with-lose1.scm b/test-suite/standalone/sassy/tests/prims/with-lose1.scm
new file mode 100644
index 000000000..bb00b3db9
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-lose1.scm
@@ -0,0 +1,20 @@
+(text
+ (label foo (ret))
+ (seq (nop)
+ (with-lose foo
+ (iter (alt (seq (nop) z!)
+ (seq (nop) a!)
+ (seq (nop) po!))))
+ (nop)))
+; foo:
+; 00000000 C3 ret
+
+; 00000001 90 nop
+; 00000002 90 nop
+; 00000003 74FD jz 0x2
+; 00000005 90 nop
+; 00000006 77FA ja 0x2
+; 00000008 90 nop
+; 00000009 7BF7 jpo 0x2
+; 0000000B E9F0FFFFFF jmp 0x0
+; 00000010 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/with-lose2 b/test-suite/standalone/sassy/tests/prims/with-lose2
new file mode 100644
index 000000000..2c4a524d7
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-lose2
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/with-lose2.scm b/test-suite/standalone/sassy/tests/prims/with-lose2.scm
new file mode 100644
index 000000000..d5edc4f24
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-lose2.scm
@@ -0,0 +1,20 @@
+(text
+ (label foo (ret))
+ (seq (nop)
+ (with-lose (reloc my-reloc foo 100)
+ (iter (alt (seq (nop) z!)
+ (seq (nop) a!)
+ (seq (nop) po!))))
+ (nop)))
+; foo:
+; 00000000 C3 ret
+
+; 00000001 90 nop
+; 00000002 90 nop
+; 00000003 74FD jz 0x2
+; 00000005 90 nop
+; 00000006 77FA ja 0x2
+; 00000008 90 nop
+; 00000009 7BF7 jpo 0x2
+; 0000000B E964000000 jmp 0x74 <- this is right, (reloc had an addend of 100)
+; 00000010 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims/with-lose3 b/test-suite/standalone/sassy/tests/prims/with-lose3
new file mode 100644
index 000000000..9d92dcc63
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-lose3
@@ -0,0 +1 @@
+รรร…๖Œ๑†์ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/with-lose3.scm b/test-suite/standalone/sassy/tests/prims/with-lose3.scm
new file mode 100644
index 000000000..9c122676f
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-lose3.scm
@@ -0,0 +1,27 @@
+(text
+ (label foo (ret))
+ (label bar (ret))
+ (label qudr (ret))
+ (seq
+ (nop)
+ (with-lose foo z!)
+ (with-lose bar ge!)
+ (with-lose qudr a!)
+ (nop)))
+
+; foo:
+; 00000000 C3 ret
+; bar:
+; 00000001 C3 ret
+; qudr:
+; 00000002 C3 ret
+; 00000003 90 nop
+; 00000004 0F85F6FFFFFF jnz near 0x0
+; 0000000A 0F8CF1FFFFFF jl near 0x1
+; 00000010 0F86ECFFFFFF jna near 0x2
+; 00000016 90 nop
+
+
+
+
+ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/with-win-lose1 b/test-suite/standalone/sassy/tests/prims/with-win-lose1
new file mode 100644
index 000000000..b0bf6a27e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win-lose1
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/with-win-lose1.scm b/test-suite/standalone/sassy/tests/prims/with-win-lose1.scm
new file mode 100644
index 000000000..4663e8639
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win-lose1.scm
@@ -0,0 +1,16 @@
+(text
+ (with-win-lose foo bar
+ (= eax 3))
+ (seq (nop) (nop) (nop))
+ (label foo (ret))
+ (label bar (ret)))
+
+; 00000000 83F803 cmp eax,byte +0x3
+; 00000003 0F8408000000 jz near 0x11
+; 00000009 E904000000 jmp 0x12
+; 0000000E 90 nop
+; 0000000F 90 nop
+; 00000010 90 nop
+; 00000011 C3 ret
+; 00000012 C3 ret
+
diff --git a/test-suite/standalone/sassy/tests/prims/with-win-lose2 b/test-suite/standalone/sassy/tests/prims/with-win-lose2
new file mode 100644
index 000000000..b0d068466
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win-lose2
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/with-win-lose2.scm b/test-suite/standalone/sassy/tests/prims/with-win-lose2.scm
new file mode 100644
index 000000000..145e1c598
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win-lose2.scm
@@ -0,0 +1,24 @@
+(text
+ (with-win-lose foo bar
+ (while (= eax 3)
+ (seq (nop)
+ (nop)
+ l!)))
+ (seq (nop) (nop) (nop))
+ (label foo (ret))
+ (label bar (ret)))
+
+; 00000000 EB08 jmp short 0xa
+; 00000002 90 nop
+; 00000003 90 nop
+; 00000004 0F8D0E000000 jnl near 0x18
+; 0000000A 83F803 cmp eax,byte +0x3
+; 0000000D 74F3 jz 0x2
+; 0000000F E903000000 jmp 0x17
+; 00000014 90 nop
+; 00000015 90 nop
+; 00000016 90 nop
+; 00000017 C3 ret
+; 00000018 C3 ret
+
+
diff --git a/test-suite/standalone/sassy/tests/prims/with-win-lose3 b/test-suite/standalone/sassy/tests/prims/with-win-lose3
new file mode 100644
index 000000000..16ad9d072
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win-lose3
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/with-win-lose3.scm b/test-suite/standalone/sassy/tests/prims/with-win-lose3.scm
new file mode 100644
index 000000000..f64f70bbc
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win-lose3.scm
@@ -0,0 +1,24 @@
+(text
+ (label foo (ret))
+ (with-win-lose bar foo
+ (if (= eax 3)
+ (nop)
+ (alt (seq (nop) a!)
+ (seq (nop) p!))))
+ (nop)
+ (label bar (ret)))
+
+; foo:
+; 00000000 C3 ret
+; 00000001 83F803 cmp eax,byte +0x3
+; 00000004 7506 jnz 0xc
+; 00000006 90 nop
+; 00000007 E914000000 jmp 0x20
+; 0000000C 90 nop
+; 0000000D 0F870D000000 ja near 0x20
+; 00000013 90 nop
+; 00000014 0F8A06000000 jpe near 0x20
+; 0000001A E9E1FFFFFF jmp 0x0
+; 0000001F 90 nop
+; bar:
+; 00000020 C3 ret
diff --git a/test-suite/standalone/sassy/tests/prims/with-win-lose4 b/test-suite/standalone/sassy/tests/prims/with-win-lose4
new file mode 100644
index 000000000..25c343959
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win-lose4
@@ -0,0 +1 @@
+SPƒ๙uร่๓ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/with-win-lose4.scm b/test-suite/standalone/sassy/tests/prims/with-win-lose4.scm
new file mode 100644
index 000000000..48832f938
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win-lose4.scm
@@ -0,0 +1,13 @@
+(text
+ (label foo (push ebx))
+ (with-win-lose (ret) (call foo)
+ (seq
+ (push eax)
+ (= ecx 4))))
+
+; 00000000 53 push ebx
+; 00000001 50 push eax
+; 00000002 83F904 cmp ecx,byte +0x4
+; 00000005 7501 jnz 0x8
+; 00000007 C3 ret
+; 00000008 E8F3FFFFFF call 0x0
diff --git a/test-suite/standalone/sassy/tests/prims/with-win-lose5 b/test-suite/standalone/sassy/tests/prims/with-win-lose5
new file mode 100644
index 000000000..fd5d346d8
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win-lose5
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/with-win-lose5.scm b/test-suite/standalone/sassy/tests/prims/with-win-lose5.scm
new file mode 100644
index 000000000..eae19d401
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win-lose5.scm
@@ -0,0 +1,16 @@
+(text
+ (label foo (push ebx))
+ (with-win-lose
+ (jmp 1000)
+ (call foo)
+ (seq
+ (push eax)
+ (= ecx 4))))
+
+; 00000000 53 push ebx
+; 00000001 50 push eax
+; 00000002 83F904 cmp ecx,byte +0x4
+; 00000005 7505 jnz 0xc
+; 00000007 E9DC030000 jmp 0x3e8
+; 0000000C E8EFFFFFFF call 0x0
+
diff --git a/test-suite/standalone/sassy/tests/prims/with-win1 b/test-suite/standalone/sassy/tests/prims/with-win1
new file mode 100644
index 000000000..a1b76fefa
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win1
@@ -0,0 +1 @@
+รรƒ๘uP้๔S้๎ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/with-win1.scm b/test-suite/standalone/sassy/tests/prims/with-win1.scm
new file mode 100644
index 000000000..5c4b22f7c
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win1.scm
@@ -0,0 +1,20 @@
+(text
+ (label foo (ret))
+ (label bar (ret))
+ (with-win bar
+ (if (= eax 3)
+ (push eax)
+ (push ebx))))
+
+; 00000000 C3 ret
+; 00000001 C3 ret
+; 00000002 83F803 cmp eax,byte +0x3
+; 00000005 7506 jnz 0xd
+; 00000007 50 push eax
+; 00000008 E9F4FFFFFF jmp 0x1
+; 0000000D 53 push ebx
+; 0000000E E9EEFFFFFF jmp 0x1
+
+
+
+ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/with-win2 b/test-suite/standalone/sassy/tests/prims/with-win2
new file mode 100644
index 000000000..0521da178
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win2
@@ -0,0 +1 @@
+รรƒ๘uP้๔S้ํ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/with-win2.scm b/test-suite/standalone/sassy/tests/prims/with-win2.scm
new file mode 100644
index 000000000..2c3696b1d
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win2.scm
@@ -0,0 +1,18 @@
+(text
+ (label foo (ret))
+ (label bar (ret))
+ (with-win bar
+ (if (= eax 3)
+ (push eax)
+ (with-win foo
+ (push ebx)))))
+
+; 00000000 C3 ret
+; 00000001 C3 ret
+; 00000002 83F803 cmp eax,byte +0x3
+; 00000005 7506 jnz 0xd
+; 00000007 50 push eax
+; 00000008 E9F4FFFFFF jmp 0x1
+; 0000000D 53 push ebx
+; 0000000E E9EDFFFFFF jmp 0x0
+
diff --git a/test-suite/standalone/sassy/tests/prims/with-win3 b/test-suite/standalone/sassy/tests/prims/with-win3
new file mode 100644
index 000000000..203346f3d
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win3
@@ -0,0 +1,2 @@
+รร๋X@ƒ๘
+}ƒ๘u๔„๋v ้ไS้ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/with-win3.scm b/test-suite/standalone/sassy/tests/prims/with-win3.scm
new file mode 100644
index 000000000..85eccfbd4
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win3.scm
@@ -0,0 +1,31 @@
+(text
+ (label foo (ret))
+ (label bar (ret))
+ (if (while (!= eax 3)
+ (seq (pop eax)
+ (inc eax)
+ (< eax 10)))
+ (with-win bar
+ (alt z! a!))
+ (with-win foo
+ (push ebx))))
+
+; foo:
+; 00000000 C3 ret
+
+; bar:
+; 00000001 C3 ret
+
+; 00000002 EB07 jmp short 0xb
+; 00000004 58 pop eax
+; 00000005 40 inc eax
+; 00000006 83F80A cmp eax,byte +0xa
+; 00000009 7D12 jnl 0x1d
+; 0000000B 83F803 cmp eax,byte +0x3
+; 0000000E 75F4 jnz 0x4
+; 00000010 0F84EBFFFFFF jz near 0x1
+; 00000016 760B jna 0x23
+; 00000018 E9E4FFFFFF jmp 0x1
+; 0000001D 53 push ebx
+; 0000001E E9DDFFFFFF jmp 0x0
+
diff --git a/test-suite/standalone/sassy/tests/prims/with-win4 b/test-suite/standalone/sassy/tests/prims/with-win4
new file mode 100644
index 000000000..289f34835
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win4
@@ -0,0 +1 @@
+SPร \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims/with-win4.scm b/test-suite/standalone/sassy/tests/prims/with-win4.scm
new file mode 100644
index 000000000..4375d9c9f
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win4.scm
@@ -0,0 +1,9 @@
+(text
+ (label foo (push ebx))
+ (seq (with-win (ret)
+ (push eax))))
+
+; 00000000 53 push ebx
+; 00000001 50 push eax
+; 00000002 C3 ret
+
diff --git a/test-suite/standalone/sassy/tests/prims/with-win5 b/test-suite/standalone/sassy/tests/prims/with-win5
new file mode 100644
index 000000000..77842e325
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win5
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims/with-win5.scm b/test-suite/standalone/sassy/tests/prims/with-win5.scm
new file mode 100644
index 000000000..c310fad00
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims/with-win5.scm
@@ -0,0 +1,15 @@
+(text
+ (mov eax 10)
+; this should loop 7 times
+ (label foo
+ (if (= eax 3)
+ (with-win (ret))
+ (with-win foo
+ (sub eax 1)))))
+
+; 00000000 B80A000000 mov eax,0xa
+; 00000005 83F803 cmp eax,byte +0x3
+; 00000008 7501 jnz 0xb
+; 0000000A C3 ret
+; 0000000B 83E801 sub eax,byte +0x1
+; 0000000E E9F2FFFFFF jmp 0x5
diff --git a/test-suite/standalone/sassy/tests/prims16/16alt1 b/test-suite/standalone/sassy/tests/prims16/16alt1
new file mode 100644
index 000000000..fe93a43c6
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16alt1
@@ -0,0 +1 @@
+๋ ๋๋๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16alt1.scm b/test-suite/standalone/sassy/tests/prims16/16alt1.scm
new file mode 100644
index 000000000..fc1f8bd52
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16alt1.scm
@@ -0,0 +1,20 @@
+(bits 16)
+
+(text
+ (seq (nop)
+ (alt (nop)
+ (nop)
+ (nop)
+ (inv (nop)))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 EB09 jmp short 0xd
+; 00000004 90 nop
+; 00000005 EB06 jmp short 0xd
+; 00000007 90 nop
+; 00000008 EB03 jmp short 0xd
+; 0000000A 90 nop
+; 0000000B EB01 jmp short 0xe
+; 0000000D 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16alt2 b/test-suite/standalone/sassy/tests/prims16/16alt2
new file mode 100644
index 000000000..1f00723a2
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16alt2
@@ -0,0 +1 @@
+๋}๋} \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16alt2.scm b/test-suite/standalone/sassy/tests/prims16/16alt2.scm
new file mode 100644
index 000000000..1759adf15
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16alt2.scm
@@ -0,0 +1,18 @@
+(bits 16)
+
+(text
+ (seq (nop)
+ (alt (nop)
+ ge!
+ (nop)
+ (inv ge!))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 EB07 jmp short 0xb
+; 00000004 7D05 jnl 0xb
+; 00000006 90 nop
+; 00000007 EB02 jmp short 0xb
+; 00000009 7D01 jnl 0xc
+; 0000000B 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16alt3 b/test-suite/standalone/sassy/tests/prims16/16alt3
new file mode 100644
index 000000000..886733710
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16alt3
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16alt3.scm b/test-suite/standalone/sassy/tests/prims16/16alt3.scm
new file mode 100644
index 000000000..bd6071eb1
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16alt3.scm
@@ -0,0 +1,17 @@
+(bits 16)
+
+(text
+ (seq (if (= cx 0)
+ (alt z! z!)
+ (nop))
+ (nop)))
+
+; 00000000 83F900 cmp cx,byte +0x0
+; 00000003 7506 jnz 0xb
+; 00000005 7405 jz 0xc
+; 00000007 7403 jz 0xc
+; 00000009 EB02 jmp short 0xd
+; 0000000B 90 nop
+; 0000000C 90 nop
+
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16alt4 b/test-suite/standalone/sassy/tests/prims16/16alt4
new file mode 100644
index 000000000..a6cf68c85
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16alt4
@@ -0,0 +1 @@
+๋}๋| \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16alt4.scm b/test-suite/standalone/sassy/tests/prims16/16alt4.scm
new file mode 100644
index 000000000..e2b7f0dfd
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16alt4.scm
@@ -0,0 +1,18 @@
+(bits 16)
+
+(text
+ (seq (nop)
+ (alt (nop)
+ ge!
+ (nop)
+ ge!)
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 EB07 jmp short 0xb
+; 00000004 7D05 jnl 0xb
+; 00000006 90 nop
+; 00000007 EB02 jmp short 0xb
+; 00000009 7C01 jl 0xc
+; 0000000B 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16begin1 b/test-suite/standalone/sassy/tests/prims16/16begin1
new file mode 100644
index 000000000..f0140b145
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16begin1
@@ -0,0 +1 @@
+๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16begin1.scm b/test-suite/standalone/sassy/tests/prims16/16begin1.scm
new file mode 100644
index 000000000..972729367
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16begin1.scm
@@ -0,0 +1,17 @@
+(bits 16)
+
+(text
+ (begin (nop)
+ (seq (nop)
+ (begin (nop)
+ (inv (nop)))
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 90 nop
+; 00000003 90 nop
+; 00000004 EB01 jmp short 0x7
+; 00000006 90 nop
+; 00000007 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16begin2 b/test-suite/standalone/sassy/tests/prims16/16begin2
new file mode 100644
index 000000000..6076321e1
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16begin2
@@ -0,0 +1 @@
+u \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16begin2.scm b/test-suite/standalone/sassy/tests/prims16/16begin2.scm
new file mode 100644
index 000000000..a5a7f7975
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16begin2.scm
@@ -0,0 +1,16 @@
+(bits 16)
+
+(text
+ (begin (nop)
+ (seq (nop)
+ (begin (nop)
+ z!)
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 90 nop
+; 00000003 7501 jnz 0x6
+; 00000005 90 nop
+; 00000006 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16begin3 b/test-suite/standalone/sassy/tests/prims16/16begin3
new file mode 100644
index 000000000..c4d342828
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16begin3
@@ -0,0 +1 @@
+๋t \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16begin3.scm b/test-suite/standalone/sassy/tests/prims16/16begin3.scm
new file mode 100644
index 000000000..bf897983e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16begin3.scm
@@ -0,0 +1,17 @@
+(bits 16)
+
+(text
+ (begin (nop)
+ (alt (nop)
+ (begin (nop)
+ z!)
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 EB04 jmp short 0x8
+; 00000004 90 nop
+; 00000005 7401 jz 0x8
+; 00000007 90 nop
+; 00000008 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16begin4 b/test-suite/standalone/sassy/tests/prims16/16begin4
new file mode 100644
index 000000000..76ad18872
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16begin4
@@ -0,0 +1 @@
+๋u \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16begin4.scm b/test-suite/standalone/sassy/tests/prims16/16begin4.scm
new file mode 100644
index 000000000..2fcbf1bfb
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16begin4.scm
@@ -0,0 +1,18 @@
+(bits 16)
+
+(text
+ (begin (nop)
+ (alt (nop)
+ (begin (nop)
+ (inv z!))
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 EB04 jmp short 0x8
+; 00000004 90 nop
+; 00000005 7501 jnz 0x8
+; 00000007 90 nop
+; 00000008 90 nop
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16begin5 b/test-suite/standalone/sassy/tests/prims16/16begin5
new file mode 100644
index 000000000..4a8138156
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16begin5
@@ -0,0 +1 @@
+ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16begin5.scm b/test-suite/standalone/sassy/tests/prims16/16begin5.scm
new file mode 100644
index 000000000..b3f22b0d6
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16begin5.scm
@@ -0,0 +1,20 @@
+(bits 16)
+
+(text
+ (begin (nop)
+ (inv (alt z!
+ l!
+ a!))
+ (nop)))
+
+;The arguments to a begin always take as their win and lose the
+;following arg in the sequence, except for the last, which takes
+;begin's win and lose. Since the assertions only generate jcc's, they
+;would all be jcc's to the last (nop). But it happens that the last
+;(nop) is the instruction following the a! assertion. But a jmp to the
+;next instruction is really doing nothing at all, so it may be
+;eliminated. But then the l! assertion is in the same circumstance,
+;and so on. Hence:
+
+; 00000000 90 nop
+; 00000001 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16esc1 b/test-suite/standalone/sassy/tests/prims16/16esc1
new file mode 100644
index 000000000..99aebf601
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16esc1
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16esc1.scm b/test-suite/standalone/sassy/tests/prims16/16esc1.scm
new file mode 100644
index 000000000..15b524b15
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16esc1.scm
@@ -0,0 +1,36 @@
+(bits 16)
+
+(text
+ (label foo (ret))
+ (label bar (ret))
+ (begin
+ (esc ((push $win))
+ (alt
+ (with-win foo
+ (seq (= ax 3)
+ (= bx 2)
+ (push eax)
+ (push ebx)))
+ (with-win bar
+ (seq (push ebx)
+ (push eax)))))
+ (nop)
+ (nop)))
+
+
+; 00000000 C3 ret
+; 00000001 C3 ret
+; 00000002 681D00 push word 0x1d
+; 00000005 3D0300 cmp ax,0x3
+; 00000008 750C jnz 0x16
+; 0000000A 83FB02 cmp bx,byte +0x2
+; 0000000D 7507 jnz 0x16
+; 0000000F 6650 push eax
+; 00000011 6653 push ebx
+; 00000013 E9EAFF jmp 0x0
+; 00000016 6653 push ebx
+; 00000018 6650 push eax
+; 0000001A E9E4FF jmp 0x1
+; 0000001D 90 nop
+; 0000001E 90 nop
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16esc2 b/test-suite/standalone/sassy/tests/prims16/16esc2
new file mode 100644
index 000000000..3a89cd66e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16esc2
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16esc2.scm b/test-suite/standalone/sassy/tests/prims16/16esc2.scm
new file mode 100644
index 000000000..99ebb4d54
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16esc2.scm
@@ -0,0 +1,37 @@
+(bits 16)
+
+(text
+ (label foo (ret))
+ (label bar (ret))
+ (seq (nop)
+ (esc ((push $win)
+ (mov dx $lose))
+ (alt
+ (with-win foo
+ (seq (= ax 3)
+ (= bx 2)
+ (push ax)
+ (push bx)))
+ (with-win bar
+ (seq (mov sp dx)
+ (push bx)
+ (push ax)))))
+ (nop)))
+
+; 00000000 C3 ret
+; 00000001 C3 ret
+; 00000002 90 nop
+; 00000003 681F00 push word 0x1f
+; 00000006 BA2000 mov dx,0x20
+; 00000009 3D0300 cmp ax,0x3
+; 0000000C 750A jnz 0x18
+; 0000000E 83FB02 cmp bx,byte +0x2
+; 00000011 7505 jnz 0x18
+; 00000013 50 push ax
+; 00000014 53 push bx
+; 00000015 E9E8FF jmp 0x0
+; 00000018 89D4 mov sp,dx
+; 0000001A 53 push bx
+; 0000001B 50 push ax
+; 0000001C E9E2FF jmp 0x1
+; 0000001F 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16esc3 b/test-suite/standalone/sassy/tests/prims16/16esc3
new file mode 100644
index 000000000..cfb4e959e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16esc3
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16esc3.scm b/test-suite/standalone/sassy/tests/prims16/16esc3.scm
new file mode 100644
index 000000000..0a4a0e497
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16esc3.scm
@@ -0,0 +1,19 @@
+(bits 16)
+
+(text
+ (begin (push $eip)
+ (push $win)
+ (push $lose))
+ (seq (push $eip)
+ (push $win)
+ (push $lose)
+ (nop)))
+
+; 00000000 680300 push word 0x3
+; 00000003 680600 push word 0x6
+; 00000006 680900 push word 0x9
+; 00000009 680C00 push word 0xc
+; 0000000C 680F00 push word 0xf
+; 0000000F 681300 push word 0x13
+; 00000012 90 nop
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16esc4 b/test-suite/standalone/sassy/tests/prims16/16esc4
new file mode 100644
index 000000000..93b2344ee
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16esc4
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16esc4.scm b/test-suite/standalone/sassy/tests/prims16/16esc4.scm
new file mode 100644
index 000000000..904921371
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16esc4.scm
@@ -0,0 +1,37 @@
+(bits 16)
+
+(text
+ (begin (call $eip)
+ (call $win)
+ (call $lose))
+ (seq (jmp $eip)
+ (jmp $win)
+ (jmp $lose)
+ (nop))
+ (seq (jmp short $eip)
+ (jmp short $win)
+ (jmp short $lose)
+ (nop))
+ (alt (jmp $win)
+ (jmp $lose)
+ (nop)
+ (nop)))
+
+; 00000000 E80000 call 0x3
+; 00000003 E80000 call 0x6
+; 00000006 E80000 call 0x9
+; 00000009 E90000 jmp 0xc
+; 0000000C E90000 jmp 0xf
+; 0000000F E90100 jmp 0x13
+; 00000012 90 nop
+; 00000013 EB00 jmp short 0x15
+; 00000015 EB00 jmp short 0x17
+; 00000017 EB01 jmp short 0x1a
+; 00000019 90 nop
+; 0000001A E90B00 jmp 0x28
+; 0000001D EB09 jmp short 0x28
+; 0000001F E90200 jmp 0x24
+; 00000022 EB04 jmp short 0x28
+; 00000024 90 nop
+; 00000025 EB01 jmp short 0x28
+; 00000027 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16esc5 b/test-suite/standalone/sassy/tests/prims16/16esc5
new file mode 100644
index 000000000..c3d6a596c
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16esc5
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16esc5.scm b/test-suite/standalone/sassy/tests/prims16/16esc5.scm
new file mode 100644
index 000000000..108591222
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16esc5.scm
@@ -0,0 +1,37 @@
+(bits 16)
+
+(text
+ (label foo (ret))
+ (label bar (ret))
+ (seq (nop)
+ (esc ((jmp $win)
+ (jmp $lose))
+ (alt
+ (with-win foo
+ (seq (= ax 3)
+ (= bx 2)
+ (push ax)
+ (push bx)))
+ (with-win bar
+ (seq (mov sp dx)
+ (push bx)
+ (push ax)))))
+ (nop)))
+
+; 00000000 C3 ret
+; 00000001 C3 ret
+; 00000002 90 nop
+; 00000003 E91900 jmp 0x1f
+; 00000006 E91700 jmp 0x20
+; 00000009 3D0300 cmp ax,0x3
+; 0000000C 750A jnz 0x18
+; 0000000E 83FB02 cmp bx,byte +0x2
+; 00000011 7505 jnz 0x18
+; 00000013 50 push ax
+; 00000014 53 push bx
+; 00000015 E9E8FF jmp 0x0
+; 00000018 89D4 mov sp,dx
+; 0000001A 53 push bx
+; 0000001B 50 push ax
+; 0000001C E9E2FF jmp 0x1
+; 0000001F 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16esc6 b/test-suite/standalone/sassy/tests/prims16/16esc6
new file mode 100644
index 000000000..90984bdbc
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16esc6
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16esc6.scm b/test-suite/standalone/sassy/tests/prims16/16esc6.scm
new file mode 100644
index 000000000..979b8d400
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16esc6.scm
@@ -0,0 +1,15 @@
+(bits 16)
+
+(text
+ (iter (seq (nop)
+ (nop)
+ (jnz $lose)
+ (nop)
+ (nop))))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 0F850400 jnz near 0xa
+; 00000006 90 nop
+; 00000007 90 nop
+; 00000008 EBF6 jmp short 0x0
diff --git a/test-suite/standalone/sassy/tests/prims16/16esc7 b/test-suite/standalone/sassy/tests/prims16/16esc7
new file mode 100644
index 000000000..86ff7bc5e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16esc7
@@ -0,0 +1 @@
+ut๘๋๖ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16esc7.scm b/test-suite/standalone/sassy/tests/prims16/16esc7.scm
new file mode 100644
index 000000000..f2ebde577
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16esc7.scm
@@ -0,0 +1,18 @@
+(bits 16)
+
+(text
+ (iter (seq (nop)
+ (nop)
+ (jnz short $lose)
+ (nop)
+ (nop)
+ (je short $win))))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 7506 jnz 0xa
+; 00000004 90 nop
+; 00000005 90 nop
+; 00000006 74F8 jz 0x0
+; 00000008 EBF6 jmp short 0x0
+ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16exp-k1 b/test-suite/standalone/sassy/tests/prims16/16exp-k1
new file mode 100644
index 000000000..cd617b311
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16exp-k1
@@ -0,0 +1 @@
+ut \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16exp-k1.scm b/test-suite/standalone/sassy/tests/prims16/16exp-k1.scm
new file mode 100644
index 000000000..cf00dd0c7
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16exp-k1.scm
@@ -0,0 +1,27 @@
+(bits 16)
+
+(macro seq-k (lambda tests
+ (cond ((null? tests) '$win)
+ ((null? (cdr tests)) (car tests))
+ (else `(with-win (seq-k ,@(cdr tests))
+ ,(car tests))))))
+(text
+ (begin (nop)
+ (nop)
+ (seq-k (nop)
+ (nop)
+ z!
+ (nop)
+ (inv z!)
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 90 nop
+; 00000003 90 nop
+; 00000004 7504 jnz 0xa
+; 00000006 90 nop
+; 00000007 7401 jz 0xa
+; 00000009 90 nop
+; 0000000A 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16exp-k2 b/test-suite/standalone/sassy/tests/prims16/16exp-k2
new file mode 100644
index 000000000..c3e2ac2c0
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16exp-k2
@@ -0,0 +1 @@
+๋t}๋๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16exp-k2.scm b/test-suite/standalone/sassy/tests/prims16/16exp-k2.scm
new file mode 100644
index 000000000..ab054cc76
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16exp-k2.scm
@@ -0,0 +1,27 @@
+(bits 16)
+
+(macro inv-k (lambda (itm)
+ `(with-win-lose $lose $win
+ ,itm)))
+
+(text
+ (alt (if (seq (inv-k (nop))
+ (inv-k z!)
+ (inv-k (inv (nop)))
+ (inv-k ge!))
+ (inv-k (nop))
+ (nop))
+ (nop)))
+
+; should be the same as inv4.scm (de Morgan)
+
+; 00000000 90 nop
+; 00000001 EB08 jmp short 0xb
+; 00000003 7406 jz 0xb
+; 00000005 90 nop
+; 00000006 7D03 jnl 0xb
+; 00000008 90 nop
+; 00000009 EB03 jmp short 0xe
+; 0000000B 90 nop
+; 0000000C EB01 jmp short 0xf
+; 0000000E 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16exp-k3 b/test-suite/standalone/sassy/tests/prims16/16exp-k3
new file mode 100644
index 000000000..76ad18872
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16exp-k3
@@ -0,0 +1 @@
+๋u \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16exp-k3.scm b/test-suite/standalone/sassy/tests/prims16/16exp-k3.scm
new file mode 100644
index 000000000..75d3a19ee
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16exp-k3.scm
@@ -0,0 +1,26 @@
+(bits 16)
+
+(macro begin-k (lambda body-tail
+ (if (null? (cdr body-tail))
+ (car body-tail)
+ `(with-win (begin-k ,@(cdr body-tail))
+ (with-lose $win
+ ,(car body-tail))))))
+
+
+(text
+ (begin-k (nop)
+ (alt (nop)
+ (begin-k (nop)
+ (inv z!))
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 EB04 jmp short 0x8
+; 00000004 90 nop
+; 00000005 7501 jnz 0x8
+; 00000007 90 nop
+; 00000008 90 nop
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16exp-k4 b/test-suite/standalone/sassy/tests/prims16/16exp-k4
new file mode 100644
index 000000000..9e722fd9b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16exp-k4
@@ -0,0 +1 @@
+u๋ ~๋{๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16exp-k4.scm b/test-suite/standalone/sassy/tests/prims16/16exp-k4.scm
new file mode 100644
index 000000000..f1158bad5
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16exp-k4.scm
@@ -0,0 +1,31 @@
+(bits 16)
+
+(macro if-k (lambda (test conseq altern)
+ `(with-win-lose ,conseq ,altern
+ ,test)))
+
+(text
+ (seq (nop)
+ (if-k (seq (nop) z!)
+ (inv (nop))
+ (if-k g!
+ (nop)
+ (if-k p!
+ (nop)
+ (nop))))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 7503 jnz 0x7
+; 00000004 90 nop
+; 00000005 EB0C jmp short 0x13
+; 00000007 7E03 jng 0xc
+; 00000009 90 nop
+; 0000000A EB06 jmp short 0x12
+; 0000000C 7B03 jpo 0x11
+; 0000000E 90 nop
+; 0000000F EB01 jmp short 0x12
+; 00000011 90 nop
+; 00000012 90 nop
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16if1 b/test-suite/standalone/sassy/tests/prims16/16if1
new file mode 100644
index 000000000..7ecc60012
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16if1
@@ -0,0 +1 @@
+tv๋๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16if1.scm b/test-suite/standalone/sassy/tests/prims16/16if1.scm
new file mode 100644
index 000000000..322d2da4b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16if1.scm
@@ -0,0 +1,18 @@
+(bits 16)
+
+(text
+ (seq (nop)
+ (if (alt z! a!)
+ (nop)
+ (inv (nop)))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 7402 jz 0x5
+; 00000003 7603 jna 0x8
+; 00000005 90 nop
+; 00000006 EB03 jmp short 0xb
+; 00000008 90 nop
+; 00000009 EB01 jmp short 0xc
+; 0000000B 90 nop
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16if2 b/test-suite/standalone/sassy/tests/prims16/16if2
new file mode 100644
index 000000000..2d8ada333
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16if2
@@ -0,0 +1 @@
+tw๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16if2.scm b/test-suite/standalone/sassy/tests/prims16/16if2.scm
new file mode 100644
index 000000000..c35b7e449
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16if2.scm
@@ -0,0 +1,23 @@
+(bits 16)
+
+(text
+ (seq (nop)
+ (if (seq (nop)
+ (inv (alt z! a!)))
+ (inv (nop))
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 7405 jz 0x9
+; 00000004 7703 ja 0x9
+; 00000006 90 nop
+; 00000007 EB02 jmp short 0xb
+; 00000009 90 nop
+; 0000000A 90 nop
+
+;Causing the consequent (first) arm of the if to lose cause the whole
+;if to lose, and thus the outer seq to lose.
+
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16if3 b/test-suite/standalone/sassy/tests/prims16/16if3
new file mode 100644
index 000000000..a459c239b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16if3
@@ -0,0 +1 @@
+u๋~๋{๋v \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16if3.scm b/test-suite/standalone/sassy/tests/prims16/16if3.scm
new file mode 100644
index 000000000..597e5742a
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16if3.scm
@@ -0,0 +1,28 @@
+(bits 16)
+
+(text
+ (seq (nop)
+ (if (seq (nop) z!)
+ (inv (nop))
+ (if g!
+ (nop)
+ (if p!
+ (nop)
+ (seq a! (nop)))))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 7503 jnz 0x7
+; 00000004 90 nop
+; 00000005 EB0E jmp short 0x15
+; 00000007 7E03 jng 0xc
+; 00000009 90 nop
+; 0000000A EB08 jmp short 0x14
+; 0000000C 7B03 jpo 0x11
+; 0000000E 90 nop
+; 0000000F EB03 jmp short 0x14
+; 00000011 7602 jna 0x15
+; 00000013 90 nop
+; 00000014 90 nop
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16if4 b/test-suite/standalone/sassy/tests/prims16/16if4
new file mode 100644
index 000000000..9e722fd9b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16if4
@@ -0,0 +1 @@
+u๋ ~๋{๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16if4.scm b/test-suite/standalone/sassy/tests/prims16/16if4.scm
new file mode 100644
index 000000000..a9fea83d3
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16if4.scm
@@ -0,0 +1,27 @@
+(bits 16)
+
+(text
+ (seq (nop)
+ (if (seq (nop) z!)
+ (inv (nop))
+ (if g!
+ (nop)
+ (if p!
+ (nop)
+ (nop))))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 7503 jnz 0x7
+; 00000004 90 nop
+; 00000005 EB0C jmp short 0x13
+; 00000007 7E03 jng 0xc
+; 00000009 90 nop
+; 0000000A EB06 jmp short 0x12
+; 0000000C 7B03 jpo 0x11
+; 0000000E 90 nop
+; 0000000F EB01 jmp short 0x12
+; 00000011 90 nop
+; 00000012 90 nop
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16inv1 b/test-suite/standalone/sassy/tests/prims16/16inv1
new file mode 100644
index 000000000..015f131dc
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16inv1
@@ -0,0 +1 @@
+u}w \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16inv1.scm b/test-suite/standalone/sassy/tests/prims16/16inv1.scm
new file mode 100644
index 000000000..b60ede303
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16inv1.scm
@@ -0,0 +1,22 @@
+(bits 16)
+
+(text
+ (seq (nop)
+ (inv (seq z!
+ l!
+ a!))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 7504 jnz 0x7
+; 00000003 7D02 jnl 0x7
+; 00000005 7701 ja 0x8
+; 00000007 90 nop
+
+;In order for the outer seq to win all its arguments must win.
+;In order for the inv to win its argument must lose.
+;The argument to inv is seq, so far a seq to lose any one of its args must lose.
+;The first two args are assertions, they lose if their opposite is true, and if their opposite is true the inv wins, hence the jcc's to 0x7.
+;The last arg, also an assertion, wins if it is true, but in that case the inv will lose, causing the outer seq to lose, hance the jcc to 0x8, past everything.
+
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16inv2 b/test-suite/standalone/sassy/tests/prims16/16inv2
new file mode 100644
index 000000000..783318320
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16inv2
@@ -0,0 +1 @@
+t|w \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16inv2.scm b/test-suite/standalone/sassy/tests/prims16/16inv2.scm
new file mode 100644
index 000000000..73d4dbf76
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16inv2.scm
@@ -0,0 +1,20 @@
+(bits 16)
+
+(text
+ (seq (nop)
+ (inv (alt z!
+ l!
+ a!))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 7405 jz 0x8
+; 00000003 7C03 jl 0x8
+; 00000005 7701 ja 0x8
+; 00000007 90 nop
+
+;In order for the outer seq to win its arguments must win. In order
+;for the inv to win its argument must lose. It's argument is alt, and
+;for an alt to lose all its arguments must lose. Therefore if any of
+;its arguments win, the inv will lose as will the outer seq. Hence the
+;jcc's past everything.
diff --git a/test-suite/standalone/sassy/tests/prims16/16inv3 b/test-suite/standalone/sassy/tests/prims16/16inv3
new file mode 100644
index 000000000..581ae8c71
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16inv3
@@ -0,0 +1 @@
+u๋}๋๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16inv3.scm b/test-suite/standalone/sassy/tests/prims16/16inv3.scm
new file mode 100644
index 000000000..d3f38fe0c
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16inv3.scm
@@ -0,0 +1,21 @@
+(bits 16)
+
+(text
+ (alt (if (inv (seq (nop)
+ z!
+ (inv (nop))
+ ge!))
+ (inv (nop))
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 7505 jnz 0x8
+; 00000003 90 nop
+; 00000004 EB02 jmp short 0x8
+; 00000006 7D03 jnl 0xb
+; 00000008 90 nop
+; 00000009 EB03 jmp short 0xe
+; 0000000B 90 nop
+; 0000000C EB01 jmp short 0xf
+; 0000000E 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16inv4 b/test-suite/standalone/sassy/tests/prims16/16inv4
new file mode 100644
index 000000000..c3e2ac2c0
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16inv4
@@ -0,0 +1 @@
+๋t}๋๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16inv4.scm b/test-suite/standalone/sassy/tests/prims16/16inv4.scm
new file mode 100644
index 000000000..2b98c5a63
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16inv4.scm
@@ -0,0 +1,21 @@
+(bits 16)
+
+(text
+ (alt (if (inv (alt (nop)
+ z!
+ (inv (nop))
+ ge!))
+ (inv (nop))
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 EB08 jmp short 0xb
+; 00000003 7406 jz 0xb
+; 00000005 90 nop
+; 00000006 7D03 jnl 0xb
+; 00000008 90 nop
+; 00000009 EB03 jmp short 0xe
+; 0000000B 90 nop
+; 0000000C EB01 jmp short 0xf
+; 0000000E 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16inv5 b/test-suite/standalone/sassy/tests/prims16/16inv5
new file mode 100644
index 000000000..581ae8c71
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16inv5
@@ -0,0 +1 @@
+u๋}๋๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16inv5.scm b/test-suite/standalone/sassy/tests/prims16/16inv5.scm
new file mode 100644
index 000000000..1893e06aa
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16inv5.scm
@@ -0,0 +1,23 @@
+(bits 16)
+
+(text
+ (alt (if (alt (inv (nop))
+ (inv z!)
+ (inv (inv (nop)))
+ (inv ge!))
+ (inv (nop))
+ (nop))
+ (nop)))
+
+; should be the same as inv3.scm, (de Morgan)
+
+; 00000000 90 nop
+; 00000001 7505 jnz 0x8
+; 00000003 90 nop
+; 00000004 EB02 jmp short 0x8
+; 00000006 7D03 jnl 0xb
+; 00000008 90 nop
+; 00000009 EB03 jmp short 0xe
+; 0000000B 90 nop
+; 0000000C EB01 jmp short 0xf
+; 0000000E 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16inv6 b/test-suite/standalone/sassy/tests/prims16/16inv6
new file mode 100644
index 000000000..c3e2ac2c0
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16inv6
@@ -0,0 +1 @@
+๋t}๋๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16inv6.scm b/test-suite/standalone/sassy/tests/prims16/16inv6.scm
new file mode 100644
index 000000000..056c7d325
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16inv6.scm
@@ -0,0 +1,23 @@
+(bits 16)
+
+(text
+ (alt (if (seq (inv (nop))
+ (inv z!)
+ (inv (inv (nop)))
+ (inv ge!))
+ (inv (nop))
+ (nop))
+ (nop)))
+
+; should be the same as inv4.scm (de Morgan)
+
+; 00000000 90 nop
+; 00000001 EB08 jmp short 0xb
+; 00000003 7406 jz 0xb
+; 00000005 90 nop
+; 00000006 7D03 jnl 0xb
+; 00000008 90 nop
+; 00000009 EB03 jmp short 0xe
+; 0000000B 90 nop
+; 0000000C EB01 jmp short 0xf
+; 0000000E 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16iter1 b/test-suite/standalone/sassy/tests/prims16/16iter1
new file mode 100644
index 000000000..9602d9f55
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16iter1
@@ -0,0 +1 @@
+tv๋๘ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16iter1.scm b/test-suite/standalone/sassy/tests/prims16/16iter1.scm
new file mode 100644
index 000000000..4ce649532
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16iter1.scm
@@ -0,0 +1,13 @@
+(bits 16)
+
+(text
+ (iter (seq (nop)
+ (alt z! a!)
+ (nop))))
+
+; 00000000 90 nop
+; 00000001 7402 jz 0x5
+; 00000003 7603 jna 0x8
+; 00000005 90 nop
+; 00000006 EBF8 jmp short 0x0
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16iter2 b/test-suite/standalone/sassy/tests/prims16/16iter2
new file mode 100644
index 000000000..405e230ae
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16iter2
@@ -0,0 +1 @@
+uv}๘ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16iter2.scm b/test-suite/standalone/sassy/tests/prims16/16iter2.scm
new file mode 100644
index 000000000..2b3097cac
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16iter2.scm
@@ -0,0 +1,15 @@
+(bits 16)
+
+(text
+ (iter
+ (seq (nop)
+ (seq z! a!)
+ (nop)
+ ge!)))
+
+; 00000000 90 nop
+; 00000001 7505 jnz 0x8
+; 00000003 7603 jna 0x8
+; 00000005 90 nop
+; 00000006 7DF8 jnl 0x0
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16iter3 b/test-suite/standalone/sassy/tests/prims16/16iter3
new file mode 100644
index 000000000..d3adf99ef
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16iter3
@@ -0,0 +1 @@
+๋uw๙๋๖}๔ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16iter3.scm b/test-suite/standalone/sassy/tests/prims16/16iter3.scm
new file mode 100644
index 000000000..a7563e3ad
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16iter3.scm
@@ -0,0 +1,15 @@
+(bits 16)
+
+(text
+ (iter (alt (nop)
+ (seq z! a!)
+ (nop)
+ ge!)))
+
+; 00000000 90 nop
+; 00000001 EBFD jmp short 0x0
+; 00000003 7502 jnz 0x7
+; 00000005 77F9 ja 0x0
+; 00000007 90 nop
+; 00000008 EBF6 jmp short 0x0
+; 0000000A 7DF4 jnl 0x0
diff --git a/test-suite/standalone/sassy/tests/prims16/16iter4 b/test-suite/standalone/sassy/tests/prims16/16iter4
new file mode 100644
index 000000000..5979312ca
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16iter4
@@ -0,0 +1 @@
+๋u๋๙t} \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16iter4.scm b/test-suite/standalone/sassy/tests/prims16/16iter4.scm
new file mode 100644
index 000000000..c31640d9e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16iter4.scm
@@ -0,0 +1,19 @@
+(bits 16)
+
+(text
+ (iter (alt (nop)
+ (iter (seq (nop)
+ (nop)
+ z!
+ (nop)))
+ (iter (inv (alt z!
+ l!))))))
+; 00000000 90 nop
+; 00000001 EBFD jmp short 0x0
+; 00000003 90 nop
+; 00000004 90 nop
+; 00000005 7503 jnz 0xa
+; 00000007 90 nop
+; 00000008 EBF9 jmp short 0x3
+; 0000000A 7402 jz 0xe
+; 0000000C 7DFC jnl 0xa
diff --git a/test-suite/standalone/sassy/tests/prims16/16iter5 b/test-suite/standalone/sassy/tests/prims16/16iter5
new file mode 100644
index 000000000..f864a6681
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16iter5
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16iter5.scm b/test-suite/standalone/sassy/tests/prims16/16iter5.scm
new file mode 100644
index 000000000..3c42b6c46
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16iter5.scm
@@ -0,0 +1,40 @@
+(bits 16)
+
+(text
+ (begin
+ (iter
+ (alt (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (zero? eax)))
+ (iter
+ (alt (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (add (& ecx (* edx 4) 1000) 1000)
+ (zero? eax)))))
+
+;testing multi-pass iter for jump sizes
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16iter6 b/test-suite/standalone/sassy/tests/prims16/16iter6
new file mode 100644
index 000000000..fcbdd1a48
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16iter6
@@ -0,0 +1 @@
+[ƒ๛t๚[ƒ๛t๚ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16iter6.scm b/test-suite/standalone/sassy/tests/prims16/16iter6.scm
new file mode 100644
index 000000000..8e6fa1729
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16iter6.scm
@@ -0,0 +1,43 @@
+(bits 16)
+
+(text
+ (iter
+ (begin (iter (seq (pop bx)
+ (= bx 2)))
+ (iter (seq (pop bx)
+ (= bx 3))))))
+
+; 00000000 5B pop ebx
+; 00000001 83FB02 cmp bx,byte +0x2
+; 00000004 74FA jz 0x0
+; 00000006 5B pop ebx
+; 00000007 83FB03 cmp bx,byte +0x3
+; 0000000A 74FA jz 0x6
+
+; Why it makes sense that the outer loop doesn't loop:
+; Iter can never win, it can only loop forever or lose, in which case
+; the loop is exited. The begin wins or loses depending on its last
+; tail. In this case, the last tail can never win, since it's an iter,
+; but it can lose. But if it loses, the whole begin loses, in which
+; case the outer iter loses and is exited.
+
+; In this case, you can put '(seq) as the last item of the
+; begin. Since '(seq) always wins, the begin always wins and the outer
+; loop never exits, so the last jmp will be generated:
+
+; (text
+; (iter
+; (begin (iter (seq (pop ebx)
+; (= ebx 2)))
+; (iter (seq (pop ebx)
+; (= ebx 3)))
+; (seq))))
+
+; 00000000 5B pop ebx
+; 00000001 83FB02 cmp ebx,byte +0x2
+; 00000004 74FA jz 0x0
+; 00000006 5B pop ebx
+; 00000007 83FB03 cmp ebx,byte +0x3
+; 0000000A 74FA jz 0x6
+; 0000000C EBF2 jmp short 0x0
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16label1 b/test-suite/standalone/sassy/tests/prims16/16label1
new file mode 100644
index 000000000..6c0c68d21
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16label1
@@ -0,0 +1 @@
+u้๚ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16label1.scm b/test-suite/standalone/sassy/tests/prims16/16label1.scm
new file mode 100644
index 000000000..b385752a2
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16label1.scm
@@ -0,0 +1,13 @@
+(bits 16)
+
+(text
+ (label foo (seq (nop)
+ (label bar z!)
+ (nop)))
+ (jmp bar))
+
+; 00000000 90 nop
+; 00000001 7501 jnz 0x4
+; 00000003 90 nop
+; 00000004 E9FAFF jmp 0x1
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16label2 b/test-suite/standalone/sassy/tests/prims16/16label2
new file mode 100644
index 000000000..45529adfc
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16label2
@@ -0,0 +1 @@
+๋๛้๙ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16label2.scm b/test-suite/standalone/sassy/tests/prims16/16label2.scm
new file mode 100644
index 000000000..15019eb43
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16label2.scm
@@ -0,0 +1,15 @@
+(bits 16)
+
+(text
+ (iter (begin
+ (nop)
+ (label foo (nop))
+ (nop)))
+ (jmp foo))
+
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 90 nop
+; 00000003 EBFB jmp short 0x0
+; 00000005 E9F9FF jmp 0x1
diff --git a/test-suite/standalone/sassy/tests/prims16/16label3 b/test-suite/standalone/sassy/tests/prims16/16label3
new file mode 100644
index 000000000..893b53039
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16label3
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16label3.scm b/test-suite/standalone/sassy/tests/prims16/16label3.scm
new file mode 100644
index 000000000..e371d69fb
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16label3.scm
@@ -0,0 +1,25 @@
+(bits 16)
+
+(text
+ (with-win-lose foo bar
+ (zero? ax))
+ (nop)
+ (nop)
+ (nop)
+ (seq (label bar
+ (inv (iter (seq (dec ax)
+ (inc cx)
+ (>= ax 0)))))
+ (label foo (push cx))))
+
+; 00000000 85C0 test ax,ax
+; 00000002 0F840D00 jz near 0x13
+; 00000006 E90300 jmp 0xc
+; 00000009 90 nop
+; 0000000A 90 nop
+; 0000000B 90 nop
+; 0000000C 48 dec ax
+; 0000000D 41 inc cx
+; 0000000E 3D0000 cmp ax,0x0
+; 00000011 7DF9 jnl 0xc
+; 00000013 51 push cx
diff --git a/test-suite/standalone/sassy/tests/prims16/16label4 b/test-suite/standalone/sassy/tests/prims16/16label4
new file mode 100644
index 000000000..ac50eb8ba
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16label4
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16label4.scm b/test-suite/standalone/sassy/tests/prims16/16label4.scm
new file mode 100644
index 000000000..a6ad3598f
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16label4.scm
@@ -0,0 +1,49 @@
+(bits 16)
+
+; local labels via brute force renaming
+
+(! (begin (define my-gensym ; assuming eval allows non-expressions (eg define)
+ (let ((count 1))
+ (lambda ()
+ (let ((new (string->symbol (string-append
+ "_label"
+ (number->string count)))))
+ (set! count (+ count 1))
+ new))))
+ 'void))
+
+(macro my-local (lambda (name . body)
+ (define new-sym (my-gensym))
+ ; do the substitution manually,
+ ; instead of relying on a macro to do it,
+ ; because 'direcs' is a directive
+ ; and we want to be able use this in a nested context
+ (define (deep-replace new old lst)
+ (cond ((pair? lst) (map (lambda (x)
+ (deep-replace new old x))
+ lst))
+ ((eqv? old lst) new)
+ (else lst)))
+ `(label ,new-sym ,@(deep-replace new-sym name body))))
+
+
+(text
+ (label foo (ret))
+
+ (seq (= cx "DO")
+ (my-local foo
+ (pop ax)
+ (cmp ax 0)
+ (jnz foo)))
+ (nop)
+ (jmp foo))
+
+; 00000000 C3 ret
+; 00000001 81F9444F cmp cx,0x4f44
+; 00000005 7508 jnz 0xf
+; 00000007 58 pop ax
+; 00000008 3D0000 cmp ax,0x0
+; 0000000B 0F85F8FF jnz near 0x7
+; 0000000F 90 nop
+; 00000010 E9EDFF jmp 0x0
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16leap-mark1 b/test-suite/standalone/sassy/tests/prims16/16leap-mark1
new file mode 100644
index 000000000..3df256f90
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16leap-mark1
@@ -0,0 +1 @@
+๋YH…ภu๚ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16leap-mark1.scm b/test-suite/standalone/sassy/tests/prims16/16leap-mark1.scm
new file mode 100644
index 000000000..724b8aa4c
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16leap-mark1.scm
@@ -0,0 +1,12 @@
+(bits 16)
+
+(text
+ (while (inv (zero? ax))
+ (seq (pop cx)
+ (dec ax))))
+
+; 00000000 EB02 jmp short 0x4
+; 00000002 59 pop cx
+; 00000003 48 dec ax
+; 00000004 85C0 test ax,ax
+; 00000006 75FA jnz 0x2
diff --git a/test-suite/standalone/sassy/tests/prims16/16leap-mark2 b/test-suite/standalone/sassy/tests/prims16/16leap-mark2
new file mode 100644
index 000000000..e5631d947
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16leap-mark2
@@ -0,0 +1 @@
+๋๋๋t๖ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16leap-mark2.scm b/test-suite/standalone/sassy/tests/prims16/16leap-mark2.scm
new file mode 100644
index 000000000..a1f3502fb
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16leap-mark2.scm
@@ -0,0 +1,21 @@
+(bits 16)
+
+(text
+ (leap (iter
+ (seq (nop)
+ (mark
+ (leap (seq (nop)
+ (mark
+ (leap (seq (nop)
+ (mark (seq (nop) z!))))))))))))
+
+;confusing but correct.
+
+; 00000000 EB07 jmp short 0x9
+; 00000002 90 nop
+; 00000003 EB04 jmp short 0x9
+; 00000005 90 nop
+; 00000006 EB01 jmp short 0x9
+; 00000008 90 nop
+; 00000009 90 nop
+; 0000000A 74F6 jz 0x2
diff --git a/test-suite/standalone/sassy/tests/prims16/16leap-mark3 b/test-suite/standalone/sassy/tests/prims16/16leap-mark3
new file mode 100644
index 000000000..0e0a21ecb
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16leap-mark3
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16leap-mark3.scm b/test-suite/standalone/sassy/tests/prims16/16leap-mark3.scm
new file mode 100644
index 000000000..d78ac4396
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16leap-mark3.scm
@@ -0,0 +1,32 @@
+(bits 16)
+
+(text
+ (label foo
+ (leap
+ (iter (seq (push dx)
+ (if (= ax 3)
+ (alt (seq (pop cx) z!)
+ (seq (push bx) z! (mark (pop bx)))
+ (seq (mov dx 3)))
+ (seq (= dx 4) (jmp foo)))
+ (push dx))))))
+
+;hmm...
+
+; 00000000 EB0C jmp short 0xe
+; 00000002 52 push dx
+; 00000003 3D0300 cmp ax,0x3
+; 00000006 750E jnz 0x16
+; 00000008 59 pop cx
+; 00000009 7413 jz 0x1e
+; 0000000B 53 push bx
+; 0000000C 7503 jnz 0x11
+; 0000000E 5B pop bx
+; 0000000F EB0D jmp short 0x1e
+; 00000011 BA0300 mov dx,0x3
+; 00000014 EB08 jmp short 0x1e
+; 00000016 83FA04 cmp dx,byte +0x4
+; 00000019 7506 jnz 0x21
+; 0000001B E9E2FF jmp 0x0
+; 0000001E 52 push dx
+; 0000001F EBE1 jmp short 0x2
diff --git a/test-suite/standalone/sassy/tests/prims16/16locals1 b/test-suite/standalone/sassy/tests/prims16/16locals1
new file mode 100644
index 000000000..dbd6717ab
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16locals1
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16locals1.scm b/test-suite/standalone/sassy/tests/prims16/16locals1.scm
new file mode 100644
index 000000000..5daa6392c
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16locals1.scm
@@ -0,0 +1,18 @@
+(bits 16)
+
+(text
+ (locals (bar quux)
+ (nop)
+ (label bar
+ (push quux)
+ (nop))
+ (label quux
+ (push bar)
+ (nop))))
+
+; 00000000 90 nop
+; 00000001 680500 push word 0x5
+; 00000004 90 nop
+; 00000005 680100 push word 0x1
+; 00000008 90 nop
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16locals2 b/test-suite/standalone/sassy/tests/prims16/16locals2
new file mode 100644
index 000000000..d62ad87c3
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16locals2
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16locals2.scm b/test-suite/standalone/sassy/tests/prims16/16locals2.scm
new file mode 100644
index 000000000..9c426ca98
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16locals2.scm
@@ -0,0 +1,25 @@
+(bits 16)
+
+(text
+ (nop)
+ (label bar
+ (push quux))
+ (locals (bar quux)
+ (nop)
+ (label bar
+ (push quux)
+ (nop))
+ (label quux
+ (push bar)
+ (nop)))
+ (label quux (push bar)))
+
+; 00000000 90 nop
+; 00000001 680D00 push word 0xd
+; 00000004 90 nop
+; 00000005 680900 push word 0x9
+; 00000008 90 nop
+; 00000009 680500 push word 0x5
+; 0000000C 90 nop
+; 0000000D 680100 push word 0x1
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16locals3 b/test-suite/standalone/sassy/tests/prims16/16locals3
new file mode 100644
index 000000000..d27d9ee80
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16locals3
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16locals3.scm b/test-suite/standalone/sassy/tests/prims16/16locals3.scm
new file mode 100644
index 000000000..dfb99eef5
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16locals3.scm
@@ -0,0 +1,25 @@
+(bits 16)
+
+(text
+ (nop)
+ (label bar (jmp quux))
+ (locals (bar quux)
+ (nop)
+ (label bar
+ (jmp quux)
+ (nop))
+ (label quux
+ (jmp bar)
+ (nop)))
+ (label quux (jmp bar)))
+
+
+
+; 00000000 90 nop
+; 00000001 E90900 jmp 0xd
+; 00000004 90 nop
+; 00000005 E90100 jmp 0x9
+; 00000008 90 nop
+; 00000009 E9F9FF jmp 0x5
+; 0000000C 90 nop
+; 0000000D E9F1FF jmp 0x1
diff --git a/test-suite/standalone/sassy/tests/prims16/16locals4 b/test-suite/standalone/sassy/tests/prims16/16locals4
new file mode 100644
index 000000000..ac50eb8ba
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16locals4
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16locals4.scm b/test-suite/standalone/sassy/tests/prims16/16locals4.scm
new file mode 100644
index 000000000..613a1c366
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16locals4.scm
@@ -0,0 +1,25 @@
+(bits 16)
+
+(text
+ (label foo (ret))
+
+ (seq (= cx "DO")
+ (locals (foo)
+ (label foo
+ (with-win foo
+ (seq (pop ax)
+ (cmp ax 0)
+ nz!)))))
+
+ (nop)
+ (jmp foo))
+
+; 00000000 C3 ret
+; 00000001 81F9444F cmp cx,0x4f44
+; 00000005 7508 jnz 0xf
+; 00000007 58 pop ax
+; 00000008 3D0000 cmp ax,0x0
+; 0000000B 0F85F8FF jnz near 0x7
+; 0000000F 90 nop
+; 00000010 E9EDFF jmp 0x0
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16locals5 b/test-suite/standalone/sassy/tests/prims16/16locals5
new file mode 100644
index 000000000..44b77bf21
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16locals5
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16locals5.scm b/test-suite/standalone/sassy/tests/prims16/16locals5.scm
new file mode 100644
index 000000000..be1614a33
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16locals5.scm
@@ -0,0 +1,38 @@
+(bits 16)
+
+(macro my-while
+ (lambda (test . body)
+ `(locals (loop)
+ (label loop
+ (with-win (jmp short loop)
+ (seq ,test
+ (begin ,@body)))))))
+
+(text
+ (label loop
+
+ (nop)
+
+ (my-while (< ax 10)
+ (pop bx)
+ (add ax bx)))
+
+ (my-while (> cx 1000)
+ (pop bx)
+ (sub cx bx))
+
+ (jmp short loop))
+
+; 00000000 90 nop
+; 00000001 3D0A00 cmp ax,0xa
+; 00000004 7D05 jnl 0xb
+; 00000006 5B pop bx
+; 00000007 01D8 add ax,bx
+; 00000009 EBF6 jmp short 0x1
+; 0000000B 81F9E803 cmp cx,0x3e8
+; 0000000F 7E05 jng 0x16
+; 00000011 5B pop bx
+; 00000012 29D9 sub cx,bx
+; 00000014 EBF5 jmp short 0xb
+; 00000016 EBE8 jmp short 0x0
+
diff --git a/test-suite/standalone/sassy/tests/prims16/16locals6 b/test-suite/standalone/sassy/tests/prims16/16locals6
new file mode 100644
index 000000000..44b77bf21
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16locals6
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16locals6.scm b/test-suite/standalone/sassy/tests/prims16/16locals6.scm
new file mode 100644
index 000000000..66f41843e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16locals6.scm
@@ -0,0 +1,37 @@
+(bits 16)
+
+(macro my-while
+ (lambda (test . body)
+ `(locals (loop)
+ (label loop
+ (with-win (jmp short loop)
+ (seq ,test
+ (begin ,@body)))))))
+
+(text
+ (label loop
+
+ (nop)
+
+ (my-while (< ax 10)
+ (pop bx)
+ (add ax bx)))
+
+ (my-while (> cx 1000)
+ (pop bx)
+ (sub cx bx))
+
+ (jmp short loop))
+
+; 00000000 90 nop
+; 00000001 3D0A00 cmp ax,0xa
+; 00000004 7D05 jnl 0xb
+; 00000006 5B pop bx
+; 00000007 01D8 add ax,bx
+; 00000009 EBF6 jmp short 0x1
+; 0000000B 81F9E803 cmp cx,0x3e8
+; 0000000F 7E05 jng 0x16
+; 00000011 5B pop bx
+; 00000012 29D9 sub cx,bx
+; 00000014 EBF5 jmp short 0xb
+; 00000016 EBE8 jmp short 0x0
diff --git a/test-suite/standalone/sassy/tests/prims16/16locals7 b/test-suite/standalone/sassy/tests/prims16/16locals7
new file mode 100644
index 000000000..d27d9ee80
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16locals7
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16locals7.scm b/test-suite/standalone/sassy/tests/prims16/16locals7.scm
new file mode 100644
index 000000000..18231a429
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16locals7.scm
@@ -0,0 +1,23 @@
+(bits 16)
+
+(text
+ (nop)
+ (label bar (jmp quux))
+ (locals (bar quux)
+ (nop)
+ (label bar)
+ (jmp quux)
+ (nop)
+ (label quux)
+ (jmp bar)
+ (nop))
+ (label quux (jmp bar)))
+
+; 00000000 90 nop
+; 00000001 E90900 jmp 0xd
+; 00000004 90 nop
+; 00000005 E90100 jmp 0x9
+; 00000008 90 nop
+; 00000009 E9F9FF jmp 0x5
+; 0000000C 90 nop
+; 0000000D E9F1FF jmp 0x1
diff --git a/test-suite/standalone/sassy/tests/prims16/16locals8 b/test-suite/standalone/sassy/tests/prims16/16locals8
new file mode 100644
index 000000000..da42f300c
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16locals8
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16locals8.scm b/test-suite/standalone/sassy/tests/prims16/16locals8.scm
new file mode 100644
index 000000000..69db4f06b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16locals8.scm
@@ -0,0 +1,17 @@
+(bits 16)
+
+; testing out skipping of undefined declarations
+
+(text
+ (label bar
+ (nop))
+ (locals (bar quux)
+ (nop)
+ (label quux)
+ (jmp bar)
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 E90000 jmp 0x5
+; 00000005 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16seq1 b/test-suite/standalone/sassy/tests/prims16/16seq1
new file mode 100644
index 000000000..d335cc333
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16seq1
@@ -0,0 +1 @@
+๋ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16seq1.scm b/test-suite/standalone/sassy/tests/prims16/16seq1.scm
new file mode 100644
index 000000000..15cfd9c35
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16seq1.scm
@@ -0,0 +1,17 @@
+(bits 16)
+
+(text
+ (seq (nop)
+ (nop)
+ (seq (nop)
+ (inv (nop))
+ (nop))
+ (seq (nop))))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 90 nop
+; 00000003 90 nop
+; 00000004 EB02 jmp short 0x8
+; 00000006 90 nop
+; 00000007 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16seq2 b/test-suite/standalone/sassy/tests/prims16/16seq2
new file mode 100644
index 000000000..6037d7912
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16seq2
@@ -0,0 +1 @@
+ut \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16seq2.scm b/test-suite/standalone/sassy/tests/prims16/16seq2.scm
new file mode 100644
index 000000000..328955900
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16seq2.scm
@@ -0,0 +1,22 @@
+(bits 16)
+
+(text
+ (seq (nop)
+ (nop)
+ (seq (nop)
+ (nop)
+ z!
+ (nop)
+ (inv z!)
+ (nop))
+ (seq (nop))))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 90 nop
+; 00000003 90 nop
+; 00000004 7505 jnz 0xb
+; 00000006 90 nop
+; 00000007 7402 jz 0xb
+; 00000009 90 nop
+; 0000000A 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16seq3 b/test-suite/standalone/sassy/tests/prims16/16seq3
new file mode 100644
index 000000000..cd617b311
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16seq3
@@ -0,0 +1 @@
+ut \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16seq3.scm b/test-suite/standalone/sassy/tests/prims16/16seq3.scm
new file mode 100644
index 000000000..539cb8e55
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16seq3.scm
@@ -0,0 +1,22 @@
+(bits 16)
+
+(text
+ (begin (nop)
+ (nop)
+ (seq (nop)
+ (nop)
+ z!
+ (nop)
+ (inv z!)
+ (nop))
+ (nop)))
+
+; 00000000 90 nop
+; 00000001 90 nop
+; 00000002 90 nop
+; 00000003 90 nop
+; 00000004 7504 jnz 0xa
+; 00000006 90 nop
+; 00000007 7401 jz 0xa
+; 00000009 90 nop
+; 0000000A 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16while1 b/test-suite/standalone/sassy/tests/prims16/16while1
new file mode 100644
index 000000000..c0f285f95
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16while1
@@ -0,0 +1 @@
+๋[X€u<t๕R๋Q \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16while1.scm b/test-suite/standalone/sassy/tests/prims16/16while1.scm
new file mode 100644
index 000000000..6be2db9a2
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16while1.scm
@@ -0,0 +1,20 @@
+(bits 16)
+
+(text
+ (if (while (= al 3)
+ (seq (pop bx)
+ (pop ax)
+ (= bh 2)))
+ (push dx)
+ (push cx)))
+
+; 00000000 EB07 jmp short 0x9
+; 00000002 5B pop bx
+; 00000003 58 pop ax
+; 00000004 80FF02 cmp bh,0x2
+; 00000007 7507 jnz 0x10
+; 00000009 3C03 cmp al,0x3
+; 0000000B 74F5 jz 0x2
+; 0000000D 52 push dx
+; 0000000E EB01 jmp short 0x11
+; 00000010 51 push cx
diff --git a/test-suite/standalone/sassy/tests/prims16/16while2 b/test-suite/standalone/sassy/tests/prims16/16while2
new file mode 100644
index 000000000..138dc1d29
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16while2
@@ -0,0 +1 @@
+๋[X€u<u๕R๋Q \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16while2.scm b/test-suite/standalone/sassy/tests/prims16/16while2.scm
new file mode 100644
index 000000000..8cef5136d
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16while2.scm
@@ -0,0 +1,20 @@
+(bits 16)
+
+(text
+ (if (until (= al 3)
+ (seq (pop bx)
+ (pop ax)
+ (= bh 2)))
+ (push dx)
+ (push cx)))
+
+; 00000000 EB07 jmp short 0x9
+; 00000002 5B pop bx
+; 00000003 58 pop ax
+; 00000004 80FF02 cmp bh,0x2
+; 00000007 7507 jnz 0x10
+; 00000009 3C03 cmp al,0x3
+; 0000000B 75F5 jnz 0x2
+; 0000000D 52 push dx
+; 0000000E EB01 jmp short 0x11
+; 00000010 51 push cx
diff --git a/test-suite/standalone/sassy/tests/prims16/16while3 b/test-suite/standalone/sassy/tests/prims16/16while3
new file mode 100644
index 000000000..e137d24e0
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16while3
@@ -0,0 +1 @@
+๋ [ƒ๛tุ๋๖ย€|๏ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16while3.scm b/test-suite/standalone/sassy/tests/prims16/16while3.scm
new file mode 100644
index 000000000..d886561ff
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16while3.scm
@@ -0,0 +1,26 @@
+(bits 16)
+
+(text
+ (while (< dh 20)
+ (begin
+ (iter (seq (pop bx)
+ (!= bx 4)
+ (add ax bx)))
+ (add dx ax))))
+
+; iter is sometimes better for inner loops, since both
+; while and until always generate a jmp at their start
+; to the test (the test is placed after their body).
+; When while or until start the body of an outer while/until
+; that means a jmp or jcc to a jmp will be generated.
+; Using iter for the inner loop fixes this.
+
+; 00000000 EB0C jmp short 0xe
+; 00000002 5B pop bx
+; 00000003 83FB04 cmp bx,byte +0x4
+; 00000006 7404 jz 0xc
+; 00000008 01D8 add ax,bx
+; 0000000A EBF6 jmp short 0x2
+; 0000000C 01C2 add dx,ax
+; 0000000E 80FE14 cmp dh,0x14
+; 00000011 7CEF jl 0x2
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-lose1 b/test-suite/standalone/sassy/tests/prims16/16with-lose1
new file mode 100644
index 000000000..2d08850ac
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-lose1
@@ -0,0 +1 @@
+รtw๚{๗้๒ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-lose1.scm b/test-suite/standalone/sassy/tests/prims16/16with-lose1.scm
new file mode 100644
index 000000000..1f87d4ab7
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-lose1.scm
@@ -0,0 +1,22 @@
+(bits 16)
+
+(text
+ (label foo (ret))
+ (seq (nop)
+ (with-lose foo
+ (iter (alt (seq (nop) z!)
+ (seq (nop) a!)
+ (seq (nop) po!))))
+ (nop)))
+; foo:
+; 00000000 C3 ret
+
+; 00000001 90 nop
+; 00000002 90 nop
+; 00000003 74FD jz 0x2
+; 00000005 90 nop
+; 00000006 77FA ja 0x2
+; 00000008 90 nop
+; 00000009 7BF7 jpo 0x2
+; 0000000B E9F0FFFFFF jmp 0x0
+; 00000010 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-lose2 b/test-suite/standalone/sassy/tests/prims16/16with-lose2
new file mode 100644
index 000000000..a0935f401
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-lose2
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-lose2.scm b/test-suite/standalone/sassy/tests/prims16/16with-lose2.scm
new file mode 100644
index 000000000..89e7a9311
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-lose2.scm
@@ -0,0 +1,21 @@
+(bits 16)
+
+(text
+ (label foo (ret))
+ (seq (nop)
+ (with-lose (reloc my-reloc foo 100)
+ (iter (alt (seq (nop) z!)
+ (seq (nop) a!)
+ (seq (nop) po!))))
+ (nop)))
+
+; 00000000 C3 ret
+; 00000001 90 nop
+; 00000002 90 nop
+; 00000003 74FD jz 0x2
+; 00000005 90 nop
+; 00000006 77FA ja 0x2
+; 00000008 90 nop
+; 00000009 7BF7 jpo 0x2
+; 0000000B E96400 jmp 0x72
+; 0000000E 90 nop
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-lose3 b/test-suite/standalone/sassy/tests/prims16/16with-lose3
new file mode 100644
index 000000000..3acbcdf00
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-lose3
@@ -0,0 +1 @@
+รรร…๘Œ๕†๒ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-lose3.scm b/test-suite/standalone/sassy/tests/prims16/16with-lose3.scm
new file mode 100644
index 000000000..27ac9beb9
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-lose3.scm
@@ -0,0 +1,26 @@
+(bits 16)
+
+(text
+ (label foo (ret))
+ (label bar (ret))
+ (label qudr (ret))
+ (seq
+ (nop)
+ (with-lose foo z!)
+ (with-lose bar ge!)
+ (with-lose qudr a!)
+ (nop)))
+
+; 00000000 C3 ret
+; 00000001 C3 ret
+; 00000002 C3 ret
+; 00000003 90 nop
+; 00000004 0F85F8FF jnz near 0x0
+; 00000008 0F8CF5FF jl near 0x1
+; 0000000C 0F86F2FF jna near 0x2
+; 00000010 90 nop
+
+
+
+
+ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win-lose1 b/test-suite/standalone/sassy/tests/prims16/16with-win-lose1
new file mode 100644
index 000000000..394e8067c
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win-lose1
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win-lose1.scm b/test-suite/standalone/sassy/tests/prims16/16with-win-lose1.scm
new file mode 100644
index 000000000..aa6d9bc4f
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win-lose1.scm
@@ -0,0 +1,17 @@
+(bits 16)
+
+(text
+ (with-win-lose foo bar
+ (= ax 3))
+ (seq (nop) (nop) (nop))
+ (label foo (ret))
+ (label bar (ret)))
+
+; 00000000 3D0300 cmp ax,0x3
+; 00000003 0F840600 jz near 0xd
+; 00000007 E90400 jmp 0xe
+; 0000000A 90 nop
+; 0000000B 90 nop
+; 0000000C 90 nop
+; 0000000D C3 ret
+; 0000000E C3 ret
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win-lose2 b/test-suite/standalone/sassy/tests/prims16/16with-win-lose2
new file mode 100644
index 000000000..6fc45b806
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win-lose2
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win-lose2.scm b/test-suite/standalone/sassy/tests/prims16/16with-win-lose2.scm
new file mode 100644
index 000000000..748e8cae1
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win-lose2.scm
@@ -0,0 +1,24 @@
+(bits 16)
+
+(text
+ (with-win-lose foo bar
+ (while (= ax 3)
+ (seq (nop)
+ (nop)
+ l!)))
+ (seq (nop) (nop) (nop))
+ (label foo (ret))
+ (label bar (ret)))
+
+; 00000000 EB06 jmp short 0x8
+; 00000002 90 nop
+; 00000003 90 nop
+; 00000004 0F8D0C00 jnl near 0x14
+; 00000008 3D0300 cmp ax,0x3
+; 0000000B 74F5 jz 0x2
+; 0000000D E90300 jmp 0x13
+; 00000010 90 nop
+; 00000011 90 nop
+; 00000012 90 nop
+; 00000013 C3 ret
+; 00000014 C3 ret
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win-lose3 b/test-suite/standalone/sassy/tests/prims16/16with-win-lose3
new file mode 100644
index 000000000..bbb1ac49e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win-lose3
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win-lose3.scm b/test-suite/standalone/sassy/tests/prims16/16with-win-lose3.scm
new file mode 100644
index 000000000..f84ffc450
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win-lose3.scm
@@ -0,0 +1,24 @@
+(bits 16)
+
+(text
+ (label foo (ret))
+ (with-win-lose bar foo
+ (if (= ax 3)
+ (nop)
+ (alt (seq (nop) a!)
+ (seq (nop) p!))))
+ (nop)
+ (label bar (ret)))
+
+; 00000000 C3 ret
+; 00000001 3D0300 cmp ax,0x3
+; 00000004 7504 jnz 0xa
+; 00000006 90 nop
+; 00000007 E90E00 jmp 0x18
+; 0000000A 90 nop
+; 0000000B 0F870900 ja near 0x18
+; 0000000F 90 nop
+; 00000010 0F8A0400 jpe near 0x18
+; 00000014 E9E9FF jmp 0x0
+; 00000017 90 nop
+; 00000018 C3 ret
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win-lose4 b/test-suite/standalone/sassy/tests/prims16/16with-win-lose4
new file mode 100644
index 000000000..0bdd94c4c
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win-lose4
@@ -0,0 +1 @@
+SPƒ๙uร่๕ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win-lose4.scm b/test-suite/standalone/sassy/tests/prims16/16with-win-lose4.scm
new file mode 100644
index 000000000..a09fdd925
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win-lose4.scm
@@ -0,0 +1,15 @@
+(bits 16)
+
+(text
+ (label foo (push bx))
+ (with-win-lose (ret) (call foo)
+ (seq
+ (push ax)
+ (= cx 4))))
+
+; 00000000 53 push bx
+; 00000001 50 push ax
+; 00000002 83F904 cmp cx,byte +0x4
+; 00000005 7501 jnz 0x8
+; 00000007 C3 ret
+; 00000008 E8F5FF call 0x0
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win-lose5 b/test-suite/standalone/sassy/tests/prims16/16with-win-lose5
new file mode 100644
index 000000000..db9f9cd54
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win-lose5
@@ -0,0 +1 @@
+SPƒ๙u้่๓ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win-lose5.scm b/test-suite/standalone/sassy/tests/prims16/16with-win-lose5.scm
new file mode 100644
index 000000000..efdb8a1af
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win-lose5.scm
@@ -0,0 +1,17 @@
+(bits 16)
+
+(text
+ (label foo (push bx))
+ (with-win-lose
+ (jmp 1000)
+ (call foo)
+ (seq
+ (push ax)
+ (= cx 4))))
+
+; 00000000 53 push bx
+; 00000001 50 push ax
+; 00000002 83F904 cmp cx,byte +0x4
+; 00000005 7503 jnz 0xa
+; 00000007 E9DE03 jmp 0x3e8
+; 0000000A E8F3FF call 0x0
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win1 b/test-suite/standalone/sassy/tests/prims16/16with-win1
new file mode 100644
index 000000000..d309920cc
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win1
@@ -0,0 +1 @@
+รรfƒ๘ufP้๔fS้๏ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win1.scm b/test-suite/standalone/sassy/tests/prims16/16with-win1.scm
new file mode 100644
index 000000000..486095f1c
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win1.scm
@@ -0,0 +1,18 @@
+(bits 16)
+
+(text
+ (label foo (ret))
+ (label bar (ret))
+ (with-win bar
+ (if (= eax 3)
+ (push eax)
+ (push ebx))))
+
+; 00000000 C3 ret
+; 00000001 C3 ret
+; 00000002 6683F803 cmp eax,byte +0x3
+; 00000006 7505 jnz 0xd
+; 00000008 6650 push eax
+; 0000000A E9F4FF jmp 0x1
+; 0000000D 6653 push ebx
+; 0000000F E9EFFF jmp 0x1
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win2 b/test-suite/standalone/sassy/tests/prims16/16with-win2
new file mode 100644
index 000000000..f046668d0
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win2
@@ -0,0 +1 @@
+รรfƒ๘ufP้๔fS้๎ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win2.scm b/test-suite/standalone/sassy/tests/prims16/16with-win2.scm
new file mode 100644
index 000000000..1ecda0ec4
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win2.scm
@@ -0,0 +1,19 @@
+(bits 16)
+
+(text
+ (label foo (ret))
+ (label bar (ret))
+ (with-win bar
+ (if (= eax 3)
+ (push eax)
+ (with-win foo
+ (push ebx)))))
+
+; 00000000 C3 ret
+; 00000001 C3 ret
+; 00000002 6683F803 cmp eax,byte +0x3
+; 00000006 7505 jnz 0xd
+; 00000008 6650 push eax
+; 0000000A E9F4FF jmp 0x1
+; 0000000D 6653 push ebx
+; 0000000F E9EEFF jmp 0x0
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win3 b/test-suite/standalone/sassy/tests/prims16/16with-win3
new file mode 100644
index 000000000..768b1de50
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win3
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win3.scm b/test-suite/standalone/sassy/tests/prims16/16with-win3.scm
new file mode 100644
index 000000000..38fc37944
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win3.scm
@@ -0,0 +1,28 @@
+(bits 16)
+
+(text
+ (label foo (ret))
+ (label bar (ret))
+ (if (while (!= ax 3)
+ (seq (pop ax)
+ (inc ax)
+ (< ax 10)))
+ (with-win bar
+ (alt z! a!))
+ (with-win foo
+ (push bx))))
+
+; 00000000 C3 ret
+; 00000001 C3 ret
+; 00000002 EB07 jmp short 0xb
+; 00000004 58 pop ax
+; 00000005 40 inc ax
+; 00000006 3D0A00 cmp ax,0xa
+; 00000009 7D0E jnl 0x19
+; 0000000B 3D0300 cmp ax,0x3
+; 0000000E 75F4 jnz 0x4
+; 00000010 0F84EDFF jz near 0x1
+; 00000014 7607 jna 0x1d
+; 00000016 E9E8FF jmp 0x1
+; 00000019 53 push bx
+; 0000001A E9E3FF jmp 0x0
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win4 b/test-suite/standalone/sassy/tests/prims16/16with-win4
new file mode 100644
index 000000000..289f34835
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win4
@@ -0,0 +1 @@
+SPร \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win4.scm b/test-suite/standalone/sassy/tests/prims16/16with-win4.scm
new file mode 100644
index 000000000..e25c2633e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win4.scm
@@ -0,0 +1,10 @@
+(bits 16)
+
+(text
+ (label foo (push bx))
+ (seq (with-win (ret)
+ (push ax))))
+
+; 00000000 53 push bx
+; 00000001 50 push ax
+; 00000002 C3 ret
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win5 b/test-suite/standalone/sassy/tests/prims16/16with-win5
new file mode 100644
index 000000000..bb213e587
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win5
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/prims16/16with-win5.scm b/test-suite/standalone/sassy/tests/prims16/16with-win5.scm
new file mode 100644
index 000000000..3bb5d3b77
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/prims16/16with-win5.scm
@@ -0,0 +1,19 @@
+(bits 16)
+
+(text
+ (mov ax 10)
+; this should loop 7 times
+ (label foo
+ (if (= ax 3)
+ (with-win (ret))
+ (with-win foo
+ (sub ax 1)))))
+
+; 00000000 B80A00 mov ax,0xa
+; 00000003 3D0300 cmp ax,0x3
+; 00000006 7501 jnz 0x9
+; 00000008 C3 ret
+; 00000009 2D0100 sub ax,0x1
+; 0000000C E9F4FF jmp 0x3
+
+
diff --git a/test-suite/standalone/sassy/tests/quick-elf.scm b/test-suite/standalone/sassy/tests/quick-elf.scm
new file mode 100644
index 000000000..e75df1303
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/quick-elf.scm
@@ -0,0 +1,17 @@
+(sassy-make-elf
+ "tests/quick-elf-new.o"
+ (sassy
+ '((text
+ (foo (begin
+ (push ebp)
+ (mov ebp esp)
+ (get-got)
+ (lea eax (gotoff quux 4))
+ (mov ecx (got qadr))
+ (call (plt wizo))
+ (jmp wizo))))
+ (import qadr wizo)
+ (export got-name)
+ (data (quux (dwords 100 200)))
+ (data (pointer (dwords (sym quux)))))))
+ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/r-rm b/test-suite/standalone/sassy/tests/r-rm
new file mode 100644
index 000000000..f5d008f1b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/r-rm
@@ -0,0 +1 @@
+fผุfฝ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/r-rm.asm b/test-suite/standalone/sassy/tests/r-rm.asm
new file mode 100644
index 000000000..939ea0a77
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/r-rm.asm
@@ -0,0 +1,5 @@
+BITS 32
+section .text
+foo:
+bsf bx, ax
+bsr bx, [eax]
diff --git a/test-suite/standalone/sassy/tests/r-rm.scm b/test-suite/standalone/sassy/tests/r-rm.scm
new file mode 100644
index 000000000..17d1bbc41
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/r-rm.scm
@@ -0,0 +1,4 @@
+(
+(bsf bx ax)
+(bsr bx (& eax))
+)
diff --git a/test-suite/standalone/sassy/tests/r-rm16 b/test-suite/standalone/sassy/tests/r-rm16
new file mode 100644
index 000000000..a3896cef0
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/r-rm16
@@ -0,0 +1 @@
+ผุgฝ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/r-rm16.asm b/test-suite/standalone/sassy/tests/r-rm16.asm
new file mode 100644
index 000000000..e0ac880b5
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/r-rm16.asm
@@ -0,0 +1,5 @@
+BITS 16
+section .text
+foo:
+bsf bx, ax
+bsr bx, [eax]
diff --git a/test-suite/standalone/sassy/tests/regenerate.scm b/test-suite/standalone/sassy/tests/regenerate.scm
new file mode 100644
index 000000000..752aed054
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/regenerate.scm
@@ -0,0 +1,2 @@
+(load "tests/generate-nasm.scm")
+(load "tests/generate-prim.scm")
diff --git a/test-suite/standalone/sassy/tests/ret b/test-suite/standalone/sassy/tests/ret
new file mode 100644
index 000000000..7d800b7c4
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/ret
@@ -0,0 +1 @@
+รย่ห \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/ret.asm b/test-suite/standalone/sassy/tests/ret.asm
new file mode 100644
index 000000000..d50a52f82
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/ret.asm
@@ -0,0 +1,6 @@
+BITS 32
+section .text
+foo:
+ret
+retn 1000
+retf
diff --git a/test-suite/standalone/sassy/tests/ret.scm b/test-suite/standalone/sassy/tests/ret.scm
new file mode 100644
index 000000000..2a0fba23b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/ret.scm
@@ -0,0 +1,5 @@
+(
+(ret)
+(retn 1000)
+(retf)
+)
diff --git a/test-suite/standalone/sassy/tests/ret16 b/test-suite/standalone/sassy/tests/ret16
new file mode 100644
index 000000000..7d800b7c4
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/ret16
@@ -0,0 +1 @@
+รย่ห \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/ret16.asm b/test-suite/standalone/sassy/tests/ret16.asm
new file mode 100644
index 000000000..3c9a9cba3
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/ret16.asm
@@ -0,0 +1,6 @@
+BITS 16
+section .text
+foo:
+ret
+retn 1000
+retf
diff --git a/test-suite/standalone/sassy/tests/rm b/test-suite/standalone/sassy/tests/rm
new file mode 100644
index 000000000..facb5cb67
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/rm
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/rm.asm b/test-suite/standalone/sassy/tests/rm.asm
new file mode 100644
index 000000000..f004a8e4a
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/rm.asm
@@ -0,0 +1,8 @@
+BITS 32
+section .text
+foo:
+invlpg [dword 300+8*esi+esp]
+lgdt [dword 300+8*esi+esp]
+sgdt [dword 300+8*esi+esp]
+lidt [dword 300+8*esi+esp]
+sidt [dword 300+8*esi+esp]
diff --git a/test-suite/standalone/sassy/tests/rm.scm b/test-suite/standalone/sassy/tests/rm.scm
new file mode 100644
index 000000000..bf077fda1
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/rm.scm
@@ -0,0 +1,8 @@
+(
+(invlpg (& 200 (* 8 esi) esp 100))
+(lgdt (& 200 (* 8 esi) esp 100))
+(sgdt (& 200 (* 8 esi) esp 100))
+(lidt (& 200 (* 8 esi) esp 100))
+(sidt (& 200 (* 8 esi) esp 100))
+)
+
diff --git a/test-suite/standalone/sassy/tests/rm16 b/test-suite/standalone/sassy/tests/rm16
new file mode 100644
index 000000000..23326523c
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/rm16
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/rm16.asm b/test-suite/standalone/sassy/tests/rm16.asm
new file mode 100644
index 000000000..a1e550a64
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/rm16.asm
@@ -0,0 +1,8 @@
+BITS 16
+section .text
+foo:
+invlpg [dword 300+8*esi+esp]
+lgdt [dword 300+8*esi+esp]
+sgdt [dword 300+8*esi+esp]
+lidt [dword 300+8*esi+esp]
+sidt [dword 300+8*esi+esp]
diff --git a/test-suite/standalone/sassy/tests/rm2 b/test-suite/standalone/sassy/tests/rm2
new file mode 100644
index 000000000..7d325165f
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/rm2
@@ -0,0 +1 @@
+๔$$ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/rm2.asm b/test-suite/standalone/sassy/tests/rm2.asm
new file mode 100644
index 000000000..c5da69740
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/rm2.asm
@@ -0,0 +1,5 @@
+BITS 32
+section .text
+foo:
+lmsw sp
+smsw [esp]
diff --git a/test-suite/standalone/sassy/tests/rm2.scm b/test-suite/standalone/sassy/tests/rm2.scm
new file mode 100644
index 000000000..8f8e297c7
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/rm2.scm
@@ -0,0 +1,4 @@
+(
+(lmsw sp)
+(smsw (& esp))
+)
diff --git a/test-suite/standalone/sassy/tests/rm216 b/test-suite/standalone/sassy/tests/rm216
new file mode 100644
index 000000000..fe1dfb112
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/rm216
@@ -0,0 +1 @@
+๔g$$ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/rm216.asm b/test-suite/standalone/sassy/tests/rm216.asm
new file mode 100644
index 000000000..7c4428f25
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/rm216.asm
@@ -0,0 +1,5 @@
+BITS 16
+section .text
+foo:
+lmsw sp
+smsw [esp]
diff --git a/test-suite/standalone/sassy/tests/run-tests.scm b/test-suite/standalone/sassy/tests/run-tests.scm
new file mode 100644
index 000000000..d10db1e1b
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/run-tests.scm
@@ -0,0 +1,541 @@
+ ;=========================;
+ ; ;
+ ; Sassy test suite ;
+ ; ;
+ ;=========================;
+
+; The three files generate-nasm.scm, generate-prims.scm, and
+; generate-direc.scm generate the baselines for these tests. Of the
+; three, only generate-nasm.scm should really ever be run again unless
+; Sassy's language actually changes, since the corectness of the output
+; for generate-prims and generate-direc has to be verified by hand.
+
+; (generate-nasm generates nasm versions of the Sassy code and assembles
+; them by calling nasm -f bin ??. For mzscheme)
+
+(define %%%include-test '((entry foo)))
+
+(define (sassy-run-tests . args)
+
+ (define (sassy-symbol-get r n)
+ (hash-table-ref (sassy-symbol-table r) n))
+
+ (define (sassy-reloc->list reloc)
+ (list (sassy-reloc-name reloc)
+ (sassy-reloc-section reloc)
+ (sassy-reloc-offset reloc)
+ (sassy-reloc-type reloc)))
+
+ (define (file-chars->list file)
+ (with-input-from-file file
+ (lambda ()
+ (let iter ((new (read-byte)))
+ (if (eof-object? new)
+ '()
+ (cons new (iter (read-byte))))))))
+
+ (define (l->hex lst)
+ (map (lambda (x)
+ (number->string x 16))
+ lst))
+
+ (define (match-lists subl longl)
+ (let iter ((rs subl)
+ (rl longl))
+ (cond ((null? rs) rl)
+ ((= (car rs) (car rl))
+ (iter (cdr rs) (cdr rl)))
+ (else (newline)
+ (display (l->hex subl))
+ (newline)
+ (display (l->hex longl))
+ (newline)
+ #f))))
+
+ (define (match-opcodes l1 l2)
+ (cond ((and (null? l1) (null? l2)) #t)
+ ((or (null? l1) (null? l2)) #f)
+ ((= (car l1) (car l2)) (match-opcodes (cdr l1) (cdr l2)))
+ ;be forgiving about prefixes
+ ((and (not (null? (cdr l1)))
+ (not (null? (cdr l2)))
+ (or (and (= (car l1) #x66) (= (cadr l1) #x67)
+ (= (car l2) #x67) (= (cadr l2) #x66))
+ (and (= (car l1) #x67) (= (cadr l1) #x66)
+ (= (car l2) #x66) (= (cadr l2) #x67))))
+ (match-opcodes (cddr l1) (cddr l2)))
+ (else #f)))
+
+
+ (define (sassy-raw c bits32?)
+ (sassy-text-list
+ (sassy (if bits32?
+ `((text (label foo)
+ (begin ,@c)))
+ `((bits 16)
+ (text (label foo)
+ (begin ,@c)))))))
+
+ (define (succeed x)
+ (display "test passed: ")
+ (display x)
+ (newline))
+
+ (define (fail x)
+ (display "TEST FAILED: ")
+ (display x)
+ (newline))
+
+
+;============================================================================;
+; opcode-test ;
+; ================ ;
+; The opcode tests are fairly exhaustive. Every opcode is tested, and ;
+; every possible successful parse, whether the opcode(s) use a "gen-" ;
+; template or has its own. The output is compared to NASM's. ;
+;============================================================================;
+ (define (opcode-test bits32?)
+ (newline)
+ (for-each
+ (lambda (x)
+ (let* ((the-codes (with-input-from-file x (lambda () (read))))
+ (sassy-res (sassy-raw the-codes bits32?))
+ (nasm-res (file-chars->list
+ (string-append
+ (substring x 0 (- (string-length x) 4))
+ (if bits32? "" "16")))))
+ (if (match-opcodes nasm-res sassy-res)
+ (succeed (if bits32? x (string-append "(16 bit) " x)))
+ (begin (fail (if bits32? x (string-append "(16 bit) " x)))
+ (let iter ((codes the-codes))
+ (let ((foo (match-lists
+ (sassy-raw (list (car codes)) bits32?)
+ nasm-res)))
+ (if foo
+ (begin (set! nasm-res foo)
+ (iter (cdr codes)))
+ (begin (display (car codes))
+ (newline)))))
+ (error "")))))
+ (if bits32?
+ the-opcode-files
+ the-opcode16-files)))
+
+ (define the-opcode-files
+ (list "tests/mem-ref.scm"
+ "tests/non.scm"
+ "tests/alu.scm"
+ "tests/bt.scm"
+ "tests/shift.scm"
+ "tests/setcc.scm"
+ "tests/cmovcc.scm"
+ "tests/decinc.scm"
+ "tests/plier.scm"
+ "tests/load.scm"
+ "tests/movx.scm"
+ "tests/r-rm.scm"
+ "tests/rm.scm"
+ "tests/rm2.scm"
+ "tests/aa.scm"
+ "tests/ret.scm"
+ "tests/doub-shift.scm"
+ "tests/cmpx.scm"
+ "tests/misc1.scm"
+ "tests/misc2.scm"
+ "tests/misc3.scm"
+ "tests/jcc.scm"
+ "tests/jumps.scm"
+ "tests/prefix.scm"
+ "tests/fp0.scm"
+ "tests/fp1.scm"
+ "tests/fp2.scm"
+ "tests/fp3.scm"
+ "tests/mmx.scm"
+ "tests/sse1.scm"
+ "tests/sse2.scm"
+ "tests/sse3.scm"
+ "tests/seg.scm"
+ "tests/brt.scm"
+ ))
+
+ (define the-opcode16-files
+ (list
+ "tests/alu.scm"
+ "tests/bt.scm"
+ "tests/cmpx.scm"
+ "tests/decinc.scm"
+ "tests/doub-shift.scm"
+ "tests/jcc.scm"
+ "tests/jumps.scm"
+ "tests/load.scm"
+ "tests/mem-ref.scm"
+ "tests/misc1.scm"
+ "tests/misc2.scm"
+ "tests/movx.scm"
+ "tests/non.scm"
+ "tests/plier.scm"
+ "tests/prefix.scm"
+ "tests/ret.scm"
+ "tests/rm2.scm"
+ "tests/rm.scm"
+ "tests/r-rm.scm"
+ "tests/setcc.scm"
+ "tests/shift.scm"
+ "tests/seg.scm"))
+
+
+;================================;
+; direc-test ;
+; ========== ;
+; The basic functionality ;
+;================================;
+
+ (define (direc-test)
+ (newline)
+ (test-export)
+ (test-import)
+ (test-heap)
+ (test-misc)
+ (test-data)
+ (test-data-locals)
+ (test-data-reloc))
+
+ (define (test-export)
+ (let ((o (sassy '((export foo quux)
+ (text (label bar (pop eax))
+ (label wizo (push eax)))
+ (export wizo)))))
+ (or (and (eqv? 'export (sassy-symbol-scope (sassy-symbol-get o 'foo)))
+ (eqv? 'export (sassy-symbol-scope (sassy-symbol-get o 'quux)))
+ (eqv? 'export (sassy-symbol-scope (sassy-symbol-get o 'wizo)))
+ (eqv? 'local (sassy-symbol-scope (sassy-symbol-get o 'bar)))
+ (succeed "exports"))
+ (fail "exports"))))
+
+ (define (test-import)
+ (let ((o (sassy '((export bar)
+ (import wizo)
+ (text (label bar (pop eax))
+ (label foo (push edx)))
+ (import qadr)))))
+ (or (and (eqv? 'export (sassy-symbol-scope (sassy-symbol-get o 'bar)))
+ (eqv? 'import (sassy-symbol-scope (sassy-symbol-get o 'wizo)))
+ (eqv? 'import (sassy-symbol-scope (sassy-symbol-get o 'qadr)))
+ (eqv? 'local (sassy-symbol-scope (sassy-symbol-get o 'foo)))
+ (succeed "imports"))
+ (fail "imports"))))
+
+ (define (test-heap)
+ (let ((o (sassy '((heap (align 128)
+ (label foo (bytes 5))
+ (words 32)
+ (align 16)
+ (label bar (dwords 100)))))))
+ (or (and (= 480 (sassy-heap-size o))
+ (= 128 (sassy-heap-align o))
+ (let ((foo-s (sassy-symbol-get o 'foo)))
+ (and (= 0 (sassy-symbol-offset foo-s))
+ (= 5 (sassy-symbol-size foo-s))))
+ (let ((bar-s (sassy-symbol-get o 'bar)))
+ (and (= 80 (sassy-symbol-offset bar-s))
+ (= 400 (sassy-symbol-size bar-s))))
+ (succeed "heap"))
+ (fail "heap"))))
+
+ (define (test-misc)
+ (let ((o (sassy '((org 1000)
+ (include %%%include-test "tests/include.scm")))))
+ (succeed "include")
+ (and (or (and (eqv? 'foo (sassy-entry-point o))
+ (succeed "entry"))
+ (fail "entry"))
+ (or (and (= 1000 (sassy-text-org o))
+ (= 1024 (sassy-symbol-offset (sassy-symbol-get o 'foo)))
+ (succeed "org"))
+ (fail "org"))
+ (or (and (= 32 (sassy-text-align o))
+ (equal? (sassy-text-list o)
+ (append (make-list 24 #x90) (list 80)))
+ (succeed "text-align"))
+ (fail "text-align")))))
+
+ (define (test-data)
+ (let ((o (sassy '((data (label foo (dwords "ab"))
+ (align 8)
+ (label bar (dwords 100 quux))
+ (dwords -3242.52)
+ (qwords -84930284902.48392048)
+ (label quux (dwords -1 #\A bar)))))))
+ (and (or (and (= 40 (sassy-data-size o))
+ (= 8 (sassy-data-align o))
+ (succeed "data-align"))
+ (fail "data-align"))
+ (or (and (= 4 (sassy-symbol-size (sassy-symbol-get o 'foo)))
+ (= 0 (sassy-symbol-offset (sassy-symbol-get o 'foo)))
+ (= 8 (sassy-symbol-size (sassy-symbol-get o 'bar)))
+ (= 8 (sassy-symbol-offset (sassy-symbol-get o 'bar)))
+ (= 12 (sassy-symbol-size (sassy-symbol-get o 'quux)))
+ (= 28 (sassy-symbol-offset (sassy-symbol-get o 'quux)))
+ (equal? (sassy-data-list o)
+ '(97 98 0 0 0 0 0 0 100 0 0 0 28 0 0 0 82
+ 168 74 197 226 123 102 77 61 198 51
+ 194 255 255 255 255 65 0 0 0 8 0 0 0))
+ (succeed "data"))
+ (fail "data")))))
+
+ (define (test-data-locals)
+ (let ((o (sassy '((data
+ (dwords 0)
+ (label foo (dwords "abcd" "efgh"))
+ (locals (foo)
+ (label foo
+ (dwords #xeeeeeeee #xffffffff)
+ (dwords foo)))
+ (dwords foo))))))
+ (if (equal? (sassy-data-list o)
+ '(0 0 0 0 97 98 99 100 101 102 103 104 238 238 238 238 255
+ 255 255 255 12 0 0 0 4 0 0 0))
+ (succeed "data-locals")
+ (fail "data-locals"))))
+
+ (define (test-data-reloc)
+ (let ((o (sassy '((data (dwords 100 (reloc abs $here 8))
+ (label foo (dwords (reloc abs $here)
+ (reloc blah quux))))
+ (text
+ (begin (push eax)
+ (nop)
+ (nop)
+ (nop))
+ (label quux (push edx)))))))
+ (or (and (equal? (sassy-data-list o)
+ '(100 0 0 0 12 0 0 0 8 0 0 0 4 0 0 0))
+ (equal? '(quux data 12 blah)
+ (sassy-reloc->list (car (sassy-reloc-list o))))
+ (equal? '(#f data 8 abs)
+ (sassy-reloc->list (cadr (sassy-reloc-list o))))
+ (equal? '(#f data 4 abs)
+ (sassy-reloc->list (caddr (sassy-reloc-list o))))
+ (succeed "data-reloc"))
+ (fail "data-reloc"))))
+
+;============================================================================;
+; prim-test ;
+; ========= ;
+; A series of several short tests of some probably (hopefully) common ;
+; usage idioms of the primitives. ;
+;============================================================================;
+ (define (prim-test)
+ (newline)
+ (for-each
+ (lambda (x)
+ (let* ((goal (file-chars->list
+ (substring x 0 (- (string-length x) 4))))
+ (source (sassy-text-list (sassy x))))
+ (if (equal? goal source)
+ (succeed x)
+ (begin (fail x)
+ (error "")))))
+ the-prim-files))
+
+ (define the-prim-files
+ (list "tests/prims/seq1.scm"
+ "tests/prims/seq2.scm"
+ "tests/prims/seq3.scm"
+ "tests/prims/alt1.scm"
+ "tests/prims/alt2.scm"
+ "tests/prims/alt3.scm"
+ "tests/prims/alt4.scm"
+ "tests/prims/begin1.scm"
+ "tests/prims/begin2.scm"
+ "tests/prims/begin3.scm"
+ "tests/prims/begin4.scm"
+ "tests/prims/begin5.scm"
+ "tests/prims/if1.scm"
+ "tests/prims/if2.scm"
+ "tests/prims/if3.scm"
+ "tests/prims/if4.scm"
+ "tests/prims/inv1.scm"
+ "tests/prims/inv2.scm"
+ "tests/prims/inv3.scm"
+ "tests/prims/inv4.scm"
+ "tests/prims/inv5.scm"
+ "tests/prims/inv6.scm"
+ "tests/prims/iter1.scm"
+ "tests/prims/iter2.scm"
+ "tests/prims/iter3.scm"
+ "tests/prims/iter4.scm"
+ "tests/prims/iter5.scm"
+ "tests/prims/iter6.scm"
+ "tests/prims/leap-mark1.scm"
+ "tests/prims/leap-mark2.scm"
+ "tests/prims/leap-mark3.scm"
+ "tests/prims/while1.scm"
+ "tests/prims/while2.scm"
+ "tests/prims/while3.scm"
+ "tests/prims/with-win1.scm"
+ "tests/prims/with-win2.scm"
+ "tests/prims/with-win3.scm"
+ "tests/prims/with-win4.scm"
+ "tests/prims/with-win5.scm"
+ "tests/prims/with-lose1.scm"
+ "tests/prims/with-lose2.scm"
+ "tests/prims/with-lose3.scm"
+ "tests/prims/with-win-lose1.scm"
+ "tests/prims/with-win-lose2.scm"
+ "tests/prims/with-win-lose3.scm"
+ "tests/prims/with-win-lose4.scm"
+ "tests/prims/with-win-lose5.scm"
+ "tests/prims/exp-k1.scm"
+ "tests/prims/exp-k2.scm"
+ "tests/prims/exp-k3.scm"
+ "tests/prims/exp-k4.scm"
+ "tests/prims/esc1.scm"
+ "tests/prims/esc2.scm"
+ "tests/prims/esc3.scm"
+ "tests/prims/esc4.scm"
+ "tests/prims/esc5.scm"
+ "tests/prims/esc6.scm"
+ "tests/prims/esc7.scm"
+ "tests/prims/label1.scm"
+ "tests/prims/label2.scm"
+ "tests/prims/label3.scm"
+ "tests/prims/label4.scm"
+ "tests/prims/locals1.scm"
+ "tests/prims/locals2.scm"
+ "tests/prims/locals3.scm"
+ "tests/prims/locals4.scm"
+ "tests/prims/locals5.scm"
+ "tests/prims/locals6.scm"
+ "tests/prims/locals7.scm"
+ "tests/prims/locals8.scm"
+
+
+ "tests/prims16/16alt1.scm"
+ "tests/prims16/16alt2.scm"
+ "tests/prims16/16alt3.scm"
+ "tests/prims16/16alt4.scm"
+ "tests/prims16/16begin1.scm"
+ "tests/prims16/16begin2.scm"
+ "tests/prims16/16begin3.scm"
+ "tests/prims16/16begin4.scm"
+ "tests/prims16/16begin5.scm"
+ "tests/prims16/16if1.scm"
+ "tests/prims16/16if2.scm"
+ "tests/prims16/16if3.scm"
+ "tests/prims16/16if4.scm"
+ "tests/prims16/16inv1.scm"
+ "tests/prims16/16inv2.scm"
+ "tests/prims16/16inv3.scm"
+ "tests/prims16/16inv4.scm"
+ "tests/prims16/16inv5.scm"
+ "tests/prims16/16inv6.scm"
+ "tests/prims16/16iter1.scm"
+ "tests/prims16/16iter2.scm"
+ "tests/prims16/16iter3.scm"
+ "tests/prims16/16iter4.scm"
+ "tests/prims16/16iter5.scm"
+ "tests/prims16/16iter6.scm"
+ "tests/prims16/16exp-k1.scm"
+ "tests/prims16/16exp-k2.scm"
+ "tests/prims16/16exp-k3.scm"
+ "tests/prims16/16exp-k4.scm"
+ "tests/prims16/16label1.scm"
+ "tests/prims16/16label2.scm"
+ "tests/prims16/16label3.scm"
+ "tests/prims16/16label4.scm"
+ "tests/prims16/16leap-mark1.scm"
+ "tests/prims16/16leap-mark2.scm"
+ "tests/prims16/16leap-mark3.scm"
+ "tests/prims16/16locals1.scm"
+ "tests/prims16/16locals2.scm"
+ "tests/prims16/16locals3.scm"
+ "tests/prims16/16locals4.scm"
+ "tests/prims16/16locals5.scm"
+ "tests/prims16/16locals6.scm"
+ "tests/prims16/16locals7.scm"
+ "tests/prims16/16locals8.scm"
+ "tests/prims16/16seq1.scm"
+ "tests/prims16/16seq2.scm"
+ "tests/prims16/16seq3.scm"
+ "tests/prims16/16while1.scm"
+ "tests/prims16/16while2.scm"
+ "tests/prims16/16while3.scm"
+ "tests/prims16/16with-lose1.scm"
+ "tests/prims16/16with-lose2.scm"
+ "tests/prims16/16with-lose3.scm"
+ "tests/prims16/16with-win1.scm"
+ "tests/prims16/16with-win2.scm"
+ "tests/prims16/16with-win3.scm"
+ "tests/prims16/16with-win4.scm"
+ "tests/prims16/16with-win5.scm"
+ "tests/prims16/16with-win-lose1.scm"
+ "tests/prims16/16with-win-lose2.scm"
+ "tests/prims16/16with-win-lose3.scm"
+ "tests/prims16/16with-win-lose4.scm"
+ "tests/prims16/16with-win-lose5.scm"
+
+ ))
+
+;============================================================================;
+; elf-test ;
+; ========= ;
+; A series of several short tests of some probably (hopefully) common ;
+; usage idioms of the primitives. ;
+;============================================================================;
+ (define (elf-test)
+ (newline)
+ (for-each
+ (lambda (x)
+ (let* ((source-name
+ (string-append
+ (substring x 0 (- (string-length x) 4))
+ ".new.o"))
+ (goal (file-chars->list
+ (string-append
+ (substring x 0 (- (string-length x) 4))
+ ".o")))
+ (source (begin (sassy-make-elf source-name
+ (sassy x))
+ (file-chars->list source-name))))
+ (if (equal? goal source)
+ (succeed x)
+ (begin (fail x)
+ (error "")))))
+ the-elf-files))
+
+ (define the-elf-files
+ (list "tests/sysexit.scm"
+ "tests/fac5.scm"
+ "tests/cell.scm"
+
+ "tests/sysexit2.scm" ; static linking
+ "tests/count.scm"
+
+ "tests/libhello.scm" ; dynamic linking
+ "tests/libgoodbye.scm"
+ "tests/hello.scm"
+ "tests/bye.scm"
+
+ "tests/localdata1.scm"
+ "tests/localdata2.scm"
+ "tests/localdata3.scm"
+ "tests/localdata4.scm"
+
+ "tests/sect.scm")) ; sections of anon relocs
+
+ (if (eqv? 'all (car args))
+ (begin (opcode-test #t)
+ (opcode-test #f)
+ (prim-test)
+ (direc-test)
+ (elf-test))
+ (let iter ((r args))
+ (if (not (null? r))
+ (begin (case (car r)
+ ((opcodes) (opcode-test #t))
+ ((opcodes16) (opcode-test #f))
+ ((prims) (prim-test))
+ ((direcs) (direc-test))
+ ((elf) (elf-test)))
+ (iter (cdr r)))))))
diff --git a/test-suite/standalone/sassy/tests/sect.scm b/test-suite/standalone/sassy/tests/sect.scm
new file mode 100644
index 000000000..78f786cda
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/sect.scm
@@ -0,0 +1,9 @@
+(data
+ (label foo
+ (dwords 100 200 300 (reloc abs $here 4))))
+
+(text
+ (label bar
+ (esc ((push $win))
+ (seq (nop)
+ (nop)))))
diff --git a/test-suite/standalone/sassy/tests/seg b/test-suite/standalone/sassy/tests/seg
new file mode 100644
index 000000000..d7b0ab130
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/seg
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/seg.asm b/test-suite/standalone/sassy/tests/seg.asm
new file mode 100644
index 000000000..be0a849fa
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/seg.asm
@@ -0,0 +1,9 @@
+BITS 32
+section .text
+foo:
+mov [es:eax], dword 3
+add edx, [ds:ebx]
+xor ecx, [cs:4+eax]
+push dword [dword es:4]
+sub eax, [dword fs:foo]
+and dword [dword gs:foo+edx], byte 3
diff --git a/test-suite/standalone/sassy/tests/seg.scm b/test-suite/standalone/sassy/tests/seg.scm
new file mode 100644
index 000000000..b9b01a9dc
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/seg.scm
@@ -0,0 +1,8 @@
+(
+(mov (es (& eax)) (dword 3))
+(add edx (ds (& ebx)))
+(xor ecx (cs (& eax 4)))
+(push (dword (es (& 4))))
+(sub eax (fs (& foo)))
+(and (dword (gs (& foo edx))) (byte 3))
+)
diff --git a/test-suite/standalone/sassy/tests/seg16 b/test-suite/standalone/sassy/tests/seg16
new file mode 100644
index 000000000..590459f07
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/seg16
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/seg16.asm b/test-suite/standalone/sassy/tests/seg16.asm
new file mode 100644
index 000000000..e7621df1e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/seg16.asm
@@ -0,0 +1,9 @@
+BITS 16
+section .text
+foo:
+mov [es:eax], dword 3
+add edx, [ds:ebx]
+xor ecx, [cs:4+eax]
+push dword [dword es:4]
+sub eax, [dword fs:foo]
+and dword [dword gs:foo+edx], byte 3
diff --git a/test-suite/standalone/sassy/tests/setcc b/test-suite/standalone/sassy/tests/setcc
new file mode 100644
index 000000000..f139b81cb
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/setcc
@@ -0,0 +1 @@
+ฤ‘0’ฤ’0’ฤ“0“ฤ“0”ฤ”0•ฤ•0–ฤ–0—ฤ—0˜ฤ™0šฤš0›ฤ›0œฤœ0ฤ0žฤž0ŸฤŸ0 \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/setcc.asm b/test-suite/standalone/sassy/tests/setcc.asm
new file mode 100644
index 000000000..57bd2a5ac
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/setcc.asm
@@ -0,0 +1,33 @@
+BITS 32
+section .text
+foo:
+seto ah
+setno [eax+esi*1]
+setb ah
+setc [eax+esi*1]
+setnae ah
+setnb [eax+esi*1]
+setnc ah
+setae [eax+esi*1]
+sete ah
+setz [eax+esi*1]
+setne ah
+setnz [eax+esi*1]
+setbe ah
+setna [eax+esi*1]
+seta ah
+setnbe [eax+esi*1]
+sets ah
+setns [eax+esi*1]
+setp ah
+setpe [eax+esi*1]
+setnp ah
+setpo [eax+esi*1]
+setl ah
+setnge [eax+esi*1]
+setge ah
+setnl [eax+esi*1]
+setle ah
+setng [eax+esi*1]
+setnle ah
+setg [eax+esi*1]
diff --git a/test-suite/standalone/sassy/tests/setcc.scm b/test-suite/standalone/sassy/tests/setcc.scm
new file mode 100644
index 000000000..6e6e77590
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/setcc.scm
@@ -0,0 +1,34 @@
+(
+(seto ah)
+(setno (& eax (* esi 1)))
+(setb ah)
+(setc (& eax (* esi 1)))
+(setnae ah)
+(setnb (& eax (* esi 1)))
+(setnc ah)
+(setae (& eax (* esi 1)))
+(sete ah)
+(setz (& eax (* esi 1)))
+(setne ah)
+(setnz (& eax (* esi 1)))
+(setbe ah)
+(setna (& eax (* esi 1)))
+(seta ah)
+(setnbe (& eax (* esi 1)))
+(sets ah)
+(setns (& eax (* esi 1)))
+(setp ah)
+(setpe (& eax (* esi 1)))
+(setnp ah)
+(setpo (& eax (* esi 1)))
+(setl ah)
+(setnge (& eax (* esi 1)))
+(setge ah)
+(setnl (& eax (* esi 1)))
+(setle ah)
+(setng (& eax (* esi 1)))
+(setnle ah)
+(setg (& eax (* esi 1)))
+)
+
+
diff --git a/test-suite/standalone/sassy/tests/setcc16 b/test-suite/standalone/sassy/tests/setcc16
new file mode 100644
index 000000000..9166c5970
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/setcc16
@@ -0,0 +1 @@
+ฤg‘0’ฤg’0’ฤg“0“ฤg“0”ฤg”0•ฤg•0–ฤg–0—ฤg—0˜ฤg™0šฤgš0›ฤg›0œฤgœ0ฤg0žฤgž0ŸฤgŸ0 \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/setcc16.asm b/test-suite/standalone/sassy/tests/setcc16.asm
new file mode 100644
index 000000000..501e189a3
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/setcc16.asm
@@ -0,0 +1,33 @@
+BITS 16
+section .text
+foo:
+seto ah
+setno [eax+esi*1]
+setb ah
+setc [eax+esi*1]
+setnae ah
+setnb [eax+esi*1]
+setnc ah
+setae [eax+esi*1]
+sete ah
+setz [eax+esi*1]
+setne ah
+setnz [eax+esi*1]
+setbe ah
+setna [eax+esi*1]
+seta ah
+setnbe [eax+esi*1]
+sets ah
+setns [eax+esi*1]
+setp ah
+setpe [eax+esi*1]
+setnp ah
+setpo [eax+esi*1]
+setl ah
+setnge [eax+esi*1]
+setge ah
+setnl [eax+esi*1]
+setle ah
+setng [eax+esi*1]
+setnle ah
+setg [eax+esi*1]
diff --git a/test-suite/standalone/sassy/tests/shift b/test-suite/standalone/sassy/tests/shift
new file mode 100644
index 000000000..309e1527d
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/shift
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/shift.asm b/test-suite/standalone/sassy/tests/shift.asm
new file mode 100644
index 000000000..0e0843df6
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/shift.asm
@@ -0,0 +1,5 @@
+BITS 32
+section .text
+foo:
+rcl ebp, 1
+rcr dword [dword 1000+eax], 1
diff --git a/test-suite/standalone/sassy/tests/shift.scm b/test-suite/standalone/sassy/tests/shift.scm
new file mode 100644
index 000000000..c7730a234
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/shift.scm
@@ -0,0 +1,20 @@
+(
+(rcl ebp 1)
+(rcr (dword (& eax 1000)) 1))
+(rol ebp cl)
+(ror (dword (& eax 1000)) cl)
+(sal ebp 9)
+(sar (dword (& eax 1000)) (byte 9)))
+(shl dh 1)
+(shr (byte (& ecx ebx)) 1)
+(rcl dh cl)
+(rcr (byte (& ecx ebx)) cl)
+(rol dh 9)
+(ror (byte (& ecx ebx)) 9)
+(sal bx 1)
+(sar (word (& 1000)) 1)
+(shl bx cl)
+(shr (word (& 1000)) cl)
+(rcl bx 9)
+(rcr (word (& 1000)) 9)
+) \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/shift16 b/test-suite/standalone/sassy/tests/shift16
new file mode 100644
index 000000000..c7463d904
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/shift16
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/shift16.asm b/test-suite/standalone/sassy/tests/shift16.asm
new file mode 100644
index 000000000..06a8f5dde
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/shift16.asm
@@ -0,0 +1,5 @@
+BITS 16
+section .text
+foo:
+rcl ebp, 1
+rcr dword [dword 1000+eax], 1
diff --git a/test-suite/standalone/sassy/tests/sse1 b/test-suite/standalone/sassy/tests/sse1
new file mode 100644
index 000000000..b91814643
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/sse1
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/sse1.asm b/test-suite/standalone/sassy/tests/sse1.asm
new file mode 100644
index 000000000..e175770ef
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/sse1.asm
@@ -0,0 +1,81 @@
+BITS 32
+section .text
+foo:
+movaps xmm5, xmm4
+movups xmm3, [edx]
+movaps [edx], xmm2
+movups xmm5, xmm4
+addps xmm3, xmm0
+subps xmm0, [edx]
+mulps xmm3, xmm0
+divps xmm0, [edx]
+rcpps xmm3, xmm0
+sqrtps xmm0, [edx]
+rsqrtps xmm3, xmm0
+maxps xmm0, [edx]
+minps xmm3, xmm0
+andps xmm0, [edx]
+andnps xmm3, xmm0
+orps xmm0, [edx]
+xorps xmm3, xmm0
+unpckhps xmm0, [edx]
+unpcklps xmm3, xmm0
+addss xmm0, xmm1
+subss xmm0, [eax]
+mulss xmm0, xmm1
+divss xmm0, [eax]
+rcpss xmm0, xmm1
+sqrtss xmm0, [eax]
+rsqrtss xmm0, xmm1
+maxss xmm0, [eax]
+minss xmm0, xmm1
+comiss xmm0, [eax]
+ucomiss xmm0, xmm1
+pavgb mm0, mm1
+pavgw mm2, [edx]
+pmaxub xmm3, xmm4
+pmaxsw xmm5, [edx]
+pminub mm0, mm1
+pminsw mm2, [edx]
+pmulhuw xmm3, xmm4
+psadbw xmm5, [edx]
+movhps xmm0, [edx]
+movlps [edx], xmm6
+movhlps xmm0, xmm1
+movlhps xmm1, xmm0
+shufps xmm0, xmm6, 10
+cmpps xmm5, [ecx], 20
+prefetcht0 [eax]
+prefetcht1 [eax]
+prefetcht2 [eax]
+prefetchnta [eax]
+sfence
+movntps [ecx], xmm3
+maskmovq mm3, mm4
+movntq [ebx], mm7
+pmovmskb eax, mm0
+pmovmskb ecx, xmm5
+pshufw mm0, mm1, 40
+pshufw mm0, [ebx], 30
+ldmxcsr [ebx]
+stmxcsr [edx]
+pinsrw mm1, eax, 4
+pinsrw mm0, [edx], 5
+pinsrw xmm4, ebx, 6
+pinsrw xmm3, [ecx], 7
+pextrw edx, mm3, 28
+pextrw esi, mm0, 14
+cvtsi2ss xmm3, edi
+cvtsi2ss xmm3, [edi]
+cvtpi2ps xmm4, mm2
+cvtpi2ps xmm4, [100+edi]
+movss xmm1, [edx]
+movss xmm1, xmm6
+movss [edx], xmm3
+movmskps ebx, xmm3
+cmpss xmm3, xmm4, 10
+cmpss xmm3, [edx], 20
+cvttss2si ebx, xmm3
+cvtss2si eax, [ecx]
+cvtps2pi mm3, xmm1
+cvttps2pi mm4, [edx]
diff --git a/test-suite/standalone/sassy/tests/sse1.scm b/test-suite/standalone/sassy/tests/sse1.scm
new file mode 100644
index 000000000..a498e2aef
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/sse1.scm
@@ -0,0 +1,81 @@
+(
+(movaps xmm5 xmm4)
+(movups xmm3 (& edx))
+(movaps (& edx) xmm2)
+(movups xmm5 xmm4)
+(addps xmm3 xmm0)
+(subps xmm0 (& edx))
+(mulps xmm3 xmm0)
+(divps xmm0 (& edx))
+(rcpps xmm3 xmm0)
+(sqrtps xmm0 (& edx))
+(rsqrtps xmm3 xmm0)
+(maxps xmm0 (& edx))
+(minps xmm3 xmm0)
+(andps xmm0 (& edx))
+(andnps xmm3 xmm0)
+(orps xmm0 (& edx))
+(xorps xmm3 xmm0)
+(unpckhps xmm0 (& edx))
+(unpcklps xmm3 xmm0)
+(addss xmm0 xmm1)
+(subss xmm0 (& eax))
+(mulss xmm0 xmm1)
+(divss xmm0 (& eax))
+(rcpss xmm0 xmm1)
+(sqrtss xmm0 (& eax))
+(rsqrtss xmm0 xmm1)
+(maxss xmm0 (& eax))
+(minss xmm0 xmm1)
+(comiss xmm0 (& eax))
+(ucomiss xmm0 xmm1)
+(pavgb mm0 mm1)
+(pavgw mm2 (& edx))
+(pmaxub xmm3 xmm4)
+(pmaxsw xmm5 (& edx))
+(pminub mm0 mm1)
+(pminsw mm2 (& edx))
+(pmulhuw xmm3 xmm4)
+(psadbw xmm5 (& edx))
+(movhps xmm0 (& edx))
+(movlps (& edx) xmm6)
+(movhlps xmm0 xmm1)
+(movlhps xmm1 xmm0)
+(shufps xmm0 xmm6 10)
+(cmpps xmm5 (& ecx) 20)
+(prefetcht0 (& eax))
+(prefetcht1 (& eax))
+(prefetcht2 (& eax))
+(prefetchnta (& eax))
+(sfence)
+(movntps (& ecx) xmm3)
+(maskmovq mm3 mm4)
+(movntq (& ebx) mm7)
+(pmovmskb eax mm0)
+(pmovmskb ecx xmm5)
+(pshufw mm0 mm1 40)
+(pshufw mm0 (& ebx) 30)
+(ldmxcsr (& ebx))
+(stmxcsr (& edx))
+(pinsrw mm1 eax 4)
+(pinsrw mm0 (& edx) 5)
+(pinsrw xmm4 ebx 6)
+(pinsrw xmm3 (& ecx) 7)
+(pextrw edx mm3 28)
+(pextrw esi mm0 14)
+(cvtsi2ss xmm3 edi)
+(cvtsi2ss xmm3 (& edi))
+(cvtpi2ps xmm4 mm2)
+(cvtpi2ps xmm4 (& edi 100))
+(movss xmm1 (& edx))
+(movss xmm1 xmm6)
+(movss (& edx) xmm3)
+(movmskps ebx xmm3)
+(cmpss xmm3 xmm4 10)
+(cmpss xmm3 (& edx) 20)
+(cvttss2si ebx xmm3)
+(cvtss2si eax (& ecx))
+(cvtps2pi mm3 xmm1)
+(cvttps2pi mm4 (& edx))
+)
+
diff --git a/test-suite/standalone/sassy/tests/sse2 b/test-suite/standalone/sassy/tests/sse2
new file mode 100644
index 000000000..3d93abb09
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/sse2
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/sse2.asm b/test-suite/standalone/sassy/tests/sse2.asm
new file mode 100644
index 000000000..654d64cf6
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/sse2.asm
@@ -0,0 +1,79 @@
+BITS 32
+section .text
+foo:
+movapd xmm0, xmm1
+movupd xmm2, [edx]
+movdqa [eax], xmm3
+movdqu xmm0, xmm1
+movhpd xmm0, [ecx]
+movmskpd ebx, xmm4
+movlpd [ecx], xmm0
+movsd xmm5, xmm6
+movsd xmm7, [esi]
+movsd [esi], xmm7
+addpd xmm0, xmm1
+subpd xmm2, [ecx]
+mulpd xmm0, xmm1
+divpd xmm2, [ecx]
+sqrtpd xmm0, xmm1
+maxpd xmm2, [ecx]
+minpd xmm0, xmm1
+andpd xmm2, [ecx]
+andnpd xmm0, xmm1
+orpd xmm2, [ecx]
+xorpd xmm0, xmm1
+unpckhpd xmm2, [ecx]
+unpcklpd xmm0, xmm1
+cvtpd2dq xmm2, [ecx]
+cvttpd2dq xmm0, xmm1
+cvtdq2ps xmm2, [ecx]
+cvtps2dq xmm0, xmm1
+cvttps2dq xmm2, [ecx]
+cvtpd2ps xmm0, xmm1
+punpckhqdq xmm2, [ecx]
+punpcklqdq xmm0, xmm1
+addsd xmm2, xmm3
+subsd xmm4, [edi]
+mulsd xmm2, xmm3
+divsd xmm4, [edi]
+maxsd xmm2, xmm3
+minsd xmm4, [edi]
+sqrtsd xmm2, xmm3
+comisd xmm4, [edi]
+ucomisd xmm2, xmm3
+cvtdq2pd xmm4, [edi]
+cvtps2pd xmm2, xmm3
+cvtsd2ss xmm4, [edi]
+cmppd xmm0, xmm1, 10
+shufpd xmm2, [ebx], 20
+pshuflw xmm0, xmm1, 10
+pshufhw xmm2, [ebx], 20
+pshufd xmm0, xmm1, 10
+cmpsd xmm4, xmm5, 20
+cmpsd xmm6, [eax], 30
+cvttpd2pi mm0, xmm1
+cvtpd2pi mm0, [ebp]
+pause
+lfence
+mfence
+clflush [ebx]
+pmuludq mm0, mm1
+paddq mm0, [edx]
+psubq xmm3, xmm1
+pmuludq xmm3, [edx]
+maskmovdqu xmm1, xmm2
+movnti [edx], eax
+movq2dq xmm3, mm4
+movdq2q mm5, xmm7
+movntpd [eax], xmm3
+movntdq [ebx], xmm4
+pslldq xmm3, 20
+psrldq xmm3, 20
+cvtpi2pd xmm3, mm4
+cvtpi2pd xmm3, [ecx]
+cvtss2sd xmm3, xmm6
+cvtss2sd xmm3, [edx]
+cvtsd2si ecx, xmm3
+cvttsd2si edx, [edx]
+cvtsi2sd xmm3, eax
+cvtsi2sd xmm3, [eax]
diff --git a/test-suite/standalone/sassy/tests/sse2.scm b/test-suite/standalone/sassy/tests/sse2.scm
new file mode 100644
index 000000000..24c35311e
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/sse2.scm
@@ -0,0 +1,78 @@
+(
+(movapd xmm0 xmm1)
+(movupd xmm2 (& edx))
+(movdqa (& eax) xmm3)
+(movdqu xmm0 xmm1)
+(movhpd xmm0 (& ecx))
+(movmskpd ebx xmm4)
+(movlpd (& ecx) xmm0)
+(movsd xmm5 xmm6)
+(movsd xmm7 (& esi))
+(movsd (& esi) xmm7)
+(addpd xmm0 xmm1)
+(subpd xmm2 (& ecx))
+(mulpd xmm0 xmm1)
+(divpd xmm2 (& ecx))
+(sqrtpd xmm0 xmm1)
+(maxpd xmm2 (& ecx))
+(minpd xmm0 xmm1)
+(andpd xmm2 (& ecx))
+(andnpd xmm0 xmm1)
+(orpd xmm2 (& ecx))
+(xorpd xmm0 xmm1)
+(unpckhpd xmm2 (& ecx))
+(unpcklpd xmm0 xmm1)
+(cvtpd2dq xmm2 (& ecx))
+(cvttpd2dq xmm0 xmm1)
+(cvtdq2ps xmm2 (& ecx))
+(cvtps2dq xmm0 xmm1)
+(cvttps2dq xmm2 (& ecx))
+(cvtpd2ps xmm0 xmm1)
+(punpckhqdq xmm2 (& ecx))
+(punpcklqdq xmm0 xmm1)
+(addsd xmm2 xmm3)
+(subsd xmm4 (& edi))
+(mulsd xmm2 xmm3)
+(divsd xmm4 (& edi))
+(maxsd xmm2 xmm3)
+(minsd xmm4 (& edi))
+(sqrtsd xmm2 xmm3)
+(comisd xmm4 (& edi))
+(ucomisd xmm2 xmm3)
+(cvtdq2pd xmm4 (& edi))
+(cvtps2pd xmm2 xmm3)
+(cvtsd2ss xmm4 (& edi))
+(cmppd xmm0 xmm1 10)
+(shufpd xmm2 (& ebx) 20)
+(pshuflw xmm0 xmm1 10)
+(pshufhw xmm2 (& ebx) 20)
+(pshufd xmm0 xmm1 10)
+(cmpsd xmm4 xmm5 20)
+(cmpsd xmm6 (& eax) 30)
+(cvttpd2pi mm0 xmm1)
+(cvtpd2pi mm0 (& ebp))
+(pause)
+(lfence)
+(mfence)
+(clflush (& ebx))
+(pmuludq mm0 mm1)
+(paddq mm0 (& edx))
+(psubq xmm3 xmm1)
+(pmuludq xmm3 (& edx))
+(maskmovdqu xmm1 xmm2)
+(movnti (& edx) eax)
+(movq2dq xmm3 mm4)
+(movdq2q mm5 xmm7)
+(movntpd (& eax) xmm3)
+(movntdq (& ebx) xmm4)
+(pslldq xmm3 20)
+(psrldq xmm3 20)
+(cvtpi2pd xmm3 mm4)
+(cvtpi2pd xmm3 (& ecx))
+(cvtss2sd xmm3 xmm6)
+(cvtss2sd xmm3 (& edx))
+(cvtsd2si ecx xmm3)
+(cvttsd2si edx (& edx))
+(cvtsi2sd xmm3 eax)
+(cvtsi2sd xmm3 (& eax))
+)
diff --git a/test-suite/standalone/sassy/tests/sse3 b/test-suite/standalone/sassy/tests/sse3
new file mode 100644
index 000000000..75919c3f4
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/sse3
@@ -0,0 +1 @@
+ศษ๒๐๒ม๒ะมfะ๒|ม๒}f|มf}๓ม๓๒ \ No newline at end of file
diff --git a/test-suite/standalone/sassy/tests/sse3.asm b/test-suite/standalone/sassy/tests/sse3.asm
new file mode 100644
index 000000000..d3976a011
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/sse3.asm
@@ -0,0 +1,16 @@
+BITS 32
+section .text
+foo:
+monitor
+mwait
+lddqu xmm0, [edx]
+movddup xmm0, xmm1
+addsubps xmm0, xmm1
+addsubpd xmm2, [edx]
+haddps xmm0, xmm1
+hsubps xmm2, [edx]
+haddpd xmm0, xmm1
+hsubpd xmm2, [edx]
+movshdup xmm0, xmm1
+movsldup xmm2, [edx]
+movddup xmm0, [edx]
diff --git a/test-suite/standalone/sassy/tests/sse3.scm b/test-suite/standalone/sassy/tests/sse3.scm
new file mode 100644
index 000000000..20529d7fc
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/sse3.scm
@@ -0,0 +1,18 @@
+(
+(monitor)
+(mwait)
+(lddqu xmm0 (& edx))
+; (fisttp (dword (& edx))) nasm, ndisasm, and objdump all disagree about these
+; (fisttp (word (& edx))) but I've double checked, and they should be right
+; (fisttp (qword (& edx))) (unless the INTEL documentation is wrong)
+(movddup xmm0 xmm1)
+(addsubps xmm0 xmm1)
+(addsubpd xmm2 (& edx))
+(haddps xmm0 xmm1)
+(hsubps xmm2 (& edx))
+(haddpd xmm0 xmm1)
+(hsubpd xmm2 (& edx))
+(movshdup xmm0 xmm1)
+(movsldup xmm2 (& edx))
+(movddup xmm0 (& edx))
+)
diff --git a/test-suite/standalone/sassy/tests/sysexit b/test-suite/standalone/sassy/tests/sysexit
new file mode 100644
index 000000000..5365a2c61
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/sysexit
Binary files differ
diff --git a/test-suite/standalone/sassy/tests/sysexit.scm b/test-suite/standalone/sassy/tests/sysexit.scm
new file mode 100644
index 000000000..f22c1b2b8
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/sysexit.scm
@@ -0,0 +1,8 @@
+(entry _start)
+
+(text
+ (label _start
+ (begin
+ (mov eax 1)
+ (mov ebx 0)
+ (int #x80))))
diff --git a/test-suite/standalone/sassy/tests/sysexit2.scm b/test-suite/standalone/sassy/tests/sysexit2.scm
new file mode 100644
index 000000000..88369ce58
--- /dev/null
+++ b/test-suite/standalone/sassy/tests/sysexit2.scm
@@ -0,0 +1,11 @@
+(export exit mybuff)
+
+(heap (label mybuff (bytes 1)))
+
+(import exit-code)
+
+(text
+ (label exit (begin
+ (mov eax 1)
+ (mov ebx (& exit-code))
+ (int #x80))))