diff options
Diffstat (limited to 'subx/013direct_addressing.cc')
-rw-r--r-- | subx/013direct_addressing.cc | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/subx/013direct_addressing.cc b/subx/013direct_addressing.cc index d51059e4..bf736e01 100644 --- a/subx/013direct_addressing.cc +++ b/subx/013direct_addressing.cc @@ -1,7 +1,7 @@ //: operating directly on a register -:(before "End Initialize Op Names(name)") -put_new(name, "01", "add r32 to rm32 (add)"); +:(before "End Initialize Op Names") +put_new(Name, "01", "add r32 to rm32 (add)"); :(scenario add_r32_to_r32) % Reg[EAX].i = 0x10; @@ -75,8 +75,8 @@ string rname(uint8_t r) { //:: subtract -:(before "End Initialize Op Names(name)") -put_new(name, "29", "subtract r32 from rm32 (sub)"); +:(before "End Initialize Op Names") +put_new(Name, "29", "subtract r32 from rm32 (sub)"); :(scenario subtract_r32_from_r32) % Reg[EAX].i = 10; @@ -101,8 +101,8 @@ case 0x29: { // subtract r32 from r/m32 //:: multiply -:(before "End Initialize Op Names(name)") -put_new(name, "f7", "negate/multiply rm32 (with EAX if necessary) depending on subop (neg/mul)"); +:(before "End Initialize Op Names") +put_new(Name, "f7", "negate/multiply rm32 (with EAX if necessary) depending on subop (neg/mul)"); :(scenario multiply_eax_by_r32) % Reg[EAX].i = 4; @@ -142,8 +142,8 @@ case 0xf7: { // xor r32 with r/m32 //: -:(before "End Initialize Op Names(name)") -put_new(name_0f, "af", "multiply rm32 into r32 (imul)"); +:(before "End Initialize Op Names") +put_new(Name_0f, "af", "multiply rm32 into r32 (imul)"); :(scenario multiply_r32_into_r32) % Reg[EAX].i = 4; @@ -168,8 +168,8 @@ case 0xaf: { // multiply r32 into r/m32 //:: and -:(before "End Initialize Op Names(name)") -put_new(name, "21", "rm32 = bitwise AND of r32 with rm32 (and)"); +:(before "End Initialize Op Names") +put_new(Name, "21", "rm32 = bitwise AND of r32 with rm32 (and)"); :(scenario and_r32_with_r32) % Reg[EAX].i = 0x0a0b0c0d; @@ -194,8 +194,8 @@ case 0x21: { // and r32 with r/m32 //:: or -:(before "End Initialize Op Names(name)") -put_new(name, "09", "rm32 = bitwise OR of r32 with rm32 (or)"); +:(before "End Initialize Op Names") +put_new(Name, "09", "rm32 = bitwise OR of r32 with rm32 (or)"); :(scenario or_r32_with_r32) % Reg[EAX].i = 0x0a0b0c0d; @@ -220,8 +220,8 @@ case 0x09: { // or r32 with r/m32 //:: xor -:(before "End Initialize Op Names(name)") -put_new(name, "31", "rm32 = bitwise XOR of r32 with rm32 (xor)"); +:(before "End Initialize Op Names") +put_new(Name, "31", "rm32 = bitwise XOR of r32 with rm32 (xor)"); :(scenario xor_r32_with_r32) % Reg[EAX].i = 0x0a0b0c0d; @@ -270,8 +270,8 @@ case 2: { // not r/m32 //:: compare (cmp) -:(before "End Initialize Op Names(name)") -put_new(name, "39", "compare: set SF if rm32 < r32 (cmp)"); +:(before "End Initialize Op Names") +put_new(Name, "39", "compare: set SF if rm32 < r32 (cmp)"); :(scenario compare_r32_with_r32_greater) % Reg[EAX].i = 0x0a0b0c0d; @@ -324,8 +324,8 @@ case 0x39: { // set SF if r/m32 < r32 //:: copy (mov) -:(before "End Initialize Op Names(name)") -put_new(name, "89", "copy r32 to rm32 (mov)"); +:(before "End Initialize Op Names") +put_new(Name, "89", "copy r32 to rm32 (mov)"); :(scenario copy_r32_to_r32) % Reg[EBX].i = 0xaf; @@ -350,8 +350,8 @@ case 0x89: { // copy r32 to r/m32 //:: xchg -:(before "End Initialize Op Names(name)") -put_new(name, "87", "swap the contents of r32 and rm32 (xchg)"); +:(before "End Initialize Op Names") +put_new(Name, "87", "swap the contents of r32 and rm32 (xchg)"); :(scenario xchg_r32_with_r32) % Reg[EBX].i = 0xaf; @@ -381,15 +381,15 @@ case 0x87: { // exchange r32 with r/m32 //:: increment -:(before "End Initialize Op Names(name)") -put_new(name, "40", "increment EAX (inc)"); -put_new(name, "41", "increment ECX (inc)"); -put_new(name, "42", "increment EDX (inc)"); -put_new(name, "43", "increment EBX (inc)"); -put_new(name, "44", "increment ESP (inc)"); -put_new(name, "45", "increment EBP (inc)"); -put_new(name, "46", "increment ESI (inc)"); -put_new(name, "47", "increment EDI (inc)"); +:(before "End Initialize Op Names") +put_new(Name, "40", "increment EAX (inc)"); +put_new(Name, "41", "increment ECX (inc)"); +put_new(Name, "42", "increment EDX (inc)"); +put_new(Name, "43", "increment EBX (inc)"); +put_new(Name, "44", "increment ESP (inc)"); +put_new(Name, "45", "increment EBP (inc)"); +put_new(Name, "46", "increment ESI (inc)"); +put_new(Name, "47", "increment EDI (inc)"); :(scenario increment_r32) % Reg[ECX].u = 0x1f; @@ -415,8 +415,8 @@ case 0x47: { // increment r32 break; } -:(before "End Initialize Op Names(name)") -put_new(name, "ff", "increment/decrement/jump/push/call rm32 based on subop (inc/dec/jmp/push/call)"); +:(before "End Initialize Op Names") +put_new(Name, "ff", "increment/decrement/jump/push/call rm32 based on subop (inc/dec/jmp/push/call)"); :(scenario increment_rm32) % Reg[EAX].u = 0x20; @@ -447,15 +447,15 @@ case 0xff: { //:: decrement -:(before "End Initialize Op Names(name)") -put_new(name, "48", "decrement EAX (dec)"); -put_new(name, "49", "decrement ECX (dec)"); -put_new(name, "4a", "decrement EDX (dec)"); -put_new(name, "4b", "decrement EBX (dec)"); -put_new(name, "4c", "decrement ESP (dec)"); -put_new(name, "4d", "decrement EBP (dec)"); -put_new(name, "4e", "decrement ESI (dec)"); -put_new(name, "4f", "decrement EDI (dec)"); +:(before "End Initialize Op Names") +put_new(Name, "48", "decrement EAX (dec)"); +put_new(Name, "49", "decrement ECX (dec)"); +put_new(Name, "4a", "decrement EDX (dec)"); +put_new(Name, "4b", "decrement EBX (dec)"); +put_new(Name, "4c", "decrement ESP (dec)"); +put_new(Name, "4d", "decrement EBP (dec)"); +put_new(Name, "4e", "decrement ESI (dec)"); +put_new(Name, "4f", "decrement EDI (dec)"); :(scenario decrement_r32) % Reg[ECX].u = 0x1f; @@ -502,15 +502,15 @@ case 1: { // decrement r/m32 //:: push -:(before "End Initialize Op Names(name)") -put_new(name, "50", "push EAX to stack (push)"); -put_new(name, "51", "push ECX to stack (push)"); -put_new(name, "52", "push EDX to stack (push)"); -put_new(name, "53", "push EBX to stack (push)"); -put_new(name, "54", "push ESP to stack (push)"); -put_new(name, "55", "push EBP to stack (push)"); -put_new(name, "56", "push ESI to stack (push)"); -put_new(name, "57", "push EDI to stack (push)"); +:(before "End Initialize Op Names") +put_new(Name, "50", "push EAX to stack (push)"); +put_new(Name, "51", "push ECX to stack (push)"); +put_new(Name, "52", "push EDX to stack (push)"); +put_new(Name, "53", "push EBX to stack (push)"); +put_new(Name, "54", "push ESP to stack (push)"); +put_new(Name, "55", "push EBP to stack (push)"); +put_new(Name, "56", "push ESI to stack (push)"); +put_new(Name, "57", "push EDI to stack (push)"); :(scenario push_r32) % Reg[ESP].u = 0x64; @@ -540,15 +540,15 @@ case 0x57: { // push r32 to stack //:: pop -:(before "End Initialize Op Names(name)") -put_new(name, "58", "pop top of stack to EAX (pop)"); -put_new(name, "59", "pop top of stack to ECX (pop)"); -put_new(name, "5a", "pop top of stack to EDX (pop)"); -put_new(name, "5b", "pop top of stack to EBX (pop)"); -put_new(name, "5c", "pop top of stack to ESP (pop)"); -put_new(name, "5d", "pop top of stack to EBP (pop)"); -put_new(name, "5e", "pop top of stack to ESI (pop)"); -put_new(name, "5f", "pop top of stack to EDI (pop)"); +:(before "End Initialize Op Names") +put_new(Name, "58", "pop top of stack to EAX (pop)"); +put_new(Name, "59", "pop top of stack to ECX (pop)"); +put_new(Name, "5a", "pop top of stack to EDX (pop)"); +put_new(Name, "5b", "pop top of stack to EBX (pop)"); +put_new(Name, "5c", "pop top of stack to ESP (pop)"); +put_new(Name, "5d", "pop top of stack to EBP (pop)"); +put_new(Name, "5e", "pop top of stack to ESI (pop)"); +put_new(Name, "5f", "pop top of stack to EDI (pop)"); :(scenario pop_r32) % Reg[ESP].u = 0x2000; |