Major dos_core.sg extension for Wolf3D real-mode acceptance (Phase 1): MZ .EXE loader with relocation fixups, full string-op REP/REPE/REPNE prefixes, multiply/divide group, 8-bit arithmetic, and extensive opcode coverage for the Wolf3D engine's code patterns.
MZ .EXE loader
MZ EXE parser
Header parse + relocation + entry point — parses MZ header, copies image past header to load segment
0x1000, applies relocation table fixups (segment:offset pairs), sets CS:IP and SS:SP from header fields. Auto-detects MZ magic (0x4D5A) vs .COM fallback (load at 0x100).New opcode groups
REP/REPE/REPNE
String op prefixes — REP prefix for all string ops (MOVSB/W, STOSB/W, LODSB) with CX countdown. REPE/REPNE for CMPSB, SCASB with ZF exit conditions. Wolf3D uses REP MOVSW heavily for VGA buffer copies.
MUL/IMUL/DIV/IDIV
Multiply/divide group — IMUL r16,r/m16 (0F AF), 3-operand IMUL (69/6B). DIV/IDIV r/m8 and r/m16 (F6/F7 /6 /7). MUL/NOT/NEG/TEST r/m8 (F6 group). Full F7 group: TEST/NOT/NEG/MUL/IMUL/DIV/IDIV r/m16.
8-bit arithmetic
ADD/SUB/CMP/AND/OR/XOR r/m8 — 00-3A range 8-bit register-register and register-memory. 80h group: ADD/OR/AND/SUB/XOR/CMP r/m8,imm8. TEST r/m8 r8 (84), TEST r/m16 r16 (85), TEST AL/AX imm (A8/A9). XCHG r/m16 r16 (87), MOV seg r/m16 (8E/8C).