mirror of
https://github.com/icicle-emu/icicle-python
synced 2026-06-21 13:53:41 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e62b6a9622 |
@@ -2728,7 +2728,8 @@ enterFrames: low5 is low5 { tmp:1 = low5; export tmp; }
|
||||
# as a NOP. We treat it as a NOP as well.
|
||||
:FSETPM is vexMode=0 & byte=0xdb; byte=0xe4 { } # 80287 set protected mode
|
||||
|
||||
:HLT is vexMode=0 & byte=0xf4 { goto inst_start; }
|
||||
define pcodeop hlt;
|
||||
:HLT is vexMode=0 & byte=0xf4 { hlt(); }
|
||||
|
||||
:IDIV rm8 is vexMode=0 & byte=0xf6; rm8 & reg_opcode=7 ... { rm8ext:2 = sext(rm8);
|
||||
local quotient = AX s/ rm8ext; # DE exception if quotient doesn't fit in AL
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
from icicle import *
|
||||
|
||||
def hlt():
|
||||
vm = Icicle("x86_64", jit=False, tracing=True)
|
||||
page = 0x10000
|
||||
vm.mem_map(page, 0x1000, MemoryProtection.ExecuteRead)
|
||||
vm.mem_write(page, b"\xF4\xEB\xFE")
|
||||
vm.reg_write("rip", page)
|
||||
status = vm.step(1000)
|
||||
print(status, vm.exception_code)
|
||||
print(hex(vm.reg_read("rip")))
|
||||
|
||||
def main():
|
||||
hlt()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user