From 8aeb85f04ee68b960a6d326aca1a17dec2f6d019 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 9 Dec 2019 01:26:58 -0800 Subject: 5806 --- html/010---vm.cc.html | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'html/010---vm.cc.html') diff --git a/html/010---vm.cc.html b/html/010---vm.cc.html index f7f8be08..6d55cc8a 100644 --- a/html/010---vm.cc.html +++ b/html/010---vm.cc.html @@ -98,7 +98,7 @@ if ('onhashchange' in window) { 37 :(before "End Help Contents") 38 cerr << " registers\n"; 39 :(before "End Help Texts") - 40 put_new(Help, "registers", + 40 put_new(Help, "registers", 41 "SubX currently supports eight 32-bit integer registers. From 0 to 7, they are:\n" 42 " EAX ECX EDX EBX ESP EBP ESI EDI\n" 43 "ESP contains the top of the stack.\n" @@ -124,11 +124,11 @@ if ('onhashchange' in window) { 63 "Various instructions (particularly 'compare') modify one or more of four 1-bit\n" 64 "'flag' registers, as a side-effect:\n" 65 "- the sign flag (SF): usually set if an arithmetic result is negative, or\n" - 66 " reset if not.\n" - 67 "- the zero flag (ZF): usually set if a result is zero, or reset if not.\n" - 68 "- the carry flag (CF): usually set if an arithmetic result overflows by just one bit.\n" + 66 " reset if not.\n" + 67 "- the zero flag (ZF): usually set if a result is zero, or reset if not.\n" + 68 "- the carry flag (CF): usually set if an arithmetic result overflows by just one bit.\n" 69 " Useful for operating on unsigned numbers.\n" - 70 "- the overflow flag (OF): usually set if an arithmetic result overflows by more\n" + 70 "- the overflow flag (OF): usually set if an arithmetic result overflows by more\n" 71 " than one bit. Useful for operating on signed numbers.\n" 72 "The flag bits are read by conditional jumps.\n" 73 "\n" @@ -201,7 +201,7 @@ if ('onhashchange' in window) { 140 :(code) 141 void sanity_check(uint32_t start, uint32_t end) { 142 bool dup_found = false; -143 for (int i = 0; i < SIZE(Mem); ++i) { +143 for (int i = 0; i < SIZE(Mem); ++i) { 144 const vma& curr = Mem.at(i); 145 if (curr.start == start) { 146 assert(!dup_found); @@ -246,16 +246,16 @@ if ('onhashchange' in window) { 185 186 inline uint8_t* mem_addr_u8(uint32_t addr) { 187 uint8_t* result = NULL; -188 for (int i = 0; i < SIZE(Mem); ++i) { +188 for (int i = 0; i < SIZE(Mem); ++i) { 189 if (Mem.at(i).match(addr)) { 190 if (result) -191 raise << "address 0x" << HEXWORD << addr << " is in two segments\n" << end(); +191 raise << "address 0x" << HEXWORD << addr << " is in two segments\n" << end(); 192 result = &Mem.at(i).data(addr); 193 } 194 } 195 if (result == NULL) { -196 if (Trace_file) Trace_file.flush(); -197 raise << "Tried to access uninitialized memory at address 0x" << HEXWORD << addr << '\n' << end(); +196 if (Trace_file) Trace_file.flush(); +197 raise << "Tried to access uninitialized memory at address 0x" << HEXWORD << addr << '\n' << end(); 198 exit(1); 199 } 200 return result; @@ -265,17 +265,17 @@ if ('onhashchange' in window) { 204 } 205 inline uint32_t* mem_addr_u32(uint32_t addr) { 206 uint32_t* result = NULL; -207 for (int i = 0; i < SIZE(Mem); ++i) { +207 for (int i = 0; i < SIZE(Mem); ++i) { 208 if (Mem.at(i).match32(addr)) { 209 if (result) -210 raise << "address 0x" << HEXWORD << addr << " is in two segments\n" << end(); +210 raise << "address 0x" << HEXWORD << addr << " is in two segments\n" << end(); 211 result = reinterpret_cast<uint32_t*>(&Mem.at(i).data(addr)); 212 } 213 } 214 if (result == NULL) { -215 if (Trace_file) Trace_file.flush(); -216 raise << "Tried to access uninitialized memory at address 0x" << HEXWORD << addr << '\n' << end(); -217 raise << "The entire 4-byte word should be initialized and lie in a single segment.\n" << end(); +215 if (Trace_file) Trace_file.flush(); +216 raise << "Tried to access uninitialized memory at address 0x" << HEXWORD << addr << '\n' << end(); +217 raise << "The entire 4-byte word should be initialized and lie in a single segment.\n" << end(); 218 exit(1); 219 } 220 return result; @@ -314,10 +314,10 @@ if ('onhashchange' in window) { 253 254 inline bool already_allocated(uint32_t addr) { 255 bool result = false; -256 for (int i = 0; i < SIZE(Mem); ++i) { +256 for (int i = 0; i < SIZE(Mem); ++i) { 257 if (Mem.at(i).match(addr)) { 258 if (result) -259 raise << "address 0x" << HEXWORD << addr << " is in two segments\n" << end(); +259 raise << "address 0x" << HEXWORD << addr << " is in two segments\n" << end(); 260 result = true; 261 } 262 } @@ -331,7 +331,7 @@ if ('onhashchange' in window) { 270 void run_one_instruction() { 271 uint8_t op=0, op2=0, op3=0; 272 // Run One Instruction -273 if (Trace_file) { +273 if (Trace_file) { 274 dump_registers(); 275 // End Dump Info for Instruction 276 } @@ -414,7 +414,7 @@ if ('onhashchange' in window) { 353 init_op_names(); 354 :(code) 355 void init_op_names() { -356 put(Name, "f4", "halt (hlt)"); +356 put(Name, "f4", "halt (hlt)"); 357 // End Initialize Op Names 358 } 359 -- cgit 1.4.1-2-gfad0