diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-10-16 02:48:14 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-10-16 02:48:14 -0700 |
commit | 4f6b2aca0dd9f795e19a5dfe8f3b1bdbe2ef9081 (patch) | |
tree | 7d724ada880dbd4fa0faeb46efd5866015514f2d /subx/013immediate_addressing.cc | |
parent | bd61a20af859a07f18aebea0d13c52d9e6b104bd (diff) | |
download | mu-4f6b2aca0dd9f795e19a5dfe8f3b1bdbe2ef9081.tar.gz |
4071
subx: conditional jump instructions Lots of boilerplate here. This commit really strains my 'copyista' ethic. But I think it's still clearer to see each instruction implemented independently than to try to create a macro or something like that.
Diffstat (limited to 'subx/013immediate_addressing.cc')
-rw-r--r-- | subx/013immediate_addressing.cc | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/subx/013immediate_addressing.cc b/subx/013immediate_addressing.cc index e97b9f6c..dd1ce4c0 100644 --- a/subx/013immediate_addressing.cc +++ b/subx/013immediate_addressing.cc @@ -366,49 +366,3 @@ case 0xc7: { // copy imm32 to r32 *arg1 = arg2; break; } - -//:: jump - -:(scenario jump_rel8) -# op ModRM SIB displacement immediate - eb 05 # skip 1 instruction - 05 00 00 00 01 - 05 00 00 00 02 -+run: inst: 0x00000001 -+run: jump 5 -+run: inst: 0x00000008 --run: inst: 0x00000003 - -:(before "End Single-Byte Opcodes") -case 0xeb: { // jump rel8 - int8_t offset = static_cast<int>(next()); - trace(2, "run") << "jump " << NUM(offset) << end(); - EIP += offset; - break; -} - -//: - -:(scenario jump_rel16) -# op ModRM SIB displacement immediate - e9 05 00 # skip 1 instruction - 05 00 00 00 01 - 05 00 00 00 02 -+run: inst: 0x00000001 -+run: jump 5 -+run: inst: 0x00000009 --run: inst: 0x00000003 - -:(before "End Single-Byte Opcodes") -case 0xe9: { // jump rel8 - int16_t offset = imm16(); - trace(2, "run") << "jump " << offset << end(); - EIP += offset; - break; -} -:(code) -int16_t imm16() { - int16_t result = next(); - result |= (next()<<8); - return result; -} |