From bc182ae559580d4d2cde6d5c5e8ed3bb5906bdb5 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 15 Mar 2021 21:22:30 -0700 Subject: boot.subx is now clean SubX --- linux/pack.subx | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'linux/pack.subx') diff --git a/linux/pack.subx b/linux/pack.subx index b619712a..d6ff7af5 100644 --- a/linux/pack.subx +++ b/linux/pack.subx @@ -1977,6 +1977,8 @@ emit-opcodes: # line: (addr stream byte), out: (addr buffered-file) # f3 xx # f2 0f xx # f3 0f xx + # 66 xx (hacky support for boot.subx) + # db xx (hacky support for boot.subx) # # pseudocode: # rewind-stream(line) @@ -1985,7 +1987,7 @@ emit-opcodes: # line: (addr stream byte), out: (addr buffered-file) # if (slice-empty?(op1) || slice-starts-with?(op1, "#")) return # op1 = next-token-from-slice(op1->start, op1->end, "/") # write-slice-buffered(out, op1) - # if !slice-equal?(op1, "0f") && !slice-equal?(op1, "f2") && !slice-equal?(op1, "f3") + # if !slice-equal?(op1, "0f") && !slice-equal?(op1, "f2") && !slice-equal?(op1, "f3") && !slice-equal?(op1, "66") && !slice-equal?(op1, "db") # return # # var op2 = next-word(line) @@ -2116,6 +2118,30 @@ $emit-opcodes:op1: # . if (eax != false) goto op2 3d/compare-eax-and 0/imm32/false 75/jump-if-!= $emit-opcodes:op2/disp8 + # if (slice-equal?(op1, "66")) goto op2 + # . eax = slice-equal?(op1, "66") + # . . push args + 68/push "66"/imm32 + 51/push-ecx + # . . call + e8/call slice-equal?/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp + # . if (eax != false) goto op2 + 3d/compare-eax-and 0/imm32/false + 75/jump-if-!= $emit-opcodes:op2/disp8 + # if (slice-equal?(op1, "db")) goto op2 + # . eax = slice-equal?(op1, "db") + # . . push args + 68/push "db"/imm32 + 51/push-ecx + # . . call + e8/call slice-equal?/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp + # . if (eax != false) goto op2 + 3d/compare-eax-and 0/imm32/false + 75/jump-if-!= $emit-opcodes:op2/disp8 # otherwise return e9/jump $emit-opcodes:end/disp32 $emit-opcodes:op2: -- cgit 1.4.1-2-gfad0 site/blame/?id=bcb215c3a7e914d05f166846a33860e48bba64fb'>root/wiki/data/cache/a/a644499e91b18989ac47a40900dffb28.metadata
blob: 7a4e94782bce3d234b470345bffdbdff8f5d8b1a (plain) (tree)
1