From 15cd825deef5811f0c5b7a98846d9e9a51991025 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 17 Oct 2017 23:50:45 -0700 Subject: 4077 Stop hyperlinking every `i` in subx html files to the integer register union. --- html/subx/002test.cc.html | 10 +++++----- html/subx/010core.cc.html | 6 +++--- html/subx/011direct_addressing.cc.html | 16 ++++++++-------- html/subx/012indirect_addressing.cc.html | 20 ++++++++++---------- html/subx/013immediate_addressing.cc.html | 12 ++++++------ update_html | 2 +- 6 files changed, 33 insertions(+), 33 deletions(-) diff --git a/html/subx/002test.cc.html b/html/subx/002test.cc.html index 85be9d1a..35c4add2 100644 --- a/html/subx/002test.cc.html +++ b/html/subx/002test.cc.html @@ -115,9 +115,9 @@ if ('onhashchange' in window) { 53 // End Test Run Initialization 54 time_t t; time(&t); 55 cerr << "C tests: " << ctime(&t); - 56 for (size_t i=0; i < sizeof(Tests)/sizeof(Tests[0]); ++i) { + 56 for (size_t i=0; i < sizeof(Tests)/sizeof(Tests[0]); ++i) { 57 //? cerr << "running .build/test_list line " << (i+1) << '\n'; - 58 ¦ run_test(i); + 58 ¦ run_test(i); 59 ¦ if (Passed) cerr << '.'; 60 ¦ else ++num_failures; 61 } @@ -133,9 +133,9 @@ if ('onhashchange' in window) { 71 } 72 73 :(code) - 74 void run_test(size_t i) { - 75 if (i >= sizeof(Tests)/sizeof(Tests[0])) { - 76 ¦ cerr << "no test " << i << '\n'; + 74 void run_test(size_t i) { + 75 if (i >= sizeof(Tests)/sizeof(Tests[0])) { + 76 ¦ cerr << "no test " << i << '\n'; 77 ¦ return; 78 } 79 reset(); diff --git a/html/subx/010core.cc.html b/html/subx/010core.cc.html index 425859f5..2fe9f502 100644 --- a/html/subx/010core.cc.html +++ b/html/subx/010core.cc.html @@ -76,8 +76,8 @@ if ('onhashchange' in window) { 13 NUM_INT_REGISTERS, 14 }; 15 union reg { - 16 int32_t i; - 17 uint32_t u; + 16 int32_t i; + 17 uint32_t u; 18 }; 19 :(before "End Globals") 20 reg Reg[NUM_INT_REGISTERS] = { {0} }; @@ -178,7 +178,7 @@ if ('onhashchange' in window) { 115 case 0x05: { // add imm32 to EAX 116 ¦ int32_t arg2 = imm32(); 117 ¦ trace(2, "run") << "add imm32 0x" << HEXWORD << arg2 << " to reg EAX" << end(); -118 ¦ BINARY_ARITHMETIC_OP(+, Reg[EAX].i, arg2); +118 ¦ BINARY_ARITHMETIC_OP(+, Reg[EAX].i, arg2); 119 ¦ break; 120 } 121 // End Single-Byte Opcodes diff --git a/html/subx/011direct_addressing.cc.html b/html/subx/011direct_addressing.cc.html index 63a702cf..2b96747f 100644 --- a/html/subx/011direct_addressing.cc.html +++ b/html/subx/011direct_addressing.cc.html @@ -80,7 +80,7 @@ if ('onhashchange' in window) { 15 uint8_t arg2 = (modrm>>3)&0x7; 16 trace(2, "run") << "add reg " << NUM(arg2) << " to effective address" << end(); 17 int32_t* arg1 = effective_address(modrm); - 18 BINARY_ARITHMETIC_OP(+, *arg1, Reg[arg2].i); + 18 BINARY_ARITHMETIC_OP(+, *arg1, Reg[arg2].i); 19 break; 20 } 21 @@ -97,7 +97,7 @@ if ('onhashchange' in window) { 32 case 3: 33 ¦ // mod 3 is just register direct addressing 34 ¦ trace(2, "run") << "effective address is reg " << NUM(rm) << end(); - 35 ¦ result = &Reg[rm].i; + 35 ¦ result = &Reg[rm].i; 36 ¦ break; 37 // End Mod Special-cases 38 default: @@ -124,7 +124,7 @@ if ('onhashchange' in window) { 59 uint8_t arg2 = (modrm>>3)&0x7; 60 trace(2, "run") << "subtract reg " << NUM(arg2) << " from effective address" << end(); 61 int32_t* arg1 = effective_address(modrm); - 62 BINARY_ARITHMETIC_OP(-, *arg1, Reg[arg2].i); + 62 BINARY_ARITHMETIC_OP(-, *arg1, Reg[arg2].i); 63 break; 64 } 65 @@ -145,7 +145,7 @@ if ('onhashchange' in window) { 80 uint8_t arg2 = (modrm>>3)&0x7; 81 trace(2, "run") << "and reg " << NUM(arg2) << " with effective address" << end(); 82 int32_t* arg1 = effective_address(modrm); - 83 BINARY_BITWISE_OP(&, *arg1, Reg[arg2].u); + 83 BINARY_BITWISE_OP(&, *arg1, Reg[arg2].u); 84 break; 85 } 86 @@ -166,7 +166,7 @@ if ('onhashchange' in window) { 101 uint8_t arg2 = (modrm>>3)&0x7; 102 trace(2, "run") << "or reg " << NUM(arg2) << " with effective address" << end(); 103 int32_t* arg1 = effective_address(modrm); -104 BINARY_BITWISE_OP(|, *arg1, Reg[arg2].u); +104 BINARY_BITWISE_OP(|, *arg1, Reg[arg2].u); 105 break; 106 } 107 @@ -187,7 +187,7 @@ if ('onhashchange' in window) { 122 uint8_t arg2 = (modrm>>3)&0x7; 123 trace(2, "run") << "xor reg " << NUM(arg2) << " with effective address" << end(); 124 int32_t* arg1 = effective_address(modrm); -125 BINARY_BITWISE_OP(^, *arg1, Reg[arg2].u); +125 BINARY_BITWISE_OP(^, *arg1, Reg[arg2].u); 126 break; 127 } 128 @@ -231,7 +231,7 @@ if ('onhashchange' in window) { 166 uint8_t reg2 = (modrm>>3)&0x7; 167 trace(2, "run") << "compare reg " << NUM(reg2) << " with effective address" << end(); 168 int32_t* arg1 = effective_address(modrm); -169 int32_t arg2 = Reg[reg2].i; +169 int32_t arg2 = Reg[reg2].i; 170 int32_t tmp1 = *arg1 - arg2; 171 SF = (tmp1 < 0); 172 ZF = (tmp1 == 0); @@ -275,7 +275,7 @@ if ('onhashchange' in window) { 210 uint8_t reg2 = (modrm>>3)&0x7; 211 trace(2, "run") << "copy reg " << NUM(reg2) << " to effective address" << end(); 212 int32_t* arg1 = effective_address(modrm); -213 *arg1 = Reg[reg2].i; +213 *arg1 = Reg[reg2].i; 214 trace(2, "run") << "storing 0x" << HEXWORD << *arg1 << end(); 215 break; 216 } diff --git a/html/subx/012indirect_addressing.cc.html b/html/subx/012indirect_addressing.cc.html index ef408d32..b64886da 100644 --- a/html/subx/012indirect_addressing.cc.html +++ b/html/subx/012indirect_addressing.cc.html @@ -80,9 +80,9 @@ if ('onhashchange' in window) { 15 // mod 0 is usually indirect addressing 16 switch (rm) { 17 default: - 18 ¦ trace(2, "run") << "effective address is mem at address 0x" << std::hex << Reg[rm].u << " (reg " << NUM(rm) << ")" << end(); - 19 ¦ assert(Reg[rm].u + sizeof(int32_t) <= Mem.size()); - 20 ¦ result = reinterpret_cast<int32_t*>(&Mem.at(Reg[rm].u)); // rely on the host itself being in little-endian order + 18 ¦ trace(2, "run") << "effective address is mem at address 0x" << std::hex << Reg[rm].u << " (reg " << NUM(rm) << ")" << end(); + 19 ¦ assert(Reg[rm].u + sizeof(int32_t) <= Mem.size()); + 20 ¦ result = reinterpret_cast<int32_t*>(&Mem.at(Reg[rm].u)); // rely on the host itself being in little-endian order 21 ¦ break; 22 // End Mod 0 Special-cases 23 } @@ -106,7 +106,7 @@ if ('onhashchange' in window) { 41 uint8_t arg1 = (modrm>>3)&0x7; 42 trace(2, "run") << "add effective address to reg " << NUM(arg1) << end(); 43 const int32_t* arg2 = effective_address(modrm); - 44 BINARY_ARITHMETIC_OP(+, Reg[arg1].i, *arg2); + 44 BINARY_ARITHMETIC_OP(+, Reg[arg1].i, *arg2); 45 break; 46 } 47 @@ -140,7 +140,7 @@ if ('onhashchange' in window) { 75 uint8_t arg1 = (modrm>>3)&0x7; 76 trace(2, "run") << "subtract effective address from reg " << NUM(arg1) << end(); 77 const int32_t* arg2 = effective_address(modrm); - 78 BINARY_ARITHMETIC_OP(-, Reg[arg1].i, *arg2); + 78 BINARY_ARITHMETIC_OP(-, Reg[arg1].i, *arg2); 79 break; 80 } 81 @@ -174,7 +174,7 @@ if ('onhashchange' in window) { 109 uint8_t arg1 = (modrm>>3)&0x7; 110 trace(2, "run") << "and effective address with reg " << NUM(arg1) << end(); 111 const int32_t* arg2 = effective_address(modrm); -112 BINARY_BITWISE_OP(&, Reg[arg1].u, *arg2); +112 BINARY_BITWISE_OP(&, Reg[arg1].u, *arg2); 113 break; 114 } 115 @@ -208,7 +208,7 @@ if ('onhashchange' in window) { 143 uint8_t arg1 = (modrm>>3)&0x7; 144 trace(2, "run") << "or effective address with reg " << NUM(arg1) << end(); 145 const int32_t* arg2 = effective_address(modrm); -146 BINARY_BITWISE_OP(|, Reg[arg1].u, *arg2); +146 BINARY_BITWISE_OP(|, Reg[arg1].u, *arg2); 147 break; 148 } 149 @@ -242,7 +242,7 @@ if ('onhashchange' in window) { 177 uint8_t arg1 = (modrm>>3)&0x7; 178 trace(2, "run") << "xor effective address with reg " << NUM(arg1) << end(); 179 const int32_t* arg2 = effective_address(modrm); -180 BINARY_BITWISE_OP(|, Reg[arg1].u, *arg2); +180 BINARY_BITWISE_OP(|, Reg[arg1].u, *arg2); 181 break; 182 } 183 @@ -307,7 +307,7 @@ if ('onhashchange' in window) { 242 uint8_t modrm = next(); 243 uint8_t reg1 = (modrm>>3)&0x7; 244 trace(2, "run") << "compare effective address with reg " << NUM(reg1) << end(); -245 int32_t arg1 = Reg[reg1].i; +245 int32_t arg1 = Reg[reg1].i; 246 int32_t* arg2 = effective_address(modrm); 247 int32_t tmp1 = arg1 - *arg2; 248 SF = (tmp1 < 0); @@ -366,7 +366,7 @@ if ('onhashchange' in window) { 301 uint8_t reg1 = (modrm>>3)&0x7; 302 trace(2, "run") << "copy effective address to reg " << NUM(reg1) << end(); 303 int32_t* arg2 = effective_address(modrm); -304 Reg[reg1].i = *arg2; +304 Reg[reg1].i = *arg2; 305 trace(2, "run") << "storing 0x" << HEXWORD << *arg2 << end(); 306 break; 307 } diff --git a/html/subx/013immediate_addressing.cc.html b/html/subx/013immediate_addressing.cc.html index bb9e6ea8..7f34dc57 100644 --- a/html/subx/013immediate_addressing.cc.html +++ b/html/subx/013immediate_addressing.cc.html @@ -118,7 +118,7 @@ if ('onhashchange' in window) { 54 case 0x2d: { // subtract imm32 from EAX 55 int32_t arg2 = imm32(); 56 trace(2, "run") << "subtract imm32 0x" << HEXWORD << arg2 << " from reg EAX" << end(); - 57 BINARY_ARITHMETIC_OP(-, Reg[EAX].i, arg2); + 57 BINARY_ARITHMETIC_OP(-, Reg[EAX].i, arg2); 58 break; 59 } 60 @@ -165,7 +165,7 @@ if ('onhashchange' in window) { 101 case 0x25: { // and imm32 with EAX 102 int32_t arg2 = imm32(); 103 trace(2, "run") << "and imm32 0x" << HEXWORD << arg2 << " with reg EAX" << end(); -104 BINARY_BITWISE_OP(&, Reg[EAX].i, arg2); +104 BINARY_BITWISE_OP(&, Reg[EAX].i, arg2); 105 break; 106 } 107 @@ -212,7 +212,7 @@ if ('onhashchange' in window) { 148 case 0x0d: { // or imm32 with EAX 149 int32_t arg2 = imm32(); 150 trace(2, "run") << "or imm32 0x" << HEXWORD << arg2 << " with reg EAX" << end(); -151 BINARY_BITWISE_OP(|, Reg[EAX].i, arg2); +151 BINARY_BITWISE_OP(|, Reg[EAX].i, arg2); 152 break; 153 } 154 @@ -259,7 +259,7 @@ if ('onhashchange' in window) { 195 case 0x35: { // xor imm32 with EAX 196 int32_t arg2 = imm32(); 197 trace(2, "run") << "xor imm32 0x" << HEXWORD << arg2 << " with reg EAX" << end(); -198 BINARY_BITWISE_OP(^, Reg[EAX].i, arg2); +198 BINARY_BITWISE_OP(^, Reg[EAX].i, arg2); 199 break; 200 } 201 @@ -304,7 +304,7 @@ if ('onhashchange' in window) { 240 241 :(before "End Single-Byte Opcodes") 242 case 0x3d: { // subtract imm32 from EAX -243 int32_t arg1 = Reg[EAX].i; +243 int32_t arg1 = Reg[EAX].i; 244 int32_t arg2 = imm32(); 245 trace(2, "run") << "compare reg EAX and imm32 0x" << HEXWORD << arg2 << end(); 246 int32_t tmp1 = arg1 - arg2; @@ -409,7 +409,7 @@ if ('onhashchange' in window) { 345 int32_t arg2 = imm32(); 346 uint8_t reg1 = modrm&0x7; // ignore mod bits 347 trace(2, "run") << "copy imm32 0x" << HEXWORD << arg2 << " to reg " << NUM(reg1) << end(); -348 Reg[reg1].i = arg2; +348 Reg[reg1].i = arg2; 349 break; 350 } 351 diff --git a/update_html b/update_html index c1a79ed0..0717a979 100755 --- a/update_html +++ b/update_html @@ -92,7 +92,7 @@ process() { process $f done ( cd subx - ctags -x *.cc > /tmp/tags + ctags -x *.cc |grep -v '^. ' > /tmp/tags # don't hyperlink every 'i' to the integer register variant ) linkify/linkify /tmp/tags html/subx/*.html for f in html/subx/*.cc.html -- cgit 1.4.1-2-gfad0