5415
Bugfix thirteen: displacement calculations were wrong because current offset was not being updated properly as words were being read and emitted. Now 10/12 example programs are translated correctly.
This commit is contained in:
parent
7fe1e24349
commit
5030d67c85
|
@ -340,16 +340,16 @@ runnable on a Linux system running on Intel x86 processors, either 32- or
|
|||
* Bootstrapping a SubX-\>ELF translator in SubX
|
||||
✓ examples/ex1
|
||||
✓ examples/ex2
|
||||
- examples/ex3
|
||||
✓ examples/ex3
|
||||
✓ examples/ex4
|
||||
- examples/ex5
|
||||
✓ examples/ex5
|
||||
- examples/ex6
|
||||
✓ examples/ex7
|
||||
- examples/ex8
|
||||
- examples/ex9
|
||||
- examples/ex10
|
||||
✓ examples/ex8
|
||||
✓ examples/ex9
|
||||
✓ examples/ex10
|
||||
- examples/ex11
|
||||
- examples/ex12
|
||||
✓ examples/ex12
|
||||
- apps/factorial.subx
|
||||
- apps/crenshaw2-1.subx
|
||||
- apps/crenshaw2-1b.subx
|
||||
|
|
BIN
subx/apps/survey
BIN
subx/apps/survey
Binary file not shown.
|
@ -1884,8 +1884,8 @@ $emit-segments:check0:
|
|||
e8/call num-bytes/disp32
|
||||
# . . discard args
|
||||
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP
|
||||
# . EBX = EAX
|
||||
89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to EBX
|
||||
# . EBX += EAX
|
||||
01/add 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . . # add EAX to EBX
|
||||
$emit-segments:word-loop:
|
||||
# next-word(line, word-slice)
|
||||
# . . push args
|
||||
|
|
|
@ -240,16 +240,64 @@ test `uname` = 'Linux' && {
|
|||
cat examples/ex2.subx |apps/dquotes |apps/assort |apps/pack |apps/survey |apps/hex |diff examples/ex2 -
|
||||
}
|
||||
|
||||
echo ex3
|
||||
cat examples/ex3.subx |./subx_bin run apps/dquotes |./subx_bin run apps/assort |./subx_bin run apps/pack |./subx_bin run apps/survey |./subx_bin run apps/hex |diff examples/ex3 -
|
||||
test `uname` = 'Linux' && {
|
||||
cat examples/ex3.subx |apps/dquotes |apps/assort |apps/pack |apps/survey |apps/hex |diff examples/ex3 -
|
||||
}
|
||||
|
||||
echo ex4
|
||||
cat examples/ex4.subx |./subx_bin run apps/dquotes |./subx_bin run apps/assort |./subx_bin run apps/pack |./subx_bin run apps/survey |./subx_bin run apps/hex |diff examples/ex4 -
|
||||
test `uname` = 'Linux' && {
|
||||
cat examples/ex4.subx |apps/dquotes |apps/assort |apps/pack |apps/survey |apps/hex |diff examples/ex4 -
|
||||
}
|
||||
|
||||
echo ex5
|
||||
cat examples/ex5.subx |./subx_bin run apps/dquotes |./subx_bin run apps/assort |./subx_bin run apps/pack |./subx_bin run apps/survey |./subx_bin run apps/hex |diff examples/ex5 -
|
||||
test `uname` = 'Linux' && {
|
||||
cat examples/ex5.subx |apps/dquotes |apps/assort |apps/pack |apps/survey |apps/hex |diff examples/ex5 -
|
||||
}
|
||||
|
||||
#? echo ex6
|
||||
#? cat examples/ex6.subx |./subx_bin run apps/dquotes |./subx_bin run apps/assort |./subx_bin run apps/pack |./subx_bin run apps/survey |./subx_bin run apps/hex |diff examples/ex6 -
|
||||
#? test `uname` = 'Linux' && {
|
||||
#? cat examples/ex6.subx |apps/dquotes |apps/assort |apps/pack |apps/survey |apps/hex |diff examples/ex6 -
|
||||
#? }
|
||||
|
||||
echo ex7
|
||||
cat examples/ex7.subx |./subx_bin run apps/dquotes |./subx_bin run apps/assort |./subx_bin run apps/pack |./subx_bin run apps/survey |./subx_bin run apps/hex |diff examples/ex7 -
|
||||
test `uname` = 'Linux' && {
|
||||
cat examples/ex7.subx |apps/dquotes |apps/assort |apps/pack |apps/survey |apps/hex |diff examples/ex7 -
|
||||
}
|
||||
|
||||
echo ex8
|
||||
cat examples/ex8.subx |./subx_bin run apps/dquotes |./subx_bin run apps/assort |./subx_bin run apps/pack |./subx_bin run apps/survey |./subx_bin run apps/hex |diff examples/ex8 -
|
||||
test `uname` = 'Linux' && {
|
||||
cat examples/ex8.subx |apps/dquotes |apps/assort |apps/pack |apps/survey |apps/hex |diff examples/ex8 -
|
||||
}
|
||||
|
||||
echo ex9
|
||||
cat examples/ex9.subx |./subx_bin run apps/dquotes |./subx_bin run apps/assort |./subx_bin run apps/pack |./subx_bin run apps/survey |./subx_bin run apps/hex |diff examples/ex9 -
|
||||
test `uname` = 'Linux' && {
|
||||
cat examples/ex9.subx |apps/dquotes |apps/assort |apps/pack |apps/survey |apps/hex |diff examples/ex9 -
|
||||
}
|
||||
|
||||
echo ex10
|
||||
cat examples/ex10.subx |./subx_bin run apps/dquotes |./subx_bin run apps/assort |./subx_bin run apps/pack |./subx_bin run apps/survey |./subx_bin run apps/hex |diff examples/ex10 -
|
||||
test `uname` = 'Linux' && {
|
||||
cat examples/ex10.subx |apps/dquotes |apps/assort |apps/pack |apps/survey |apps/hex |diff examples/ex10 -
|
||||
}
|
||||
|
||||
#? echo ex11
|
||||
#? cat examples/ex11.subx |./subx_bin run apps/dquotes |./subx_bin run apps/assort |./subx_bin run apps/pack |./subx_bin run apps/survey |./subx_bin run apps/hex |diff examples/ex11 -
|
||||
#? test `uname` = 'Linux' && {
|
||||
#? cat examples/ex11.subx |apps/dquotes |apps/assort |apps/pack |apps/survey |apps/hex |diff examples/ex11 -
|
||||
#? }
|
||||
|
||||
echo ex12
|
||||
cat examples/ex12.subx |./subx_bin run apps/dquotes |./subx_bin run apps/assort |./subx_bin run apps/pack |./subx_bin run apps/survey |./subx_bin run apps/hex |diff examples/ex12 -
|
||||
test `uname` = 'Linux' && {
|
||||
cat examples/ex12.subx |apps/dquotes |apps/assort |apps/pack |apps/survey |apps/hex |diff examples/ex12 -
|
||||
}
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Reference in New Issue