From fcc161e70502caf34bc0206d2c428e8341e97fa6 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sun, 24 May 2020 22:43:18 -0700 Subject: 6397 Drop '---' section boundaries from filenames. I noticed them confusing tab-completion for certain advanced shell setups. --- html/016index_addressing.cc.html | 64 ++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'html/016index_addressing.cc.html') diff --git a/html/016index_addressing.cc.html b/html/016index_addressing.cc.html index e64badfc..82714dc7 100644 --- a/html/016index_addressing.cc.html +++ b/html/016index_addressing.cc.html @@ -60,8 +60,8 @@ if ('onhashchange' in window) { 2 3 :(code) 4 void test_add_r32_to_mem_at_r32_with_sib() { - 5 Reg[EBX].i = 0x10; - 6 Reg[EAX].i = 0x2000; + 5 Reg[EBX].i = 0x10; + 6 Reg[EAX].i = 0x2000; 7 run( 8 "== code 0x1\n" 9 // op ModR/M SIB displacement immediate @@ -72,8 +72,8 @@ if ('onhashchange' in window) { 14 "01 00 00 00\n" // 0x00000001 15 ); 16 CHECK_TRACE_CONTENTS( - 17 "run: add EBX to r/m32\n" - 18 "run: effective address is initially 0x00002000 (EAX)\n" + 17 "run: add EBX to r/m32\n" + 18 "run: effective address is initially 0x00002000 (EAX)\n" 19 "run: effective address is 0x00002000\n" 20 "run: storing 0x00000011\n" 21 ); @@ -85,36 +85,36 @@ if ('onhashchange' in window) { 27 break; 28 :(code) 29 uint32_t effective_address_from_sib(uint8_t mod) { - 30 const uint8_t sib = next(); + 30 const uint8_t sib = next(); 31 const uint8_t base = sib&0x7; 32 uint32_t addr = 0; - 33 if (base != EBP || mod != 0) { - 34 addr = Reg[base].u; - 35 trace(Callstack_depth+1, "run") << "effective address is initially 0x" << HEXWORD << addr << " (" << rname(base) << ")" << end(); + 33 if (base != EBP || mod != 0) { + 34 addr = Reg[base].u; + 35 trace(Callstack_depth+1, "run") << "effective address is initially 0x" << HEXWORD << addr << " (" << rname(base) << ")" << end(); 36 } 37 else { 38 // base == EBP && mod == 0 39 addr = next32(); // ignore base - 40 trace(Callstack_depth+1, "run") << "effective address is initially 0x" << HEXWORD << addr << " (disp32)" << end(); + 40 trace(Callstack_depth+1, "run") << "effective address is initially 0x" << HEXWORD << addr << " (disp32)" << end(); 41 } 42 const uint8_t index = (sib>>3)&0x7; - 43 if (index == ESP) { + 43 if (index == ESP) { 44 // ignore index and scale - 45 trace(Callstack_depth+1, "run") << "effective address is 0x" << HEXWORD << addr << end(); + 45 trace(Callstack_depth+1, "run") << "effective address is 0x" << HEXWORD << addr << end(); 46 } 47 else { 48 const uint8_t scale = (1 << (sib>>6)); - 49 addr += Reg[index].i*scale; // treat index register as signed. Maybe base as well? But we'll always ensure it's non-negative. - 50 trace(Callstack_depth+1, "run") << "effective address is 0x" << HEXWORD << addr << " (after adding " << rname(index) << "*" << NUM(scale) << ")" << end(); + 49 addr += Reg[index].i*scale; // treat index register as signed. Maybe base as well? But we'll always ensure it's non-negative. + 50 trace(Callstack_depth+1, "run") << "effective address is 0x" << HEXWORD << addr << " (after adding " << rname(index) << "*" << NUM(scale) << ")" << end(); 51 } 52 return addr; 53 } 54 55 :(code) 56 void test_add_r32_to_mem_at_base_r32_index_r32() { - 57 Reg[EBX].i = 0x10; // source - 58 Reg[EAX].i = 0x1ffe; // dest base - 59 Reg[ECX].i = 0x2; // dest index + 57 Reg[EBX].i = 0x10; // source + 58 Reg[EAX].i = 0x1ffe; // dest base + 59 Reg[ECX].i = 0x2; // dest index 60 run( 61 "== code 0x1\n" 62 // op ModR/M SIB displacement immediate @@ -125,8 +125,8 @@ if ('onhashchange' in window) { 67 "01 00 00 00\n" // 0x00000001 68 ); 69 CHECK_TRACE_CONTENTS( - 70 "run: add EBX to r/m32\n" - 71 "run: effective address is initially 0x00001ffe (EAX)\n" + 70 "run: add EBX to r/m32\n" + 71 "run: effective address is initially 0x00001ffe (EAX)\n" 72 "run: effective address is 0x00002000 (after adding ECX*1)\n" 73 "run: storing 0x00000011\n" 74 ); @@ -134,7 +134,7 @@ if ('onhashchange' in window) { 76 77 :(code) 78 void test_add_r32_to_mem_at_displacement_using_sib() { - 79 Reg[EBX].i = 0x10; // source + 79 Reg[EBX].i = 0x10; // source 80 run( 81 "== code 0x1\n" 82 // op ModR/M SIB displacement immediate @@ -145,8 +145,8 @@ if ('onhashchange' in window) { 87 "01 00 00 00\n" // 0x00000001 88 ); 89 CHECK_TRACE_CONTENTS( - 90 "run: add EBX to r/m32\n" - 91 "run: effective address is initially 0x00002000 (disp32)\n" + 90 "run: add EBX to r/m32\n" + 91 "run: effective address is initially 0x00002000 (disp32)\n" 92 "run: effective address is 0x00002000\n" 93 "run: storing 0x00000011\n" 94 ); @@ -156,9 +156,9 @@ if ('onhashchange' in window) { 98 99 :(code) 100 void test_add_r32_to_mem_at_base_r32_index_r32_plus_disp8() { -101 Reg[EBX].i = 0x10; // source -102 Reg[EAX].i = 0x1ff9; // dest base -103 Reg[ECX].i = 0x5; // dest index +101 Reg[EBX].i = 0x10; // source +102 Reg[EAX].i = 0x1ff9; // dest base +103 Reg[ECX].i = 0x5; // dest index 104 run( 105 "== code 0x1\n" 106 // op ModR/M SIB displacement immediate @@ -169,8 +169,8 @@ if ('onhashchange' in window) { 111 "01 00 00 00\n" // 0x00000001 112 ); 113 CHECK_TRACE_CONTENTS( -114 "run: add EBX to r/m32\n" -115 "run: effective address is initially 0x00001ff9 (EAX)\n" +114 "run: add EBX to r/m32\n" +115 "run: effective address is initially 0x00001ff9 (EAX)\n" 116 "run: effective address is 0x00001ffe (after adding ECX*1)\n" 117 "run: effective address is 0x00002000 (after adding disp8)\n" 118 "run: storing 0x00000011\n" @@ -186,9 +186,9 @@ if ('onhashchange' in window) { 128 129 :(code) 130 void test_add_r32_to_mem_at_base_r32_index_r32_plus_disp32() { -131 Reg[EBX].i = 0x10; // source -132 Reg[EAX].i = 0x1ff9; // dest base -133 Reg[ECX].i = 0x5; // dest index +131 Reg[EBX].i = 0x10; // source +132 Reg[EAX].i = 0x1ff9; // dest base +133 Reg[ECX].i = 0x5; // dest index 134 run( 135 "== code 0x1\n" 136 // op ModR/M SIB displacement immediate @@ -199,10 +199,10 @@ if ('onhashchange' in window) { 141 "01 00 00 00\n" // 0x00000001 142 ); 143 CHECK_TRACE_CONTENTS( -144 "run: add EBX to r/m32\n" -145 "run: effective address is initially 0x00001ff9 (EAX)\n" +144 "run: add EBX to r/m32\n" +145 "run: effective address is initially 0x00001ff9 (EAX)\n" 146 "run: effective address is 0x00001ffe (after adding ECX*1)\n" -147 "run: effective address is 0x00002000 (after adding disp32)\n" +147 "run: effective address is 0x00002000 (after adding disp32)\n" 148 "run: storing 0x00000011\n" 149 ); 150 } -- cgit 1.4.1-2-gfad0