about summary refs log tree commit diff stats
path: root/html/003trace.cc.html
Commit message (Collapse)AuthorAgeFilesLines
* 6084Kartik Agaram2020-03-061-2/+2
|
* 5893Kartik Agaram2020-01-141-87/+88
|
* 5806Kartik Agaram2019-12-091-327/+329
|
* 5490Kartik Agaram2019-07-271-15/+15
|
* 5485 - promote SubX to top-levelKartik Agaram2019-07-271-426/+511
|
* 4891Kartik Agaram2018-12-301-0/+1
| | | | | | | | | | | Couple more tweaks to html rendering: a) SubX definitions no longer link redundantly to themselves. This long-standing issue turns out to be tractable to solve for SubX files since the syntax is so simple. b) Fix links to SubX definitions in other directories. I forgot that I have to always generate tags from the directory of the file being linkified. c) Fix link colors. Before we lost all syntax highlighting for functions and Globals. Now they maintain their colors, just add an underline.
* 4890 - new html renderingsKartik Agaram2018-12-291-15/+10
| | | | | | | a) Switch to a light background. b) Linkify calls in .subx files. c) Keep all colorization in the Vim colorscheme, get rid of hacky special-cases in update_html.
* 4814Kartik Agaram2018-12-011-66/+70
|
* 4709Kartik Agaram2018-10-171-276/+275
|
* 4588Kartik Agaram2018-09-221-186/+190
|
* 4539Kartik Agaram2018-09-071-4/+4
|
* 4447Kartik Agaram2018-07-271-329/+348
|
* 4239Kartik Agaram2018-05-081-10/+10
|
* 4199Kartik K. Agaram2018-01-251-65/+64
|
* 4161Kartik K. Agaram2017-12-151-9/+9
|
* 4155Kartik K. Agaram2017-12-071-288/+290
|
* 4134 - 'input' = 'ingredient'Kartik K. Agaram2017-12-031-1/+1
|
* 4102Kartik K. Agaram2017-11-011-25/+24
|
* 3971Kartik K. Agaram2017-08-191-1/+1
|
* 3927Kartik K. Agaram2017-06-191-216/+228
|
* 3897 - various updates to documentationKartik K. Agaram2017-05-291-6/+6
|
* 3764 - better colors for cross-linksKartik K. Agaram2017-03-081-4/+5
|
* 3761Kartik K. Agaram2017-03-071-63/+64
|
* 3751Kartik K. Agaram2017-03-021-2/+2
| | | | Some hacky manual fixes to auto-generated html.
* 3750Kartik K. Agaram2017-03-021-373/+365
|
* 3749Kartik K. Agaram2017-03-021-407/+405
|
* 3716Kartik K. Agaram2016-12-261-0/+2
| | | | Make hyperlinks less salient in the rendered html since there's so many of them.
* 3713 - cross-link calls with definitions in htmlKartik K. Agaram2016-12-261-56/+56
|
* 3710Kartik K. Agaram2016-12-261-411/+411
| | | | | Turns out we don't need to explicitly add anchors for each line. Vim's TOhtml has magic for that out of the box.
* 3709 - line numbers in htmlKartik K. Agaram2016-12-261-414/+438
| | | | | | Each line number also gets an anchor name, but I'm not hyperlinking them for now because I don't want to encourage bookmarking these links just yet. They aren't permalinks because every revision may change what's at any given line number.
* 3679Kartik K. Agaram2016-11-171-4/+8
|
* 3667Kartik K. Agaram2016-11-111-0/+3
|
* 3627 - selective dumping a single labelKartik K. Agaram2016-11-051-1/+5
| | | | Follow-up to commit 3516.
* 3561Kartik K. Agaram2016-10-221-2/+3
|
* 3544Kartik K. Agaram2016-10-221-1/+1
|
* 3543Kartik K. Agaram2016-10-221-5/+1
|
* 3524Kartik K. Agaram2016-10-201-6/+8
|
* 3371Kartik K. Agaram2016-09-161-4/+5
|
* 3315Kartik K. Agaram2016-09-101-79/+85
|
* 3266Kartik K. Agaram2016-08-271-1/+2
|
* 3219Kartik K. Agaram2016-08-171-0/+12
| | | | | | | | Trying keeping html in the master branch: https://github.com/blog/2228-simpler-github-pages-publishing Let's see if https://akkartik.github.io/mu updates after I push this commit to just the master branch.
* 3102Kartik K. Agaram2016-07-051-25/+30
|
* 2996Kartik K. Agaram2016-05-211-0/+3
|
* 2812Kartik K. Agaram2016-03-271-12/+21
|
* 2744Kartik K. Agaram2016-03-091-4/+4
| | | | Tweak colors and font-sizes in generated html.
* 2743Kartik K. Agaram2016-03-091-97/+89
| | | | | Looks like "TOhtml | <other command>" doesn't work on Mac OS X for some reason..
* 2706 - update htmlKartik K. Agaram2016-02-251-20/+15
|
* 2605Kartik K. Agaram2016-01-261-1/+11
|
* 2611Kartik K. Agaram2015-11-291-4/+2
|
* 2423 - describe shape-shifting in html docsKartik K. Agaram2015-11-101-74/+77
|
nt) == 4 on the host as well. trace(Callstack_depth+1, "run") << "storing 0x" << HEXBYTE << NUM(*dest) << end(); break; } //: :(before "End Initialize Op Names") put_new(Name, "8a", "copy r8/m8-at-r32 to r8"); :(code) void test_copy_mem_at_rm32_to_r8() { Reg[EBX].i = 0xaabbcc0f; // one nibble each of lowest byte set to all 0s and all 1s, to maximize value of this test Reg[EAX].i = 0x2000; run( "== code 0x1\n" // op ModR/M SIB displacement immediate " 8a 18 \n" // copy just the byte at *EAX to BL // ModR/M in binary: 00 (indirect mode) 011 (dest EBX) 000 (src EAX) "== data 0x2000\n" "ab ff ff ff\n" // 0xab with more data in following bytes ); CHECK_TRACE_CONTENTS( "run: copy r8/m8-at-r32 to BL\n" "run: effective address is 0x00002000 (EAX)\n" "run: storing 0xab\n" // remaining bytes of EBX are *not* cleared "run: EBX now contains 0xaabbccab\n" ); } :(before "End Single-Byte Opcodes") case 0x8a: { // copy r/m8 to r8 const uint8_t modrm = next(); const uint8_t rdest = (modrm>>3)&0x7; trace(Callstack_depth+1, "run") << "copy r8/m8-at-r32 to " << rname_8bit(rdest) << end(); // use unsigned to zero-extend 8-bit value to 32 bits const uint8_t* src = effective_byte_address(modrm); uint8_t* dest = reg_8bit(rdest); trace(Callstack_depth+1, "run") << "storing 0x" << HEXBYTE << NUM(*src) << end(); *dest = *src; // Read/write multiple elements of vector<uint8_t> at once. Assumes sizeof(int) == 4 on the host as well. const uint8_t rdest_32bit = rdest & 0x3; trace(Callstack_depth+1, "run") << rname(rdest_32bit) << " now contains 0x" << HEXWORD << Reg[rdest_32bit].u << end(); break; } :(code) void test_cannot_copy_byte_to_ESP_EBP_ESI_EDI() { Reg[ESI].u = 0xaabbccdd; Reg[EBX].u = 0x11223344; run( "== code 0x1\n" // op ModR/M SIB displacement immediate " 8a f3 \n" // copy just the byte at *EBX to 8-bit register '6' // ModR/M in binary: 11 (direct mode) 110 (dest 8-bit 'register 6') 011 (src EBX) ); CHECK_TRACE_CONTENTS( // ensure 8-bit register '6' is DH, not ESI "run: copy r8/m8-at-r32 to DH\n" "run: storing 0x44\n" ); // ensure ESI is unchanged CHECK_EQ(Reg[ESI].u, 0xaabbccdd); } //: :(before "End Initialize Op Names") put_new(Name, "c6", "copy imm8 to r8/m8-at-r32 with subop 0 (mov)"); :(code) void test_copy_imm8_to_mem_at_rm32() { Reg[EAX].i = 0x2000; run( "== code 0x1\n" // op ModR/M SIB displacement immediate " c6 00 dd \n" // copy to the byte at *EAX // ModR/M in binary: 00 (indirect mode) 000 (unused) 000 (dest EAX) "== data 0x2000\n" "f0 cc bb aa\n" ); CHECK_TRACE_CONTENTS( "run: copy imm8 to r8/m8-at-r32\n" "run: effective address is 0x00002000 (EAX)\n" "run: storing 0xdd\n" ); CHECK_EQ(0xaabbccdd, read_mem_u32(0x2000)); } :(before "End Single-Byte Opcodes") case 0xc6: { // copy imm8 to r/m8 const uint8_t modrm = next(); const uint8_t src = next(); trace(Callstack_depth+1, "run") << "copy imm8 to r8/m8-at-r32" << end(); trace(Callstack_depth+1, "run") << "imm8 is 0x" << HEXBYTE << NUM(src) << end(); const uint8_t subop = (modrm>>3)&0x7; // middle 3 'reg opcode' bits if (subop != 0) { cerr << "unrecognized subop for opcode c6: " << NUM(subop) << " (only 0/copy currently implemented)\n"; exit(1); } // use unsigned to zero-extend 8-bit value to 32 bits uint8_t* dest = effective_byte_address(modrm); *dest = src; // Write multiple elements of vector<uint8_t> at once. Assumes sizeof(int) == 4 on the host as well. trace(Callstack_depth+1, "run") << "storing 0x" << HEXBYTE << NUM(*dest) << end(); break; } //:: set flags (setcc) :(before "End Initialize Op Names") put_new(Name_0f, "94", "set r8/m8-at-rm32 to 1 if equal, if ZF is set, 0 otherwise (setcc/setz/sete)"); put_new(Name_0f, "95", "set r8/m8-at-rm32 to 1 if not equal, if ZF is not set, 0 otherwise (setcc/setnz/setne)"); put_new(Name_0f, "9f", "set r8/m8-at-rm32 to 1 if greater, if ZF is unset and SF == OF, 0 otherwise (setcc/setg/setnle)"); put_new(Name_0f, "97", "set r8/m8-at-rm32 to 1 if greater (addr, float), if ZF is unset and CF is unset, 0 otherwise (setcc/seta/setnbe)"); put_new(Name_0f, "9d", "set r8/m8-at-rm32 to 1 if greater or equal, if SF == OF, 0 otherwise (setcc/setge/setnl)"); put_new(Name_0f, "93", "set r8/m8-at-rm32 to 1 if greater or equal (addr, float), if CF is unset, 0 otherwise (setcc/setae/setnb)"); put_new(Name_0f, "9c", "set r8/m8-at-rm32 to 1 if lesser, if SF != OF, 0 otherwise (setcc/setl/setnge)"); put_new(Name_0f, "92", "set r8/m8-at-rm32 to 1 if lesser (addr, float), if CF is set, 0 otherwise (setcc/setb/setnae)"); put_new(Name_0f, "9e", "set r8/m8-at-rm32 to 1 if lesser or equal, if ZF is set or SF != OF, 0 otherwise (setcc/setle/setng)"); put_new(Name_0f, "96", "set r8/m8-at-rm32 to 1 if lesser or equal (addr, float), if ZF is set or CF is set, 0 otherwise (setcc/setbe/setna)"); :(before "End Two-Byte Opcodes Starting With 0f") case 0x94: { // set r8/m8-at-rm32 if ZF const uint8_t modrm = next(); trace(Callstack_depth+1, "run") << "set r8/m8-at-rm32" << end(); uint8_t* dest = effective_byte_address(modrm); *dest = ZF; trace(Callstack_depth+1, "run") << "storing " << NUM(*dest) << end(); break; } case 0x95: { // set r8/m8-at-rm32 if !ZF const uint8_t modrm = next(); trace(Callstack_depth+1, "run") << "set r8/m8-at-rm32" << end(); uint8_t* dest = effective_byte_address(modrm); *dest = !ZF; trace(Callstack_depth+1, "run") << "storing " << NUM(*dest) << end(); break; } case 0x9f: { // set r8/m8-at-rm32 if !SF and !ZF const uint8_t modrm = next(); trace(Callstack_depth+1, "run") << "set r8/m8-at-rm32" << end(); uint8_t* dest = effective_byte_address(modrm); *dest = !ZF && SF == OF; trace(Callstack_depth+1, "run") << "storing " << NUM(*dest) << end(); break; } case 0x97: { // set r8/m8-at-rm32 if !CF and !ZF const uint8_t modrm = next(); trace(Callstack_depth+1, "run") << "set r8/m8-at-rm32" << end(); uint8_t* dest = effective_byte_address(modrm); *dest = (!CF && !ZF); trace(Callstack_depth+1, "run") << "storing " << NUM(*dest) << end(); break; } case 0x9d: { // set r8/m8-at-rm32 if !SF const uint8_t modrm = next(); trace(Callstack_depth+1, "run") << "set r8/m8-at-rm32" << end(); uint8_t* dest = effective_byte_address(modrm); *dest = (SF == OF); trace(Callstack_depth+1, "run") << "storing " << NUM(*dest) << end(); break; } case 0x93: { // set r8/m8-at-rm32 if !CF const uint8_t modrm = next(); trace(Callstack_depth+1, "run") << "set r8/m8-at-rm32" << end(); uint8_t* dest = effective_byte_address(modrm); *dest = !CF; trace(Callstack_depth+1, "run") << "storing " << NUM(*dest) << end(); break; } case 0x9c: { // set r8/m8-at-rm32 if SF and !ZF const uint8_t modrm = next(); trace(Callstack_depth+1, "run") << "set r8/m8-at-rm32" << end(); uint8_t* dest = effective_byte_address(modrm); *dest = (SF != OF); trace(Callstack_depth+1, "run") << "storing " << NUM(*dest) << end(); break; } case 0x92: { // set r8/m8-at-rm32 if CF const uint8_t modrm = next(); trace(Callstack_depth+1, "run") << "set r8/m8-at-rm32" << end(); uint8_t* dest = effective_byte_address(modrm); *dest = CF; trace(Callstack_depth+1, "run") << "storing " << NUM(*dest) << end(); break; } case 0x9e: { // set r8/m8-at-rm32 if SF or ZF const uint8_t modrm = next(); trace(Callstack_depth+1, "run") << "set r8/m8-at-rm32" << end(); uint8_t* dest = effective_byte_address(modrm); *dest = (ZF || SF != OF); trace(Callstack_depth+1, "run") << "storing " << NUM(*dest) << end(); break; } case 0x96: { // set r8/m8-at-rm32 if ZF or CF const uint8_t modrm = next(); trace(Callstack_depth+1, "run") << "set r8/m8-at-rm32" << end(); uint8_t* dest = effective_byte_address(modrm); *dest = (ZF || CF); trace(Callstack_depth+1, "run") << "storing " << NUM(*dest) << end(); break; }