From 7e274cf2be2afcd54b187a3184b5aefe79ebf0c9 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 26 Sep 2018 10:48:44 -0700 Subject: 4520 --- html/subx/014indirect_addressing.cc.html | 50 ++++++++++++++++---------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'html/subx/014indirect_addressing.cc.html') diff --git a/html/subx/014indirect_addressing.cc.html b/html/subx/014indirect_addressing.cc.html index b3594524..157701b7 100644 --- a/html/subx/014indirect_addressing.cc.html +++ b/html/subx/014indirect_addressing.cc.html @@ -82,7 +82,7 @@ if ('onhashchange' in window) { 18 case 0: // indirect addressing 19 switch (rm) { 20 default: // address in register - 21 trace(90, "run") << "effective address is 0x" << std::hex << Reg[rm].u << " (" << rname(rm) << ")" << end(); + 21 trace(90, "run") << "effective address is 0x" << std::hex << Reg[rm].u << " (" << rname(rm) << ")" << end(); 22 addr = Reg[rm].u; 23 break; 24 // End Mod 0 Special-cases(addr) @@ -111,7 +111,7 @@ if ('onhashchange' in window) { 47 case 0x03: { // add r/m32 to r32 48 uint8_t modrm = next(); 49 uint8_t arg1 = (modrm>>3)&0x7; - 50 trace(90, "run") << "add r/m32 to " << rname(arg1) << end(); + 50 trace(90, "run") << "add r/m32 to " << rname(arg1) << end(); 51 const int32_t* arg2 = effective_address(modrm); 52 BINARY_ARITHMETIC_OP(+, Reg[arg1].i, *arg2); 53 break; @@ -154,7 +154,7 @@ if ('onhashchange' in window) { 90 case 0x2b: { // subtract r/m32 from r32 91 uint8_t modrm = next(); 92 uint8_t arg1 = (modrm>>3)&0x7; - 93 trace(90, "run") << "subtract r/m32 from " << rname(arg1) << end(); + 93 trace(90, "run") << "subtract r/m32 from " << rname(arg1) << end(); 94 const int32_t* arg2 = effective_address(modrm); 95 BINARY_ARITHMETIC_OP(-, Reg[arg1].i, *arg2); 96 break; @@ -197,7 +197,7 @@ if ('onhashchange' in window) { 133 case 0x23: { // and r/m32 with r32 134 uint8_t modrm = next(); 135 uint8_t arg1 = (modrm>>3)&0x7; -136 trace(90, "run") << "and r/m32 with " << rname(arg1) << end(); +136 trace(90, "run") << "and r/m32 with " << rname(arg1) << end(); 137 const int32_t* arg2 = effective_address(modrm); 138 BINARY_BITWISE_OP(&, Reg[arg1].u, *arg2); 139 break; @@ -240,7 +240,7 @@ if ('onhashchange' in window) { 176 case 0x0b: { // or r/m32 with r32 177 uint8_t modrm = next(); 178 uint8_t arg1 = (modrm>>3)&0x7; -179 trace(90, "run") << "or r/m32 with " << rname(arg1) << end(); +179 trace(90, "run") << "or r/m32 with " << rname(arg1) << end(); 180 const int32_t* arg2 = effective_address(modrm); 181 BINARY_BITWISE_OP(|, Reg[arg1].u, *arg2); 182 break; @@ -283,7 +283,7 @@ if ('onhashchange' in window) { 219 case 0x33: { // xor r/m32 with r32 220 uint8_t modrm = next(); 221 uint8_t arg1 = (modrm>>3)&0x7; -222 trace(90, "run") << "xor r/m32 with " << rname(arg1) << end(); +222 trace(90, "run") << "xor r/m32 with " << rname(arg1) << end(); 223 const int32_t* arg2 = effective_address(modrm); 224 BINARY_BITWISE_OP(|, Reg[arg1].u, *arg2); 225 break; @@ -367,7 +367,7 @@ if ('onhashchange' in window) { 303 case 0x3b: { // set SF if r32 < r/m32 304 uint8_t modrm = next(); 305 uint8_t reg1 = (modrm>>3)&0x7; -306 trace(90, "run") << "compare r/m32 with " << rname(reg1) << end(); +306 trace(90, "run") << "compare r/m32 with " << rname(reg1) << end(); 307 int32_t arg1 = Reg[reg1].i; 308 int32_t* arg2 = effective_address(modrm); 309 int32_t tmp1 = arg1 - *arg2; @@ -375,7 +375,7 @@ if ('onhashchange' in window) { 311 ZF = (tmp1 == 0); 312 int64_t tmp2 = arg1 - *arg2; 313 OF = (tmp1 != tmp2); -314 trace(90, "run") << "SF=" << SF << "; ZF=" << ZF << "; OF=" << OF << end(); +314 trace(90, "run") << "SF=" << SF << "; ZF=" << ZF << "; OF=" << OF << end(); 315 break; 316 } 317 @@ -439,10 +439,10 @@ if ('onhashchange' in window) { 375 case 0x8b: { // copy r32 to r/m32 376 uint8_t modrm = next(); 377 uint8_t reg1 = (modrm>>3)&0x7; -378 trace(90, "run") << "copy r/m32 to " << rname(reg1) << end(); +378 trace(90, "run") << "copy r/m32 to " << rname(reg1) << end(); 379 int32_t* arg2 = effective_address(modrm); 380 Reg[reg1].i = *arg2; -381 trace(90, "run") << "storing 0x" << HEXWORD << *arg2 << end(); +381 trace(90, "run") << "storing 0x" << HEXWORD << *arg2 << end(); 382 break; 383 } 384 @@ -469,11 +469,11 @@ if ('onhashchange' in window) { 405 case 0x88: { // copy r/m8 to r8 406 uint8_t modrm = next(); 407 uint8_t reg2 = (modrm>>3)&0x7; -408 trace(90, "run") << "copy lowermost byte of " << rname(reg2) << " to r8/m8-at-r32" << end(); +408 trace(90, "run") << "copy lowermost byte of " << rname(reg2) << " to r8/m8-at-r32" << end(); 409 // use unsigned to zero-extend 8-bit value to 32 bits 410 uint8_t* arg1 = reinterpret_cast<uint8_t*>(effective_address(modrm)); 411 *arg1 = Reg[reg2].u; -412 trace(90, "run") << "storing 0x" << HEXBYTE << NUM(*arg1) << end(); +412 trace(90, "run") << "storing 0x" << HEXBYTE << NUM(*arg1) << end(); 413 break; 414 } 415 @@ -501,12 +501,12 @@ if ('onhashchange' in window) { 437 case 0x8a: { // copy r/m8 to r8 438 uint8_t modrm = next(); 439 uint8_t reg1 = (modrm>>3)&0x7; -440 trace(90, "run") << "copy r8/m8-at-r32 to lowermost byte of " << rname(reg1) << end(); +440 trace(90, "run") << "copy r8/m8-at-r32 to lowermost byte of " << rname(reg1) << end(); 441 // use unsigned to zero-extend 8-bit value to 32 bits 442 uint8_t* arg2 = reinterpret_cast<uint8_t*>(effective_address(modrm)); -443 trace(90, "run") << "storing 0x" << HEXBYTE << NUM(*arg2) << end(); +443 trace(90, "run") << "storing 0x" << HEXBYTE << NUM(*arg2) << end(); 444 *reinterpret_cast<uint8_t*>(&Reg[reg1].u) = *arg2; // assumes host is little-endian -445 trace(90, "run") << rname(reg1) << " now contains 0x" << HEXWORD << Reg[reg1].u << end(); +445 trace(90, "run") << rname(reg1) << " now contains 0x" << HEXWORD << Reg[reg1].u << end(); 446 break; 447 } 448 @@ -531,10 +531,10 @@ if ('onhashchange' in window) { 467 468 :(before "End Op ff Subops") 469 case 4: { // jump to r/m32 -470 trace(90, "run") << "jump to r/m32" << end(); +470 trace(90, "run") << "jump to r/m32" << end(); 471 int32_t* arg2 = effective_address(modrm); 472 EIP = *arg2; -473 trace(90, "run") << "jumping to 0x" << HEXWORD << EIP << end(); +473 trace(90, "run") << "jumping to 0x" << HEXWORD << EIP << end(); 474 break; 475 } 476 @@ -556,7 +556,7 @@ if ('onhashchange' in window) { 492 493 :(before "End Op ff Subops") 494 case 6: { // push r/m32 to stack -495 trace(90, "run") << "push r/m32" << end(); +495 trace(90, "run") << "push r/m32" << end(); 496 const int32_t* val = effective_address(modrm); 497 push(*val); 498 break; @@ -587,7 +587,7 @@ if ('onhashchange' in window) { 523 uint8_t subop = (modrm>>3)&0x7; 524 switch (subop) { 525 case 0: { -526 trace(90, "run") << "pop into r/m32" << end(); +526 trace(90, "run") << "pop into r/m32" << end(); 527 int32_t* dest = effective_address(modrm); 528 *dest = pop(); 529 break; @@ -613,7 +613,7 @@ if ('onhashchange' in window) { 549 :(before "End Mod 0 Special-cases(addr)") 550 case 5: // exception: mod 0b00 rm 0b101 => incoming disp32 551 addr = next32(); -552 trace(90, "run") << "effective address is 0x" << std::hex << addr << " (disp32)" << end(); +552 trace(90, "run") << "effective address is 0x" << std::hex << addr << " (disp32)" << end(); 553 break; 554 555 //: @@ -637,13 +637,13 @@ if ('onhashchange' in window) { 573 switch (rm) { 574 default: 575 addr = Reg[rm].u; -576 trace(90, "run") << "effective address is initially 0x" << std::hex << addr << " (" << rname(rm) << ")" << end(); +576 trace(90, "run") << "effective address is initially 0x" << std::hex << addr << " (" << rname(rm) << ")" << end(); 577 break; 578 // End Mod 1 Special-cases(addr) 579 } 580 if (addr > 0) { 581 addr += static_cast<int8_t>(next()); -582 trace(90, "run") << "effective address is 0x" << std::hex << addr << " (after adding disp8)" << end(); +582 trace(90, "run") << "effective address is 0x" << std::hex << addr << " (after adding disp8)" << end(); 583 } 584 break; 585 @@ -682,13 +682,13 @@ if ('onhashchange' in window) { 618 switch (rm) { 619 default: 620 addr = Reg[rm].u; -621 trace(90, "run") << "effective address is initially 0x" << std::hex << addr << " (" << rname(rm) << ")" << end(); +621 trace(90, "run") << "effective address is initially 0x" << std::hex << addr << " (" << rname(rm) << ")" << end(); 622 break; 623 // End Mod 2 Special-cases(addr) 624 } 625 if (addr > 0) { 626 addr += next32(); -627 trace(90, "run") << "effective address is 0x" << std::hex << addr << " (after adding disp32)" << end(); +627 trace(90, "run") << "effective address is 0x" << std::hex << addr << " (after adding disp32)" << end(); 628 } 629 break; 630 @@ -724,7 +724,7 @@ if ('onhashchange' in window) { 660 case 0x8d: { // lea m32 to r32 661 uint8_t modrm = next(); 662 uint8_t arg1 = (modrm>>3)&0x7; -663 trace(90, "run") << "lea into " << rname(arg1) << end(); +663 trace(90, "run") << "lea into " << rname(arg1) << end(); 664 Reg[arg1].u = effective_address_number(modrm); 665 break; 666 } -- cgit 1.4.1-2-gfad0