789 Commits

Author SHA1 Message Date
Theodore Dubois
6c35aa18a0 Implement movzx 2018-05-22 15:39:40 -07:00
Theodore Dubois
1c21407897 Sign extend arithmetic result 2018-05-22 15:38:03 -07:00
Theodore Dubois
3c0c9f8601 Make operation sizes great again 2018-05-22 15:32:22 -07:00
Theodore Dubois
bc0c9d8c30 Compile pop 2018-05-15 19:08:08 -07:00
Theodore Dubois
d55a12fbd2 Make 8-bit memory operations happen 2018-05-15 19:06:08 -07:00
Theodore Dubois
62b25f4f33 Upgrade the compiler to use sized tokens 2018-05-15 16:16:27 -07:00
Theodore Dubois
21fb9b2ca7 Fix the sizes on scas and cmps 2018-05-15 15:53:50 -07:00
Theodore Dubois
f3a1775bfe Use sized tokens in decoder and interpreter 2018-05-15 12:19:51 -07:00
Theodore Dubois
a6c9213f46 Care about instruction size in codegen 2018-05-14 11:54:46 -07:00
Theodore Dubois
04cc913473 Correctly update AF for boolean operations 2018-05-13 18:56:14 -07:00
Theodore Dubois
8d97f89d03 Implement unconditional jumps 2018-05-13 18:31:32 -07:00
Theodore Dubois
3a2741afdf Implement ja (jump if carry or zero) 2018-05-13 18:18:11 -07:00
Theodore Dubois
3021ae81f6 Don't crash when generating a nonexistent gadget 2018-05-13 18:05:57 -07:00
Theodore Dubois
c0b76b1b79 Implement test 2018-05-13 18:01:59 -07:00
Theodore Dubois
183f4654aa Correctly set operands for AF 2018-05-13 17:18:22 -07:00
Theodore Dubois
16b45bef6f Don't let inc/dec modify CF 2018-05-13 17:12:30 -07:00
Theodore Dubois
c5f3627e4b Get jz working 2018-05-13 16:48:30 -07:00
Theodore Dubois
fb27d9352d Implement SIB addressing in JIT 2018-05-13 15:52:26 -07:00
Theodore Dubois
7a3a99a190 Implement some limited flag handling 2018-05-13 15:39:05 -07:00
Theodore Dubois
816ed1177e Store OF and CF as bytes for improved efficiency 2018-05-13 14:26:38 -07:00
Theodore Dubois
35b6316ae5 Compile inc and dec 2018-05-12 19:48:22 -07:00
Theodore Dubois
68ae5a5122 Use realloc instead of malloc to resize blocks 2018-05-12 19:46:55 -07:00
Theodore Dubois
787fa2870c Add a bunch of math gadgets 2018-05-12 19:46:45 -07:00
Theodore Dubois
18b71e49b0 Write a cool nested loop that generates all the gadgets for me 2018-05-12 19:04:14 -07:00
Theodore Dubois
3d5ce06f49 Implement store_mem32 gadget 2018-05-12 18:53:33 -07:00
Theodore Dubois
a2002aea55 Truncate the interrupt number to 8 bits 2018-05-12 18:52:28 -07:00
Theodore Dubois
9bb4092e1b Compile interrupt instruction 2018-05-12 16:05:25 -07:00
Theodore Dubois
d6adc41ff7 Implement load_addr and use to compile lea 2018-05-12 15:58:13 -07:00
Theodore Dubois
eaa85f96d4 Implement add and load/store with immediates 2018-05-12 15:48:43 -07:00
Theodore Dubois
897bda0f75 Compile ret 2018-05-12 15:28:45 -07:00
Theodore Dubois
543eb92ce1 Compile mov (%esp), %eax 2018-05-12 15:23:59 -07:00
Theodore Dubois
94217971f0 Move dirty_page to TLB 2018-05-12 15:06:30 -07:00
Theodore Dubois
bbbd9dbd9f Name custom register assignments starting with underscores 2018-05-12 14:39:47 -07:00
Theodore Dubois
2bf0ebfe45 Compile call relative instruction 2018-05-11 19:16:57 -07:00
Theodore Dubois
703ecdb3f4 Make the gadgets responsible for setting cpu->eip 2018-05-11 14:51:06 -07:00
Theodore Dubois
bdec76ae53 Change memory access macros to address translation macros 2018-05-08 15:01:29 -07:00
Theodore Dubois
5c52caf7c7 Move gadgets between files 2018-05-08 14:48:07 -07:00
Theodore Dubois
635b9ab14a Disable flag checking in ptraceomatic for now 2018-05-08 14:48:07 -07:00
Theodore Dubois
d91e7b7551 Compile subtraction of immediates 2018-05-08 14:48:07 -07:00
Theodore Dubois
540d36331d Replace imm8 with sign extension in READIMM8 2018-05-08 14:48:07 -07:00
Theodore Dubois
760dd4e262 Correctly compile mov instructions with two registers 2018-05-08 14:48:07 -07:00
Theodore Dubois
869782e601 Advance cpu->eip at the end of each block 2018-05-08 14:48:07 -07:00
Theodore Dubois
f611f9cadd Correctly compile push %ebp 2018-05-08 14:48:07 -07:00
Theodore Dubois
46a26ad58b Fix vdso inclusion on Mac 2018-05-07 10:55:20 -07:00
Theodore Dubois
40211545f9 Set the main iSH scheme as shared 2018-05-07 10:25:12 -07:00
Theodore Dubois
d4d7d4652f Replace cify with .incbin 2018-05-03 16:13:33 -07:00
Theodore Dubois
498c17b1a3 Foundations of jit, no actual compiling yet 2018-05-03 14:48:08 -07:00
Theodore Dubois
18c71cb6a2 Make modrm handling less emulator-specific 2018-05-01 11:36:10 -07:00
Theodore Dubois
c83d07c092 Fix some file descriptor leaks 2018-04-20 18:32:56 -07:00
Theodore Dubois
959a7a0cb2 Sync terminal size 2018-04-20 17:22:16 -07:00