1 ;============================================================================= 2 ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 ;----------------------------------------------------------------------------- 6 ; insight.asm 7 ; Main module. 8 ;----------------------------------------------------------------------------- 9 ; This program is free software; you can redistribute it and/or 10 ; modify it under the terms of the GNU General Public License 11 ; as published by the Free Software Foundation; either version 2 12 ; of the License, or (at your option) any later version. 13 ; 14 ; This program is distributed in the hope that it will be useful, 15 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 ; GNU General Public License for more details. 18 ; 19 ; You should have received a copy of the GNU General Public License 20 ; along with this program; if not, write to the Free Software 21 ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 ; 02110-1301 USA 23 ;============================================================================= 24 25 26 %include "lmacros3.mac" 1 <1> [list -] 14 <2> [list -] 14 <1> [list -] 27 28 29 ;============================================================================= 30 ; Constants. 31 ;============================================================================= 32 %include "insight.inc" ;Constants 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; insight.inc 7 <1> ; Constants. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; Changelog 28 <1> ;----------------------------------------------------------------------------- 29 <1> ; 2007-02-27 0leg Added CONFIG_BORLAND_MENU, MAX_SCR_ROWS. 30 <1> ; Changed definition of DUMP_Y. 31 <1> ; 2007-03-24 0leg Added USED_COLS. 32 <1> ;============================================================================= 33 <1> 34 <1> 35 <1> %define DRAWING_LIST "" 36 <1> %define ASCII_LIST "" 37 <1> %assign DRAWINDEX 0 38 <1> %macro drawchoice 2.nolist 39 <1> %xdefine DRAWING_LIST DRAWING_LIST,%1 40 <1> %xdefine ASCII_LIST ASCII_LIST,%2 41 <1> %xdefine DRAWADDRESS draw_table + DRAWINDEX 42 <1> %assign DRAWINDEX DRAWINDEX + 1 43 <1> %endmacro 44 <1> 45 <1> %define ARROW_OFFSET_LIST "" 46 <1> %macro drawarrowoffset 1.nolist 47 <1> %%offset equ $ + (%1) 48 <1> %xdefine ARROW_OFFSET_LIST ARROW_OFFSET_LIST,%%offset 49 <1> %endmacro 50 <1> 51 <1> 52 <1> ;============================================================================= 53 <1> %define SERIAL_NUMBER "Insight 1.24" 54 <1> %define BUILD "2009-01-11" 55 <1> 56 <1> ; Borland-style menu if defined, Norton-style otherwise. 57 <1> %define CONFIG_BORLAND_MENU 58 <1> 59 <1> %define WINDOW_BUF_SIZE 2800 60 <1> %define STRING_BUF_SIZE (WINDOW_BUF_SIZE - 256 * 3) 61 <1> 62 <1> ;No more needed 63 <1> %define PaletteBuffer (window_buffer + STRING_BUF_SIZE) 64 <1> 65 <1> %define follow_stack PaletteBuffer 66 <1> 67 <1> %define jmps jmp short 68 <1> 69 <1> USED_COLS equ 80 ;Number of columns used by debugger 70 <1> 71 <1> %if SCR_WIDTH==80 72 <1> 73 <1> ; Settings for mode 80x25. 74 <1> SCR_COLS equ 80 ;Number of columns on the screen 75 <1> SCR_ROWS equ 25 ;Number of rows on the screen 76 <1> MAX_SCR_ROWS equ 50 ;Max. number of rows on the screen 77 <1> 78 <1> %elif SCR_WIDTH==90 79 <1> 80 <1> ; Settings for mode 90x25. 81 <1> SCR_COLS equ 90 ;Number of columns on the screen 82 <1> SCR_ROWS equ 25 ;Number of rows on the screen 83 <1> MAX_SCR_ROWS equ 30 ;Max. number of rows on the screen 84 <1> 85 <1> %else 86 <1> 87 <1> ; Settings for mode 80x25 (default). 88 <1> SCR_COLS equ 80 ;Number of columns on the screen 89 <1> SCR_ROWS equ 25 ;Number of rows on the screen 90 <1> MAX_SCR_ROWS equ 50 ;Max. number of rows on the screen 91 <1> 92 <1> %endif 93 <1> 94 <1> 95 <1> SEARCH_FILL_LEN equ 50 96 <1> FILENAME_LEN equ 80 97 <1> 98 <1> STACK_SIZE equ 800h ;Size of debugger's stack (in bytes) 99 <1> MAX_PROGRAM_SIZE equ 65000 ;Max. size of debugger (code+data) 100 <1> 101 <1> ;~MaxIniFileBuff equ (200+2) 102 <1> 103 <1> NUM_FLAGS equ 8 104 <1> 105 <1> NUM_16_REGS equ 14 106 <1> NUM_32_REGS equ 24 107 <1> 108 <1> MAX_BREAKPOINTS equ 10 ;Number of breakpoints 109 <1> MAX_ITEMS equ 32 ;Max. number of elements in a 110 <1> ;dialog window 111 <1> 112 <1> ;~RPTlength equ 14 113 <1> 114 <1> %define CMD_POS 21 115 <1> 116 <1> ;~NameStrSize equ 64 117 <1> ;~NameStrLen equ 100 118 <1> MAX_FILENAME equ 150 ;??? Not used ??? 119 <1> ADDRESS_STRING_LENGTH equ 24 ;Length of address input lines 120 <1> 121 <1> CPU_ADDR_SIZE equ 6 122 <1> CPU_OPCODE_SIZE equ 15 123 <1> 124 <1> CPU_X equ 0 125 <1> CPU_Y equ 0 126 <1> CPU_START equ (CPU_Y*SCR_COLS+CPU_X)*2 127 <1> CMD_START equ ((CPU_Y+1)*SCR_COLS+CPU_X)*2 128 <1> CPU_WIDTH equ 54 129 <1> CPU_HEIGHT equ 17 130 <1> 131 <1> REG_X equ CPU_X+CPU_WIDTH+1 132 <1> REG_Y equ 0 133 <1> REG_START equ (REG_Y*SCR_COLS+REG_X)*2 134 <1> 135 <1> DUMP_HEIGHT equ 5 136 <1> DUMP_X equ 0 137 <1> DUMP_Y equ CPU_HEIGHT+3 138 <1> DUMP_START equ (DUMP_Y*SCR_COLS+DUMP_X)*2 139 <1> 140 <1> STK16_X equ REG_X 141 <1> STK16_Y equ 10 142 <1> STK16_LEN equ 8 143 <1> STK16_START equ ((STK16_Y+STK16_LEN-1)*SCR_COLS+(STK16_X))*2 144 <1> 145 <1> STK32_X equ REG_X 146 <1> STK32_Y equ 13 147 <1> STK32_LEN equ 5 148 <1> STK32_START equ ((STK32_Y+STK32_LEN-1)*SCR_COLS+(STK32_X))*2 149 <1> 150 <1> STK_BOT_Y equ CPU_Y+CPU_HEIGHT 151 <1> STK_START equ ((STK32_Y+STK32_LEN-1)*SCR_COLS+(STK32_X))*2 152 <1> 153 <1> FLAG16_X equ REG_X 154 <1> FLAG16_Y equ (STK16_Y-3) 155 <1> FLAG16_START equ (FLAG16_Y*SCR_COLS+FLAG16_X)*2 156 <1> 157 <1> FLAG32_X equ REG_X 158 <1> FLAG32_Y equ (STK32_Y-3) 159 <1> FLAG32_START equ (FLAG32_Y*SCR_COLS+FLAG32_X)*2 160 <1> 161 <1> MEM_START equ (CPU_Y+CPU_HEIGHT+1)*SCR_COLS*2+40 162 <1> WATCH_START equ (CPU_Y+CPU_HEIGHT+1)*SCR_COLS*2+40+42+8 163 <1> 164 <1> MAX_CUR_X equ USED_COLS-CPU_WIDTH 165 <1> ASM_LINE_SIZE equ CPU_WIDTH-1-CMD_POS 166 <1> MAX_ASM_SIZE equ USED_COLS-CMD_POS 167 <1> ADDR_STR_SIZE equ 24 168 <1> 169 <1> SCAN_CODE equ 1 170 <1> SHIFT_CODE equ 4 171 <1> 172 <1> MAGIC_REQUEST_CODE equ 0C0DEh 173 <1> DEVELOPER_ID equ 0FACEh 174 <1> APPLICATION_ID equ 1 175 <1> DEBUGGER_VERSION equ 0103h 176 <1> MAGIC_ANSWER_CODE equ 0FADEh 177 <1> 178 <1> ED_DUMP equ 1 179 <1> ED_STACK equ 2 180 <1> 181 <1> ;----------------------------------------------------------------------------- 182 <1> BP_UNUSED equ 0 183 <1> BP_ENABLED equ 1 184 <1> BP_DISABLED equ 2 185 <1> ;----------------------------------------------------------------------------- 186 <1> BP_SEG equ 0 ;w 187 <1> BP_OFFS equ 2 ;w 188 <1> BP_BYTE equ 4 ;b 189 <1> BP_SET equ 5 ;b 190 <1> BP_ACTIVE equ 6 ;b 191 <1> 192 <1> SIZEOF_BREAKPOINT equ 7 ;Size of breakpoint structure 193 <1> ;----------------------------------------------------------------------------- 194 <1> AP_REG_NUMBER equ 0 ;b, -1 195 <1> AP_VALUE equ 1 ;w, 0 196 <1> AP_MEM_FLAG equ 3 ;b, 0 197 <1> AP_BX_FLAG equ 4 ;b, 0 198 <1> AP_BP_FLAG equ 5 ;b, 0 199 <1> AP_SI_FLAG equ 6 ;b, 0 200 <1> AP_DI_FLAG equ 7 ;b, 0 201 <1> AP_WORD_FLAG equ 8 ;b, 0 202 <1> 203 <1> SIZEOF_ASM_PARAM equ 9 204 <1> ;----------------------------------------------------------------------------- 205 <1> REG_POS_X equ 0 ;b \ register 206 <1> REG_POS_Y equ 1 ;b / position 207 <1> REG_POS_LINK equ 2 ;w ptr to saved reg 208 <1> REG_POS_LEFT equ 4 ;b -. 209 <1> REG_POS_RIGHT equ 5 ;b | distance between this reg. struc 210 <1> REG_POS_UP equ 6 ;b | and linked struc 211 <1> REG_POS_DOWN equ 7 ;b -' 212 <1> 213 <1> SIZEOF_REG_POS equ 8 214 <1> ;----------------------------------------------------------------------------- 215 <1> REG_AX equ 0 216 <1> REG_BX equ 4 217 <1> REG_CX equ 8 218 <1> REG_DX equ 12 219 <1> ; 220 <1> REG_SI equ 16 221 <1> REG_DI equ 20 222 <1> REG_BP equ 24 223 <1> REG_SP equ 28 224 <1> ; 225 <1> REG_CS equ 32 226 <1> REG_DS equ 36 227 <1> REG_ES equ 40 228 <1> REG_SS equ 44 229 <1> ; 230 <1> REG_FS equ 48 231 <1> REG_GS equ 52 232 <1> REG_IP equ 56 233 <1> REG_FL equ 60 234 <1> 235 <1> SIZEOF_REGISTERS_32 equ 64 236 <1> ;----------------------------------------------------------------------------- 237 <1> 238 <1> DOS_GET_RETURN_CODE equ 4dh 239 <1> 240 <1> ;============================================================================= 241 <1> 242 <1> ; Keyboard constants 243 <1> 244 <1> kbF1 equ 3B00h 245 <1> kbF2 equ 3C00h 246 <1> kbF3 equ 3D00h 247 <1> kbF4 equ 3E00h 248 <1> kbF5 equ 3F00h 249 <1> kbF6 equ 4000h 250 <1> kbF7 equ 4100h 251 <1> kbF8 equ 4200h 252 <1> kbF9 equ 4300h 253 <1> kbF10 equ 4400h 254 <1> 255 <1> kbCtrlF1 equ 5E00h 256 <1> kbCtrlF2 equ 5F00h 257 <1> kbCtrlF3 equ 6000h 258 <1> kbCtrlF4 equ 6100h 259 <1> kbCtrlF5 equ 6200h 260 <1> kbCtrlF6 equ 6300h 261 <1> kbCtrlF7 equ 6400h 262 <1> kbCtrlF8 equ 6500h 263 <1> kbCtrlF9 equ 6600h 264 <1> kbCtrlF10 equ 6700h 265 <1> 266 <1> kbAltF1 equ 6800h 267 <1> kbAltF2 equ 6900h 268 <1> kbAltF3 equ 6A00h 269 <1> kbAltF4 equ 6B00h 270 <1> kbAltF5 equ 6C00h 271 <1> kbAltF6 equ 6D00h 272 <1> kbAltF7 equ 6E00h 273 <1> kbAltF8 equ 6F00h 274 <1> kbAltF9 equ 7000h 275 <1> kbAltF10 equ 7100h 276 <1> 277 <1> kbShiftF1 equ 5400h 278 <1> kbShiftF2 equ 5500h 279 <1> kbShiftF3 equ 5600h 280 <1> kbShiftF4 equ 5700h 281 <1> kbShiftF5 equ 5800h 282 <1> kbShiftF6 equ 5800h 283 <1> kbShiftF7 equ 5A00h 284 <1> kbShiftF8 equ 5B00h 285 <1> kbShiftF9 equ 5C00h 286 <1> kbShiftF10 equ 5D00h 287 <1> 288 <1> kbAltEqu equ 8300h 289 <1> 290 <1> kbAlt1 equ 7800h 291 <1> kbAlt2 equ 7900h 292 <1> kbAlt3 equ 7A00h 293 <1> kbAlt4 equ 7B00h 294 <1> kbAlt5 equ 7C00h 295 <1> kbAlt6 equ 7D00h 296 <1> kbAlt7 equ 7E00h 297 <1> kbAlt8 equ 7F00h 298 <1> kbAlt9 equ 8000h 299 <1> kbAlt0 equ 8100h 300 <1> 301 <1> kbAltQ equ 1000h 302 <1> kbAltW equ 1100h 303 <1> kbAltE equ 1200h 304 <1> kbAltR equ 1300h 305 <1> kbAltT equ 1400h 306 <1> kbAltY equ 1500h 307 <1> kbAltU equ 1600h 308 <1> kbAltI equ 1700h 309 <1> kbAltO equ 1800h 310 <1> kbAltP equ 1900h 311 <1> 312 <1> kbAltA equ 1E00h 313 <1> kbAltS equ 1F00h 314 <1> kbAltD equ 2000h 315 <1> kbAltF equ 2100h 316 <1> kbAltG equ 2200h 317 <1> kbAltH equ 2300h 318 <1> kbAltJ equ 2400h 319 <1> kbAltK equ 2500h 320 <1> kbAltL equ 2600h 321 <1> 322 <1> kbAltZ equ 2C00h 323 <1> kbAltX equ 2D00h 324 <1> kbAltC equ 2E00h 325 <1> kbAltV equ 2F00h 326 <1> kbAltB equ 3000h 327 <1> kbAltN equ 3100h 328 <1> kbAltM equ 3200h 329 <1> 330 <1> kbCtrlA equ 1E01h 331 <1> kbCtrlB equ 3002h 332 <1> kbCtrlC equ 2E03h 333 <1> kbCtrlD equ 2004h 334 <1> kbCtrlE equ 1205h 335 <1> kbCtrlF equ 2106h 336 <1> kbCtrlG equ 2207h 337 <1> kbCtrlH equ 2308h 338 <1> kbCtrlI equ 1709h 339 <1> kbCtrlJ equ 240Ah 340 <1> kbCtrlK equ 250Bh 341 <1> kbCtrlL equ 260Ch 342 <1> kbCtrlM equ 320Dh 343 <1> kbCtrlN equ 310Eh 344 <1> kbCtrlO equ 180Fh 345 <1> kbCtrlP equ 1910h 346 <1> kbCtrlQ equ 1011h 347 <1> kbCtrlR equ 1312h 348 <1> kbCtrlS equ 1F13h 349 <1> kbCtrlT equ 1414h 350 <1> kbCtrlU equ 1615h 351 <1> kbCtrlV equ 2F16h 352 <1> kbCtrlW equ 1117h 353 <1> kbCtrlX equ 2D18h 354 <1> kbCtrlY equ 1519h 355 <1> kbCtrlZ equ 2C1Ah 356 <1> kbCtrlYGerman equ 2C19h 357 <1> kbCtrlZGerman equ 151Ah 358 <1> 359 <1> kbHome equ 4700h 360 <1> kbUp equ 4800h 361 <1> kbPgUp equ 4900h 362 <1> kbLeft equ 4B00h 363 <1> kbRight equ 4D00h 364 <1> kbEnd equ 4F00h 365 <1> kbDown equ 5000h 366 <1> kbPgDn equ 5100h 367 <1> 368 <1> kbShiftHome equ 4737h 369 <1> kbShiftUp equ 4838h 370 <1> kbShiftPgUp equ 4939h 371 <1> kbShiftLeft equ 4B34h 372 <1> kbShiftRight equ 4D36h 373 <1> kbShiftEnd equ 4F31h 374 <1> kbShiftDown equ 5032h 375 <1> kbShiftPgDn equ 5133h 376 <1> 377 <1> kbIns equ 5200h 378 <1> kbDel equ 5300h 379 <1> 380 <1> kbEsc equ 011Bh 381 <1> kbEnter equ 1C0Dh 382 <1> kbTab equ 0F09h 383 <1> kbBackSpace equ 0E08h 384 <1> kbShiftTab equ 0F00h 385 <1> kbCtrlEnter equ 1C0Ah 386 <1> kbSpace equ 3920h 387 <1> kbGrayPlus equ 4E2Bh 388 <1> kbGrayMinus equ 4A2Dh 389 <1> 390 <1> kbCtrlLeft equ 7300h 391 <1> kbCtrlRight equ 7400h 392 <1> 393 <1> kbAltAlone equ 0FFFEh 394 <1> ;============================================================================= 395 <1> ; Colors 396 <1> ; 397 <1> BLACK equ 0 398 <1> BLUE equ 1 399 <1> GREEN equ 2 400 <1> CYAN equ 3 401 <1> RED equ 4 402 <1> MAGENTA equ 5 403 <1> BROWN equ 6 404 <1> LIGHT_GRAY equ 7 405 <1> 406 <1> DARK_GRAY equ 8 407 <1> LIGHT_BLUE equ 9 408 <1> LIGHT_GREEN equ 10 409 <1> LIGHT_CYAN equ 11 410 <1> LIGHT_RED equ 12 411 <1> LIGHT_MAGENTA equ 13 412 <1> YELLOW equ 14 413 <1> WHITE equ 15 414 <1> 415 <1> ;----------------------------------------------------------------------------- 416 <1> %macro reg_pos 7 417 <1> db REG_X+%1 418 <1> db REG_Y+%2 419 <1> dw cpu_regs+REG_%3 420 <1> db %4 421 <1> db %5 422 <1> db %6 423 <1> db %7 424 <1> %endmacro 425 <1> ; 426 <1> ;----------------------------------------------------------------------------- 427 <1> CMD_HELP equ 1b 428 <1> CMD_RESIDENT equ 10b 429 <1> CMD_SKIP_MOD equ 100b 430 <1> CMD_SKIP_INI equ 1000b 431 <1> CMD_UNLOAD equ 10000b 432 <1> CMD_EGA equ 100000b 433 <1> CMD_ASCII equ 1000000b 434 <1> CMD_ERROR equ 10000000b 435 <1> ;----------------------------------------------------------------------------- 436 <1> SRCH_IGN_CASE equ 1b 437 <1> SRCH_BACKWARD equ 10b 438 <1> SRCH_EXCL_HMA equ 100b 439 <1> SRCH_RES_CODE equ 1000b 440 <1> ;----------------------------------------------------------------------------- 441 <1> ;******** Assembler *********** 442 <1> 443 <1> ER_EMPTY equ 1 444 <1> ER_MNEMONIC equ 2 445 <1> ER_INV_PARAM equ 3 446 <1> ER_MEM_PARAM equ 4 447 <1> ER_EXTRA equ 5 448 <1> ER_BIG_NUMBER equ 6 449 <1> ER_REG_BITS equ 7 450 <1> erParamType equ 8 451 <1> ER_REP_ERROR equ 8 452 <1> 453 <1> regAL equ 0 454 <1> regCL equ 1 455 <1> regDL equ 2 456 <1> regBL equ 3 457 <1> regAH equ 4 458 <1> regCH equ 5 459 <1> regDH equ 6 460 <1> regBH equ 7 461 <1> regAX equ 8 462 <1> regCX equ 9 463 <1> regDX equ 10 464 <1> regBX equ 11 465 <1> regSP equ 12 466 <1> regBP equ 13 467 <1> regSI equ 14 468 <1> regDI equ 15 469 <1> 470 <1> MAX_LETTER equ 7 471 <1> ;============================================================================= 472 <1> ;****** CPU ******** 473 <1> 474 <1> I8086 equ 0 475 <1> I8088 equ 1 476 <1> I80286 equ 2 477 <1> I80386 equ 3 478 <1> I80486 equ 4 479 <1> 480 <1> ;============================================================================= 481 <1> ;******** dialogs ******** 482 <1> 483 <1> BF_DEFAULT equ 1 484 <1> CM_CANCEL equ 0 485 <1> CM_DEFAULT equ 1 486 <1> CM_OK equ 1 487 <1> 488 <1> ; The item types are used in dialog data definitions, which are 489 <1> ; all stored in actdlgs.inc currently. They are used as offsets 490 <1> ; into the items_table (actdata.inc) which has two word offsets 491 <1> ; (thus 4 bytes) per item type. The item types are stored as words 492 <1> ; in the dialog definitions, but only a byte is checked in a few 493 <1> ; places in dialogs.inc (in exec_dialog). 494 <1> ; The dialog window structure (dialog data definition) is described 495 <1> ; in the protocol comment of init_dialog (dialogs.inc). The formats 496 <1> ; of the item-type-specific structures are described in the comments 497 <1> ; of the corresponding init_* functions (also in dialogs.inc). 498 <1> PUSH_BUTTON equ 0 499 <1> INPUT_LINE equ 4 500 <1> STATIC_TEXT equ 8 501 <1> CHECK_BOXES equ 12 502 <1> STRING_LIST equ 16 503 <1> 504 <1> ;============================================================================= 505 <1> ;******** follow *********** 506 <1> 507 <1> RF_FOLLOW equ 1b 508 <1> RF_JUMP equ 10b 509 <1> RF_BACKWARD equ 100b 510 <1> RF_CONDITION equ 1000b 511 <1> RF_TRUE equ 10000b 512 <1> RF_PREFIX equ 100000b 513 <1> RF_ADDRESS_32 equ 1000000b 514 <1> RF_OPERAND_32 equ 10000000b 515 <1> 516 <1> RF_32 equ (RF_OPERAND_32+RF_ADDRESS_32) 517 <1> 518 <1> ;============================================================================= 519 <1> ;******* unasm ******** 520 <1> 521 <1> %define CMD_X CMD_POS+buffer 522 <1> %define OPER_X CMD_POS+8+buffer 523 <1> %define BUF_SIZE 80 524 <1> 525 <1> ;============================================================================= 526 <1> ;******* windows ********* 527 <1> 528 <1> SUB_MENU equ 1 529 <1> 530 <1> ;============================================================================= 531 <1> SEPARATOR equ 0 532 <1> DISABLED equ 2 533 <1> ;============================================================================= 534 <1> 535 <1> COLOR_SEG equ 0b800h 536 <1> 537 <1> ;============================================================================= 538 <1> ; E0F 539 <1> ;============================================================================= 540 <1> 541 <1> 33 %defstr str_col_sch COL_SCH 34 %include str_col_sch ;Color scheme 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; data\colors_k.inc 7 <1> ; Colors definition. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> %define MAIN_BG BLACK 26 <1> %define MAIN_FG LIGHT_GRAY 27 <1> %define BORDER_FG WHITE 28 <1> %define TITLE_FG YELLOW 29 <1> %define CPU_NAME_FG CYAN 30 <1> 31 <1> %define CODE_MARK_FG LIGHT_RED 32 <1> %define UNASM_ADDR_FG LIGHT_CYAN 33 <1> %define DATA_WATCH_FG LIGHT_RED 34 <1> %define ADDR_FG LIGHT_GRAY 35 <1> %define NAME_FG LIGHT_GRAY 36 <1> %define VALUE_FG LIGHT_GREEN 37 <1> %define NEW_VALUE_FG LIGHT_CYAN 38 <1> 39 <1> %define OP_FG GREEN 40 <1> %define INS_FG LIGHT_GREEN 41 <1> %define NUM_FG CYAN 42 <1> %define ARR_FG WHITE 43 <1> %define DIS_FG LIGHT_GRAY 44 <1> 45 <1> %define CPU_S_BG LIGHT_GRAY 46 <1> %define ADR_S_FG BLACK 47 <1> %define OP_S_FG BLACK 48 <1> %define INS_S_FG BLACK 49 <1> %define NUM_S_FG BLACK 50 <1> %define ARR_S_FG LIGHT_CYAN 51 <1> %define DIS_S_FG DARK_GRAY 52 <1> 53 <1> %define CPU_B_BG RED 54 <1> %define ADR_B_FG WHITE 55 <1> %define OP_B_FG WHITE 56 <1> %define INS_B_FG WHITE 57 <1> %define NUM_B_FG WHITE 58 <1> %define ARR_B_FG WHITE 59 <1> %define DIS_B_FG DARK_GRAY 60 <1> 61 <1> %define ADR_BD_FG DARK_GRAY 62 <1> %define OP_BD_FG DARK_GRAY 63 <1> %define INS_BD_FG DARK_GRAY 64 <1> %define NUM_BD_FG DARK_GRAY 65 <1> %define ARR_BD_FG WHITE 66 <1> %define DIS_BD_FG DARK_GRAY 67 <1> 68 <1> %define ADR_BDS_FG DARK_GRAY 69 <1> %define OP_BDS_FG DARK_GRAY 70 <1> %define INS_BDS_FG DARK_GRAY 71 <1> %define NUM_BDS_FG DARK_GRAY 72 <1> %define ARR_BDS_FG WHITE 73 <1> %define DIS_BDS_FG DARK_GRAY 74 <1> 75 <1> %define CPU_BS_BG MAGENTA 76 <1> %define ADR_BS_FG WHITE 77 <1> %define OP_BS_FG WHITE 78 <1> %define INS_BS_FG WHITE 79 <1> %define NUM_BS_FG WHITE 80 <1> %define ARR_BS_FG WHITE 81 <1> %define DIS_BS_FG DARK_GRAY 82 <1> 83 <1> %define ADR_NF_FG YELLOW 84 <1> %define OP_NF_FG YELLOW 85 <1> %define INS_NF_FG YELLOW 86 <1> %define NUM_NF_FG YELLOW 87 <1> %define ARR_NF_FG WHITE 88 <1> %define DIS_NF_FG LIGHT_GRAY 89 <1> 90 <1> %define DUMP_CUR_BG BLUE 91 <1> %define DUMP_CUR_FG WHITE 92 <1> %define DUMP_ZERO_FG GREEN 93 <1> 94 <1> %define MENU_BG LIGHT_GRAY 95 <1> %define MENU_S_BG GREEN 96 <1> %define MENU_BORDER_FG BLACK 97 <1> %define MENU_TXT_FG BLACK 98 <1> %define MENU_HOT_FG RED 99 <1> %define MENU_DIS_FG DARK_GRAY 100 <1> %define MENU_S_TXT_FG BLACK 101 <1> %define MENU_S_HOT_FG RED 102 <1> %define MENU_S_DIS_FG DARK_GRAY 103 <1> 104 <1> %define MSG_BOX_BG BLUE 105 <1> %define MSG_BOX_B_FG WHITE 106 <1> %define MSG_BOX_T_FG LIGHT_CYAN 107 <1> %define MSG_BOX_M_FG YELLOW 108 <1> 109 <1> %define ERR_BOX_BG RED 110 <1> %define ERR_BOX_B_FG WHITE 111 <1> %define ERR_BOX_T_FG YELLOW 112 <1> %define ERR_BOX_M_FG YELLOW 113 <1> 114 <1> %define DIALOG_BG LIGHT_GRAY 115 <1> %define DIALOG_B_FG WHITE 116 <1> %define DIALOG_T_FG WHITE 117 <1> 118 <1> %define WINDOW_SH_BG BLACK 119 <1> %define WINDOW_SH_FG LIGHT_GRAY 120 <1> 121 <1> %define INPUT_BG BLUE 122 <1> %define INPUT_FG WHITE 123 <1> %define INPUT_S_BG GREEN 124 <1> %define INPUT_S_FG WHITE 125 <1> 126 <1> %define BUTTON_BG GREEN 127 <1> %define BUTTON_FG BLACK 128 <1> %define BUTTON_L_FG YELLOW 129 <1> %define BUTTON_S_FG WHITE 130 <1> %define BUTTON_SL_FG YELLOW 131 <1> %define BUTTON_DEF_FG BLUE 132 <1> %define BUTTON_LDEF_FG YELLOW 133 <1> %define BUTTON_SH_FG BLACK 134 <1> 135 <1> %define LABEL_FG BLACK 136 <1> %define LABEL_L_FG YELLOW 137 <1> %define LABEL_S_FG WHITE 138 <1> %define LABEL_SL_FG YELLOW 139 <1> 140 <1> %define LIST_BG CYAN 141 <1> %define LIST_S_BG GREEN 142 <1> %define LIST_FG BLACK 143 <1> %define LIST_S_FG WHITE 144 <1> %define LIST_D_FG YELLOW 145 <1> 146 <1> %define CB_RB_BG CYAN 147 <1> %define CB_RB_T_FG BLACK 148 <1> %define CB_RB_S_FG WHITE 149 <1> %define CB_RB_H_FG YELLOW 150 <1> 151 <1> %define ASM_FG WHITE 152 <1> %define ASM_B_FG LIGHT_CYAN 153 <1> 154 <1> %define MEM_ADDR_FG WHITE 155 <1> %define MEM_VAL_FG YELLOW 156 <1> 157 <1> ; HELP: 3 2 7 14 15 158 <1> 159 <1> ;============================================================================= 160 <1> ; E0F 161 <1> ;============================================================================= 35 %include "colors.inc" ;Color scheme 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; colors.inc 7 <1> ; Constants: colors. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; Main screen 28 <1> ;----------------------------------------------------------------------------- 29 <1> atMainWindow equ MAIN_BG*16+MAIN_FG 30 <1> atTitle equ MAIN_BG*16+TITLE_FG 31 <1> atCPUborder equ MAIN_BG*16+BORDER_FG 32 <1> atCPUName equ MAIN_BG*16+CPU_NAME_FG 33 <1> 34 <1> ;atCmdNormal equ atNormInstr 35 <1> ;atCmdSelected equ atSelInstr 36 <1> ;atBP_and_Cur equ atBrkSelInstr 37 <1> ;atBreakPoint equ atBrkInstr 38 <1> 39 <1> atNormAddr equ MAIN_BG*16+ADDR_FG 40 <1> atNormOpcode equ MAIN_BG*16+OP_FG 41 <1> atNormInstr equ MAIN_BG*16+INS_FG 42 <1> atNormNumber equ MAIN_BG*16+NUM_FG 43 <1> atNormArrow equ MAIN_BG*16+ARR_FG 44 <1> atNormDisable equ MAIN_BG*16+DIS_FG 45 <1> 46 <1> atSelAddr equ CPU_S_BG*16+ADR_S_FG 47 <1> atSelOpcode equ CPU_S_BG*16+OP_S_FG 48 <1> atSelInstr equ CPU_S_BG*16+INS_S_FG 49 <1> atSelNumber equ CPU_S_BG*16+NUM_S_FG 50 <1> atSelArrow equ CPU_S_BG*16+ARR_S_FG 51 <1> atSelDisable equ CPU_S_BG*16+DIS_S_FG 52 <1> 53 <1> atBrkAddr equ CPU_B_BG*16+ADR_B_FG 54 <1> atBrkOpcode equ CPU_B_BG*16+OP_B_FG 55 <1> atBrkInstr equ CPU_B_BG*16+INS_B_FG 56 <1> atBrkNumber equ CPU_B_BG*16+NUM_B_FG 57 <1> atBrkArrow equ CPU_B_BG*16+ARR_B_FG 58 <1> atBrkDisable equ CPU_B_BG*16+DIS_B_FG 59 <1> 60 <1> atBrkDisAddr equ CPU_B_BG*16+ADR_BD_FG 61 <1> atBrkDisOpcode equ CPU_B_BG*16+OP_BD_FG 62 <1> atBrkDisInstr equ CPU_B_BG*16+INS_BD_FG 63 <1> atBrkDisNumber equ CPU_B_BG*16+NUM_BD_FG 64 <1> atBrkDisArrow equ CPU_B_BG*16+ARR_BD_FG 65 <1> atBrkDisDisable equ CPU_B_BG*16+DIS_BD_FG 66 <1> 67 <1> atBrkSelAddr equ CPU_BS_BG*16+ADR_BS_FG 68 <1> atBrkSelOpcode equ CPU_BS_BG*16+OP_BS_FG 69 <1> atBrkSelInstr equ CPU_BS_BG*16+INS_BS_FG 70 <1> atBrkSelNumber equ CPU_BS_BG*16+NUM_BS_FG 71 <1> atBrkSelArrow equ CPU_BS_BG*16+ARR_BS_FG 72 <1> atBrkSelDisable equ CPU_BS_BG*16+DIS_BS_FG 73 <1> 74 <1> atBrkDSAddr equ CPU_BS_BG*16+ADR_BDS_FG 75 <1> atBrkDSOpcode equ CPU_BS_BG*16+OP_BDS_FG 76 <1> atBrkDSInstr equ CPU_BS_BG*16+INS_BDS_FG 77 <1> atBrkDSNumber equ CPU_BS_BG*16+NUM_BDS_FG 78 <1> atBrkDSArrow equ CPU_BS_BG*16+ARR_BDS_FG 79 <1> atBrkDSDisable equ CPU_BS_BG*16+DIS_BDS_FG 80 <1> 81 <1> atNFAddr equ MAIN_BG*16+ADR_NF_FG 82 <1> atNFOpcode equ MAIN_BG*16+OP_NF_FG 83 <1> atNFInstr equ MAIN_BG*16+INS_NF_FG 84 <1> atNFNumber equ MAIN_BG*16+NUM_NF_FG 85 <1> atNFArrow equ MAIN_BG*16+ARR_NF_FG 86 <1> atNFDisable equ MAIN_BG*16+DIS_NF_FG 87 <1> 88 <1> ;atCmdNormal equ LIGHT_GREEN 89 <1> ;atCmdSelected equ LIGHT_GRAY*16 90 <1> ;atBreakPoint equ RED*16+WHITE 91 <1> ;atBP&Cur equ MAGENTA*16+WHITE 92 <1> 93 <1> ;atAsmLine equ BLACK*16+WHITE 94 <1> 95 <1> atCodeMark equ MAIN_BG*16+CODE_MARK_FG 96 <1> 97 <1> atRegName equ MAIN_BG*16+NAME_FG 98 <1> atRegValue equ MAIN_BG*16+VALUE_FG 99 <1> atRegNewValue equ MAIN_BG*16+NEW_VALUE_FG 100 <1> 101 <1> atFlagValue equ MAIN_BG*16+VALUE_FG 102 <1> atFlagNewValue equ MAIN_BG*16+NEW_VALUE_FG 103 <1> 104 <1> atDumpAddr equ MAIN_BG*16+ADDR_FG 105 <1> atDumpValue equ MAIN_BG*16+VALUE_FG 106 <1> atDumpZero equ MAIN_BG*16+DUMP_ZERO_FG 107 <1> atDumpCursor equ DUMP_CUR_BG*16+DUMP_CUR_FG 108 <1> 109 <1> atStackName equ MAIN_BG*16+NAME_FG 110 <1> atStackAddr equ MAIN_BG*16+ADDR_FG 111 <1> atStackValue equ MAIN_BG*16+VALUE_FG 112 <1> 113 <1> atMemAddr equ MAIN_BG*16+MEM_ADDR_FG 114 <1> atMemValue equ MAIN_BG*16+MEM_VAL_FG 115 <1> 116 <1> atCurUnasmAddr equ MAIN_BG*16+UNASM_ADDR_FG 117 <1> 118 <1> atDataWatchMem equ MAIN_BG*16+DATA_WATCH_FG 119 <1> 120 <1> atAssembler equ CPU_S_BG*16+ASM_FG 121 <1> atsAssembler equ CPU_S_BG*16+ASM_FG 122 <1> atBrkAssembler equ CPU_BS_BG*16+ASM_B_FG 123 <1> atsBrkAssembler equ CPU_BS_BG*16+ASM_B_FG 124 <1> 125 <1> ;============================================================================= 126 <1> ; Menu. 127 <1> ;----------------------------------------------------------------------------- 128 <1> atMenuBorder equ MENU_BG*16+MENU_BORDER_FG 129 <1> atMenuNorm equ MENU_BG*16+MENU_TXT_FG 130 <1> atMenuNormHot equ MENU_BG*16+MENU_HOT_FG 131 <1> atMenuNormDis equ MENU_BG*16+MENU_DIS_FG 132 <1> atMenuSel equ MENU_S_BG*16+MENU_S_TXT_FG 133 <1> atMenuSelHot equ MENU_S_BG*16+MENU_S_HOT_FG 134 <1> atMenuSelDis equ MENU_S_BG*16+MENU_S_DIS_FG 135 <1> 136 <1> ;============================================================================= 137 <1> ; Horizontal menu. 138 <1> ;----------------------------------------------------------------------------- 139 <1> atHMenuNorm equ MENU_BG*16+MENU_TXT_FG 140 <1> atHMenuNormHot equ MENU_BG*16+MENU_HOT_FG 141 <1> atHMenuSel equ MENU_S_BG*16+MENU_S_TXT_FG 142 <1> atHMenuSelHot equ MENU_S_BG*16+MENU_S_HOT_FG 143 <1> 144 <1> ;============================================================================= 145 <1> ; Input line. 146 <1> ;----------------------------------------------------------------------------- 147 <1> atInputLine equ INPUT_BG*16+INPUT_FG 148 <1> atsInputLine equ INPUT_S_BG*16+INPUT_S_FG 149 <1> 150 <1> ;============================================================================= 151 <1> ; Message box / Error box. 152 <1> ;----------------------------------------------------------------------------- 153 <1> atMessageBox equ MSG_BOX_BG*16+MSG_BOX_B_FG 154 <1> atMessageBoxTitle equ MSG_BOX_BG*16+MSG_BOX_T_FG 155 <1> atMessage equ MSG_BOX_BG*16+MSG_BOX_M_FG 156 <1> 157 <1> atErrorBox equ ERR_BOX_BG*16+ERR_BOX_B_FG 158 <1> atErrorBoxTitle equ ERR_BOX_BG*16+ERR_BOX_T_FG 159 <1> atErrorMsg equ ERR_BOX_BG*16+ERR_BOX_M_FG 160 <1> 161 <1> ;============================================================================= 162 <1> ; Dialog windows. 163 <1> ;----------------------------------------------------------------------------- 164 <1> atDialogWindow equ DIALOG_BG*16+DIALOG_B_FG 165 <1> atDialogWindowTitle equ DIALOG_BG*16+DIALOG_T_FG 166 <1> atShadow equ WINDOW_SH_BG*16+WINDOW_SH_FG 167 <1> 168 <1> ;============================================================================= 169 <1> ; Buttons. 170 <1> ;----------------------------------------------------------------------------- 171 <1> atPushButton equ BUTTON_BG*16+BUTTON_FG 172 <1> atlPushButton equ BUTTON_BG*16+BUTTON_L_FG 173 <1> atsPushButton equ BUTTON_BG*16+BUTTON_S_FG 174 <1> atlsPushButton equ BUTTON_BG*16+BUTTON_SL_FG 175 <1> atPushButtonDef equ BUTTON_BG*16+BUTTON_DEF_FG 176 <1> atlPushButtonDef equ BUTTON_BG*16+BUTTON_LDEF_FG 177 <1> atButtonShadow equ DIALOG_BG*16+BUTTON_SH_FG 178 <1> 179 <1> ;============================================================================= 180 <1> ; Labels. 181 <1> ;----------------------------------------------------------------------------- 182 <1> atLabel equ DIALOG_BG*16+LABEL_FG 183 <1> atlLabel equ DIALOG_BG*16+LABEL_L_FG 184 <1> atsLabel equ DIALOG_BG*16+LABEL_S_FG 185 <1> atlsLabel equ DIALOG_BG*16+LABEL_SL_FG 186 <1> 187 <1> ;============================================================================= 188 <1> ; String list. 189 <1> ;----------------------------------------------------------------------------- 190 <1> atListNormal equ LIST_BG*16+LIST_FG 191 <1> atListSelected equ LIST_S_BG*16+LIST_S_FG 192 <1> atListDefault equ LIST_BG*16+LIST_D_FG 193 <1> 194 <1> ;============================================================================= 195 <1> ; Check boxes. 196 <1> ;----------------------------------------------------------------------------- 197 <1> atCheckBoxes equ CB_RB_BG*16+CB_RB_T_FG 198 <1> atsCheckBoxes equ CB_RB_BG*16+CB_RB_S_FG 199 <1> atlCheckBoxes equ CB_RB_BG*16+CB_RB_H_FG 200 <1> 201 <1> ;============================================================================= 202 <1> ; Radio buttons. 203 <1> ;----------------------------------------------------------------------------- 204 <1> atRadioButtons equ CB_RB_BG*16+CB_RB_T_FG 205 <1> atsRadioButtons equ CB_RB_BG*16+CB_RB_S_FG 206 <1> atlRadioButtons equ CB_RB_BG*16+CB_RB_H_FG 207 <1> 208 <1> ;============================================================================= 209 <1> ; E0F 210 <1> ;============================================================================= 211 <1> 36 ;============================================================================= 37 38 39 ;============================================================================= 40 ; Code. 41 ;============================================================================= 42 section .text 43 cpu 8086 44 org 100h 45 offset_0100h: 46 00000000 E92680 jmp install 47 48 ;============================================================================= 49 ; Included modules. 50 ;============================================================================= 51 %include "iface_1.inc" ;Main module: part 1 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; iface_1.inc 7 <1> ; User interface and other procedures. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; Changelog 28 <1> ;----------------------------------------------------------------------------- 29 <1> ; 2007-02-?? 0leg Too many changes... 30 <1> ; 2007-03-25 0leg reset_program and term_handler fixed. 31 <1> ; 2007-04-01 0leg draw_cpu_window optimized. _update_dump modified 32 <1> ; (highlighting of NUL bytes). 33 <1> ; 2007-12-02 0leg update_stack, edit_flags, edit_registers, edit_dump 34 <1> ; cleaned up. 35 <1> ;============================================================================= 36 <1> 37 <1> 38 <1> ;============================================================================= 39 <1> ; about 40 <1> ;----------------------------------------------------------------------------- 41 <1> ; Shows `About' or `Info' window. 42 <1> ; 43 <1> about: 44 00000003 BE[9062] <1> mov si,about_dialog 45 <1> _about: 46 00000006 E8E222 <1> call init_dialog 47 00000009 E83923 <1> call exec_dialog 48 0000000C E97217 <1> jmp draw_screen 49 <1> ;============================================================================= 50 <1> ; show_help 51 <1> ;----------------------------------------------------------------------------- 52 <1> ; Shows help screen. 53 <1> ; 54 <1> show_help: 55 0000000F E88C19 <1> call pushr 56 00000012 8E06[E27E] <1> mov es,[video_seg] 57 00000016 BE[5A78] <1> mov si,help_page1 58 00000019 E81800 <1> call show_help_page 59 0000001C E8FE1A <1> call read_key 60 0000001F 3D003B <1> cmp ax,kbF1 61 00000022 7509 <1> jne @@quit 62 00000024 BE[C47C] <1> mov si,help_page2 63 00000027 E80A00 <1> call show_help_page 64 0000002A E8F01A <1> call read_key 65 <1> @@quit: 66 0000002D E85117 <1> call draw_screen 67 00000030 E87E19 <1> call popr 68 00000033 C3 <1> ret 69 <1> ;============================================================================= 70 <1> ; show_help_page 71 <1> ;----------------------------------------------------------------------------- 72 <1> show_help_page: 73 00000034 31FF <1> xor di,di 74 00000036 BB0F80 <1> mov bx,800fh 75 00000039 31C9 <1> xor cx,cx 76 0000003B BD0100 <1> mov bp,1 77 0000003E 8CDA <1> mov dx,ds 78 <1> 79 00000040 EB01 <1> jmps decompr_start_n2b 80 <1> ;Decompressor start 81 <1> %include "n2b_d8e.inc" ;Slightly modified part of UPX 1 <2> ; n2b_d8e.ash -- ucl_nrv2b_decompress_8 in 16-bit assembly (dos/exe) 2 <2> ; 3 <2> ; This file is part of the UCL data compression library. 4 <2> ; 5 <2> ; Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer 6 <2> ; All Rights Reserved. 7 <2> ; 8 <2> ; The UCL library is free software; you can redistribute it and/or 9 <2> ; modify it under the terms of the GNU General Public License as 10 <2> ; published by the Free Software Foundation; either version 2 of 11 <2> ; the License, or (at your option) any later version. 12 <2> ; 13 <2> ; The UCL library is distributed in the hope that it will be useful, 14 <2> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 <2> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 <2> ; GNU General Public License for more details. 17 <2> ; 18 <2> ; You should have received a copy of the GNU General Public License 19 <2> ; along with the UCL library; see the file COPYING. 20 <2> ; If not, write to the Free Software Foundation, Inc., 21 <2> ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 <2> ; 23 <2> ; Markus F.X.J. Oberhumer 24 <2> ; 25 <2> ; http://www.oberhumer.com/ucl 26 <2> ; 27 <2> 28 <2> 29 <2> ; ------------- DECOMPRESSION ------------- 30 <2> 31 <2> ; Input 32 <2> ; ds:si - source 33 <2> ; es:di - dest 34 <2> ; dx = ds 35 <2> ; cx = 0 36 <2> ; bx = 0x800F 37 <2> ; bp = 1 38 <2> 39 <2> 40 <2> %ifndef jmps 41 <2> %define jmps jmp short 42 <2> %endif 43 <2> %ifndef jmpn 44 <2> %define jmpn jmp near 45 <2> %endif 46 <2> 47 <2> 48 <2> ; __NRV2B16S__ 49 <2> literal_n2b: 50 00000042 A4 <2> movsb 51 <2> decompr_start_n2b: 52 00000043 00FF <2> add bh, bh 53 00000045 7503 <2> jnz dec1_n2b 54 00000047 E86A00 <2> call reloadbh_n2b 55 <2> dec1_n2b: 56 0000004A 72F6 <2> jc literal_n2b 57 0000004C 41 <2> inc cx 58 0000004D 8CC0 <2> mov ax, es 59 <2> ;%ifdef __N2B64K01__ 60 <2> ; add di, di 61 <2> ; jnc di_ok_n2b 62 <2> ; add ah, 8 63 <2> ; mov es, ax 64 <2> ;di_ok_n2b: 65 <2> ; shr di, 1 66 <2> ;%endif; __NRV2BEX1__ 67 <2> offset_loop_n2b: 68 0000004F E85500 <2> call getbit_cx_n2b 69 00000052 E366 <2> jcxz decomp_done_n2b 70 00000054 73F9 <2> jnc offset_loop_n2b 71 00000056 49 <2> dec cx 72 00000057 49 <2> dec cx 73 00000058 7411 <2> jz offset_ok_n2b 74 <2> ;%ifdef __N2BX8601__ 75 0000005A 01C9 <2> add cx, cx 76 0000005C 01C9 <2> add cx, cx 77 0000005E 01C9 <2> add cx, cx 78 00000060 01C9 <2> add cx, cx 79 <2> ;%else; __N2B28601__ 80 <2> ; shl cx, 4 81 <2> ;%endif; __NRV2BEX2__ 82 00000062 89CD <2> mov bp, cx 83 00000064 8A1C <2> mov bl, [si] 84 00000066 46 <2> inc si 85 00000067 F6D3 <2> not bl 86 00000069 31C9 <2> xor cx, cx 87 <2> offset_ok_n2b: 88 0000006B E83900 <2> call getbit_cx_n2b 89 0000006E 11C9 <2> adc cx, cx 90 00000070 7508 <2> jnz copy_match_n2b 91 00000072 41 <2> inc cx 92 <2> length_loop_n2b: 93 00000073 E83100 <2> call getbit_cx_n2b 94 00000076 73FB <2> jnc length_loop_n2b 95 00000078 41 <2> inc cx 96 00000079 41 <2> inc cx 97 <2> copy_match_n2b: 98 0000007A 81FDD100 <2> cmp bp, 0xd1 99 0000007E 83D9FE <2> sbb cx, byte -2 100 <2> 101 00000081 29E8 <2> sub ax, bp 102 00000083 720E <2> jb handle_underflow_n2b 103 00000085 8ED8 <2> mov ds, ax 104 00000087 8D01 <2> lea ax, [bx + di] 105 <2> ds_ok_n2b: 106 00000089 28FC <2> sub ah, bh 107 0000008B 96 <2> xchg ax, si 108 0000008C F3 <2> rep 109 0000008D A4 <2> movsb 110 0000008E 96 <2> xchg ax, si 111 0000008F 8EDA <2> mov ds, dx 112 00000091 EBB0 <2> jmps decompr_start_n2b 113 <2> handle_underflow_n2b: 114 <2> ;%ifdef __N2BX8602__ 115 00000093 D1E0 <2> shl ax, 1 116 00000095 D1E0 <2> shl ax, 1 117 00000097 D1E0 <2> shl ax, 1 118 00000099 D1E0 <2> shl ax, 1 119 0000009B 50 <2> push ax 120 0000009C 31C0 <2> xor ax, ax 121 0000009E 8ED8 <2> mov ds, ax 122 000000A0 58 <2> pop ax 123 <2> ;%else; __N2B28602__ 124 <2> ; shl ax, 4 125 <2> ; push byte 0 126 <2> ; pop ds 127 <2> ;%endif; __NRV2BEX3__ 128 000000A1 01D8 <2> add ax, bx 129 000000A3 01F8 <2> add ax, di 130 000000A5 EBE2 <2> jmps ds_ok_n2b 131 <2> getbit_cx_n2b: 132 000000A7 00FF <2> add bh, bh 133 000000A9 7503 <2> jnz gb2_n2b 134 000000AB E80600 <2> call reloadbh_n2b 135 <2> gb2_n2b: 136 000000AE 11C9 <2> adc cx, cx 137 <2> getbit_n2b: 138 000000B0 00FF <2> add bh, bh 139 000000B2 7505 <2> jnz f2_n2b 140 <2> reloadbh_n2b: 141 000000B4 8A3C <2> mov bh, [si] 142 <2> ;%ifdef __N2B64K02__ 143 <2> ; adc si, si 144 <2> ; jnc si_ok_n2b 145 <2> ; add dh, 8 146 <2> ; mov ds, dx 147 <2> ;si_ok_n2b: 148 <2> ; shr si, 1 149 <2> ;%endif; __NRV2BEX9__ 150 000000B6 46 <2> inc si 151 000000B7 10FF <2> adc bh, bh 152 <2> f2_n2b: 153 000000B9 C3 <2> ret 154 <2> decomp_done_n2b: 155 <2> ; __NRV2B16E__ 156 <2> 157 <2> ; vi:ts=8:et 158 <2> 82 <1> ;Decompressor end 83 000000BA C3 <1> ret 84 <1> ;============================================================================= 85 <1> ; any_key 86 <1> ;----------------------------------------------------------------------------- 87 <1> any_key: 88 000000BB E8A91A <1> call check_shift 89 000000BE 7416 <1> jz @@check_cheat_code 90 000000C0 B90500 <1> mov cx,EDIT_PROCS_NUM 91 000000C3 BB[4B78] <1> mov bx,edit_procs 92 <1> @@next: 93 000000C6 3827 <1> cmp [bx],ah 94 000000C8 7505 <1> jne @@skip 95 000000CA FF5701 <1> call [bx+1] 96 000000CD F8 <1> clc 97 000000CE C3 <1> ret 98 <1> @@skip: 99 000000CF 83C303 <1> add bx,3 100 000000D2 E2F2 <1> loop @@next 101 <1> 102 <1> @@exit: 103 000000D4 F9 <1> stc 104 000000D5 C3 <1> ret 105 <1> 106 <1> @@check_cheat_code: 107 000000D6 E87319 <1> call upcase 108 000000D9 3445 <1> xor al,45h 109 000000DB 8B1E[D68B] <1> mov bx,[magic_offs] 110 000000DF 3887[8073] <1> cmp [magic_code+bx],al 111 000000E3 7408 <1> je @@next_char 112 000000E5 31DB <1> xor bx,bx 113 000000E7 3806[8073] <1> cmp [magic_code],al 114 000000EB 75E7 <1> jne @@exit 115 <1> @@next_char: 116 000000ED 43 <1> inc bx 117 000000EE 891E[D68B] <1> mov [magic_offs],bx 118 000000F2 80FB05 <1> cmp bl,5 119 000000F5 75DD <1> jne @@exit 120 000000F7 BE[A662] <1> mov si,info_dialog 121 000000FA E809FF <1> call _about 122 000000FD F8 <1> clc 123 000000FE C3 <1> ret 124 <1> ;============================================================================= 125 <1> ; data_watch 126 <1> ;----------------------------------------------------------------------------- 127 <1> data_watch: 128 000000FF 833E[AA8B]00 <1> cmp word [data_watch_proc],0 129 00000104 C706[AA8B]0000 <1> mov word [data_watch_proc],0 130 0000010A 750F <1> jne @@update_watch 131 0000010C A1[AC8B] <1> mov ax,[data_watch_temp] 132 0000010F 09C0 <1> or ax,ax 133 00000111 7503 <1> jnz @@on 134 00000113 E95E19 <1> jmp beep 135 <1> 136 <1> @@on: 137 00000116 A3[AA8B] <1> mov [data_watch_proc],ax 138 00000119 FFD0 <1> call ax 139 <1> @@update_watch: 140 0000011B E91C08 <1> jmp update_watch_label 141 <1> ;============================================================================= 142 <1> ; switch_reg_mode 143 <1> ;----------------------------------------------------------------------------- 144 <1> switch_reg_mode: 145 0000011E 803E[6E8B]03 <1> cmp byte [system_cpu],3 146 00000123 7303 <1> jae @@toggle 147 00000125 E94C19 <1> jmp beep 148 <1> @@toggle: 149 00000128 E87318 <1> call pushr 150 0000012B 8036[8C8B]01 <1> xor byte [regs_mode],1 151 00000130 8136[476D]0204 <1> xor word [regs_menu_1],'16' ^ '32' 152 00000136 8136[9C71]0204 <1> xor word [regs_menu_2],'16' ^ '32' 153 0000013C 8336[3478]0D <1> xor word [stack_height],STK16_LEN ^ STK32_LEN 154 00000141 E88321 <1> call get_cursor 155 00000144 E83A16 <1> call draw_screen ;CX preserved 156 00000147 E89521 <1> call set_cursor 157 0000014A E86418 <1> call popr 158 0000014D C3 <1> ret 159 <1> ;============================================================================= 160 <1> ; cur_down 161 <1> ;----------------------------------------------------------------------------- 162 <1> cur_down: 163 0000014E 833E[748B]10 <1> cmp word [cur_line],CPU_HEIGHT-1 164 00000153 720D <1> jb @@inc 165 00000155 8B36[2878] <1> mov si,[cur_ip] 166 00000159 E8692D <1> call unassemble 167 0000015C 8936[2878] <1> mov [cur_ip],si 168 00000160 EB04 <1> jmp @@quit 169 <1> @@inc: 170 00000162 FF06[748B] <1> inc word [cur_line] 171 <1> @@quit: 172 00000166 E9B908 <1> jmp update_commands 173 <1> ;============================================================================= 174 <1> ; cur_up 175 <1> ;----------------------------------------------------------------------------- 176 <1> cur_up: 177 00000169 833E[748B]00 <1> cmp word [cur_line],0 178 0000016E 773C <1> ja @@dec 179 00000170 833E[2878]00 <1> cmp word [cur_ip],0 180 00000175 7439 <1> je @@quit 181 00000177 C706[B301]1400 <1> mov word [@@c],20 ;??? 182 <1> @@next_1: 183 0000017D 8B36[2878] <1> mov si,[cur_ip] 184 00000181 2B36[B301] <1> sub si,[@@c] 185 00000185 7302 <1> jnc @@next 186 00000187 31F6 <1> xor si,si 187 <1> @@next: 188 00000189 89F5 <1> mov bp,si 189 0000018B E8372D <1> call unassemble 190 0000018E 3B36[2878] <1> cmp si,[cur_ip] 191 00000192 7412 <1> je @@found 192 00000194 3B36[2878] <1> cmp si,[cur_ip] 193 00000198 72EF <1> jb @@next 194 0000019A FF0E[B301] <1> dec word [@@c] 195 0000019E 75DD <1> jnz @@next_1 196 000001A0 FF0E[2878] <1> dec word [cur_ip] 197 000001A4 EB0A <1> jmp @@quit 198 <1> @@found: 199 000001A6 892E[2878] <1> mov [cur_ip],bp 200 000001AA EB04 <1> jmp @@quit 201 <1> @@dec: 202 000001AC FF0E[748B] <1> dec word [cur_line] 203 <1> @@quit: 204 000001B0 E96F08 <1> jmp update_commands 205 <1> 206 000001B3 1400 <1> @@c dw 20 207 <1> ;============================================================================= 208 <1> ; page_down 209 <1> ;----------------------------------------------------------------------------- 210 <1> page_down: 211 000001B5 8B36[2878] <1> mov si,[cur_ip] 212 000001B9 B91000 <1> mov cx,CPU_HEIGHT-1 213 <1> @@next: 214 000001BC E8062D <1> call unassemble 215 000001BF E2FB <1> loop @@next 216 <1> 217 000001C1 8936[2878] <1> mov [cur_ip],si 218 000001C5 E95A08 <1> jmp update_commands 219 <1> ;============================================================================= 220 <1> ; page_up 221 <1> ;----------------------------------------------------------------------------- 222 <1> page_up: 223 000001C8 8B36[2878] <1> mov si,[cur_ip] 224 000001CC 09F6 <1> or si,si 225 000001CE 743E <1> je cur_home 226 000001D0 83EE55 <1> sub si,5*CPU_HEIGHT 227 000001D3 7302 <1> jnc @@3 228 000001D5 31F6 <1> xor si,si 229 <1> @@3: 230 000001D7 B91000 <1> mov cx,CPU_HEIGHT-1 231 000001DA 31DB <1> xor bx,bx 232 <1> @@next: 233 000001DC 89B7[768D] <1> mov [instr_table+bx],si 234 000001E0 E8E22C <1> call unassemble 235 000001E3 43 <1> inc bx 236 000001E4 43 <1> inc bx 237 000001E5 E2F5 <1> loop @@next 238 <1> @@2: 239 000001E7 3B36[2878] <1> cmp si,[cur_ip] 240 000001EB 7316 <1> jae @@found 241 000001ED B90F00 <1> mov cx,CPU_HEIGHT-2 242 000001F0 FC <1> cld 243 000001F1 56 <1> push si 244 000001F2 BE[768D] <1> mov si,instr_table 245 000001F5 89F7 <1> mov di,si 246 000001F7 AD <1> lodsw 247 000001F8 F3A5 <1> rep movsw 248 000001FA 5E <1> pop si 249 000001FB 89F0 <1> mov ax,si 250 000001FD AB <1> stosw 251 000001FE E8C42C <1> call unassemble 252 00000201 EBE4 <1> jmp @@2 253 <1> @@found: 254 00000203 8B36[768D] <1> mov si,[instr_table] 255 00000207 8936[2878] <1> mov [cur_ip],si 256 0000020B E91408 <1> jmp update_commands 257 <1> ;============================================================================= 258 <1> ; cur_home 259 <1> ;----------------------------------------------------------------------------- 260 <1> cur_home: 261 0000020E C706[748B]0000 <1> mov word [cur_line],0 262 00000214 E90B08 <1> jmp update_commands 263 <1> ;============================================================================= 264 <1> ; cur_end 265 <1> ;----------------------------------------------------------------------------- 266 <1> cur_end: 267 00000217 C706[748B]1000 <1> mov word [cur_line],CPU_HEIGHT-1 268 0000021D E90208 <1> jmp update_commands 269 <1> ;============================================================================= 270 <1> ; cur_right 271 <1> ;----------------------------------------------------------------------------- 272 <1> cur_right: 273 00000220 833E[728B]1A <1> cmp word [cur_x],MAX_CUR_X 274 00000225 7307 <1> jae @@quit 275 00000227 FF06[728B] <1> inc word [cur_x] 276 0000022B E8F407 <1> call update_commands 277 <1> @@quit: 278 0000022E C3 <1> ret 279 <1> ;============================================================================= 280 <1> ; cur_left 281 <1> ;----------------------------------------------------------------------------- 282 <1> cur_left: 283 0000022F 833E[728B]00 <1> cmp word [cur_x],0 284 00000234 7407 <1> je @@quit 285 00000236 FF0E[728B] <1> dec word [cur_x] 286 0000023A E8E507 <1> call update_commands 287 <1> @@quit: 288 0000023D C3 <1> ret 289 <1> ;============================================================================= 290 <1> ; go_to_origin 291 <1> ;----------------------------------------------------------------------------- 292 <1> go_to_origin: 293 0000023E A1[E88A] <1> mov ax,[cpu_regs+REG_CS] 294 00000241 A3[9B8B] <1> mov [unasm_seg],ax 295 00000244 A1[008B] <1> mov ax,[cpu_regs+REG_IP] 296 00000247 A3[2878] <1> mov [cur_ip],ax 297 0000024A C706[748B]0000 <1> mov word [cur_line],0 298 00000250 E9CF07 <1> jmp update_commands 299 <1> ;============================================================================= 300 <1> ; new_csip 301 <1> ;----------------------------------------------------------------------------- 302 <1> new_csip: 303 00000253 A1[768B] <1> mov ax,[cur_line_ip] 304 00000256 A3[008B] <1> mov [cpu_regs+REG_IP],ax 305 00000259 A1[9B8B] <1> mov ax,[unasm_seg] 306 0000025C A3[E88A] <1> mov [cpu_regs+REG_CS],ax 307 0000025F E92E15 <1> jmp update_regs_and_cmds 308 <1> ;============================================================================= 309 <1> ; byte_up 310 <1> ;----------------------------------------------------------------------------- 311 <1> byte_up: 312 00000262 833E[2878]00 <1> cmp word [cur_ip],0 313 00000267 7407 <1> je @@quit 314 00000269 FF0E[2878] <1> dec word [cur_ip] 315 0000026D E8B207 <1> call update_commands 316 <1> @@quit: 317 00000270 C3 <1> ret 318 <1> ;============================================================================= 319 <1> ; byte_down 320 <1> ;----------------------------------------------------------------------------- 321 <1> byte_down: 322 00000271 FF06[2878] <1> inc word [cur_ip] 323 00000275 E9AA07 <1> jmp update_commands 324 <1> ;============================================================================= 325 <1> ; exec_user_screen 326 <1> ;----------------------------------------------------------------------------- 327 <1> exec_user_screen: 328 00000278 E8B929 <1> call restore_screen 329 0000027B E89F18 <1> call read_key 330 0000027E E83C29 <1> call save_screen 331 00000281 E9FD14 <1> jmp draw_screen 332 <1> ;============================================================================= 333 <1> ; restore_all 334 <1> ;----------------------------------------------------------------------------- 335 <1> restore_all: 336 00000284 E85950 <1> call restore_regs 337 <1> ; jmp update_regs_and_cmds ;2007-12-01 338 00000287 E90015 <1> jmp update_screen 339 <1> ;============================================================================= 340 <1> ; restore_flags 341 <1> ;----------------------------------------------------------------------------- 342 <1> restore_flags: 343 0000028A A1[C48A] <1> mov ax,[save_cpu_regs+REG_FL] 344 0000028D A3[048B] <1> mov [cpu_regs+REG_FL],ax 345 00000290 E9FD14 <1> jmp update_regs_and_cmds 346 <1> ;============================================================================= 347 <1> ; restore_csip 348 <1> ;----------------------------------------------------------------------------- 349 <1> restore_csip: 350 00000293 A1[C08A] <1> mov ax,[save_cpu_regs+REG_IP] 351 00000296 A3[008B] <1> mov [cpu_regs+REG_IP],ax 352 00000299 A1[A88A] <1> mov ax,[save_cpu_regs+REG_CS] 353 0000029C A3[E88A] <1> mov [cpu_regs+REG_CS],ax 354 0000029F E9EE14 <1> jmp update_regs_and_cmds 355 <1> ;============================================================================= 356 <1> ; unasm_go_to 357 <1> ;----------------------------------------------------------------------------- 358 <1> unasm_go_to: 359 000002A2 B82C09 <1> mov ax,9*256+44 360 000002A5 BF[8F90] <1> mov di,main_addr_string 361 000002A8 E81F00 <1> call read_address 362 000002AB 721C <1> jc @@quit 363 <1> 364 000002AD E8AD57 <1> call push_unasm_pos 365 <1> 366 000002B0 08ED <1> or ch,ch 367 000002B2 7409 <1> jz @@no_seg 368 000002B4 8916[9B8B] <1> mov [unasm_seg],dx 369 000002B8 80FD02 <1> cmp ch,2 370 000002BB 7403 <1> je @@no_offs 371 <1> @@no_seg: 372 000002BD A3[2878] <1> mov [cur_ip],ax 373 <1> @@no_offs: 374 000002C0 C706[748B]0000 <1> mov word [cur_line],0 375 000002C6 E85907 <1> call update_commands 376 <1> @@quit: 377 000002C9 C3 <1> ret 378 <1> ;============================================================================= 379 <1> ; read_address 380 <1> ;----------------------------------------------------------------------------- 381 <1> read_address: 382 000002CA 56 <1> push si 383 000002CB 57 <1> push di 384 000002CC 55 <1> push bp 385 000002CD 06 <1> push es 386 000002CE 1E <1> push ds 387 000002CF 07 <1> pop es 388 000002D0 893E[6C64] <1> mov [d_addr_str],di 389 000002D4 BE[5C64] <1> mov si,addr_dialog 390 000002D7 8904 <1> mov [si],ax 391 000002D9 051F07 <1> add ax,31+7*256 392 000002DC 894402 <1> mov [si+2],ax 393 000002DF E80920 <1> call init_dialog 394 <1> 395 <1> @@again: 396 000002E2 E86020 <1> call exec_dialog 397 000002E5 740F <1> jz @@error_exit 398 <1> 399 000002E7 8B36[6C64] <1> mov si,[d_addr_str] 400 000002EB E82D00 <1> call get_address 401 000002EE 72F2 <1> jc @@again 402 <1> 403 000002F0 E88E14 <1> call draw_screen 404 000002F3 F8 <1> clc 405 000002F4 EB04 <1> jmp @@exit 406 <1> 407 <1> @@error_exit: 408 000002F6 E88814 <1> call draw_screen 409 000002F9 F9 <1> stc 410 <1> @@exit: 411 000002FA 07 <1> pop es 412 000002FB 5D <1> pop bp 413 000002FC 5F <1> pop di 414 000002FD 5E <1> pop si 415 000002FE C3 <1> ret 416 <1> ;============================================================================= 417 <1> ; get_address_ds 418 <1> ;----------------------------------------------------------------------------- 419 <1> get_address_ds: 420 000002FF 1E <1> push ds 421 00000300 07 <1> pop es 422 00000301 E81700 <1> call get_address 423 00000304 7214 <1> jc @@exit 424 <1> 425 00000306 8B1E[EC8A] <1> mov bx,[cpu_regs+REG_DS] 426 0000030A 80FD01 <1> cmp ch,1 427 0000030D 740B <1> je @@exit 428 0000030F 80FD00 <1> cmp ch,0 429 00000312 7404 <1> je @@def_seg 430 00000314 31C0 <1> xor ax,ax 431 00000316 EB02 <1> jmp @@exit 432 <1> 433 <1> @@def_seg: 434 00000318 89DA <1> mov dx,bx 435 <1> 436 <1> @@exit: 437 0000031A C3 <1> ret 438 <1> ;============================================================================= 439 <1> ; get_address 440 <1> ;----------------------------------------------------------------------------- 441 <1> get_address: 442 0000031B E80D00 <1> call get_address_ 443 0000031E 7307 <1> jnc @@exit 444 <1> 445 00000320 BE[D875] <1> mov si,addr_error_msg 446 00000323 E83E14 <1> call _error_message 447 00000326 F9 <1> stc 448 <1> @@exit: 449 00000327 BE[5C64] <1> mov si,addr_dialog 450 0000032A C3 <1> ret 451 <1> ;============================================================================= 452 <1> ; get_address_ 453 <1> ;----------------------------------------------------------------------------- 454 <1> get_address_: 455 0000032B 31ED <1> xor bp,bp 456 0000032D 31D2 <1> xor dx,dx 457 0000032F 31C9 <1> xor cx,cx 458 00000331 880E[9403] <1> mov [@@op],cl 459 <1> 460 <1> @@next: 461 00000335 AC <1> lodsb 462 00000336 3C20 <1> cmp al,' ' 463 00000338 74FB <1> je @@next 464 0000033A 4E <1> dec si 465 0000033B 3C00 <1> cmp al,0 466 0000033D 743F <1> je @@done_1 467 0000033F E85300 <1> call get_reg_value 468 00000342 7405 <1> je @@do_oper 469 00000344 E88900 <1> call get_hex_value 470 00000347 7245 <1> jc @@error 471 <1> 472 <1> @@do_oper: 473 00000349 803E[9403]2D <1> cmp byte [@@op],'-' 474 0000034E 7502 <1> jne @@plus 475 00000350 F7DB <1> neg bx 476 <1> 477 <1> @@plus: 478 00000352 01DD <1> add bp,bx 479 00000354 C606[9403]00 <1> mov byte [@@op],0 480 <1> 481 <1> @@skip: 482 00000359 AC <1> lodsb 483 0000035A 3C20 <1> cmp al,' ' 484 0000035C 74FB <1> je @@skip 485 0000035E 3C00 <1> cmp al,0 486 00000360 742D <1> je @@done 487 00000362 3C3A <1> cmp al,':' 488 00000364 740D <1> je @@seg 489 00000366 3C2B <1> cmp al,'+' 490 00000368 7404 <1> je @@p 491 0000036A 3C2D <1> cmp al,'-' 492 0000036C 7520 <1> jne @@error 493 <1> 494 <1> @@p: 495 0000036E A2[9403] <1> mov [@@op],al 496 00000371 EBC2 <1> jmp @@next 497 <1> 498 <1> @@seg: 499 00000373 08C9 <1> or cl,cl 500 00000375 7517 <1> jne @@error 501 00000377 41 <1> inc cx 502 00000378 89EA <1> mov dx,bp 503 0000037A 31ED <1> xor bp,bp 504 0000037C EBB7 <1> jmp @@next 505 <1> 506 <1> @@done_1: 507 0000037E 803E[9403]00 <1> cmp byte [@@op],0 508 00000383 7509 <1> jne @@error 509 00000385 83F901 <1> cmp cx,1 510 00000388 7501 <1> jne @@ok 511 0000038A 41 <1> inc cx 512 <1> @@ok: 513 0000038B F8 <1> clc 514 0000038C EB01 <1> jmp @@done 515 <1> 516 <1> @@error: 517 <1> @@error_exit: 518 0000038E F9 <1> stc 519 <1> 520 <1> @@done: 521 0000038F 89E8 <1> mov ax,bp 522 00000391 88CD <1> mov ch,cl 523 00000393 C3 <1> ret 524 <1> 525 00000394 00 <1> @@op db 0 526 <1> ;============================================================================= 527 <1> ; get_reg_value 528 <1> ;----------------------------------------------------------------------------- 529 <1> get_reg_value: 530 00000395 50 <1> push ax 531 00000396 51 <1> push cx 532 00000397 BF[7D77] <1> mov di,rreg 533 0000039A 8B04 <1> mov ax,[si] 534 0000039C 86C4 <1> xchg al,ah 535 0000039E E8AB16 <1> call upcase 536 000003A1 86C4 <1> xchg al,ah 537 000003A3 E8A616 <1> call upcase 538 000003A6 B91000 <1> mov cx,16 539 000003A9 F2AF <1> repne scasw 540 000003AB 7517 <1> jne @@not 541 000003AD 3D4753 <1> cmp ax,'GS' 542 000003B0 7415 <1> je @@check_386 543 000003B2 3D4653 <1> cmp ax,'FS' 544 000003B5 7410 <1> je @@check_386 545 <1> @@get_value: 546 000003B7 AD <1> lodsw 547 000003B8 81EF[7F77] <1> sub di,rreg+2 548 000003BC D1E7 <1> shl di,1 549 000003BE 8B9D[C88A] <1> mov bx,[cpu_regs+di] 550 000003C2 39C0 <1> cmp ax,ax 551 <1> @@not: 552 000003C4 59 <1> pop cx 553 000003C5 58 <1> pop ax 554 000003C6 C3 <1> ret 555 <1> @@check_386: 556 000003C7 803E[6E8B]03 <1> cmp byte [system_cpu],3 557 000003CC 72F6 <1> jb @@not 558 000003CE EBE7 <1> jmp @@get_value 559 <1> ;============================================================================= 560 <1> ; get_hex_value 561 <1> ;----------------------------------------------------------------------------- 562 <1> get_hex_value: 563 000003D0 50 <1> push ax 564 000003D1 51 <1> push cx 565 000003D2 B104 <1> mov cl,4 566 000003D4 31DB <1> xor bx,bx 567 000003D6 8A04 <1> mov al,[si] 568 000003D8 E8D116 <1> call ascii_to_bin 569 000003DB 7213 <1> jc @@not 570 <1> @@set: 571 000003DD F6C7F0 <1> test bh,0f0h 572 000003E0 F9 <1> stc 573 000003E1 750D <1> jnz @@not 574 000003E3 D3E3 <1> shl bx,cl 575 000003E5 08C3 <1> or bl,al 576 000003E7 46 <1> inc si 577 000003E8 8A04 <1> mov al,[si] 578 000003EA E8BF16 <1> call ascii_to_bin 579 000003ED 73EE <1> jnc @@set 580 000003EF F8 <1> clc 581 <1> @@not: 582 000003F0 59 <1> pop cx 583 000003F1 58 <1> pop ax 584 000003F2 C3 <1> ret 585 <1> ;============================================================================= 586 <1> ; get_counter 587 <1> ;----------------------------------------------------------------------------- 588 <1> get_counter: 589 000003F3 BE[DA90] <1> mov si,count_string 590 000003F6 E832FF <1> call get_address_ 591 000003F9 720A <1> jc @@error 592 000003FB 80FD00 <1> cmp ch,0 593 000003FE 7505 <1> jne @@error 594 00000400 A3[D48B] <1> mov [count_value],ax 595 00000403 F8 <1> clc 596 00000404 C3 <1> ret 597 <1> @@error: 598 00000405 BE[EE75] <1> mov si,count_error_msg 599 00000408 E85913 <1> call _error_message 600 0000040B F9 <1> stc 601 0000040C C3 <1> ret 602 <1> ;============================================================================= 603 <1> ; get_delay 604 <1> ;----------------------------------------------------------------------------- 605 <1> get_delay: 606 0000040D BE[F390] <1> mov si,delay_string 607 00000410 E818FF <1> call get_address_ 608 00000413 720A <1> jc @@error 609 00000415 80FD00 <1> cmp ch,0 610 00000418 7505 <1> jne @@error 611 0000041A A3[207E] <1> mov [delay_value],ax 612 0000041D F8 <1> clc 613 0000041E C3 <1> ret 614 <1> @@error: 615 0000041F BE[EE75] <1> mov si,count_error_msg 616 00000422 E83F13 <1> call _error_message 617 00000425 F9 <1> stc 618 00000426 C3 <1> ret 619 <1> ;============================================================================= 620 <1> ; save_int_table 621 <1> ;----------------------------------------------------------------------------- 622 <1> save_int_table: 623 00000427 E87415 <1> call pushr 624 0000042A BF[7491] <1> mov di,interrupt_table 625 <1> ;SaveInts: 626 0000042D FA <1> cli 627 0000042E 31F6 <1> xor si,si 628 00000430 8EDE <1> mov ds,si 629 00000432 FC <1> cld 630 00000433 B90002 <1> mov cx,512 631 00000436 F3A5 <1> rep movsw 632 00000438 FB <1> sti 633 00000439 E87515 <1> call popr 634 0000043C C3 <1> ret 635 <1> ;============================================================================= 636 <1> ; restore_int_table 637 <1> ;----------------------------------------------------------------------------- 638 <1> restore_int_table: 639 0000043D E85E15 <1> call pushr 640 00000440 BE[7491] <1> mov si,interrupt_table 641 <1> ;RestoreInts: 642 00000443 FA <1> cli 643 00000444 31FF <1> xor di,di 644 00000446 8EC7 <1> mov es,di 645 00000448 FC <1> cld 646 00000449 B90002 <1> mov cx,512 647 0000044C F3A5 <1> rep movsw 648 0000044E FB <1> sti 649 0000044F E85F15 <1> call popr 650 00000452 C3 <1> ret 651 <1> ;============================================================================= 652 <1> ; create_program 653 <1> ;----------------------------------------------------------------------------- 654 <1> create_program: 655 00000453 E8C502 <1> call set_my_pid 656 00000456 E88500 <1> call make_environment 657 00000459 8CC5 <1> mov bp,es 658 0000045B B448 <1> mov ah,48h 659 0000045D BBFFFF <1> mov bx,0ffffh 660 00000460 CD21 <1> int 21h 661 00000462 B448 <1> mov ah,48h 662 00000464 CD21 <1> int 21h 663 00000466 A3[788B] <1> mov [user_pid],ax 664 00000469 A3[708B] <1> mov [save_dta_seg],ax 665 0000046C A3[E88A] <1> mov [cpu_regs+REG_CS],ax 666 0000046F A3[EC8A] <1> mov [cpu_regs+REG_DS],ax 667 00000472 A3[F08A] <1> mov [cpu_regs+REG_ES],ax 668 00000475 A3[F48A] <1> mov [cpu_regs+REG_SS],ax 669 00000478 C706[008B]0001 <1> mov word [cpu_regs+REG_IP],100h 670 0000047E C706[E48A]FEFF <1> mov word [cpu_regs+REG_SP],-2 671 00000484 8EC0 <1> mov es,ax 672 00000486 50 <1> push ax ; 673 00000487 26C706FEFF0000 <1> mov word [es:0fffeh],0 674 0000048E 48 <1> dec ax 675 0000048F 8EC0 <1> mov es,ax 676 00000491 40 <1> inc ax 677 00000492 26A30100 <1> mov [es:1],ax 678 00000496 8B360200 <1> mov si,[2] 679 0000049A 89C2 <1> mov dx,ax 680 0000049C B455 <1> mov ah,55h 681 0000049E CD21 <1> int 21h 682 000004A0 07 <1> pop es ; 683 000004A1 BF8000 <1> mov di,80h 684 000004A4 BE[038E] <1> mov si,my_cmd_line 685 000004A7 AC <1> lodsb 686 000004A8 AA <1> stosb 687 000004A9 88C1 <1> mov cl,al 688 000004AB B500 <1> mov ch,0 689 000004AD F3A4 <1> rep movsb 690 000004AF A4 <1> movsb 691 000004B0 B90001 <1> mov cx,100h 692 000004B3 29F9 <1> sub cx,di 693 000004B5 B000 <1> mov al,0 694 000004B7 F3AA <1> rep stosb 695 000004B9 26892E2C00 <1> mov [es:2ch],bp 696 000004BE 4D <1> dec bp 697 000004BF 8CC0 <1> mov ax,es 698 000004C1 8EC5 <1> mov es,bp 699 000004C3 26A30100 <1> mov [es:1],ax 700 000004C7 0E <1> push cs 701 000004C8 07 <1> pop es 702 000004C9 E8EC00 <1> call init_registers 703 000004CC A0[828B] <1> mov al,[my_port_21] 704 000004CF A2[838B] <1> mov [user_port_21],al 705 000004D2 E83D02 <1> call set_user_pid 706 000004D5 C706[2678]8000 <1> mov word [save_dta_offs],80h 707 000004DB E96102 <1> jmp restore_dta 708 <1> ;============================================================================= 709 <1> ; make_environment 710 <1> ;----------------------------------------------------------------------------- 711 <1> make_environment: 712 000004DE 8E062C00 <1> mov es,[2ch] 713 000004E2 31FF <1> xor di,di 714 000004E4 B000 <1> mov al,0 715 000004E6 FC <1> cld 716 000004E7 B9FFFF <1> mov cx,-1 717 <1> @@again: 718 000004EA F2AE <1> repne scasb 719 000004EC 7532 <1> jne @@error 720 000004EE 49 <1> dec cx 721 000004EF AE <1> scasb 722 000004F0 75F8 <1> jne @@again 723 000004F2 F7D1 <1> not cx 724 000004F4 89CB <1> mov bx,cx 725 000004F6 83C31E <1> add bx,30 726 000004F9 D1EB <1> shr bx,1 727 000004FB D1EB <1> shr bx,1 728 000004FD D1EB <1> shr bx,1 729 000004FF D1EB <1> shr bx,1 730 00000501 B448 <1> mov ah,48h 731 00000503 CD21 <1> int 21h 732 00000505 7219 <1> jc @@error 733 00000507 06 <1> push es 734 00000508 1F <1> pop ds 735 00000509 8EC0 <1> mov es,ax 736 0000050B 31FF <1> xor di,di 737 0000050D 31F6 <1> xor si,si 738 0000050F F3A4 <1> rep movsb 739 00000511 B80100 <1> mov ax,1 740 00000514 AB <1> stosw 741 00000515 BE[7477] <1> mov si,env_name 742 00000518 0E <1> push cs 743 00000519 1F <1> pop ds 744 <1> @@next: 745 0000051A AC <1> lodsb 746 0000051B AA <1> stosb 747 0000051C 3C00 <1> cmp al,0 748 0000051E 75FA <1> jne @@next 749 <1> @@error: 750 00000520 C3 <1> ret 751 <1> ;============================================================================= 752 <1> ; load_program 753 <1> ;----------------------------------------------------------------------------- 754 <1> load_program: 755 00000521 E8F701 <1> call set_my_pid 756 00000524 8C0E[9A05] <1> mov [cmd_line_seg],cs 757 00000528 8C0E[9E05] <1> mov [fcb1_seg],cs 758 0000052C 8C0E[A205] <1> mov [fcb2_seg],cs 759 00000530 BA[BA8F] <1> mov dx,filename 760 00000533 BB[9605] <1> mov bx,epb 761 00000536 B8014B <1> mov ax,4b01h 762 00000539 CD21 <1> int 21h 763 0000053B 7258 <1> jc @@quit 764 0000053D A1[A605] <1> mov ax,[user_ss] 765 00000540 A3[F48A] <1> mov [cpu_regs+REG_SS],ax 766 00000543 A1[A405] <1> mov ax,[user_sp] 767 00000546 83F8FE <1> cmp ax,0fffeh 768 00000549 7302 <1> jae @@001 769 0000054B 40 <1> inc ax 770 0000054C 40 <1> inc ax 771 <1> @@001: 772 0000054D A3[E48A] <1> mov [cpu_regs+REG_SP],ax 773 00000550 A1[AA05] <1> mov ax,[user_cs] 774 00000553 A3[E88A] <1> mov [cpu_regs+REG_CS],ax 775 00000556 A1[A805] <1> mov ax,[user_ip] 776 00000559 A3[008B] <1> mov [cpu_regs+REG_IP],ax 777 <1> 778 0000055C B451 <1> mov ah,51h 779 0000055E CD21 <1> int 21h 780 00000560 891E[788B] <1> mov [user_pid],bx 781 00000564 891E[EC8A] <1> mov [cpu_regs+REG_DS],bx 782 00000568 891E[F08A] <1> mov [cpu_regs+REG_ES],bx 783 0000056C 8EC3 <1> mov es,bx 784 0000056E 26A08000 <1> mov al,[es:80h] 785 00000572 B400 <1> mov ah,0 786 00000574 40 <1> inc ax 787 00000575 40 <1> inc ax 788 00000576 BF8000 <1> mov di,80h 789 00000579 01C7 <1> add di,ax 790 0000057B B98000 <1> mov cx,80h 791 0000057E 29C1 <1> sub cx,ax 792 00000580 B000 <1> mov al,0 793 00000582 FC <1> cld 794 00000583 F3AA <1> rep stosb 795 00000585 0E <1> push cs 796 00000586 07 <1> pop es 797 00000587 C606[8A8B]01 <1> mov byte [file_specified],1 798 0000058C E82900 <1> call init_registers 799 0000058F A0[828B] <1> mov al,[my_port_21] 800 00000592 A2[838B] <1> mov [user_port_21],al 801 <1> @@quit: 802 00000595 C3 <1> ret 803 <1> ;============================================================================= 804 <1> 805 <1> epb: 806 00000596 0000 <1> env_seg dw 0 807 00000598 [038E] <1> cmd_line_offs dw my_cmd_line 808 0000059A 0000 <1> cmd_line_seg dw 0 809 0000059C [AC05] <1> fcb1_offs dw my_fcb1 810 0000059E 0000 <1> fcb1_seg dw 0 811 000005A0 [AC05] <1> fcb2_offs dw my_fcb2 812 000005A2 0000 <1> fcb2_seg dw 0 813 000005A4 0000 <1> user_sp dw 0 814 000005A6 0000 <1> user_ss dw 0 815 000005A8 0000 <1> user_ip dw 0 816 000005AA 0000 <1> user_cs dw 0 817 <1> 818 <1> ;MyCmdLine db 0, 0Dh 819 <1> my_fcb1: 820 <1> my_fcb2: 821 000005AC 00 <1> db 0 822 000005AD 20 <1> times 11 db ' ' 823 <1> ;============================================================================= 824 <1> ; init_registers 825 <1> ;----------------------------------------------------------------------------- 826 <1> init_registers: 827 000005B8 31C0 <1> xor ax,ax 828 000005BA A3[C88A] <1> mov [cpu_regs+REG_AX],ax 829 000005BD A3[CC8A] <1> mov [cpu_regs+REG_BX],ax 830 000005C0 C706[D08A]FF00 <1> mov word [cpu_regs+REG_CX],00ffh 831 000005C6 A1[EC8A] <1> mov ax,[cpu_regs+REG_DS] 832 000005C9 A3[D48A] <1> mov [cpu_regs+REG_DX],ax 833 000005CC A1[008B] <1> mov ax,[cpu_regs+REG_IP] 834 000005CF A3[D88A] <1> mov [cpu_regs+REG_SI],ax 835 000005D2 A1[E48A] <1> mov ax,[cpu_regs+REG_SP] 836 000005D5 A3[DC8A] <1> mov [cpu_regs+REG_DI],ax 837 000005D8 C706[E08A]1C09 <1> mov word [cpu_regs+REG_BP],91ch 838 000005DE C706[048B]0272 <1> mov word [cpu_regs+REG_FL],07202h 839 000005E4 E9EA4C <1> jmp save_regs 840 <1> ;============================================================================= 841 <1> ; read_cmd_line 842 <1> ;----------------------------------------------------------------------------- 843 <1> read_cmd_line: 844 000005E7 E8B413 <1> call pushr 845 000005EA 803E[8A8B]00 <1> cmp byte [file_specified],0 846 000005EF 7508 <1> jne @@1 847 000005F1 BE[5976] <1> mov si,no_specif_msg 848 000005F4 E86D11 <1> call _error_message 849 000005F7 EB18 <1> jmp @@quit 850 <1> @@1: 851 000005F9 BE[3664] <1> mov si,arg_dialog 852 000005FC E8EC1C <1> call init_dialog 853 000005FF E8431D <1> call exec_dialog 854 00000602 E87C11 <1> call draw_screen 855 00000605 09C0 <1> or ax,ax 856 00000607 7408 <1> jz @@quit 857 00000609 E80900 <1> call set_command_line 858 0000060C E8A213 <1> call popr 859 0000060F EB7E <1> jmp reset_program 860 <1> @@quit: 861 00000611 E89D13 <1> call popr 862 00000614 C3 <1> ret 863 <1> ;============================================================================= 864 <1> ; set_command_line 865 <1> ;----------------------------------------------------------------------------- 866 <1> set_command_line: 867 00000615 E88613 <1> call pushr 868 00000618 BE[838E] <1> mov si,cmd_line_string 869 0000061B E82014 <1> call strlen 870 0000061E BF[038E] <1> mov di,my_cmd_line 871 00000621 88C8 <1> mov al,cl 872 00000623 AA <1> stosb 873 00000624 F3A4 <1> rep movsb 874 00000626 B00D <1> mov al,13 875 00000628 AA <1> stosb 876 00000629 E88513 <1> call popr 877 0000062C C3 <1> ret 878 <1> ;============================================================================= 879 <1> ; load_file 880 <1> ;----------------------------------------------------------------------------- 881 <1> load_file: 882 0000062D BA[D077] <1> mov dx,file_mask 883 00000630 E82D00 <1> call init_file_list 884 00000633 BE[8264] <1> mov si,load_dialog 885 00000636 E8B21C <1> call init_dialog 886 00000639 E8091D <1> call exec_dialog 887 0000063C E84211 <1> call draw_screen 888 <1> 889 0000063F 8B36[1E8D] <1> mov si,[string_ptr] 890 00000643 E85454 <1> call _check_shared_area 891 <1> 892 00000646 09C0 <1> or ax,ax 893 00000648 740A <1> je @@quit 894 0000064A E80800 <1> call full_prog_name 895 0000064D C606[8A8B]01 <1> mov byte [file_specified],1 896 00000652 EB3B <1> jmp reset_program 897 <1> 898 <1> @@quit: 899 00000654 C3 <1> ret 900 <1> ;============================================================================= 901 <1> ; full_prog_name 902 <1> ;----------------------------------------------------------------------------- 903 <1> full_prog_name: 904 00000655 BE[BA8F] <1> mov si,filename 905 00000658 BF[BA8F] <1> mov di,filename 906 0000065B B460 <1> mov ah,60h 907 0000065D CD21 <1> int 21h 908 0000065F C3 <1> ret 909 <1> ;============================================================================= 910 <1> ; init_file_list 911 <1> ;----------------------------------------------------------------------------- 912 <1> init_file_list: 913 00000660 E83B13 <1> call pushr 914 00000663 E8BC00 <1> call save_dta 915 00000666 E8B200 <1> call set_my_pid 916 00000669 E8C700 <1> call set_my_dta 917 0000066C B81000 <1> mov ax,16 918 0000066F E83221 <1> call init_string_list 919 00000672 B44E <1> mov ah,4eh 920 00000674 B92700 <1> mov cx,27h ;!!! 921 <1> @@find_next: 922 00000677 CD21 <1> int 21h 923 00000679 720A <1> jc @@end 924 0000067B BE9E00 <1> mov si,9eh 925 0000067E E83321 <1> call add_string 926 00000681 B44F <1> mov ah,4fh 927 00000683 EBF2 <1> jmp @@find_next 928 <1> @@end: 929 00000685 E88A00 <1> call set_user_pid 930 00000688 E8B400 <1> call restore_dta 931 0000068B E82313 <1> call popr 932 0000068E C3 <1> ret 933 <1> ;============================================================================= 934 <1> ; reset_program 935 <1> ;----------------------------------------------------------------------------- 936 <1> reset_program: 937 0000068F E80C13 <1> call pushr 938 00000692 803E[8A8B]00 <1> cmp byte [file_specified],0 939 00000697 7441 <1> je @@no_spec 940 00000699 E8B200 <1> call unload_program 941 0000069C E882FE <1> call load_program 942 0000069F 730E <1> jnc @@next 943 000006A1 BE[6B76] <1> mov si,load_error_msg 944 000006A4 E8BD10 <1> call _error_message 945 000006A7 E8A9FD <1> call create_program 946 000006AA C606[8A8B]00 <1> mov byte [file_specified],0 947 <1> @@next: 948 000006AF A1[008B] <1> mov ax,[cpu_regs+REG_IP] ;0leg, 2007-03-25 949 000006B2 A3[2878] <1> mov [cur_ip],ax ;Set initial addresses 950 000006B5 A1[E88A] <1> mov ax,[cpu_regs+REG_CS] ;for Code and Dump windows 951 000006B8 A3[9B8B] <1> mov [unasm_seg],ax ; 952 000006BB A1[EC8A] <1> mov ax,[cpu_regs+REG_DS] ; 953 000006BE A3[BA8B] <1> mov [dump_seg],ax ; 954 000006C1 C706[748B]0000 <1> mov word [cur_line],0 ; 955 000006C7 C706[BC8B]0000 <1> mov word [dump_offs],0 ; 956 <1> ..@program_created: 957 000006CD E84200 <1> call set_user_pid 958 000006D0 E8AC00 <1> call set_term_handler 959 000006D3 E8B410 <1> call update_screen 960 <1> @@quit: 961 000006D6 E8D812 <1> call popr 962 000006D9 C3 <1> ret 963 <1> @@no_spec: 964 000006DA BE[5976] <1> mov si,no_specif_msg 965 000006DD E88410 <1> call _error_message 966 000006E0 EBF4 <1> jmp @@quit 967 <1> ;============================================================================= 968 <1> ; new_program 969 <1> ;----------------------------------------------------------------------------- 970 <1> new_program: 971 000006E2 E8B912 <1> call pushr 972 000006E5 C606[838E]00 <1> mov byte [cmd_line_string],0 973 000006EA C706[038E]000D <1> mov word [my_cmd_line],0d00h 974 000006F0 E85B00 <1> call unload_program 975 000006F3 E8670F <1> call clear_all_breaks 976 000006F6 E85AFD <1> call create_program 977 000006F9 A1[008B] <1> mov ax,[cpu_regs+REG_IP] 978 000006FC A3[2878] <1> mov [cur_ip],ax 979 000006FF A1[E88A] <1> mov ax,[cpu_regs+REG_CS] 980 00000702 A3[9B8B] <1> mov [unasm_seg],ax 981 00000705 C706[748B]0000 <1> mov word [cur_line],0 982 0000070B C606[8A8B]00 <1> mov byte [file_specified],0 983 00000710 EBBB <1> jmp ..@program_created 984 <1> ;============================================================================= 985 <1> ; set_user_pid 986 <1> ;----------------------------------------------------------------------------- 987 <1> set_user_pid: 988 00000712 B450 <1> mov ah,50h 989 00000714 8B1E[788B] <1> mov bx,[user_pid] 990 00000718 CD21 <1> int 21h 991 0000071A C3 <1> ret 992 <1> ;============================================================================= 993 <1> ; set_my_pid 994 <1> ;----------------------------------------------------------------------------- 995 <1> set_my_pid: 996 0000071B B450 <1> mov ah,50h 997 0000071D 8CCB <1> mov bx,cs 998 0000071F CD21 <1> int 21h 999 00000721 C3 <1> ret 1000 <1> ;============================================================================= 1001 <1> ; save_dta 1002 <1> ;----------------------------------------------------------------------------- 1003 <1> save_dta: 1004 00000722 53 <1> push bx 1005 00000723 06 <1> push es 1006 00000724 B42F <1> mov ah,2fh 1007 00000726 CD21 <1> int 21h 1008 00000728 8C06[708B] <1> mov [save_dta_seg],es 1009 0000072C 891E[2678] <1> mov [save_dta_offs],bx 1010 00000730 07 <1> pop es 1011 00000731 5B <1> pop bx 1012 00000732 C3 <1> ret 1013 <1> ;============================================================================= 1014 <1> ; set_my_dta 1015 <1> ;----------------------------------------------------------------------------- 1016 <1> set_my_dta: 1017 00000733 52 <1> push dx 1018 00000734 0E <1> push cs 1019 00000735 1F <1> pop ds 1020 00000736 BA8000 <1> mov dx,80h 1021 00000739 B41A <1> mov ah,1ah 1022 0000073B CD21 <1> int 21h 1023 0000073D 5A <1> pop dx 1024 0000073E C3 <1> ret 1025 <1> ;============================================================================= 1026 <1> ; restore_dta 1027 <1> ;----------------------------------------------------------------------------- 1028 <1> restore_dta: 1029 0000073F B41A <1> mov ah,1ah 1030 00000741 1E <1> push ds 1031 00000742 8B16[2678] <1> mov dx,[save_dta_offs] 1032 00000746 8E1E[708B] <1> mov ds,[save_dta_seg] 1033 0000074A CD21 <1> int 21h 1034 0000074C 1F <1> pop ds 1035 0000074D C3 <1> ret 1036 <1> ;============================================================================= 1037 <1> ; unload_program 1038 <1> ;----------------------------------------------------------------------------- 1039 <1> unload_program: 1040 0000074E E8C1FF <1> call set_user_pid 1041 00000751 8E06[788B] <1> mov es,[user_pid] 1042 00000755 268C0E0C00 <1> mov [es:0ch],cs 1043 0000075A B8[7A07] <1> mov ax,@@1 1044 0000075D 26A30A00 <1> mov [es:0ah],ax 1045 00000761 9C <1> pushf 1046 00000762 0E <1> push cs 1047 00000763 50 <1> push ax 1048 00000764 06 <1> push es 1049 00000765 1E <1> push ds 1050 00000766 55 <1> push bp 1051 00000767 57 <1> push di 1052 00000768 56 <1> push si 1053 00000769 52 <1> push dx 1054 0000076A 51 <1> push cx 1055 0000076B 53 <1> push bx 1056 0000076C 50 <1> push ax 1057 0000076D 89262E00 <1> mov [2eh],sp 1058 00000771 8C163000 <1> mov [30h],ss 1059 00000775 B8004C <1> mov ax,4c00h 1060 00000778 CD21 <1> int 21h 1061 <1> @@1: 1062 0000077A 0E <1> push cs 1063 0000077B 1F <1> pop ds 1064 0000077C 0E <1> push cs 1065 0000077D 07 <1> pop es 1066 0000077E C3 <1> ret 1067 <1> ;============================================================================= 1068 <1> ; set_term_handler 1069 <1> ;----------------------------------------------------------------------------- 1070 <1> set_term_handler: 1071 0000077F 8E06[788B] <1> mov es,[user_pid] 1072 00000783 268C0E0C00 <1> mov [es:0ch],cs 1073 00000788 26C7060A00[A107] <1> mov word [es:0ah],term_handler 1074 <1> 1075 <1> ; mov ds:[2Eh],StackPtr-24 1076 0000078F 31C9 <1> xor cx,cx 1077 00000791 E83012 <1> call calc_prog_size 1078 00000794 83E818 <1> sub ax,24 1079 00000797 A32E00 <1> mov [2eh],ax 1080 <1> 1081 0000079A 8C163000 <1> mov [30h],ss 1082 0000079E 0E <1> push cs 1083 0000079F 07 <1> pop es 1084 000007A0 C3 <1> ret 1085 <1> ;============================================================================= 1086 <1> ; term_handler 1087 <1> ;----------------------------------------------------------------------------- 1088 <1> term_handler: 1089 <1> ; mov sp,StackPtr 1090 <1> 1091 000007A1 8CC8 <1> mov ax,cs 1092 000007A3 8ED8 <1> mov ds,ax 1093 000007A5 8EC0 <1> mov es,ax 1094 <1> 1095 000007A7 31C9 <1> xor cx,cx 1096 000007A9 E81812 <1> call calc_prog_size 1097 000007AC 89C4 <1> mov sp,ax 1098 <1> 1099 000007AE E88A4D <1> call restore_01_vector 1100 000007B1 E8AC4D <1> call restore_03_vector 1101 <1> ; call SaveUserInts 1102 <1> ; call RestoreIntTable 1103 000007B4 E89B4F <1> call clear_breakpoints 1104 000007B7 E8DD4C <1> call save_user_port_21_and_reset_to_mine 1105 000007BA E80024 <1> call save_screen 1106 000007BD E893FC <1> call create_program 1107 <1> ; call SetUserPID 1108 000007C0 E8BCFF <1> call set_term_handler 1109 <1> ; mov cur_line,0 1110 000007C3 C606[4978]01 <1> mov byte [focus],1 ;0leg, 2007-03-25 1111 000007C8 E8B60F <1> call draw_screen 1112 <1> ;----------------------------------------------------------------------------- 1113 <1> ; Get return code 1114 <1> ;----------------------------------------------------------------------------- 1115 000007CB BF[A376] <1> mov di,return_code 1116 000007CE B8304D <1> mov ax,DOS_GET_RETURN_CODE * 256 + '0' 1117 000007D1 AA <1> stosb 1118 000007D2 AA <1> stosb 1119 000007D3 AA <1> stosb 1120 000007D4 CD21 <1> int 21h 1121 000007D6 80C430 <1> add ah,'0' 1122 000007D9 8826[9276] <1> mov [term_method],ah 1123 <1> @@loop99: 1124 000007DD 4F <1> dec di 1125 000007DE D40A <1> aam ;AH = AL / 10; AL = AL % 10 1126 000007E0 0005 <1> add [di],al 1127 000007E2 86C4 <1> xchg al,ah 1128 000007E4 08C0 <1> or al,al 1129 000007E6 75F5 <1> jnz @@loop99 1130 <1> ;----------------------------------------------------------------------------- 1131 000007E8 BE[7E76] <1> mov si,terminate_msg 1132 000007EB E87C0F <1> call _msg_box 1133 000007EE E94D0F <1> jmp main_key_loop 1134 <1> ;============================================================================= 1135 <1> ; E0F 1136 <1> ;============================================================================= 1137 <1> 1138 <1> 52 %include "iface_2.inc" ;Main module: part 2 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; iface_2.inc 7 <1> ; User interface and other procedures. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; Changelog 28 <1> ;----------------------------------------------------------------------------- 29 <1> ; 2008-11-03 0leg Fixed Alt+L in the Dump window, added Alt+F5, Alt+U. 30 <1> ; Added Up/Down to the Flags window. 31 <1> ; 2009-01-08 0leg GPF on BP/SP modification: fixed. 32 <1> ;============================================================================= 33 <1> 34 <1> 35 <1> ;============================================================================= 36 <1> ; draw_cpu_window 37 <1> ;----------------------------------------------------------------------------- 38 <1> draw_cpu_window: 39 000007F1 E8AA11 <1> call pushr 40 000007F4 E8DB1A <1> call no_cursor 41 000007F7 8E06[E27E] <1> mov es,[video_seg] 42 000007FB 31FF <1> xor di,di 43 000007FD FC <1> cld 44 000007FE B9D007 <1> mov cx,SCR_COLS*SCR_ROWS 45 00000801 F606[8B8B]20 <1> test byte [cmd_line_options],CMD_EGA 46 00000806 7404 <1> jz @@not_ega 47 00000808 81C1D007 <1> add cx,SCR_COLS*(MAX_SCR_ROWS-SCR_ROWS) 48 <1> @@not_ega: 49 0000080C B82007 <1> mov ax,atMainWindow*100h+20h 50 0000080F F3AB <1> rep stosw 51 <1> 52 00000811 F606[4478]01 <1> test byte [large_dump],1 53 00000816 7403 <1> jz @@not_quit 54 00000818 E99700 <1> jmp @@quit 55 <1> @@not_quit: 56 <1> ;;;; jnz @@quit ;!!! 57 <1> 58 0000081B BF0000 <1> mov di,CPU_START 59 <1> drawchoice '═', '=' 60 0000081E A0[D88B] <1> mov al, byte [DRAWADDRESS] 61 00000821 B40F <1> mov ah,atCPUborder 62 00000823 B93600 <1> mov cx,CPU_WIDTH 63 00000826 F3AB <1> rep stosw 64 <1> drawchoice '╕', '#' 65 00000828 A0[D98B] <1> mov al, byte [DRAWADDRESS] 66 <1> 67 0000082B AB <1> stosw 68 <1> drawchoice '│', '|' 69 0000082C A0[DA8B] <1> mov al, byte [DRAWADDRESS] 70 0000082F B91100 <1> mov cx,CPU_HEIGHT 71 <1> 72 <1> @@next_bord_line: 73 00000832 81C79E00 <1> add di,(SCR_COLS-1)*2 74 00000836 AB <1> stosw 75 00000837 E2F9 <1> loop @@next_bord_line 76 <1> 77 00000839 BF400B <1> mov di,CPU_START+(CPU_HEIGHT+1)*SCR_COLS*2 78 <1> drawchoice '─', '-' 79 0000083C A0[DB8B] <1> mov al, byte [DRAWADDRESS] 80 0000083F B95000 <1> mov cx,USED_COLS 81 00000842 F3AB <1> rep stosw 82 00000844 BFAC0B <1> mov di,CPU_START+((CPU_HEIGHT+1)*SCR_COLS+CPU_WIDTH)*2 83 <1> drawchoice '┴', '+' 84 00000847 A0[DC8B] <1> mov al, byte [DRAWADDRESS] 85 0000084A AB <1> stosw 86 <1> 87 0000084B BBCE04 <1> mov bx,FLAG16_START 88 0000084E 803E[8C8B]01 <1> cmp byte [regs_mode],1 89 00000853 7503 <1> jne @@skip_32 90 00000855 BBAE06 <1> mov bx,FLAG32_START 91 <1> @@skip_32: 92 00000858 8DBF5EFF <1> lea di,[bx-SCR_COLS*2-2] 93 <1> 94 <1> drawchoice '├', '+' 95 0000085C A0[DD8B] <1> mov al, byte [DRAWADDRESS] 96 0000085F AB <1> stosw 97 00000860 B91900 <1> mov cx,USED_COLS-1-CPU_WIDTH 98 <1> drawchoice '─', '-' 99 00000863 A0[DE8B] <1> mov al, byte [DRAWADDRESS] 100 00000866 F3AB <1> rep stosw 101 <1> 102 00000868 8DBF3E01 <1> lea di,[bx+2*SCR_COLS*2-2] 103 <1> 104 <1> drawchoice '├', '+' 105 0000086C A0[DF8B] <1> mov al, byte [DRAWADDRESS] 106 0000086F AB <1> stosw 107 00000870 B91900 <1> mov cx,USED_COLS-1-CPU_WIDTH 108 <1> drawchoice '─', '-' 109 00000873 A0[E08B] <1> mov al, byte [DRAWADDRESS] 110 00000876 F3AB <1> rep stosw 111 <1> 112 <1> ;flags names 113 00000878 B407 <1> mov ah,atRegName 114 0000087A 8D7F02 <1> lea di,[bx+2] 115 0000087D BE[A477] <1> mov si,flags_str 116 00000880 B90800 <1> mov cx,NUM_FLAGS 117 <1> @@loop01: 118 00000883 AC <1> lodsb 119 00000884 AB <1> stosw 120 00000885 B046 <1> mov al,'F' 121 00000887 AB <1> stosw 122 00000888 AF <1> scasw 123 00000889 E2F8 <1> loop @@loop01 124 <1> 125 0000088B B82100 <1> mov ax,40-TITLE_LEN/2 126 0000088E B70E <1> mov bh,atTitle 127 00000890 BE[6875] <1> mov si,main_title 128 00000893 E8D919 <1> call write_string 129 <1> 130 00000896 B80500 <1> mov ax,CPU_START+5 131 00000899 B703 <1> mov bh,atCPUName 132 0000089B 8B36[D477] <1> mov si,[cpu_name] 133 0000089F E8CD19 <1> call write_string 134 <1> 135 000008A2 803E[8C8B]01 <1> cmp byte [regs_mode],1 136 000008A7 740D <1> je @@regs_32 137 000008A9 E80F00 <1> call draw_registers_16 138 <1> @@exit: 139 000008AC BE[9D77] <1> mov si,flags_msg 140 000008AF E8C800 <1> call fill_str 141 <1> @@quit: 142 000008B2 E8FC10 <1> call popr 143 000008B5 C3 <1> ret 144 <1> 145 <1> @@regs_32: 146 000008B6 E83A00 <1> call draw_registers_32 147 000008B9 EBF1 <1> jmp @@exit 148 <1> ;============================================================================= 149 <1> ; draw_registers_16 150 <1> ;----------------------------------------------------------------------------- 151 <1> draw_registers_16: 152 000008BB BF6E00 <1> mov di,REG_START 153 000008BE BE[7D77] <1> mov si,rreg 154 000008C1 B407 <1> mov ah,atRegName 155 000008C3 B90400 <1> mov cx,4 156 <1> 157 <1> @@next_reg_line: 158 000008C6 51 <1> push cx 159 000008C7 B90300 <1> mov cx,3 160 <1> 161 <1> @@next_reg_col: 162 000008CA AC <1> lodsb 163 000008CB AB <1> stosw 164 000008CC AC <1> lodsb 165 000008CD AB <1> stosw 166 000008CE B03D <1> mov al,'=' 167 000008D0 AB <1> stosw 168 000008D1 83C70C <1> add di,12 169 000008D4 83C606 <1> add si,6 170 000008D7 E2F1 <1> loop @@next_reg_col 171 <1> 172 000008D9 83C76A <1> add di,SCR_COLS*2-18*3 173 000008DC 59 <1> pop cx 174 000008DD 83EE16 <1> sub si,22 175 000008E0 E2E4 <1> loop @@next_reg_line 176 <1> 177 000008E2 81C7A000 <1> add di,SCR_COLS*2 178 000008E6 B049 <1> mov al,'I' 179 000008E8 AB <1> stosw 180 000008E9 B050 <1> mov al,'P' 181 000008EB AB <1> stosw 182 000008EC B03D <1> mov al,'=' 183 000008EE AB <1> stosw 184 000008EF 83C718 <1> add di,24 185 000008F2 C3 <1> ret 186 <1> ;============================================================================= 187 <1> ; draw_registers_32 188 <1> ;----------------------------------------------------------------------------- 189 <1> draw_registers_32: 190 000008F3 BF6E00 <1> mov di,REG_START 191 000008F6 BE[7D77] <1> mov si,rreg ;1st column 192 000008F9 BD[8D77] <1> mov bp,rreg_segs ;2nd column 193 000008FC B407 <1> mov ah,atRegName 194 000008FE B90600 <1> mov cx,6 195 <1> 196 <1> @@next_reg_32: 197 00000901 E81100 <1> call @@display_names 198 00000904 E2FB <1> loop @@next_reg_32 199 <1> 200 00000906 81C7A000 <1> add di,SCR_COLS*2 201 0000090A E80800 <1> call @@display_names 202 0000090D E80500 <1> call @@display_names 203 <1> 204 00000910 81EF8200 <1> sub di,(SCR_COLS-15)*2 205 00000914 C3 <1> ret 206 <1> 207 <1> @@display_names: 208 00000915 57 <1> push di 209 00000916 B045 <1> mov al,'E' 210 00000918 AB <1> stosw 211 00000919 AC <1> lodsb 212 0000091A AB <1> stosw 213 0000091B AC <1> lodsb 214 0000091C AB <1> stosw 215 0000091D B03D <1> mov al,'=' 216 0000091F AB <1> stosw 217 00000920 83C708 <1> add di,4*2 218 00000923 B03A <1> mov al,':' 219 00000925 AB <1> stosw 220 00000926 83C712 <1> add di,18 221 00000929 87F5 <1> xchg si,bp 222 0000092B AC <1> lodsb 223 0000092C AB <1> stosw 224 0000092D AC <1> lodsb 225 0000092E AB <1> stosw 226 0000092F B03D <1> mov al,'=' 227 00000931 AB <1> stosw 228 00000932 87F5 <1> xchg si,bp 229 00000934 5F <1> pop di 230 00000935 81C7A000 <1> add di,SCR_COLS*2 231 00000939 C3 <1> ret 232 <1> ;============================================================================= 233 <1> ; update_watch_label 234 <1> ;----------------------------------------------------------------------------- 235 <1> update_watch_label: 236 0000093A 803E[4478]00 <1> cmp byte [large_dump],0 237 0000093F 7401 <1> jz @@upd 238 00000941 C3 <1> ret 239 <1> @@upd: 240 00000942 E85910 <1> call pushr 241 <1> 242 00000945 8E06[E27E] <1> mov es,[video_seg] 243 00000949 FC <1> cld 244 0000094A BF9A0B <1> mov di,WATCH_START 245 <1> 246 0000094D 833E[AA8B]00 <1> cmp word [data_watch_proc],0 247 00000952 741A <1> je @@draw_line 248 <1> 249 00000954 8B36[AE8B] <1> mov si,[data_watch_label] 250 00000958 B8200C <1> mov ax,atDataWatchMem*256 + ' ' 251 0000095B AB <1> stosw 252 <1> 253 0000095C AC <1> lodsb 254 0000095D AB <1> stosw 255 0000095E AC <1> lodsb 256 0000095F AB <1> stosw 257 <1> 258 00000960 B03A <1> mov al,':' 259 00000962 AB <1> stosw 260 <1> 261 00000963 AC <1> lodsb 262 00000964 AB <1> stosw 263 00000965 AC <1> lodsb 264 00000966 AB <1> stosw 265 <1> 266 00000967 B020 <1> mov al,' ' 267 00000969 AB <1> stosw 268 <1> @@exit: 269 0000096A E84410 <1> call popr 270 0000096D C3 <1> ret 271 <1> 272 <1> @@draw_line: 273 <1> 274 0000096E B40F <1> mov ah, atCPUborder 275 <1> drawchoice '─', '-' 276 00000970 A0[E18B] <1> mov al, byte [DRAWADDRESS] 277 00000973 B90700 <1> mov cx,7 278 00000976 F3AB <1> rep stosw 279 00000978 EBF0 <1> jmp @@exit 280 <1> ;============================================================================= 281 <1> ; fill_str 282 <1> ;----------------------------------------------------------------------------- 283 <1> fill_str: 284 <1> @@next: 285 0000097A AC <1> lodsb 286 0000097B 3C00 <1> cmp al,0 287 0000097D 7403 <1> je @@quit 288 0000097F AB <1> stosw 289 00000980 EBF8 <1> jmp @@next 290 <1> @@quit: 291 00000982 C3 <1> ret 292 <1> ;============================================================================= 293 <1> ; update_registers 294 <1> ;----------------------------------------------------------------------------- 295 <1> update_registers: 296 00000983 803E[4478]00 <1> cmp byte [large_dump],0 297 00000988 7401 <1> jz @@upd 298 0000098A C3 <1> ret 299 <1> @@upd: 300 0000098B E81010 <1> call pushr 301 0000098E 8E06[E27E] <1> mov es,[video_seg] 302 <1> 303 00000992 B87205 <1> mov ax,FLAG16_START+SCR_COLS*2+4 304 00000995 B90E00 <1> mov cx,NUM_16_REGS 305 00000998 BE[8873] <1> mov si,reg16_pos_table 306 0000099B 803E[8C8B]01 <1> cmp byte [regs_mode],1 307 000009A0 7508 <1> jne @@skip_32 308 000009A2 B85207 <1> mov ax,FLAG32_START+SCR_COLS*2+4 309 000009A5 B118 <1> mov cl,NUM_32_REGS ;CL instead of CX 310 000009A7 BE[F873] <1> mov si,reg32_pos_table 311 <1> @@skip_32: 312 000009AA 50 <1> push ax 313 <1> 314 <1> @@next_reg: 315 000009AB 31D2 <1> xor dx,dx 316 000009AD 8A14 <1> mov dl,[si+REG_POS_X] 317 000009AF D1E2 <1> shl dx,1 318 000009B1 B0A0 <1> mov al,SCR_COLS*2 319 000009B3 F66401 <1> mul byte [si+REG_POS_Y] 320 000009B6 01C2 <1> add dx,ax 321 000009B8 8B7C02 <1> mov di,[si+REG_POS_LINK] 322 <1> 323 000009BB 8B05 <1> mov ax,[di] 324 <1> 325 000009BD B70B <1> mov bh,atRegNewValue 326 000009BF 3945C0 <1> cmp [di+save_cpu_regs-cpu_regs],ax 327 000009C2 7519 <1> jne @@fill 328 000009C4 B70A <1> mov bh,atRegValue 329 000009C6 803E[8C8B]01 <1> cmp byte [regs_mode],1 330 000009CB 7510 <1> jne @@fill 331 000009CD E84600 <1> call align_reg 332 000009D0 50 <1> push ax 333 <1> cpu 386 334 000009D1 668B05 <1> mov eax,[di] 335 000009D4 663945C0 <1> cmp [di+save_cpu_regs-cpu_regs],eax 336 <1> cpu 8086 337 000009D8 58 <1> pop ax 338 000009D9 7402 <1> je @@fill 339 000009DB B70B <1> mov bh,atRegNewValue 340 <1> @@fill: 341 000009DD 89D7 <1> mov di,dx 342 000009DF E8A518 <1> call fill_word 343 000009E2 83C608 <1> add si,SIZEOF_REG_POS 344 000009E5 E2C4 <1> loop @@next_reg 345 <1> 346 000009E7 5F <1> pop di 347 <1> ;----------------------------------------------------------------------------- 348 <1> @@draw_flags: 349 000009E8 BED50E <1> mov si,0000111011010101b 350 <1> ; ----oditsz-a-p-c 351 000009EB B90800 <1> mov cx,NUM_FLAGS 352 <1> 353 000009EE 8B1E[048B] <1> mov bx,[cpu_regs+REG_FL] 354 000009F2 8B2E[C48A] <1> mov bp,[save_cpu_regs+REG_FL] 355 <1> @@next_flag: 356 <1> @@next_bit: 357 000009F6 B8300A <1> mov ax,atFlagValue*100h+'0' 358 000009F9 89C2 <1> mov dx,ax 359 000009FB D1E5 <1> shl bp,1 360 000009FD 10EA <1> adc dl,ch ;CH instead of 0 361 000009FF D1E3 <1> shl bx,1 362 00000A01 1400 <1> adc al,0 363 00000A03 D1E6 <1> shl si,1 364 00000A05 73EF <1> jnc @@next_bit 365 <1> 366 00000A07 31C2 <1> xor dx,ax 367 00000A09 7402 <1> jz @@display_flag 368 00000A0B B40B <1> mov ah,atFlagNewValue 369 <1> @@display_flag: 370 00000A0D AB <1> stosw 371 00000A0E AF <1> scasw 372 00000A0F AF <1> scasw 373 00000A10 E2E4 <1> loop @@next_flag 374 <1> 375 00000A12 E89C0F <1> call popr 376 00000A15 C3 <1> ret 377 <1> ;============================================================================= 378 <1> ; align_reg 379 <1> ;----------------------------------------------------------------------------- 380 <1> align_reg: 381 00000A16 81EF[C88A] <1> sub di,cpu_regs 382 00000A1A 83E77C <1> and di,01111100b 383 00000A1D 81C7[C88A] <1> add di,cpu_regs 384 00000A21 C3 <1> ret 385 <1> ;============================================================================= 386 <1> ; update_commands 387 <1> ;----------------------------------------------------------------------------- 388 <1> update_commands: 389 00000A22 803E[4478]00 <1> cmp byte [large_dump],0 390 00000A27 7401 <1> jz @@upd 391 00000A29 C3 <1> ret 392 <1> @@upd: 393 00000A2A E8710F <1> call pushr 394 00000A2D C606[8D8B]00 <1> mov byte [cur_line_brk],0 395 00000A32 C706[768B]0000 <1> mov word [cur_line_ip],0 396 00000A38 C706[2A78]FFFF <1> mov word [cur_ip_line],-1 397 00000A3E 8B36[2878] <1> mov si,[cur_ip] 398 00000A42 BFA000 <1> mov di,CMD_START 399 00000A45 8E06[E27E] <1> mov es,[video_seg] 400 00000A49 B91100 <1> mov cx,CPU_HEIGHT 401 00000A4C 31ED <1> xor bp,bp 402 <1> 403 <1> next_cpu_line: 404 00000A4E 31D2 <1> xor dx,dx 405 00000A50 8B1E[9B8B] <1> mov bx,[unasm_seg] 406 00000A54 3B1E[E88A] <1> cmp bx,[cpu_regs+REG_CS] 407 00000A58 750B <1> jne @@1 408 00000A5A 3B36[008B] <1> cmp si,[cpu_regs+REG_IP] 409 00000A5E 7505 <1> jne @@1 410 00000A60 42 <1> inc dx 411 00000A61 892E[2A78] <1> mov [cur_ip_line],bp 412 <1> @@1: 413 00000A65 E81C0C <1> call check_break 414 00000A68 7206 <1> jc @@8 415 00000A6A B601 <1> mov dh,1 ;Breakpoint exist 416 00000A6C 7402 <1> jz @@8 ;2008-03-26, JE => JZ 417 00000A6E B602 <1> mov dh,2 ;Breakpoint disabled 418 <1> @@8: 419 00000A70 89F3 <1> mov bx,si 420 00000A72 E85024 <1> call unassemble 421 00000A75 B8[B874] <1> mov ax,cmd_normal 422 00000A78 80FE01 <1> cmp dh,1 423 00000A7B 7208 <1> jb @@a 424 00000A7D B8[C474] <1> mov ax,cmd_breakpoint 425 00000A80 7403 <1> jz @@a 426 00000A82 B8[CA74] <1> mov ax,cmd_brk_disabled 427 <1> @@a: 428 00000A85 08D2 <1> or dl,dl 429 00000A87 7408 <1> jz @@2 430 <1> drawchoice 11h, '<' 431 <1> drawchoice 10h, '>' 432 00000A89 FF36[E28B] <1> push word [DRAWADDRESS - 1] ; get last two bytes ( or <>) 433 00000A8D 8F06[AE8D] <1> pop word [buffer + 4] 434 <1> @@2: 435 00000A91 3B2E[748B] <1> cmp bp,[cur_line] 436 00000A95 7523 <1> jne @@display 437 00000A97 803E[4978]01 <1> cmp byte [focus],1 438 00000A9C 7515 <1> jne @@e 439 00000A9E 3D[C474] <1> cmp ax,cmd_breakpoint 440 00000AA1 B8[BE74] <1> mov ax,cmd_selected 441 00000AA4 720D <1> jb @@e 442 00000AA6 C606[8D8B]01 <1> mov byte [cur_line_brk],1 443 00000AAB B8[D074] <1> mov ax,cmd_brk_selected 444 00000AAE 7403 <1> je @@e 445 00000AB0 B8[D674] <1> mov ax,cmd_brk_dis_sel 446 <1> @@e: 447 00000AB3 891E[768B] <1> mov [cur_line_ip],bx 448 00000AB7 E8D600 <1> call update_cmd_mem 449 <1> 450 <1> @@display: 451 00000ABA E83000 <1> call @@displayy 452 00000ABD E85150 <1> call get_ref_addresses 453 00000AC0 E87652 <1> call set_direction 454 00000AC3 E85600 <1> call display_cpu_line 455 <1> 456 00000AC6 81C7A000 <1> add di,SCR_COLS*2 457 00000ACA 45 <1> inc bp 458 <1> 459 00000ACB E8B052 <1> call display_code_marks 460 <1> 461 00000ACE E21A <1> loop jmp_next_cpu_line 462 <1> 463 00000AD0 2EF606[848B]03 <1> test byte [cs:edit_mode],ED_STACK+ED_DUMP ;2008-03-23 464 00000AD6 750E <1> jnz @@quit ;2008-03-23 465 <1> 466 00000AD8 83C70A <1> add di,10 467 00000ADB 8B0E[9B8B] <1> mov cx,[unasm_seg] 468 00000ADF 8B16[768B] <1> mov dx,[cur_line_ip] 469 00000AE3 E81D00 <1> call show_address 470 <1> @@quit: 471 00000AE6 E8C80E <1> call popr 472 00000AE9 C3 <1> ret 473 <1> 474 <1> jmp_next_cpu_line equ $ 475 00000AEA E961FF <1> jmp next_cpu_line 476 <1> 477 <1> ;----------------------------------------------------------------------------- 478 <1> @@displayy: 479 00000AED 803E[4978]01 <1> cmp byte [focus],1 480 00000AF2 740E <1> je @@focus 481 00000AF4 3B2E[748B] <1> cmp bp,[cur_line] 482 00000AF8 7508 <1> jne @@focus 483 00000AFA 3D[C474] <1> cmp ax,cmd_breakpoint 484 00000AFD 7303 <1> jae @@focus 485 00000AFF B8[DC74] <1> mov ax,cmd_not_focus 486 <1> @@focus: 487 00000B02 C3 <1> ret 488 <1> ;----------------------------------------------------------------------------- 489 <1> 490 <1> show_address: 491 00000B03 B8200B <1> mov ax,atCurUnasmAddr*100h+' ' 492 00000B06 AB <1> stosw 493 <1> show_address_2: 494 00000B07 B70B <1> mov bh,atCurUnasmAddr 495 00000B09 89C8 <1> mov ax,cx 496 00000B0B E87917 <1> call fill_word 497 00000B0E B83A0B <1> mov ax,atCurUnasmAddr*100h+':' 498 00000B11 AB <1> stosw 499 00000B12 89D0 <1> mov ax,dx 500 00000B14 E87017 <1> call fill_word 501 00000B17 B8200B <1> mov ax,atCurUnasmAddr*100h+' ' 502 00000B1A AB <1> stosw 503 00000B1B C3 <1> ret 504 <1> 505 <1> ;============================================================================= 506 <1> ; display_cpu_line 507 <1> ;----------------------------------------------------------------------------- 508 <1> display_cpu_line: 509 00000B1C E87F0E <1> call pushr 510 00000B1F 95 <1> xchg ax,bp 511 00000B20 BE[AA8D] <1> mov si,buffer 512 00000B23 8B16[728B] <1> mov dx,[cur_x] 513 00000B27 B93500 <1> mov cx,CPU_WIDTH-1 514 <1> 515 00000B2A 8A6600 <1> mov ah,[bp] 516 00000B2D BB0600 <1> mov bx,CPU_ADDR_SIZE 517 00000B30 E81000 <1> call @@display 518 <1> 519 00000B33 8A6601 <1> mov ah,[bp+1] 520 00000B36 BB0F00 <1> mov bx,CPU_OPCODE_SIZE 521 00000B39 E80700 <1> call @@display 522 <1> 523 00000B3C E81500 <1> call @@display_command 524 <1> 525 00000B3F E86F0E <1> call popr 526 00000B42 C3 <1> ret 527 <1> 528 <1> @@display: 529 00000B43 87D9 <1> xchg bx,cx 530 <1> @@next_char: 531 00000B45 AC <1> lodsb 532 00000B46 09D2 <1> or dx,dx 533 00000B48 7403 <1> jz @@write_char 534 00000B4A 4A <1> dec dx 535 00000B4B EB02 <1> jmp @@update_cx 536 <1> 537 <1> @@write_char: 538 00000B4D AB <1> stosw 539 00000B4E 4B <1> dec bx 540 <1> 541 <1> @@update_cx: 542 00000B4F E2F4 <1> loop @@next_char 543 00000B51 87D9 <1> xchg bx,cx 544 00000B53 C3 <1> ret 545 <1> 546 <1> @@display_command: 547 00000B54 AC <1> lodsb 548 <1> 549 00000B55 8A6604 <1> mov ah,[bp+4] 550 00000B58 3C18 <1> cmp al,18h 551 00000B5A 7425 <1> je @@write 552 00000B5C 3C19 <1> cmp al,19h 553 00000B5E 7421 <1> je @@write 554 <1> 555 00000B60 8A6605 <1> mov ah,[bp+5] 556 00000B63 3C1E <1> cmp al,1eh 557 00000B65 7425 <1> je @@disabled_arrow 558 00000B67 3C1F <1> cmp al,1fh 559 00000B69 7421 <1> je @@disabled_arrow 560 <1> 561 00000B6B 8A6602 <1> mov ah,[bp+2] 562 00000B6E 3C30 <1> cmp al,'0' 563 00000B70 720F <1> jb @@write 564 00000B72 3C39 <1> cmp al,'9' 565 00000B74 7608 <1> jbe @@digit 566 00000B76 3C41 <1> cmp al,'A' 567 00000B78 7207 <1> jb @@write 568 00000B7A 3C46 <1> cmp al,'F' 569 00000B7C 7703 <1> ja @@write 570 <1> @@digit: 571 00000B7E 8A6603 <1> mov ah,[bp+3] 572 <1> 573 <1> @@write: 574 00000B81 09D2 <1> or dx,dx 575 00000B83 7403 <1> jz @@stosw 576 00000B85 4A <1> dec dx 577 00000B86 EBCC <1> jmp @@display_command 578 <1> @@stosw: 579 00000B88 AB <1> stosw 580 00000B89 E2C9 <1> loop @@display_command 581 00000B8B C3 <1> ret 582 <1> 583 <1> @@disabled_arrow: 584 00000B8C 2C06 <1> sub al,1eh-18h 585 00000B8E EBF1 <1> jmp @@write 586 <1> ;============================================================================= 587 <1> ; update_cmd_mem 588 <1> ;----------------------------------------------------------------------------- 589 <1> update_cmd_mem: 590 00000B90 E80B0E <1> call pushr 591 00000B93 8E06[E27E] <1> mov es,[video_seg] 592 00000B97 BF680B <1> mov di,MEM_START 593 <1> drawchoice '─', '-' 594 00000B9A A0[E48B] <1> mov al, byte [DRAWADDRESS] 595 00000B9D B40F <1> mov ah,atCPUborder 596 00000B9F B91500 <1> mov cx,21 597 00000BA2 F3AB <1> rep stosw 598 00000BA4 803E[7A8B]00 <1> cmp byte [memory_flag],0 599 00000BA9 741B <1> je @@exit 600 00000BAB E86900 <1> call calc_mem_address 601 00000BAE E8DC00 <1> call disp_mem_addr 602 00000BB1 8A1E[7A8B] <1> mov bl,[memory_flag] 603 00000BB5 B700 <1> mov bh,0 604 00000BB7 4B <1> dec bx 605 00000BB8 83FB02 <1> cmp bx,2 606 00000BBB 7709 <1> ja @@exit 607 00000BBD 8EDA <1> mov ds,dx 608 00000BBF 01DB <1> add bx,bx 609 00000BC1 2EFF97[570C] <1> call [cs:display_mem_disp+bx] 610 <1> @@exit: 611 00000BC6 E8E80D <1> call popr 612 00000BC9 C3 <1> ret 613 <1> 614 00000BCA [DC0B] <1> calc_mem_disp dw calc_bxsi 615 00000BCC [E40B] <1> dw calc_bxdi 616 00000BCE [EC0B] <1> dw calc_bpsi 617 00000BD0 [FA0B] <1> dw calc_bpdi 618 00000BD2 [030C] <1> dw calc_si 619 00000BD4 [070C] <1> dw calc_di 620 00000BD6 [0F0C] <1> dw calc_bp 621 00000BD8 [0B0C] <1> dw calc_bx 622 00000BDA [140C] <1> dw calc_mem 623 <1> 624 00000BDC A1[CC8A] <1> calc_bxsi: mov ax,[cpu_regs+REG_BX] 625 00000BDF 0306[D88A] <1> add ax,[cpu_regs+REG_SI] 626 00000BE3 C3 <1> ret 627 <1> 628 00000BE4 A1[CC8A] <1> calc_bxdi: mov ax,[cpu_regs+REG_BX] 629 00000BE7 0306[DC8A] <1> add ax,[cpu_regs+REG_DI] 630 00000BEB C3 <1> ret 631 <1> 632 00000BEC A1[E08A] <1> calc_bpsi: mov ax,[cpu_regs+REG_BP] 633 00000BEF 0306[D88A] <1> add ax,[cpu_regs+REG_SI] 634 00000BF3 8B16[F48A] <1> ..@ss: mov dx,[cpu_regs+REG_SS] 635 00000BF7 B153 <1> mov cl,'S' 636 00000BF9 C3 <1> ret 637 <1> 638 00000BFA A1[E08A] <1> calc_bpdi: mov ax,[cpu_regs+REG_BP] 639 00000BFD 0306[DC8A] <1> add ax,[cpu_regs+REG_DI] 640 00000C01 EBF0 <1> jmp ..@ss 641 <1> 642 00000C03 A1[D88A] <1> calc_si: mov ax,[cpu_regs+REG_SI] 643 00000C06 C3 <1> ret 644 <1> 645 00000C07 A1[DC8A] <1> calc_di: mov ax,[cpu_regs+REG_DI] 646 00000C0A C3 <1> ret 647 <1> 648 00000C0B A1[CC8A] <1> calc_bx: mov ax,[cpu_regs+REG_BX] 649 00000C0E C3 <1> ret 650 <1> 651 00000C0F A1[E08A] <1> calc_bp: mov ax,[cpu_regs+REG_BP] 652 00000C12 EBDF <1> jmp ..@ss 653 <1> 654 00000C14 31C0 <1> calc_mem: xor ax,ax 655 00000C16 C3 <1> ret 656 <1> ;============================================================================= 657 <1> ; calc_mem_address 658 <1> ;----------------------------------------------------------------------------- 659 <1> calc_mem_address: 660 00000C17 8A1E[7B8B] <1> mov bl,[mem_disp_type] 661 00000C1B B700 <1> mov bh,0 662 00000C1D D1E3 <1> shl bx,1 663 00000C1F 8B16[EC8A] <1> mov dx,[cpu_regs+REG_DS] 664 00000C23 B144 <1> mov cl,'D' 665 00000C25 FF97[CA0B] <1> call [calc_mem_disp+bx] 666 00000C29 0306[7C8B] <1> add ax,[mem_disp_offs] 667 00000C2D 89C6 <1> mov si,ax 668 00000C2F A1[7E8B] <1> mov ax,[mem_prefix] 669 00000C32 09C0 <1> or ax,ax 670 00000C34 7420 <1> jz @@exit 671 <1> 672 00000C36 3D[CB3D] <1> cmp ax,pfs 673 00000C39 720E <1> jb @@set_prefix 674 00000C3B 803E[6E8B]03 <1> cmp byte [system_cpu],3 675 00000C40 7214 <1> jb @@exit 676 00000C42 803E[C42E]72 <1> cmp byte [cpu_type],a386 677 00000C47 720D <1> jb @@exit 678 <1> 679 <1> @@set_prefix: 680 00000C49 89C3 <1> mov bx,ax 681 00000C4B 8A0F <1> mov cl,[bx] 682 00000C4D 80E920 <1> sub cl,'a'-'A' 683 00000C50 81C32D4D <1> add bx,cpu_regs+REG_CS-pcs 684 00000C54 8B17 <1> mov dx,[bx] 685 <1> @@exit: 686 00000C56 C3 <1> ret 687 <1> ;============================================================================= 688 <1> 689 <1> display_mem_disp: 690 00000C57 [5D0C] <1> dw disp_byte 691 00000C59 [650C] <1> dw disp_word 692 00000C5B [760C] <1> dw disp_dword 693 <1> disp_byte: 694 00000C5D 88E7 <1> mov bh,ah 695 00000C5F AC <1> lodsb 696 00000C60 E82B16 <1> call fill_byte 697 00000C63 EB22 <1> jmp ..@rest 698 <1> disp_word: 699 00000C65 88E7 <1> mov bh,ah 700 00000C67 83FEFF <1> cmp si,-1 701 00000C6A 7504 <1> jne @@lodsw 702 00000C6C AC <1> lodsb 703 00000C6D 88C4 <1> mov ah,al 704 00000C6F AC <1> lodsb 705 <1> @@lodsw: 706 00000C70 AD <1> lodsw 707 00000C71 E81316 <1> call fill_word 708 00000C74 EB11 <1> jmp ..@rest 709 <1> disp_dword: 710 00000C76 88E7 <1> mov bh,ah 711 00000C78 AD <1> lodsw 712 00000C79 91 <1> xchg ax,cx 713 00000C7A AD <1> lodsw 714 00000C7B E80916 <1> call fill_word 715 00000C7E 88FC <1> mov ah,bh 716 00000C80 B03A <1> mov al,':' 717 00000C82 AB <1> stosw 718 00000C83 91 <1> xchg ax,cx 719 00000C84 E80016 <1> call fill_word 720 <1> ..@rest: 721 00000C87 88FC <1> mov ah,bh 722 00000C89 B020 <1> mov al,' ' 723 00000C8B AA <1> stosb 724 00000C8C C3 <1> ret 725 <1> ;============================================================================= 726 <1> ; disp_mem_addr 727 <1> ;----------------------------------------------------------------------------- 728 <1> disp_mem_addr: 729 00000C8D 8E06[E27E] <1> mov es,[video_seg] 730 00000C91 BF680B <1> mov di,MEM_START 731 00000C94 B40F <1> mov ah,atMemAddr 732 00000C96 B020 <1> mov al,' ' 733 00000C98 AB <1> stosw 734 00000C99 88C8 <1> mov al,cl 735 00000C9B AB <1> stosw 736 00000C9C B053 <1> mov al,'S' 737 00000C9E AB <1> stosw 738 00000C9F B03A <1> mov al,':' 739 00000CA1 AB <1> stosw 740 00000CA2 88E7 <1> mov bh,ah 741 00000CA4 89F0 <1> mov ax,si 742 00000CA6 E8DE15 <1> call fill_word 743 00000CA9 88FC <1> mov ah,bh 744 00000CAB B020 <1> mov al,' ' 745 00000CAD AB <1> stosw 746 00000CAE B03D <1> mov al,'=' 747 00000CB0 AB <1> stosw 748 00000CB1 B020 <1> mov al,' ' 749 00000CB3 AB <1> stosw 750 00000CB4 B40E <1> mov ah,atMemValue 751 00000CB6 C3 <1> ret 752 <1> ;----------------------------------------------------------------------------- 753 <1> expand_dump: 754 00000CB7 C706[4678]A000 <1> mov word [dump_start],SCR_COLS*2 ;1st row 755 00000CBD A1[2E78] <1> mov ax,[screen_height] 756 00000CC0 A3[3078] <1> mov [dump_height],ax 757 00000CC3 C606[4578]01 <1> mov byte [dump_y],1 758 00000CC8 C606[4478]01 <1> mov byte [large_dump],1 759 00000CCD C3 <1> ret 760 <1> ;----------------------------------------------------------------------------- 761 <1> shrink_dump: 762 00000CCE C706[4678]800C <1> mov word [dump_start],DUMP_START 763 00000CD4 A1[3278] <1> mov ax,[e_dump_height] 764 00000CD7 A3[3078] <1> mov [dump_height],ax 765 00000CDA C606[4578]14 <1> mov byte [dump_y],DUMP_Y 766 00000CDF C606[4478]00 <1> mov byte [large_dump],0 767 00000CE4 C3 <1> ret 768 <1> ;----------------------------------------------------------------------------- 769 <1> 770 <1> zoom_dump: 771 00000CE5 F606[4478]01 <1> test byte [large_dump],1 772 00000CEA 7424 <1> jz @@enlarge 773 <1> 774 00000CEC A1[3278] <1> mov ax,[e_dump_height] 775 00000CEF B104 <1> mov cl,4 776 00000CF1 D3E0 <1> shl ax,cl 777 00000CF3 0306[BC8B] <1> add ax,[dump_offs] 778 00000CF7 39C6 <1> cmp si,ax 779 00000CF9 720F <1> jb @@ok 780 00000CFB 89F0 <1> mov ax,si 781 00000CFD 2B06[BC8B] <1> sub ax,[dump_offs] 782 00000D01 83E0F0 <1> and ax,0fff0h 783 00000D04 0106[BC8B] <1> add [dump_offs],ax 784 00000D08 B600 <1> mov dh,0 785 <1> @@ok: 786 00000D0A E8C1FF <1> call shrink_dump 787 00000D0D E9710A <1> jmp draw_screen 788 <1> @@enlarge: 789 00000D10 8E06[E27E] <1> mov es,[video_seg] 790 00000D14 31FF <1> xor di,di 791 00000D16 FC <1> cld 792 00000D17 B9D007 <1> mov cx,SCR_COLS*SCR_ROWS 793 00000D1A F606[8B8B]20 <1> test byte [cmd_line_options],CMD_EGA 794 00000D1F 7404 <1> jz @@not_ega 795 00000D21 81C1D007 <1> add cx,SCR_COLS*(MAX_SCR_ROWS-SCR_ROWS) 796 <1> @@not_ega: 797 00000D25 B82007 <1> mov ax,atMainWindow*100h+20h 798 00000D28 F3AB <1> rep stosw 799 00000D2A E88AFF <1> call expand_dump 800 <1> 801 <1> ;============================================================================= 802 <1> ; _update_dump 803 <1> ;----------------------------------------------------------------------------- 804 <1> _update_dump: 805 00000D2D 833E[AA8B]00 <1> cmp word [data_watch_proc],0 806 00000D32 7404 <1> je update_dump 807 00000D34 FF26[AA8B] <1> jmp word [data_watch_proc] 808 <1> update_dump: 809 00000D38 E8630C <1> call pushr 810 00000D3B 8B36[BC8B] <1> mov si,[dump_offs] 811 00000D3F 8E06[E27E] <1> mov es,[video_seg] 812 <1> 813 00000D43 89F0 <1> mov ax,si 814 <1> ;----------------------------------------------------------------------------- 815 <1> ; Draw line of hex digits above dump 816 <1> ;----------------------------------------------------------------------------- 817 00000D45 B407 <1> mov ah,atDumpAddr 818 00000D47 8B2E[4678] <1> mov bp,[dump_start] 819 00000D4B 89EF <1> mov di,bp 820 00000D4D 83ED26 <1> sub bp,SCR_COLS*2-(DUMP_X+13+16*3)*2 821 00000D50 81EF8800 <1> sub di,SCR_COLS*2-(DUMP_X+12)*2 822 00000D54 B91000 <1> mov cx,16 823 <1> @@next: 824 00000D57 240F <1> and al,0fh 825 00000D59 50 <1> push ax 826 00000D5A 3C0A <1> cmp al,10 827 00000D5C 1C69 <1> sbb al,69h 828 00000D5E 2F <1> das 829 00000D5F AB <1> stosw 830 00000D60 87FD <1> xchg di,bp 831 00000D62 AB <1> stosw 832 00000D63 87FD <1> xchg di,bp 833 00000D65 58 <1> pop ax 834 00000D66 AF <1> scasw 835 00000D67 AF <1> scasw 836 00000D68 40 <1> inc ax 837 00000D69 E2EC <1> loop @@next 838 <1> ;----------------------------------------------------------------------------- 839 00000D6B 8E1E[BA8B] <1> mov ds,[dump_seg] 840 00000D6F 2E8B3E[4678] <1> mov di,[cs:dump_start] 841 00000D74 2E8B0E[3078] <1> mov cx,[cs:dump_height] 842 00000D79 80EA10 <1> sub dl,16 843 00000D7C F6DA <1> neg dl 844 <1> 845 00000D7E 52 <1> push dx 846 <1> 847 <1> @@next_row: 848 00000D7F B707 <1> mov bh,atDumpAddr 849 00000D81 8CD8 <1> mov ax,ds 850 00000D83 E80115 <1> call fill_word 851 00000D86 B03A <1> mov al,':' 852 00000D88 88FC <1> mov ah,bh 853 00000D8A AB <1> stosw 854 00000D8B 89F0 <1> mov ax,si 855 00000D8D E8F714 <1> call fill_word 856 00000D90 AF <1> scasw 857 00000D91 AF <1> scasw 858 00000D92 B30A <1> mov bl,atDumpValue 859 00000D94 B41F <1> mov ah,atDumpCursor 860 00000D96 51 <1> push cx 861 00000D97 B91000 <1> mov cx,16 862 <1> @@next_col: 863 00000D9A 88DF <1> mov bh,bl 864 00000D9C AC <1> lodsb 865 00000D9D 08C0 <1> or al,al 866 00000D9F 7502 <1> jnz @@nz 867 00000DA1 B702 <1> mov bh,atDumpZero 868 <1> @@nz: 869 00000DA3 2EF606[848B]01 <1> test byte [cs:edit_mode],ED_DUMP 870 00000DA9 740B <1> jz @@not_cur_1 871 00000DAB 80FE00 <1> cmp dh,0 872 00000DAE 7506 <1> jne @@not_cur_1 873 00000DB0 38CA <1> cmp dl,cl 874 00000DB2 7502 <1> jne @@not_cur_1 875 00000DB4 88E7 <1> mov bh,ah 876 <1> @@not_cur_1: 877 00000DB6 E8D514 <1> call fill_byte 878 00000DB9 AF <1> scasw 879 00000DBA E2DE <1> loop @@next_col 880 00000DBC 59 <1> pop cx 881 00000DBD FECE <1> dec dh 882 00000DBF 83C72A <1> add di,(SCR_COLS-59)*2 883 00000DC2 E2BB <1> loop @@next_row 884 <1> 885 00000DC4 5A <1> pop dx 886 00000DC5 B70A <1> mov bh,atDumpValue 887 00000DC7 B31F <1> mov bl,atDumpCursor 888 <1> 889 00000DC9 2E8B36[BC8B] <1> mov si,[cs:dump_offs] 890 00000DCE 2E8B3E[4678] <1> mov di,[cs:dump_start] 891 00000DD3 83C77A <1> add di,61*2 ;!!! 892 00000DD6 2E8B0E[3078] <1> mov cx,[cs:dump_height] 893 <1> @@next_row_1: 894 00000DDB 51 <1> push cx 895 00000DDC B91000 <1> mov cx,16 896 <1> @@next_col_1: 897 00000DDF 88FC <1> mov ah,bh 898 00000DE1 AC <1> lodsb 899 00000DE2 2ED006[8A7E] <1> rol byte [cs:option_cpdump], 1 900 00000DE7 7304 <1> jnc @F ; not set, hide CP-dependent --> 901 00000DE9 84C0 <1> test al, al ; zero ? 902 00000DEB 750C <1> jnz @FFF ; no --> 903 <1> ; If zero, fall through into the next check 904 <1> ; and eventually replace this byte too. 905 <1> @@: 906 00000DED 3C20 <1> cmp al, 32 907 00000DEF 7204 <1> jb @F ; if below, replace 908 00000DF1 3C7F <1> cmp al, 127 909 00000DF3 7204 <1> jb @FF ; if above-or-equal, fall through and replace 910 <1> @@: 911 00000DF5 B402 <1> mov ah,atDumpZero 912 00000DF7 B02E <1> mov al,'.' 913 <1> @@: 914 00000DF9 2EF606[848B]01 <1> test byte [cs:edit_mode],ED_DUMP 915 00000DFF 740B <1> jz @@not_cur_2 916 00000E01 80FE00 <1> cmp dh,0 917 00000E04 7506 <1> jne @@not_cur_2 918 00000E06 38CA <1> cmp dl,cl 919 00000E08 7502 <1> jne @@not_cur_2 920 00000E0A 88DC <1> mov ah,bl 921 <1> @@not_cur_2: 922 00000E0C AB <1> stosw 923 00000E0D E2D0 <1> loop @@next_col_1 924 <1> 925 00000E0F 59 <1> pop cx 926 00000E10 FECE <1> dec dh 927 00000E12 81C78000 <1> add di,(SCR_COLS-16)*2 928 00000E16 E2C3 <1> loop @@next_row_1 929 <1> 930 <1> ;----------------------------------------------------------------------------- 931 00000E18 2EF606[848B]01 <1> test byte [cs:edit_mode],ED_DUMP 932 00000E1E 741F <1> jz @@quit 933 00000E20 2E8B0E[BA8B] <1> mov cx,[cs:dump_seg] 934 00000E25 2E8B16[B88B] <1> mov dx,[cs:dump_address] 935 00000E2A BF4A0B <1> mov di,DUMP_START-SCR_COLS*4+10 936 00000E2D 2E803E[4478]01 <1> cmp byte [cs:large_dump],1 937 00000E33 7507 <1> jne @@show 938 00000E35 31FF <1> xor di,di 939 00000E37 E8CDFC <1> call show_address_2 940 00000E3A EB03 <1> jmp @@quit 941 <1> @@show: 942 00000E3C E8C4FC <1> call show_address 943 <1> @@quit: 944 <1> ;----------------------------------------------------------------------------- 945 <1> 946 00000E3F E86F0B <1> call popr 947 00000E42 C3 <1> ret 948 <1> ;============================================================================= 949 <1> ; update_stack 950 <1> ;----------------------------------------------------------------------------- 951 <1> update_stack: 952 00000E43 803E[4478]00 <1> cmp byte [large_dump],0 953 00000E48 7403 <1> jz @@ok 954 00000E4A E99E00 <1> jmp @@quit 955 <1> @@ok: 956 <1> 957 00000E4D E84E0B <1> call pushr 958 <1> 959 00000E50 A1[E48A] <1> mov ax,[cpu_regs+REG_SP] 960 00000E53 F606[848B]02 <1> test byte [edit_mode],ED_STACK 961 00000E58 7503 <1> jnz @@0001 962 00000E5A A3[3878] <1> mov [initial_sp_val],ax 963 <1> @@0001: 964 <1> 965 00000E5D BF0E0B <1> mov di,STK_START 966 00000E60 8B0E[3478] <1> mov cx,[stack_height] 967 00000E64 8B36[3878] <1> mov si,[initial_sp_val] 968 00000E68 8B2E[3D78] <1> mov bp,[initial_bp_disp] 969 00000E6C 8E06[E27E] <1> mov es,[video_seg] 970 00000E70 8E1E[F48A] <1> mov ds,[cpu_regs+REG_SS] 971 <1> 972 <1> @@next: 973 00000E74 B85307 <1> mov ax,atStackAddr*256+'S' 974 00000E77 AB <1> stosw 975 00000E78 AB <1> stosw 976 00000E79 B03A <1> mov al,':' 977 00000E7B AB <1> stosw 978 00000E7C 93 <1> xchg ax,bx ;Instead of MOV BH,AH 979 00000E7D 89F0 <1> mov ax,si 980 00000E7F E80514 <1> call fill_word ;SP value 981 <1> 982 00000E82 B407 <1> mov ah, atStackName 983 <1> drawchoice 10h, '>' 984 00000E84 2EA0[E58B] <1> mov al, byte [cs:DRAWADDRESS] 985 00000E88 2E3B36[E48A] <1> cmp si,[cs:cpu_regs+REG_SP] 986 00000E8D 7402 <1> je @@st0 987 00000E8F B020 <1> mov al,' ' 988 <1> @@st0: 989 00000E91 AB <1> stosw 990 00000E92 B70A <1> mov bh,atStackValue 991 00000E94 AC <1> lodsb 992 00000E95 88C4 <1> mov ah,al 993 00000E97 AC <1> lodsb 994 00000E98 86E0 <1> xchg ah,al 995 00000E9A E8EA13 <1> call fill_word ;[SS:SP] 996 <1> 997 00000E9D AF <1> scasw 998 00000E9E AF <1> scasw 999 <1> 1000 00000E9F B82B07 <1> mov ax,atStackAddr*256+'+' 1001 00000EA2 89EB <1> mov bx,bp 1002 00000EA4 09ED <1> or bp,bp 1003 00000EA6 7904 <1> jns @@st1 1004 00000EA8 B02D <1> mov al,'-' 1005 00000EAA F7DB <1> neg bx 1006 <1> @@st1: 1007 00000EAC AB <1> stosw 1008 00000EAD 93 <1> xchg ax,bx ;BH := AH (color); AX := BX (displ-t) 1009 00000EAE E8D613 <1> call fill_word ;Displacement 1010 00000EB1 AF <1> scasw 1011 00000EB2 89EB <1> mov bx,bp 1012 00000EB4 2E031E[E08A] <1> add bx,[cs:cpu_regs+REG_BP] 1013 00000EB9 8A07 <1> mov al,[bx] 1014 00000EBB 8A6701 <1> mov ah,[bx+1] 1015 00000EBE B70A <1> mov bh,atStackValue 1016 00000EC0 E8C413 <1> call fill_word ;[SS:BP+xxxx] 1017 00000EC3 83C502 <1> add bp,2 1018 <1> 1019 00000EC6 81EFD000 <1> sub di,(SCR_COLS+24)*2 1020 00000ECA E2A8 <1> loop @@next 1021 <1> 1022 00000ECC 2EF606[848B]02 <1> test byte [cs:edit_mode],ED_STACK 1023 00000ED2 7414 <1> jz @@dont_show 1024 00000ED4 2E8B0E[F48A] <1> mov cx,[cs:cpu_regs+REG_SS] 1025 00000ED9 2E8B2E[4278] <1> mov bp,[cs:stack_mode] 1026 00000EDE 2E8B5603 <1> mov dx,word [cs:bp+3] 1027 00000EE2 BF4A0B <1> mov di,DUMP_START-SCR_COLS*4+10 1028 00000EE5 E81BFC <1> call show_address 1029 <1> @@dont_show: 1030 <1> 1031 00000EE8 E8C60A <1> call popr 1032 <1> @@quit: 1033 00000EEB C3 <1> ret 1034 <1> ;============================================================================= 1035 <1> ; update_regs_color 1036 <1> ;----------------------------------------------------------------------------- 1037 <1> update_regs_color: 1038 00000EEC 803E[4A78]01 <1> cmp byte [regs_saved],1 1039 00000EF1 740A <1> je @@exit 1040 00000EF3 FE06[4A78] <1> inc byte [regs_saved] 1041 00000EF7 E8D743 <1> call save_regs 1042 00000EFA E886FA <1> call update_registers 1043 <1> @@exit: 1044 00000EFD C3 <1> ret 1045 <1> ;============================================================================= 1046 <1> ; display_focus 1047 <1> ;----------------------------------------------------------------------------- 1048 <1> display_focus: 1049 00000EFE FE06[4978] <1> inc byte [focus] 1050 00000F02 E91DFB <1> jmp update_commands 1051 <1> ;============================================================================= 1052 <1> ; hide_focus 1053 <1> ;----------------------------------------------------------------------------- 1054 <1> hide_focus: 1055 00000F05 FE0E[4978] <1> dec byte [focus] 1056 00000F09 E916FB <1> jmp update_commands 1057 <1> ;============================================================================= 1058 <1> ; edit_registers 1059 <1> ;----------------------------------------------------------------------------- 1060 <1> edit_registers: 1061 00000F0C E8F6FF <1> call hide_focus 1062 00000F0F E8DAFF <1> call update_regs_color 1063 00000F12 E8C713 <1> call large_cursor 1064 <1> 1065 <1> @@start_edit: 1066 00000F15 BE[8873] <1> mov si,reg16_pos_table 1067 00000F18 803E[8C8B]01 <1> cmp byte [regs_mode],1 1068 00000F1D 7503 <1> jne @@skip_32 1069 00000F1F BE[F873] <1> mov si,reg32_pos_table 1070 <1> @@skip_32: 1071 00000F22 31D2 <1> xor dx,dx 1072 <1> 1073 <1> @@next: 1074 00000F24 52 <1> push dx 1075 00000F25 0314 <1> add dx,[si] 1076 00000F27 E89213 <1> call gotoxy 1077 00000F2A 5A <1> pop dx 1078 <1> 1079 <1> @@read_key: 1080 00000F2B E8EF0B <1> call read_key 1081 <1> 1082 00000F2E BF[1F10] <1> mov di,@@actions - 3 1083 00000F31 E8B90A <1> call action_short_jump 1084 00000F34 7206 <1> jc @@other 1085 00000F36 81C7[3C0F] <1> add di,@@first_action 1086 00000F3A FFE7 <1> jmp di 1087 <1> 1088 <1> @@first_action: 1089 <1> ; 0..9, A..F, a..f 1090 <1> @@other: 1091 00000F3C E86D0B <1> call ascii_to_bin 1092 00000F3F 72E3 <1> jc @@next 1093 00000F41 8B7C02 <1> mov di,[si+REG_POS_LINK] 1094 00000F44 E81301 <1> call set_half_byte 1095 00000F47 FEC2 <1> inc dl 1096 00000F49 80FA04 <1> cmp dl,4 1097 00000F4C 7305 <1> jae @@move 1098 <1> 1099 <1> @@update: 1100 <1> ; call update_regs_and_cmds 1101 00000F4E E83908 <1> call update_screen ;We need to update stack window also... 1102 00000F51 EBD1 <1> jmp @@next 1103 <1> ; Tab 1104 <1> @@move: 1105 00000F53 8A4405 <1> mov al,[si+REG_POS_RIGHT] 1106 00000F56 31D2 <1> xor dx,dx 1107 00000F58 E9BB00 <1> jmp @@get_next 1108 <1> ; Shift+Tab 1109 <1> @@move_back: 1110 00000F5B 8A4404 <1> mov al,[si+REG_POS_LEFT] 1111 00000F5E B200 <1> mov dl,0 1112 00000F60 E9B300 <1> jmp @@get_next 1113 <1> ; Right 1114 <1> @@right: 1115 00000F63 FEC2 <1> inc dl 1116 00000F65 80FA03 <1> cmp dl,3 1117 00000F68 77E9 <1> ja @@move 1118 00000F6A EBB8 <1> jmp @@next 1119 <1> ; Left 1120 <1> @@left: 1121 00000F6C 08D2 <1> or dl,dl 1122 00000F6E 7508 <1> jnz @@dec 1123 00000F70 8A4404 <1> mov al,[si+REG_POS_LEFT] 1124 00000F73 B203 <1> mov dl,3 1125 00000F75 E99E00 <1> jmp @@get_next 1126 <1> @@dec: 1127 00000F78 FECA <1> dec dl 1128 00000F7A EBA8 <1> jmp @@next 1129 <1> ; Up 1130 <1> @@up: 1131 00000F7C 8A4406 <1> mov al,[si+REG_POS_UP] 1132 00000F7F E99400 <1> jmp @@get_next 1133 <1> ; Down 1134 <1> @@down: 1135 00000F82 8A4407 <1> mov al,[si+REG_POS_DOWN] 1136 00000F85 E98E00 <1> jmp @@get_next 1137 <1> ; Alt+F10 1138 <1> @@local_menu: 1139 00000F88 56 <1> push si 1140 00000F89 BE[0671] <1> mov si,regs_local_struc 1141 00000F8C E8E107 <1> call _local_menu 1142 00000F8F 5E <1> pop si 1143 00000F90 7292 <1> jc @@next 1144 00000F92 FFE0 <1> jmp ax 1145 <1> ; Ctrl+R 1146 <1> @@switch_reg_mode: 1147 00000F94 E887F1 <1> call switch_reg_mode 1148 00000F97 E97BFF <1> jmp @@start_edit 1149 <1> ; Ctrl+A 1150 <1> @@restore_all: 1151 00000F9A 56 <1> push si 1152 00000F9B E8E6F2 <1> call restore_all 1153 00000F9E 5E <1> pop si 1154 00000F9F EB83 <1> jmp @@next 1155 <1> ; Ctrl+T 1156 <1> @@restore_flags: 1157 00000FA1 E8E6F2 <1> call restore_flags 1158 00000FA4 E97DFF <1> jmp @@next 1159 <1> ; Ctrl+C 1160 <1> @@restore_csip: 1161 00000FA7 E8E9F2 <1> call restore_csip ;[0leg, 2006-12-31] 1162 00000FAA E977FF <1> jmp @@next ;Was: restore_flags 1163 <1> ; Ctrl+I 1164 <1> @@inc_reg: 1165 00000FAD 8B7C02 <1> mov di,[si+REG_POS_LINK] 1166 00000FB0 803E[8C8B]01 <1> cmp byte [regs_mode],1 1167 00000FB5 7404 <1> je @@inc_32 1168 <1> @@inc_16: 1169 00000FB7 FF05 <1> inc word [di] 1170 00000FB9 EB93 <1> jmp @@update 1171 <1> @@inc_32: 1172 00000FBB 81FF[E88A] <1> cmp di,cpu_regs+REG_CS 1173 00000FBF 73F6 <1> jae @@inc_16 1174 00000FC1 E852FA <1> call align_reg 1175 <1> cpu 386 1176 00000FC4 66FF05 <1> inc dword [di] 1177 <1> cpu 8086 1178 00000FC7 EB85 <1> jmp @@update 1179 <1> ; Ctrl+D 1180 <1> @@dec_reg: 1181 00000FC9 8B7C02 <1> mov di,[si+REG_POS_LINK] 1182 00000FCC 803E[8C8B]01 <1> cmp byte [regs_mode],1 1183 00000FD1 7405 <1> je @@dec_32 1184 <1> @@dec_16: 1185 00000FD3 FF0D <1> dec word [di] 1186 00000FD5 E976FF <1> jmp @@update 1187 <1> @@dec_32: 1188 00000FD8 81FF[E88A] <1> cmp di,cpu_regs+REG_CS 1189 00000FDC 73F5 <1> jae @@dec_16 1190 00000FDE E835FA <1> call align_reg 1191 <1> cpu 386 1192 00000FE1 66FF0D <1> dec dword [di] 1193 <1> cpu 8086 1194 00000FE4 E967FF <1> jmp @@update 1195 <1> ; Ctrl+Z 1196 <1> @@zero_reg: 1197 00000FE7 8B7C02 <1> mov di,[si+REG_POS_LINK] 1198 00000FEA E829FA <1> call align_reg 1199 00000FED C7050000 <1> mov word [di],0 1200 00000FF1 C745020000 <1> mov word [di+2],0 1201 00000FF6 E955FF <1> jmp @@update 1202 <1> ; Ctrl+O 1203 <1> @@restore_reg: 1204 00000FF9 8B7C02 <1> mov di,[si+REG_POS_LINK] 1205 00000FFC E817FA <1> call align_reg 1206 00000FFF 8B45C0 <1> mov ax,[di+save_cpu_regs-cpu_regs] 1207 00001002 8905 <1> mov [di],ax 1208 00001004 8B45C2 <1> mov ax,[di+2+save_cpu_regs-cpu_regs] 1209 00001007 894502 <1> mov [di+2],ax 1210 0000100A E941FF <1> jmp @@update 1211 <1> ; ESC, Enter 1212 <1> @@quit: 1213 0000100D E8C212 <1> call no_cursor 1214 00001010 E87707 <1> call update_screen 1215 00001013 E9E8FE <1> jmp display_focus 1216 <1> 1217 00001016 98 <1> @@get_next: cbw 1218 00001017 D1E0 <1> shl ax,1 1219 00001019 D1E0 <1> shl ax,1 1220 0000101B D1E0 <1> shl ax,1 1221 0000101D 01C6 <1> add si,ax 1222 0000101F E92CFF <1> jmp @@update 1223 <1> 1224 00001022 1B01 <1> @@actions dw kbEsc 1225 00001024 D1 <1> db @@quit - @@first_action 1226 00001025 0044 <1> dw kbF10 1227 00001027 D1 <1> db @@quit - @@first_action 1228 00001028 0D1C <1> dw kbEnter 1229 0000102A D1 <1> db @@quit - @@first_action 1230 0000102B 090F <1> dw kbTab 1231 0000102D 17 <1> db @@move - @@first_action 1232 0000102E 000F <1> dw kbShiftTab 1233 00001030 1F <1> db @@move_back - @@first_action 1234 00001031 004D <1> dw kbRight 1235 00001033 27 <1> db @@right - @@first_action 1236 00001034 004B <1> dw kbLeft 1237 00001036 30 <1> db @@left - @@first_action 1238 00001037 0048 <1> dw kbUp 1239 00001039 40 <1> db @@up - @@first_action 1240 0000103A 0050 <1> dw kbDown 1241 0000103C 46 <1> db @@down - @@first_action 1242 0000103D 011E <1> dw kbCtrlA 1243 0000103F 5E <1> db @@restore_all - @@first_action 1244 00001040 0F18 <1> dw kbCtrlO 1245 00001042 BD <1> db @@restore_reg - @@first_action 1246 00001043 1414 <1> dw kbCtrlT 1247 00001045 65 <1> db @@restore_flags - @@first_action 1248 00001046 032E <1> dw kbCtrlC 1249 00001048 6B <1> db @@restore_csip - @@first_action 1250 00001049 1213 <1> dw kbCtrlR 1251 0000104B 58 <1> db @@switch_reg_mode - @@first_action 1252 0000104C 0917 <1> dw kbCtrlI 1253 0000104E 71 <1> db @@inc_reg - @@first_action 1254 0000104F 0420 <1> dw kbCtrlD 1255 00001051 8D <1> db @@dec_reg - @@first_action 1256 00001052 1A2C <1> dw kbCtrlZ 1257 00001054 AB <1> db @@zero_reg - @@first_action 1258 00001055 0071 <1> dw kbAltF10 1259 00001057 4C <1> db @@local_menu - @@first_action 1260 00001058 0000 <1> dw 0 1261 <1> 1262 <1> _switch_reg_mode equ @@switch_reg_mode 1263 <1> _restore_all equ @@restore_all 1264 <1> _restore_flags equ @@restore_flags 1265 <1> _restore_csip equ @@restore_csip 1266 <1> inc_reg equ @@inc_reg 1267 <1> dec_reg equ @@dec_reg 1268 <1> zero_reg equ @@zero_reg 1269 <1> restore_reg equ @@restore_reg 1270 <1> 1271 <1> ;============================================================================= 1272 <1> ; set_half_byte 1273 <1> ;----------------------------------------------------------------------------- 1274 <1> ; Changes nybble in a word. 1275 <1> ; In: DL -- number of nybble: 0..3 1276 <1> ; DS:DI -> word to edit 1277 <1> ; AL -- value of nybble: 0..F 1278 <1> ; Out: DS:DI -> changed word 1279 <1> ; Modf: AX, BX, CL 1280 <1> ; Call: --- 1281 <1> ; Use: --- 1282 <1> ; 1283 <1> set_half_byte: 1284 0000105A BBF0FF <1> mov bx,0fff0h 1285 0000105D B103 <1> mov cl,3 1286 0000105F 28D1 <1> sub cl,dl 1287 00001061 D0E1 <1> shl cl,1 1288 00001063 D0E1 <1> shl cl,1 1289 00001065 D3C3 <1> rol bx,cl 1290 00001067 231D <1> and bx,[di] 1291 00001069 B400 <1> mov ah,0 1292 0000106B D3E0 <1> shl ax,cl 1293 0000106D 09D8 <1> or ax,bx 1294 0000106F 8905 <1> mov [di],ax 1295 00001071 C3 <1> ret 1296 <1> ;============================================================================= 1297 <1> ; toggle_flag 1298 <1> ;----------------------------------------------------------------------------- 1299 <1> toggle_flag: 1300 00001072 E80500 <1> call get_flag_mask 1301 00001075 3106[048B] <1> xor [cpu_regs+REG_FL],ax 1302 00001079 C3 <1> ret 1303 <1> 1304 <1> get_flag_mask: 1305 0000107A 8A8F[1978] <1> mov cl,[reg_shift+bx] 1306 0000107E B80100 <1> mov ax,1 1307 00001081 D3E0 <1> shl ax,cl 1308 00001083 C3 <1> ret 1309 <1> ;============================================================================= 1310 <1> ; edit_flags 1311 <1> ;----------------------------------------------------------------------------- 1312 <1> edit_flags: 1313 00001084 E87EFE <1> call hide_focus 1314 00001087 E862FE <1> call update_regs_color 1315 0000108A E84F12 <1> call large_cursor 1316 0000108D 31DB <1> xor bx,bx 1317 <1> @@next: 1318 0000108F BA3910 <1> mov dx,(STK_BOT_Y-1)*256+FLAG16_X+2 1319 00001092 2A36[3478] <1> sub dh,[stack_height] 1320 00001096 00DA <1> add dl,bl 1321 00001098 00DA <1> add dl,bl 1322 0000109A 00DA <1> add dl,bl 1323 0000109C E81D12 <1> call gotoxy 1324 0000109F E87B0A <1> call read_key 1325 <1> 1326 000010A2 BF[F310] <1> mov di,@@actions - 3 1327 000010A5 E84509 <1> call action_short_jump 1328 000010A8 72E5 <1> jc @@next 1329 000010AA 81C7[B010] <1> add di,@@first_action 1330 000010AE FFE7 <1> jmp di 1331 <1> 1332 <1> @@first_action: 1333 <1> ; 0 1334 <1> @@clear: 1335 000010B0 E8C7FF <1> call get_flag_mask 1336 000010B3 F7D0 <1> not ax 1337 000010B5 2106[048B] <1> and [cpu_regs+REG_FL],ax 1338 000010B9 EB18 <1> jmp @@update 1339 <1> ; 1 1340 <1> @@set: 1341 000010BB E8BCFF <1> call get_flag_mask 1342 000010BE 0906[048B] <1> or [cpu_regs+REG_FL],ax 1343 000010C2 EB0F <1> jmp @@update 1344 <1> ; Alt+F10 1345 <1> @@local_menu: 1346 000010C4 BE[D271] <1> mov si,flags_local_struc 1347 000010C7 E8A606 <1> call _local_menu 1348 000010CA 72C3 <1> jc @@next 1349 000010CC FFD0 <1> call ax 1350 000010CE EB03 <1> jmp @@update 1351 <1> ; Space 1352 <1> @@toggle: 1353 000010D0 E89FFF <1> call toggle_flag 1354 <1> @@update: 1355 000010D3 E8BA06 <1> call update_regs_and_cmds 1356 000010D6 EBB7 <1> jmp @@next 1357 <1> ; Right 1358 <1> @@right: 1359 000010D8 FEC3 <1> inc bl 1360 000010DA 80FB08 <1> cmp bl,NUM_FLAGS 1361 000010DD 72B0 <1> jb @@next 1362 000010DF B300 <1> mov bl,0 1363 000010E1 EBAC <1> jmp @@next 1364 <1> ; Left 1365 <1> @@left: 1366 000010E3 FECB <1> dec bl 1367 000010E5 79A8 <1> jns @@next 1368 000010E7 B307 <1> mov bl,NUM_FLAGS-1 1369 000010E9 EBA4 <1> jmp @@next 1370 <1> ; Ctrl+T 1371 <1> @@restore_flags: 1372 000010EB E89CF1 <1> call restore_flags 1373 000010EE EB9F <1> jmp @@next 1374 <1> ; ESC, Enter 1375 <1> @@quit: 1376 000010F0 E8DF11 <1> call no_cursor 1377 000010F3 E908FE <1> jmp display_focus 1378 <1> 1379 <1> 1380 000010F6 1B01 <1> @@actions dw kbEsc 1381 000010F8 40 <1> db @@quit - @@first_action 1382 000010F9 0044 <1> dw kbF10 1383 000010FB 40 <1> db @@quit - @@first_action 1384 000010FC 0D1C <1> dw kbEnter 1385 000010FE 40 <1> db @@quit - @@first_action 1386 000010FF 004D <1> dw kbRight 1387 00001101 28 <1> db @@right - @@first_action 1388 00001102 004B <1> dw kbLeft 1389 00001104 33 <1> db @@left - @@first_action 1390 00001105 0050 <1> dw kbDown 1391 00001107 00 <1> db @@clear - @@first_action 1392 00001108 0048 <1> dw kbUp 1393 0000110A 0B <1> db @@set - @@first_action 1394 0000110B 300B <1> dw 0b00h+'0' 1395 0000110D 00 <1> db @@clear - @@first_action 1396 0000110E 3102 <1> dw 0200h+'1' 1397 00001110 0B <1> db @@set - @@first_action 1398 00001111 2039 <1> dw 3900h+' ' 1399 00001113 20 <1> db @@toggle - @@first_action 1400 00001114 1414 <1> dw kbCtrlT 1401 00001116 3B <1> db @@restore_flags - @@first_action 1402 00001117 0071 <1> dw kbAltF10 1403 00001119 14 <1> db @@local_menu - @@first_action 1404 0000111A 0000 <1> dw 0 1405 <1> ;============================================================================= 1406 <1> ; edit_dump 1407 <1> ;----------------------------------------------------------------------------- 1408 <1> edit_dump: 1409 0000111C 800E[848B]01 <1> or byte [edit_mode],ED_DUMP 1410 00001121 E8E1FD <1> call hide_focus 1411 <1> 1412 00001124 06 <1> push es 1413 <1> 1414 <1> @@next_r: 1415 00001125 8B36[BC8B] <1> mov si,[dump_offs] 1416 00001129 2E8936[B88B] <1> mov [cs:dump_address],si ;2008-03-23 1417 0000112E 8E06[BA8B] <1> mov es,[dump_seg] 1418 00001132 31DB <1> xor bx,bx 1419 00001134 31D2 <1> xor dx,dx 1420 00001136 31ED <1> xor bp,bp 1421 <1> 1422 00001138 E8FDFB <1> call update_dump 1423 <1> 1424 <1> @@next: 1425 0000113B E89E11 <1> call large_cursor 1426 0000113E 52 <1> push dx 1427 0000113F 09ED <1> or bp,bp 1428 00001141 7405 <1> jz @@hex_cur 1429 00001143 80C23D <1> add dl,DUMP_X+11+48+2 1430 00001146 EB0B <1> jmp @@set_cur 1431 <1> @@hex_cur: 1432 00001148 88D0 <1> mov al,dl 1433 0000114A 00C2 <1> add dl,al 1434 0000114C 00C2 <1> add dl,al 1435 0000114E 00DA <1> add dl,bl 1436 00001150 80C20B <1> add dl,DUMP_X+11 1437 <1> @@set_cur: 1438 00001153 0236[4578] <1> add dh,[dump_y] 1439 00001157 E86211 <1> call gotoxy 1440 0000115A 5A <1> pop dx 1441 <1> 1442 <1> @@read_key: 1443 0000115B E8BF09 <1> call read_key 1444 0000115E BF[1113] <1> mov di,@@actions - 4 ;2008-11-03 1445 00001161 E8A108 <1> call action_long_jump 1446 00001164 7209 <1> jc @@not_found 1447 00001166 81C7[9E11] <1> add di,@@first_action 1448 0000116A B8[E258] <1> mov ax,dump_csip 1449 0000116D FFE7 <1> jmp di 1450 <1> ; 0..9, A..F, a..f 1451 <1> @@not_found: 1452 0000116F 09ED <1> or bp,bp 1453 00001171 7553 <1> jnz @@fill_char 1454 00001173 E83609 <1> call ascii_to_bin 1455 00001176 72C3 <1> jc @@next 1456 00001178 88D9 <1> mov cl,bl 1457 0000117A 80F101 <1> xor cl,1 1458 0000117D D0E1 <1> shl cl,1 1459 0000117F D0E1 <1> shl cl,1 1460 00001181 B4F0 <1> mov ah,0f0h 1461 00001183 D2C4 <1> rol ah,cl 1462 00001185 262224 <1> and ah,[es:si] 1463 00001188 D2E0 <1> shl al,cl 1464 0000118A 08C4 <1> or ah,al 1465 0000118C 268824 <1> mov [es:si],ah 1466 0000118F 263824 <1> cmp [es:si],ah 1467 00001192 743E <1> je @@right 1468 <1> @@not_ram: 1469 00001194 56 <1> push si 1470 00001195 BE[A776] <1> mov si,dump_not_in_ram 1471 00001198 E8C905 <1> call _error_message 1472 0000119B 5E <1> pop si 1473 0000119C EB45 <1> jmp @@update 1474 <1> 1475 <1> @@first_action: 1476 <1> ; Ctrl+F 1477 <1> @@dump_follow: 1478 0000119E 56 <1> push si 1479 0000119F BE[4E70] <1> mov si,follow_menu_struc 1480 000011A2 EB0A <1> jmp @@exec_menu 1481 <1> ; Ctrl+B 1482 <1> @@block: 1483 000011A4 56 <1> push si 1484 000011A5 BE[C070] <1> mov si,block_menu_struc 1485 000011A8 EB04 <1> jmp @@exec_menu 1486 <1> ; Alt+F10 1487 <1> @@local_menu: 1488 000011AA 56 <1> push si 1489 000011AB BE[D26F] <1> mov si,dump_menu_struc 1490 <1> 1491 <1> @@exec_menu: 1492 000011AE E8BF05 <1> call _local_menu 1493 000011B1 5E <1> pop si 1494 000011B2 7276 <1> jc @@jump_to_next 1495 <1> 1496 <1> @@call_action: 1497 000011B4 E8E707 <1> call pushr 1498 000011B7 FFD0 <1> call ax 1499 000011B9 E8F507 <1> call popr 1500 000011BC EB03 <1> jmp @@select_next_jump 1501 <1> ; Ctrl+D 1502 <1> @@dump_go_to: 1503 000011BE E8FE02 <1> call dump_go_to 1504 <1> 1505 <1> @@select_next_jump: 1506 000011C1 7267 <1> jc @@jump_to_next 1507 <1> 1508 <1> @@jump_to_next_r: 1509 000011C3 E95FFF <1> jmp @@next_r 1510 <1> ; Any char 1511 <1> @@fill_char: 1512 000011C6 3C00 <1> cmp al,0 1513 000011C8 7460 <1> je @@jump_to_next 1514 000011CA 268804 <1> mov [es:si],al 1515 000011CD 263804 <1> cmp [es:si],al 1516 000011D0 75C2 <1> jne @@not_ram 1517 <1> ; Right 1518 <1> @@right: 1519 000011D2 09ED <1> or bp,bp 1520 000011D4 7505 <1> jnz @@cm_1 1521 000011D6 80F301 <1> xor bl,1 1522 000011D9 7508 <1> jnz @@update ;jmp @@next ??? 1523 <1> @@cm_1: 1524 000011DB 46 <1> inc si 1525 000011DC FEC2 <1> inc dl 1526 000011DE 80FA0F <1> cmp dl,15 1527 000011E1 774A <1> ja @@next_line 1528 <1> @@update: 1529 000011E3 2E8936[B88B] <1> mov [cs:dump_address],si ;2008-03-23 1530 000011E8 E84DFB <1> call update_dump 1531 000011EB E834F8 <1> call update_commands 1532 000011EE E852FC <1> call update_stack 1533 000011F1 E947FF <1> jmp @@next 1534 <1> ; Alt+= 1535 <1> @@dump_reference: 1536 000011F4 B8[6358] <1> mov ax,dump_reference 1537 000011F7 EBBB <1> jmp @@call_action 1538 <1> ; Alt+L 1539 <1> @@dump_cur_line: 1540 000011F9 B8[7758] <1> mov ax,dump_cur_line 1541 000011FC EBB6 <1> jmp @@call_action 1542 <1> ; Alt+U 1543 <1> @@dump_user_scr: 1544 000011FE B8[8258] <1> mov ax,dump_user_screen 1545 00001201 EBB1 <1> jmp @@call_action 1546 <1> ; Alt+E 1547 <1> @@dump_esdi: 1548 00001203 83E80B <1> sub ax,update_dump_window-dump_csip 1549 <1> ; Alt+D 1550 <1> @@dump_dssi: 1551 00001206 83E80B <1> sub ax,update_dump_window-dump_csip 1552 <1> ; Alt+B 1553 <1> @@dump_esbx: 1554 00001209 83E80B <1> sub ax,update_dump_window-dump_csip 1555 <1> ; Alt+S 1556 <1> @@dump_ssbp: 1557 0000120C 83E80B <1> sub ax,update_dump_window-dump_csip 1558 <1> ; Alt+A 1559 <1> @@dump_dxax: 1560 0000120F 83E80B <1> sub ax,update_dump_window-dump_csip 1561 <1> ; Alt+F 1562 <1> @@dump_dsdx: 1563 00001212 83E80B <1> sub ax,update_dump_window-dump_csip 1564 <1> ; Alt+I 1565 <1> @@dump_essi: 1566 00001215 83E80B <1> sub ax,update_dump_window-dump_csip 1567 <1> ; Alt+J 1568 <1> @@dump_dsdi: 1569 00001218 83E80B <1> sub ax,update_dump_window-dump_csip 1570 <1> ; Alt+C 1571 <1> @@dump_csip: 1572 0000121B EB97 <1> jmp @@call_action 1573 <1> ; Ctrl+S 1574 <1> @@search: 1575 0000121D B8[0B13] <1> mov ax,data_search 1576 00001220 EB92 <1> jmp @@call_action 1577 <1> ; Ctrl+L 1578 <1> @@search_next: 1579 00001222 B8[1013] <1> mov ax,data_search_next 1580 00001225 EB8D <1> jmp @@call_action 1581 <1> ; Alt+Z 1582 <1> @@zoom_dump: 1583 00001227 E8BBFA <1> call zoom_dump 1584 <1> 1585 <1> @@jump_to_next: 1586 0000122A E90EFF <1> jmp @@next 1587 <1> 1588 <1> @@next_line: 1589 0000122D B200 <1> mov dl,0 1590 <1> @@down_1: 1591 0000122F FEC6 <1> inc dh 1592 00001231 3A36[3078] <1> cmp dh,[dump_height] 1593 00001235 72AC <1> jb @@update 1594 00001237 8306[BC8B]10 <1> add word [dump_offs],16 1595 0000123C 8A36[3078] <1> mov dh,[dump_height] 1596 00001240 FECE <1> dec dh 1597 00001242 EB9F <1> jmp @@update 1598 <1> ; Down 1599 <1> @@down: 1600 00001244 83C610 <1> add si,16 1601 00001247 EBE6 <1> jmp @@down_1 1602 <1> ; Left 1603 <1> @@left: 1604 00001249 09ED <1> or bp,bp 1605 0000124B 7505 <1> jnz @@cm_2 1606 0000124D 80F301 <1> xor bl,1 1607 00001250 7491 <1> jz @@update ;jmp @@next ??? 1608 <1> @@cm_2: 1609 00001252 4E <1> dec si 1610 00001253 FECA <1> dec dl ;dl always >=0 before dec 1611 00001255 798C <1> jns @@update 1612 00001257 B20F <1> mov dl,15 1613 <1> @@up_1: 1614 00001259 FECE <1> dec dh 1615 0000125B 7986 <1> jns @@update ;dh always >=0 before dec 1616 0000125D B600 <1> mov dh,0 1617 0000125F 832E[BC8B]10 <1> sub word [dump_offs],16 1618 00001264 E97CFF <1> jmp @@update 1619 <1> ; Up 1620 <1> @@up: 1621 00001267 83EE10 <1> sub si,16 1622 0000126A EBED <1> jmp @@up_1 1623 <1> ; Home 1624 <1> @@home: 1625 0000126C 88D0 <1> mov al,dl 1626 0000126E 98 <1> cbw 1627 0000126F B200 <1> mov dl,0 1628 00001271 EB08 <1> jmp @@upd0 1629 <1> ; End 1630 <1> @@end: 1631 00001273 88D0 <1> mov al,dl 1632 00001275 98 <1> cbw 1633 00001276 83C60F <1> add si,15 1634 00001279 B20F <1> mov dl,15 1635 <1> @@upd0: 1636 0000127B 29C6 <1> sub si,ax 1637 0000127D 30DB <1> xor bl,bl 1638 0000127F E961FF <1> jmp @@update 1639 <1> ; Ctrl+Right 1640 <1> @@byte_right: 1641 00001282 FF06[BC8B] <1> inc word [dump_offs] 1642 00001286 46 <1> inc si 1643 00001287 E959FF <1> jmp @@update 1644 <1> ; Ctrl+Left 1645 <1> @@byte_left: 1646 0000128A FF0E[BC8B] <1> dec word [dump_offs] 1647 0000128E 4E <1> dec si 1648 0000128F E951FF <1> jmp @@update 1649 <1> ; Tab 1650 <1> @@switch: 1651 00001292 83F501 <1> xor bp,1 1652 00001295 7593 <1> jnz @@jump_to_next 1653 00001297 31DB <1> xor bx,bx 1654 00001299 EB8F <1> jmp @@jump_to_next 1655 <1> ; Page Up 1656 <1> @@page_up: 1657 0000129B B0F0 <1> mov al,-16 1658 0000129D EB02 <1> jmp @@up_dn 1659 <1> ; Page Down 1660 <1> @@page_down: 1661 0000129F B010 <1> mov al,16 1662 <1> @@up_dn: 1663 000012A1 F62E[3078] <1> imul byte [dump_height] 1664 000012A5 0106[BC8B] <1> add [dump_offs],ax 1665 000012A9 01C6 <1> add si,ax 1666 000012AB E935FF <1> jmp @@update 1667 <1> ; ESC, Enter 1668 <1> @@quit: 1669 000012AE E82110 <1> call no_cursor 1670 000012B1 8026[848B]FE <1> and byte [edit_mode],~ED_DUMP 1671 000012B6 E815FA <1> call shrink_dump 1672 000012B9 E8C504 <1> call draw_screen 1673 000012BC E83FFC <1> call display_focus 1674 000012BF 07 <1> pop es 1675 000012C0 C3 <1> ret 1676 <1> ; Alt+F5 1677 <1> @@user_scr: 1678 000012C1 E87019 <1> call restore_screen 1679 000012C4 E85608 <1> call read_key 1680 000012C7 E8F318 <1> call save_screen 1681 000012CA E96EFE <1> jmp @@next 1682 <1> 1683 <1> @@follow_data_seg: 1684 000012CD 268B04 <1> mov ax,[es:si] 1685 000012D0 A3[BA8B] <1> mov [dump_seg],ax 1686 000012D3 31C0 <1> xor ax,ax 1687 000012D5 EB0A <1> jmp @@follow_data 1688 <1> 1689 <1> @@follow_far_data: 1690 000012D7 268B4402 <1> mov ax,[es:si+2] 1691 000012DB A3[BA8B] <1> mov [dump_seg],ax 1692 <1> 1693 <1> @@follow_near_data: 1694 000012DE 268B04 <1> mov ax,[es:si] 1695 <1> @@follow_data: 1696 000012E1 A3[BC8B] <1> mov [dump_offs],ax 1697 000012E4 E851FA <1> call update_dump 1698 000012E7 F8 <1> clc 1699 000012E8 C3 <1> ret 1700 <1> 1701 <1> @@follow_code_seg: 1702 000012E9 268B04 <1> mov ax,[es:si] 1703 000012EC A3[9B8B] <1> mov [unasm_seg],ax 1704 000012EF 31C0 <1> xor ax,ax 1705 000012F1 EB0A <1> jmp @@follow_code 1706 <1> 1707 <1> @@follow_far_code: 1708 000012F3 268B4402 <1> mov ax,[es:si+2] 1709 000012F7 A3[9B8B] <1> mov [unasm_seg],ax 1710 <1> 1711 <1> @@follow_near_code: 1712 000012FA 268B04 <1> mov ax,[es:si] 1713 <1> @@follow_code: 1714 000012FD A3[2878] <1> mov [cur_ip],ax 1715 00001300 C706[748B]0000 <1> mov word [cur_line],0 1716 00001306 E819F7 <1> call update_commands 1717 00001309 F9 <1> stc 1718 0000130A C3 <1> ret 1719 <1> 1720 <1> @@data_search: 1721 0000130B E8C34A <1> call search_bytes 1722 0000130E F8 <1> clc 1723 0000130F C3 <1> ret 1724 <1> 1725 <1> @@data_search_next: 1726 00001310 E84A4B <1> call search_next 1727 00001313 F8 <1> clc 1728 00001314 C3 <1> ret 1729 <1> 1730 00001315 1B01 <1> @@actions dw kbEsc 1731 00001317 1001 <1> dw @@quit - @@first_action 1732 00001319 0044 <1> dw kbF10 1733 0000131B 1001 <1> dw @@quit - @@first_action 1734 0000131D 0D1C <1> dw kbEnter 1735 0000131F 1001 <1> dw @@quit - @@first_action 1736 00001321 004D <1> dw kbRight 1737 00001323 3400 <1> dw @@right - @@first_action 1738 00001325 004B <1> dw kbLeft 1739 00001327 AB00 <1> dw @@left - @@first_action 1740 00001329 0048 <1> dw kbUp 1741 0000132B C900 <1> dw @@up - @@first_action 1742 0000132D 0050 <1> dw kbDown 1743 0000132F A600 <1> dw @@down - @@first_action 1744 00001331 0049 <1> dw kbPgUp 1745 00001333 FD00 <1> dw @@page_up - @@first_action 1746 00001335 0051 <1> dw kbPgDn 1747 00001337 0101 <1> dw @@page_down - @@first_action 1748 00001339 0073 <1> dw kbCtrlLeft 1749 0000133B EC00 <1> dw @@byte_left - @@first_action 1750 0000133D 0074 <1> dw kbCtrlRight 1751 0000133F E400 <1> dw @@byte_right - @@first_action 1752 00001341 1A2C <1> dw kbCtrlZ 1753 00001343 EC00 <1> dw @@byte_left - @@first_action 1754 00001345 1915 <1> dw kbCtrlY 1755 00001347 EC00 <1> dw @@byte_left - @@first_action 1756 00001349 1A15 <1> dw kbCtrlZGerman 1757 0000134B EC00 <1> dw @@byte_left - @@first_action 1758 0000134D 192C <1> dw kbCtrlYGerman 1759 0000134F EC00 <1> dw @@byte_left - @@first_action 1760 00001351 182D <1> dw kbCtrlX 1761 00001353 E400 <1> dw @@byte_right - @@first_action 1762 00001355 0047 <1> dw kbHome 1763 00001357 CE00 <1> dw @@home - @@first_action 1764 00001359 004F <1> dw kbEnd 1765 0000135B D500 <1> dw @@end - @@first_action 1766 0000135D 090F <1> dw kbTab 1767 0000135F F400 <1> dw @@switch - @@first_action 1768 00001361 0420 <1> dw kbCtrlD 1769 00001363 2000 <1> dw @@dump_go_to - @@first_action 1770 00001365 0071 <1> dw kbAltF10 1771 00001367 0C00 <1> dw @@local_menu - @@first_action 1772 00001369 0083 <1> dw kbAltEqu 1773 0000136B 5600 <1> dw @@dump_reference - @@first_action 1774 0000136D 0016 <1> dw kbAltU 1775 0000136F 6000 <1> dw @@dump_user_scr - @@first_action 1776 00001371 0012 <1> dw kbAltE 1777 00001373 6500 <1> dw @@dump_esdi - @@first_action 1778 00001375 0020 <1> dw kbAltD 1779 00001377 6800 <1> dw @@dump_dssi - @@first_action 1780 00001379 0030 <1> dw kbAltB 1781 0000137B 6B00 <1> dw @@dump_esbx - @@first_action 1782 0000137D 001F <1> dw kbAltS 1783 0000137F 6E00 <1> dw @@dump_ssbp - @@first_action 1784 00001381 001E <1> dw kbAltA 1785 00001383 7100 <1> dw @@dump_dxax - @@first_action 1786 00001385 0021 <1> dw kbAltF 1787 00001387 7400 <1> dw @@dump_dsdx - @@first_action 1788 00001389 0017 <1> dw kbAltI 1789 0000138B 7700 <1> dw @@dump_essi - @@first_action 1790 0000138D 0024 <1> dw kbAltJ 1791 0000138F 7A00 <1> dw @@dump_dsdi - @@first_action 1792 00001391 002E <1> dw kbAltC 1793 00001393 7D00 <1> dw @@dump_csip - @@first_action 1794 00001395 0026 <1> dw kbAltL 1795 00001397 5B00 <1> dw @@dump_cur_line - @@first_action 1796 00001399 0621 <1> dw kbCtrlF 1797 0000139B 0000 <1> dw @@dump_follow - @@first_action 1798 0000139D 0230 <1> dw kbCtrlB 1799 0000139F 0600 <1> dw @@block - @@first_action 1800 000013A1 131F <1> dw kbCtrlS 1801 000013A3 7F00 <1> dw @@search - @@first_action 1802 000013A5 0C26 <1> dw kbCtrlL 1803 000013A7 8400 <1> dw @@search_next - @@first_action 1804 000013A9 002C <1> dw kbAltZ 1805 000013AB 8900 <1> dw @@zoom_dump - @@first_action 1806 000013AD 006C <1> dw kbAltF5 1807 000013AF 2301 <1> dw @@user_scr - @@first_action 1808 000013B1 0000 <1> dw 0 ;end of table 1809 <1> 1810 <1> follow_data_seg equ @@follow_data_seg 1811 <1> follow_far_data equ @@follow_far_data 1812 <1> follow_near_data equ @@follow_near_data 1813 <1> follow_code_seg equ @@follow_code_seg 1814 <1> follow_far_code equ @@follow_far_code 1815 <1> follow_near_code equ @@follow_near_code 1816 <1> data_search equ @@data_search 1817 <1> data_search_next equ @@data_search_next 1818 <1> 1819 <1> ;============================================================================= 1820 <1> ; edit_stack 1821 <1> ;----------------------------------------------------------------------------- 1822 <1> edit_stack: 1823 000013B3 800E[848B]02 <1> or byte [edit_mode],ED_STACK 1824 000013B8 E84AFB <1> call hide_focus 1825 000013BB 31D2 <1> xor dx,dx 1826 000013BD BD[3778] <1> mov bp,edit_sssp_params 1827 000013C0 892E[4278] <1> mov [stack_mode],bp 1828 000013C4 E8D300 <1> call calc_ss_addr 1829 000013C7 E879FA <1> call update_stack 1830 <1> 1831 <1> @@next: 1832 000013CA E80F0F <1> call large_cursor 1833 000013CD 52 <1> push dx 1834 000013CE 3E025600 <1> add dl,[ds:bp+0] ;X 1835 000013D2 F6DE <1> neg dh 1836 000013D4 80C611 <1> add dh,STK_BOT_Y 1837 000013D7 E8E20E <1> call gotoxy 1838 000013DA 5A <1> pop dx 1839 <1> 1840 <1> @@read_key: 1841 000013DB E83F07 <1> call read_key 1842 000013DE BF[7714] <1> mov di,@@actions - 3 1843 000013E1 E80906 <1> call action_short_jump 1844 000013E4 7206 <1> jc @@not_found 1845 000013E6 81C7[FF13] <1> add di,@@first_action 1846 000013EA FFE7 <1> jmp di 1847 <1> @@not_found: 1848 000013EC E8BD06 <1> call ascii_to_bin 1849 000013EF 72D9 <1> jc @@next 1850 000013F1 E8A600 <1> call calc_ss_addr ;DI -> word 1851 000013F4 1E <1> push ds 1852 000013F5 8E1E[F48A] <1> mov ds,[cpu_regs+REG_SS] 1853 000013F9 E85EFC <1> call set_half_byte 1854 000013FC 1F <1> pop ds 1855 000013FD EB0E <1> jmp @@right 1856 <1> 1857 <1> @@first_action: 1858 <1> 1859 <1> ;@@local_menu: 1860 <1> ; push si 1861 <1> ; mov si,dump_menu_struc 1862 <1> ; 1863 <1> ;@@exec_menu: 1864 <1> ; call _local_menu 1865 <1> ; pop si 1866 <1> ; jc @@jump_to_next 1867 <1> ; 1868 <1> 1869 <1> @@update: 1870 000013FF E89800 <1> call calc_ss_addr 1871 00001402 E833F9 <1> call update_dump 1872 00001405 E81AF6 <1> call update_commands 1873 00001408 E838FA <1> call update_stack 1874 0000140B EBBD <1> jmp @@next 1875 <1> ; Right 1876 <1> @@right: 1877 0000140D FEC2 <1> inc dl 1878 0000140F 80FA03 <1> cmp dl,3 1879 00001412 76EB <1> jbe @@update 1880 00001414 B200 <1> mov dl,0 1881 <1> ; Down 1882 <1> @@down: 1883 00001416 FECE <1> dec dh 1884 00001418 79E5 <1> jns @@update 1885 0000141A 3E836E0102 <1> sub word [ds:bp+1],2 1886 0000141F B600 <1> mov dh,0 1887 00001421 EBDC <1> jmp @@update 1888 <1> ; Left 1889 <1> @@left: 1890 00001423 FECA <1> dec dl 1891 00001425 79D8 <1> jns @@update 1892 00001427 B203 <1> mov dl,3 1893 <1> ; Up 1894 <1> @@up: 1895 00001429 FEC6 <1> inc dh 1896 0000142B 3A36[3478] <1> cmp dh,[stack_height] 1897 0000142F 72CE <1> jb @@update 1898 00001431 8A36[3478] <1> mov dh,[stack_height] 1899 00001435 FECE <1> dec dh 1900 00001437 3E83460102 <1> add word [ds:bp+1],2 1901 0000143C EBC1 <1> jmp @@update 1902 <1> ; Page Up 1903 <1> @@page_up: 1904 0000143E A0[3478] <1> mov al,[stack_height] 1905 00001441 D0E0 <1> shl al,1 1906 00001443 98 <1> cbw 1907 00001444 3E014601 <1> add word [ds:bp+1],ax 1908 00001448 EBB5 <1> jmp @@update 1909 <1> ; Page Down 1910 <1> @@page_down: 1911 0000144A A0[3478] <1> mov al,[stack_height] 1912 0000144D D0E0 <1> shl al,1 1913 0000144F 98 <1> cbw 1914 00001450 3E294601 <1> sub word [ds:bp+1],ax 1915 00001454 EBA9 <1> jmp @@update 1916 <1> ; Tab 1917 <1> @@switch: 1918 00001456 30D2 <1> xor dl,dl 1919 00001458 83F50B <1> xor bp,word ED_SSSP ^ ED_SSBP 1920 0000145B 892E[4278] <1> mov [stack_mode],bp 1921 0000145F 8716[3578] <1> xchg dx,[stack_wnd_xy] 1922 00001463 EB9A <1> jmp @@update ;@@next 1923 <1> ; ESC, Enter 1924 <1> @@quit: 1925 00001465 E86A0E <1> call no_cursor 1926 00001468 8026[848B]FD <1> and byte [edit_mode],~ED_STACK 1927 0000146D C706[3578]0000 <1> mov word [stack_wnd_xy],0 1928 00001473 E80B03 <1> call draw_screen 1929 00001476 E885FA <1> call display_focus 1930 00001479 C3 <1> ret 1931 <1> 1932 0000147A 1B01 <1> @@actions dw kbEsc 1933 0000147C 66 <1> db @@quit - @@first_action 1934 0000147D 0044 <1> dw kbF10 1935 0000147F 66 <1> db @@quit - @@first_action 1936 00001480 0D1C <1> dw kbEnter 1937 00001482 66 <1> db @@quit - @@first_action 1938 00001483 0048 <1> dw kbUp 1939 00001485 2A <1> db @@up - @@first_action 1940 00001486 0050 <1> dw kbDown 1941 00001488 17 <1> db @@down - @@first_action 1942 00001489 004B <1> dw kbLeft 1943 0000148B 24 <1> db @@left - @@first_action 1944 0000148C 004D <1> dw kbRight 1945 0000148E 0E <1> db @@right - @@first_action 1946 0000148F 0049 <1> dw kbPgUp 1947 00001491 3F <1> db @@page_up - @@first_action 1948 00001492 0051 <1> dw kbPgDn 1949 00001494 4B <1> db @@page_down - @@first_action 1950 00001495 090F <1> dw kbTab 1951 00001497 57 <1> db @@switch - @@first_action 1952 00001498 0000 <1> dw 0 1953 <1> 1954 <1> ;============================================================================= 1955 <1> ; --- 1956 <1> ; In: DH -- line 1957 <1> ; Out: DI -> word 1958 <1> ; Modf: --- 1959 <1> ; Call: --- 1960 <1> ; Use: --- 1961 <1> ; 1962 <1> calc_ss_addr: 1963 0000149A 97 <1> xchg ax,di 1964 0000149B 88F0 <1> mov al,dh 1965 0000149D 00F0 <1> add al,dh 1966 0000149F 98 <1> cbw 1967 000014A0 3E034601 <1> add ax,[ds:bp+1] 1968 000014A4 81FD[3778] <1> cmp bp,edit_sssp_params 1969 000014A8 7404 <1> je @@sssp_01 1970 000014AA 0306[E08A] <1> add ax,[cpu_regs+REG_BP] 1971 <1> @@sssp_01: 1972 000014AE 3E894603 <1> mov [ds:bp+3],ax 1973 000014B2 97 <1> xchg ax,di 1974 000014B3 C3 <1> ret 1975 <1> 1976 <1> ;============================================================================= 1977 <1> ; block_menu 1978 <1> ;----------------------------------------------------------------------------- 1979 <1> block_menu: 1980 000014B4 BE[C070] <1> mov si,block_menu_struc 1981 000014B7 E8B602 <1> call _local_menu 1982 000014BA 7202 <1> jc @@exit 1983 000014BC FFD0 <1> call ax 1984 <1> @@exit: 1985 000014BE C3 <1> ret 1986 <1> ;============================================================================= 1987 <1> ; dump_go_to 1988 <1> ;----------------------------------------------------------------------------- 1989 <1> dump_go_to: 1990 000014BF B82810 <1> mov ax,16*256+40 1991 000014C2 BF[7690] <1> mov di,dump_addr_string 1992 000014C5 E802EE <1> call read_address 1993 000014C8 7214 <1> jc @@quit 1994 000014CA 08ED <1> or ch,ch 1995 000014CC 7409 <1> jz @@no_seg 1996 000014CE 8916[BA8B] <1> mov [dump_seg],dx 1997 000014D2 80FD02 <1> cmp ch,2 1998 000014D5 7403 <1> je @@no_offs 1999 <1> @@no_seg: 2000 000014D7 A3[BC8B] <1> mov [dump_offs],ax 2001 <1> @@no_offs: 2002 000014DA E85BF8 <1> call update_dump 2003 000014DD F8 <1> clc 2004 <1> @@quit: 2005 000014DE C3 <1> ret 2006 <1> ;============================================================================= 2007 <1> ; edit_commands 2008 <1> ;----------------------------------------------------------------------------- 2009 <1> edit_commands: 2010 000014DF 833E[728B]00 <1> cmp word [cur_x],0 2011 000014E4 7409 <1> je @@skip 2012 000014E6 C706[728B]0000 <1> mov word [cur_x],0 2013 000014EC E833F5 <1> call update_commands 2014 <1> @@skip: 2015 000014EF 803E[4978]01 <1> cmp byte [focus],1 2016 000014F4 730C <1> jae @@skip2 2017 000014F6 C606[EC15]01 <1> mov byte [@@focus],1 2018 000014FB FE06[4978] <1> inc byte [focus] 2019 000014FF E820F5 <1> call update_commands 2020 <1> @@skip2: 2021 00001502 FF36[807E] <1> push word [read_exit_keys] 2022 00001506 C706[807E][E274] <1> mov word [read_exit_keys],asm_exit_keys 2023 0000150C 0E <1> push cs 2024 0000150D 07 <1> pop es 2025 <1> @@next_line: 2026 0000150E 8B36[768B] <1> mov si,[cur_line_ip] 2027 00001512 E8B019 <1> call unassemble 2028 00001515 BF[F88D] <1> mov di,buffer+CMD_POS+MAX_ASM_SIZE-2 2029 00001518 B93900 <1> mov cx,MAX_ASM_SIZE-2 2030 0000151B FD <1> std 2031 0000151C B020 <1> mov al,' ' 2032 0000151E F3AE <1> repe scasb 2033 00001520 FC <1> cld 2034 00001521 AF <1> scasw 2035 00001522 B000 <1> mov al,0 2036 00001524 AA <1> stosb 2037 00001525 83C103 <1> add cx,3 2038 00001528 BE[BF8D] <1> mov si,buffer+CMD_POS 2039 0000152B BF[3A90] <1> mov di,asm_line 2040 0000152E F3A4 <1> rep movsb 2041 <1> ; mov AsmLine+MaxAsmSize-1,al 2042 <1> @@again: 2043 00001530 BF[3A90] <1> mov di,asm_line 2044 00001533 8A26[748B] <1> mov ah,[cur_line] 2045 <1> ; add ah,CPUy 2046 00001537 B012 <1> mov al,CMD_POS-3 2047 00001539 B91F3B <1> mov cx,MAX_ASM_SIZE*256+ASM_LINE_SIZE-1 2048 0000153C BB7F7F <1> mov bx,atsAssembler*256+atAssembler 2049 0000153F 803E[8D8B]01 <1> cmp byte [cur_line_brk],1 2050 00001544 7503 <1> jne @@read_line 2051 00001546 BB5B5B <1> mov bx,atsBrkAssembler*256+atBrkAssembler 2052 <1> @@read_line: 2053 00001549 E8F607 <1> call read_line 2054 0000154C 3D1B01 <1> cmp ax,kbEsc 2055 0000154F 7503E98000 <1> je @@quit 2056 00001554 3D0044 <1> cmp ax,kbF10 2057 00001557 747B <1> je @@quit 2058 00001559 3D0050 <1> cmp ax,kbDown 2059 0000155C 7505 <1> jne @@1 2060 0000155E E8EDEB <1> call cur_down 2061 00001561 EBAB <1> jmp @@next_line 2062 00001563 3D0048 <1> @@1: cmp ax,kbUp 2063 00001566 7505 <1> jne @@2 2064 00001568 E8FEEB <1> call cur_up 2065 0000156B EBA1 <1> jmp @@next_line 2066 0000156D 3D0051 <1> @@2: cmp ax,kbPgDn 2067 00001570 7505 <1> jne @@3 2068 00001572 E840EC <1> call page_down 2069 00001575 EB97 <1> jmp @@next_line 2070 00001577 3D0049 <1> @@3: cmp ax,kbPgUp 2071 0000157A 7505 <1> jne @@4 2072 0000157C E849EC <1> call page_up 2073 0000157F EB8D <1> jmp @@next_line 2074 <1> @@4: 2075 00001581 BE[3A90] <1> mov si,asm_line 2076 00001584 8B3E[768B] <1> mov di,[cur_line_ip] 2077 00001588 06 <1> push es 2078 00001589 8E06[9B8B] <1> mov es,[unasm_seg] 2079 0000158D 268A05 <1> mov al,[es:di] 2080 00001590 26FE05 <1> inc byte [es:di] 2081 00001593 FEC0 <1> inc al 2082 00001595 263A05 <1> cmp al,[es:di] 2083 00001598 7533 <1> jne @@rom_error 2084 0000159A 26FE0D <1> dec byte [es:di] 2085 0000159D 89FB <1> mov bx,di 2086 0000159F E8B92C <1> call assemble 2087 000015A2 07 <1> pop es 2088 000015A3 731F <1> jnc @@ok 2089 000015A5 83F801 <1> cmp ax,ER_EMPTY 2090 000015A8 741D <1> je @@ok_1 2091 000015AA 48 <1> dec ax 2092 000015AB 48 <1> dec ax 2093 000015AC 83F807 <1> cmp ax,9-2 2094 000015AF 770A <1> ja @@unk_err 2095 000015B1 89C3 <1> mov bx,ax 2096 000015B3 D1E3 <1> shl bx,1 2097 000015B5 8BB7[F274] <1> mov si,[asm_errors+bx] 2098 000015B9 EB03 <1> jmp @@err_msg 2099 <1> @@unk_err: 2100 000015BB BE[FD76] <1> mov si,asm_error_msg 2101 <1> @@err_msg: 2102 000015BE E8A301 <1> call _error_message 2103 000015C1 E96CFF <1> jmp @@again 2104 <1> @@ok: 2105 000015C4 E871F7 <1> call update_dump 2106 <1> @@ok_1: 2107 000015C7 E884EB <1> call cur_down 2108 000015CA E941FF <1> jmp @@next_line 2109 <1> @@rom_error: 2110 000015CD 07 <1> pop es 2111 000015CE BA[ED76] <1> mov dx,code_not_in_ram 2112 000015D1 E89001 <1> call _error_message 2113 <1> @@quit: 2114 000015D4 803E[EC15]01 <1> cmp byte [@@focus],1 2115 000015D9 7509 <1> jne @@quittt 2116 000015DB C606[EC15]00 <1> mov byte [@@focus],0 2117 000015E0 FE0E[4978] <1> dec byte [focus] 2118 <1> @@quittt: 2119 000015E4 E83BF4 <1> call update_commands 2120 000015E7 8F06[807E] <1> pop word [read_exit_keys] 2121 000015EB C3 <1> ret 2122 <1> 2123 000015EC 00 <1> @@focus db 0 2124 <1> 2125 <1> 2126 <1> ;============================================================================= 2127 <1> %include "bp.inc" 1 <2> ;============================================================================= 2 <2> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <2> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <2> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <2> ;----------------------------------------------------------------------------- 6 <2> ; bp.inc 7 <2> ; Breakpoints: set, clear, check, etc. 8 <2> ;----------------------------------------------------------------------------- 9 <2> ; This program is free software; you can redistribute it and/or 10 <2> ; modify it under the terms of the GNU General Public License 11 <2> ; as published by the Free Software Foundation; either version 2 12 <2> ; of the License, or (at your option) any later version. 13 <2> ; 14 <2> ; This program is distributed in the hope that it will be useful, 15 <2> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <2> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <2> ; GNU General Public License for more details. 18 <2> ; 19 <2> ; You should have received a copy of the GNU General Public License 20 <2> ; along with this program; if not, write to the Free Software 21 <2> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <2> ; 02110-1301 USA 23 <2> ;============================================================================= 24 <2> 25 <2> 26 <2> ;============================================================================= 27 <2> ; Changelog 28 <2> ;----------------------------------------------------------------------------- 29 <2> ; 2008-03-26 0leg Added comments to all procedures, some procedures 30 <2> ; optimized. 31 <2> ; 2008-04-20 0leg toggle_breakpoint -> toggle_break, 32 <2> ; test_breakpoint -> test_break, 33 <2> ; check_bp -> check_break. 34 <2> ;============================================================================= 35 <2> 36 <2> 37 <2> ;============================================================================= 38 <2> ; toggle_break 39 <2> ;----------------------------------------------------------------------------- 40 <2> ; Sets/clears a breakpoint under cursor. 41 <2> ; In: --- 42 <2> ; Out: --- 43 <2> ; Modf: AX, BX, CX, SI 44 <2> ; Call: check_break, test_break, _error_message, update_commands 45 <2> ; Use: cur_line_ip, bp1, unasm_seg, bp_not_in_ram, many_bp_msg 46 <2> ; 47 <2> toggle_break: 48 000015ED 8B36[768B] <2> mov si,[cur_line_ip] 49 000015F1 E89000 <2> call check_break ;Is bp exist? 50 000015F4 7206 <2> jc @@set ;No, set bp 51 000015F6 C6470600 <2> mov byte [bx+BP_ACTIVE],BP_UNUSED ;Clear bp... 52 000015FA EB34 <2> jmp @@ok ;and exit 53 <2> @@set: 54 000015FC BB[0F8B] <2> mov bx,bp1 55 000015FF B90A00 <2> mov cx,MAX_BREAKPOINTS 56 <2> @@next_bp: 57 00001602 807F0600 <2> cmp byte [bx+BP_ACTIVE],BP_UNUSED 58 00001606 751D <2> jne @@skip 59 00001608 A1[9B8B] <2> mov ax,[unasm_seg] 60 0000160B 8907 <2> mov [bx+BP_SEG],ax ;Set segment 61 0000160D A1[768B] <2> mov ax,[cur_line_ip] 62 00001610 894702 <2> mov [bx+BP_OFFS],ax ;Set offset 63 00001613 C6470500 <2> mov byte [bx+BP_SET],0 ;Bp is not set 64 00001617 E84F00 <2> call test_break 65 0000161A BE[D776] <2> mov si,bp_not_in_ram 66 0000161D 720E <2> jc @@err_msg ;Can't set bp... 67 0000161F C6470601 <2> mov byte [bx+BP_ACTIVE],BP_ENABLED ;Enable bp 68 00001623 EB0B <2> jmp @@ok 69 <2> @@skip: 70 00001625 83C307 <2> add bx,SIZEOF_BREAKPOINT 71 00001628 E2D8 <2> loop @@next_bp 72 <2> 73 0000162A BE[C276] <2> mov si,many_bp_msg 74 <2> @@err_msg: 75 0000162D E83401 <2> call _error_message 76 <2> @@ok: 77 00001630 E9EFF3 <2> jmp update_commands 78 <2> ;============================================================================= 79 <2> ; toggle_activity 80 <2> ;----------------------------------------------------------------------------- 81 <2> ; Enables or disables a breakpoint under cursor. 82 <2> ; In: --- 83 <2> ; Out: --- 84 <2> ; Modf: ~BX, SI 85 <2> ; Call: check_break, beep, update_commands 86 <2> ; Use: cur_line_bp 87 <2> ; 88 <2> toggle_activity: 89 00001633 8B36[768B] <2> mov si,[cur_line_ip] 90 00001637 E84A00 <2> call check_break 91 0000163A 7303 <2> jnc @@toggle 92 0000163C E93504 <2> jmp beep 93 <2> @@toggle: 94 0000163F 80770603 <2> xor byte [bx+BP_ACTIVE],BP_ENABLED ^ BP_DISABLED 95 00001643 E9DCF3 <2> jmp update_commands 96 <2> ;============================================================================= 97 <2> ; set_all_breaks 98 <2> ;----------------------------------------------------------------------------- 99 <2> ; Assigns specified value to BP_ACTIVE field of all used breakpoints. 100 <2> ; In: AL -- value (BP_UNUSED, BP_ENABLED, BP_DISABLED) 101 <2> ; Out: --- 102 <2> ; Modf: BX, CX 103 <2> ; Call: update_commands 104 <2> ; Use: bp1 105 <2> ; 106 <2> set_all_breaks: 107 00001646 BB[0F8B] <2> mov bx,bp1 108 00001649 B90A00 <2> mov cx,MAX_BREAKPOINTS 109 <2> 110 <2> @@next_bp: 111 0000164C 807F0600 <2> cmp byte [bx+BP_ACTIVE],BP_UNUSED 112 00001650 7403 <2> je @@skip 113 00001652 884706 <2> mov byte [bx+BP_ACTIVE],al 114 <2> @@skip: 115 00001655 83C307 <2> add bx,SIZEOF_BREAKPOINT 116 00001658 E2F2 <2> loop @@next_bp 117 <2> 118 0000165A E9C5F3 <2> jmp update_commands 119 <2> ;============================================================================= 120 <2> ; clear_all_breaks 121 <2> ;----------------------------------------------------------------------------- 122 <2> ; Clears all breakpoints. 123 <2> ; In: --- 124 <2> ; Out: --- 125 <2> ; Modf: AX 126 <2> ; Call: set_all_breaks 127 <2> ; Use: --- 128 <2> ; 129 <2> clear_all_breaks: 130 0000165D B000 <2> mov al,BP_UNUSED 131 0000165F EBE5 <2> jmp set_all_breaks 132 <2> ;============================================================================= 133 <2> ; enable_all_breaks 134 <2> ;----------------------------------------------------------------------------- 135 <2> ; Enables all breakpoints. 136 <2> ; In: --- 137 <2> ; Out: --- 138 <2> ; Modf: AX 139 <2> ; Call: set_all_breaks 140 <2> ; Use: --- 141 <2> ; 142 <2> enable_all_breaks: 143 00001661 B001 <2> mov al,BP_ENABLED 144 00001663 EBE1 <2> jmp set_all_breaks 145 <2> ;============================================================================= 146 <2> ; disable_all_breaks 147 <2> ;----------------------------------------------------------------------------- 148 <2> ; Disables all breakpoints. 149 <2> ; In: --- 150 <2> ; Out: --- 151 <2> ; Modf: AX 152 <2> ; Call: set_all_breaks 153 <2> ; Use: --- 154 <2> ; 155 <2> disable_all_breaks: 156 00001665 B002 <2> mov al,BP_DISABLED 157 00001667 EBDD <2> jmp set_all_breaks 158 <2> ;============================================================================= 159 <2> ; test_break 160 <2> ;----------------------------------------------------------------------------- 161 <2> ; Checks if a breakpoint can be set. 162 <2> ; In: DS:BX -> breakpoint structure 163 <2> ; Out: CF -- status: 164 <2> ; CF == 0 -- BP can be set 165 <2> ; CF == 1 -- BP can't be set 166 <2> ; Modf: --- 167 <2> ; Call: --- 168 <2> ; Use: --- 169 <2> ; 170 <2> test_break: 171 00001669 50 <2> push ax 172 0000166A 56 <2> push si 173 0000166B 1E <2> push ds 174 0000166C FA <2> cli 175 0000166D 8B7702 <2> mov si,[bx+BP_OFFS] 176 00001670 8E1F <2> mov ds,[bx+BP_SEG] 177 00001672 8A04 <2> mov al,[si] 178 00001674 C604CC <2> mov byte [si],0cch 179 00001677 803CCC <2> cmp byte [si],0cch 180 0000167A 7401 <2> je @@ok 181 0000167C F9 <2> stc 182 <2> @@ok: 183 0000167D 8804 <2> mov [si],al 184 0000167F FB <2> sti 185 00001680 1F <2> pop ds 186 00001681 5E <2> pop si 187 00001682 58 <2> pop ax 188 00001683 C3 <2> ret 189 <2> ;============================================================================= 190 <2> ; check_break 191 <2> ;----------------------------------------------------------------------------- 192 <2> ; Checks if a breakpoint at specified offset is set and enabled. 193 <2> ; In: SI -- offset 194 <2> ; Out: CF, ZF -- status of a breakpoint: 195 <2> ; CF == 1 -- breakpoint not exist 196 <2> ; CF == 0, ZF == 1 -- breakpoint exist and enabled 197 <2> ; CF == 0, ZF == 0 -- breakpoint exist and disabled 198 <2> ; DS:BX -> breakpoint structure 199 <2> ; Modf: !BX 200 <2> ; Call: --- 201 <2> ; Use: bp1, unasm_seg 202 <2> ; 203 <2> check_break: 204 00001684 50 <2> push ax 205 00001685 51 <2> push cx 206 00001686 BB[0F8B] <2> mov bx,bp1 ;Array of breakpoint structures 207 00001689 B90A00 <2> mov cx,MAX_BREAKPOINTS 208 <2> @@next_bp: 209 0000168C 807F0600 <2> cmp byte [bx+BP_ACTIVE],BP_UNUSED 210 00001690 7412 <2> je @@skip ;Unused... 211 00001692 3B7702 <2> cmp si,[bx+BP_OFFS] 212 00001695 750D <2> jne @@skip ;Offset doesn't match... 213 00001697 A1[9B8B] <2> mov ax,[unasm_seg] 214 0000169A 3B07 <2> cmp ax,[bx+BP_SEG] 215 0000169C 7506 <2> jne @@skip ;Segment doesn't match... 216 0000169E 807F0601 <2> cmp byte [bx+BP_ACTIVE],BP_ENABLED 217 000016A2 EB06 <2> jmp @@exit ;All Ok, flags are set, exit 218 <2> @@skip: 219 000016A4 83C307 <2> add bx,SIZEOF_BREAKPOINT 220 000016A7 E2E3 <2> loop @@next_bp 221 000016A9 F9 <2> stc ;Breakpoint not found 222 <2> @@exit: 223 000016AA 59 <2> pop cx 224 000016AB 58 <2> pop ax 225 000016AC C3 <2> ret 226 <2> ;============================================================================= 227 <2> 2128 <1> ;============================================================================= 2129 <1> 2130 <1> 2131 <1> ;============================================================================= 2132 <1> ; execute_menu 2133 <1> ;----------------------------------------------------------------------------- 2134 <1> execute_menu: 2135 000016AD E855F8 <1> call hide_focus 2136 000016B0 BE[9269] <1> mov si,menu_structure 2137 000016B3 E8EE04 <1> call exec_menu 2138 000016B6 E845F8 <1> call display_focus 2139 000016B9 E8D143 <1> call check_shared_area 2140 000016BC A0[C42E] <1> mov al,[cpu_type] 2141 000016BF 2C70 <1> sub al,a86 2142 000016C1 A2[406C] <1> mov [opt_cpu],al 2143 000016C4 803E[858B]01 <1> cmp byte [quit_flag],1 2144 000016C9 7503 <1> jne @@1 2145 000016CB E98000 <1> jmp quit_act 2146 <1> @@1: 2147 000016CE C3 <1> ret 2148 <1> ;============================================================================= 2149 <1> ; quit_proc 2150 <1> ;----------------------------------------------------------------------------- 2151 <1> quit_proc: 2152 000016CF C606[858B]01 <1> mov byte [quit_flag],1 2153 000016D4 C3 <1> ret 2154 <1> ;============================================================================= 2155 <1> ; set_cpu_88 2156 <1> ;----------------------------------------------------------------------------- 2157 <1> set_cpu_88: 2158 <1> ; mov OptCPU,0 2159 000016D5 C606[C42E]70 <1> mov byte [cpu_type],a86 2160 000016DA E945F3 <1> jmp update_commands 2161 <1> ;============================================================================= 2162 <1> ; set_cpu_286 2163 <1> ;----------------------------------------------------------------------------- 2164 <1> set_cpu_286: 2165 <1> ; mov OptCPU,1 2166 000016DD C606[C42E]71 <1> mov byte [cpu_type],a286 2167 000016E2 E93DF3 <1> jmp update_commands 2168 <1> ;============================================================================= 2169 <1> ; set_cpu_386 2170 <1> ;----------------------------------------------------------------------------- 2171 <1> set_cpu_386: 2172 <1> ; mov OptCPU,2 2173 000016E5 C606[C42E]72 <1> mov byte [cpu_type],a386 2174 000016EA E935F3 <1> jmp update_commands 2175 <1> ;============================================================================= 2176 <1> ; set_cpu_486 2177 <1> ;----------------------------------------------------------------------------- 2178 <1> set_cpu_486: 2179 <1> ; mov OptCPU,3 2180 000016ED C606[C42E]73 <1> mov byte [cpu_type],a486 2181 000016F2 E92DF3 <1> jmp update_commands 2182 <1> ;============================================================================= 2183 <1> ; set_cpu_auto 2184 <1> ;----------------------------------------------------------------------------- 2185 <1> set_cpu_auto: 2186 000016F5 A0[6E8B] <1> mov al,[system_cpu] 2187 000016F8 2C01 <1> sub al,1 2188 000016FA 1400 <1> adc al,0 2189 000016FC A2[406C] <1> mov [opt_cpu],al 2190 000016FF 0470 <1> add al,a86 2191 00001701 A2[C42E] <1> mov [cpu_type],al 2192 00001704 E91BF3 <1> jmp update_commands 2193 <1> ;============================================================================= 2194 <1> ; set_swap_off 2195 <1> ;----------------------------------------------------------------------------- 2196 <1> set_swap_off: 2197 00001707 C606[946C]00 <1> mov byte [swap_mode],0 2198 0000170C C3 <1> ret 2199 <1> ;============================================================================= 2200 <1> ; set_swap_smart 2201 <1> ;----------------------------------------------------------------------------- 2202 <1> set_swap_smart: 2203 0000170D C606[946C]01 <1> mov byte [swap_mode],1 2204 00001712 C3 <1> ret 2205 <1> ;============================================================================= 2206 <1> ; set_swap_on 2207 <1> ;----------------------------------------------------------------------------- 2208 <1> set_swap_on: 2209 00001713 C606[946C]02 <1> mov byte [swap_mode],2 2210 00001718 C3 <1> ret 2211 <1> ;============================================================================= 2212 <1> ; cpu_local_menu 2213 <1> ;----------------------------------------------------------------------------- 2214 <1> cpu_local_menu: 2215 00001719 BE[146D] <1> mov si,cpu_local_struc 2216 0000171C E85100 <1> call _local_menu 2217 0000171F 7202 <1> jc @@exit 2218 00001721 FFE0 <1> jmp ax 2219 <1> @@exit: 2220 00001723 C3 <1> ret 2221 <1> ;============================================================================= 2222 <1> ; continue_init 2223 <1> ;----------------------------------------------------------------------------- 2224 <1> continue_init: 2225 00001724 803E[4878]01 <1> cmp byte [loaded],1 2226 00001729 7406 <1> je @@check_resident 2227 0000172B BE[6B76] <1> mov si,load_error_msg 2228 0000172E E83300 <1> call _error_message 2229 <1> 2230 <1> @@check_resident: 2231 00001731 F606[8B8B]02 <1> test byte [cmd_line_options],CMD_RESIDENT 2232 00001736 7403 <1> jz start_key_loop 2233 00001738 E85449 <1> call _resident 2234 <1> 2235 <1> start_key_loop: 2236 <1> 2237 0000173B E84300 <1> call draw_screen 2238 <1> main_key_loop: 2239 0000173E C706[128D][0C72] <1> mov word [keys],main_loop 2240 00001744 E87E03 <1> call key_loop 2241 00001747 803E[868B]00 <1> cmp byte [resident_mode],0 2242 0000174C 75F0 <1> jne main_key_loop 2243 <1> 2244 <1> ;----- Exit from ACT ---------------------------------------------------------- 2245 <1> quit_act: 2246 0000174E E8FDEF <1> call unload_program 2247 00001751 E8C7EF <1> call set_my_pid 2248 00001754 E8E6EC <1> call restore_int_table 2249 00001757 E8DA14 <1> call restore_screen 2250 <1> 2251 0000175A A0[828B] <1> mov al,[my_port_21] 2252 0000175D E621 <1> out 21h,al 2253 0000175F B8004C <1> mov ax,4c00h 2254 00001762 CD21 <1> int 21h 2255 <1> ;============================================================================= 2256 <1> ; _error_message 2257 <1> ;----------------------------------------------------------------------------- 2258 <1> _error_message: 2259 00001764 E83E09 <1> call error_message 2260 00001767 E92343 <1> jmp check_shared_area 2261 <1> ;============================================================================= 2262 <1> ; _msg_box 2263 <1> ;----------------------------------------------------------------------------- 2264 <1> _msg_box: 2265 0000176A E84A09 <1> call message_box 2266 0000176D E91D43 <1> jmp check_shared_area 2267 <1> ;============================================================================= 2268 <1> ; _local_menu 2269 <1> ;----------------------------------------------------------------------------- 2270 <1> _local_menu: 2271 00001770 E8A805 <1> call local_menu 2272 00001773 9C <1> pushf 2273 00001774 E81643 <1> call check_shared_area 2274 00001777 9D <1> popf 2275 00001778 C3 <1> ret 2276 <1> 2277 <1> toggle_ascii: 2278 00001779 8036[8B8B]40 <1> xor byte [cmd_line_options], CMD_ASCII 2279 0000177E E81800 <1> call initialise_draw_table 2280 <1> 2281 <1> ;============================================================================= 2282 <1> ; draw_screen 2283 <1> ;----------------------------------------------------------------------------- 2284 <1> draw_screen: 2285 00001781 C706[887E][148C] <1> mov word [dialog_accelerators_behind_last], dialog_accelerators 2286 <1> ; Magic: If we draw the screen then we have finished 2287 <1> ; processing any open dialog. Eg for search, pressing 2288 <1> ; the Search button with an invalid search string 2289 <1> ; results in re-executing the Search dialog, but 2290 <1> ; without re-initialising it. Therefore this reset 2291 <1> ; does not belong at the end of exec_dialog. 2292 00001787 E867F0 <1> call draw_cpu_window 2293 <1> update_screen: 2294 0000178A E8B6F6 <1> call update_stack 2295 0000178D E8AAF1 <1> call update_watch_label 2296 <1> update_regs_and_cmds: 2297 00001790 E89AF5 <1> call _update_dump 2298 00001793 E8EDF1 <1> call update_registers 2299 00001796 E989F2 <1> jmp update_commands 2300 <1> 2301 <1> initialise_draw_table: 2302 00001799 E80202 <1> call pushr 2303 0000179C 1E <1> push ds 2304 0000179D 07 <1> pop es 2305 0000179E BE[E87E] <1> mov si, drawing_list_table 2306 000017A1 F606[8B8B]40 <1> test byte [cmd_line_options], CMD_ASCII 2307 000017A6 7403 <1> jz @F 2308 000017A8 BE[107F] <1> mov si, ascii_list_table 2309 <1> @@: 2310 000017AB B92800 <1> mov cx, drawing_list_table.size 2311 000017AE BF[D88B] <1> mov di, draw_table 2312 000017B1 F3A4 <1> rep movsb 2313 <1> 2314 <1> drawchoice '', '>' 2315 000017B3 A0[E68B] <1> mov al, byte [DRAWADDRESS] 2316 000017B6 BE[387F] <1> mov si, arrow_offset_list_table 2317 000017B9 B90700 <1> mov cx, arrow_offset_list_table.amount 2318 <1> @@: 2319 000017BC 97 <1> xchg ax, di 2320 000017BD AD <1> lodsw 2321 000017BE 97 <1> xchg ax, di 2322 000017BF AA <1> stosb 2323 000017C0 E2FA <1> loop @B 2324 000017C2 E8EC01 <1> call popr 2325 000017C5 C3 <1> retn 2326 <1> 2327 <1> ;============================================================================= 2328 <1> ; E0F 2329 <1> ;============================================================================= 2330 <1> 53 %include "block.inc" ;Read/write/copy/fill blocks 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; block.inc 7 <1> ; Procedures for copying, filling, reading and writing memory blocks. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> 27 <1> ;============================================================================= 28 <1> ; copy_mem_block 29 <1> ;----------------------------------------------------------------------------- 30 <1> copy_mem_block: 31 000017C6 BE[5E63] <1> mov si,copy_data_dialog 32 000017C9 E81F0B <1> call init_dialog 33 <1> 34 <1> @@again_: 35 000017CC C606[6563]00 <1> mov byte [copy_dlg_item],0 36 <1> @@again: 37 000017D1 E8780B <1> call exec_dialog_ 38 000017D4 7456 <1> jz @@exit 39 <1> 40 000017D6 BE[A890] <1> mov si,from_string 41 000017D9 E823EB <1> call get_address_ds 42 000017DC 72EE <1> jc @@again_ 43 <1> 44 000017DE E84845 <1> call adjust_address 45 <1> 46 000017E1 A3[CC8B] <1> mov [from_addr],ax 47 000017E4 8916[CE8B] <1> mov [from_addr+2],dx 48 <1> 49 000017E8 BE[C190] <1> mov si,to_string 50 000017EB E811EB <1> call get_address_ds 51 000017EE C606[6563]01 <1> mov byte [copy_dlg_item],1 52 000017F3 72DC <1> jc @@again 53 <1> 54 000017F5 E83145 <1> call adjust_address 55 <1> 56 000017F8 A3[D08B] <1> mov [to_addr],ax 57 000017FB 8916[D28B] <1> mov [to_addr+2],dx 58 <1> 59 000017FF E8F1EB <1> call get_counter 60 00001802 C606[6563]02 <1> mov byte [copy_dlg_item],2 61 00001807 72C8 <1> jc @@again 62 <1> 63 00001809 91 <1> xchg ax,cx 64 0000180A FC <1> cld 65 0000180B C43E[D08B] <1> les di,[to_addr] 66 0000180F C536[CC8B] <1> lds si,[from_addr] 67 00001813 8CD8 <1> mov ax,ds 68 00001815 8CC3 <1> mov bx,es 69 00001817 39D8 <1> cmp ax,bx 70 00001819 770D <1> ja @@copy 71 0000181B 7204 <1> jb @@change_dir 72 0000181D 39FE <1> cmp si,di 73 0000181F 7707 <1> ja @@copy 74 <1> @@change_dir: 75 00001821 01CE <1> add si,cx 76 00001823 01CF <1> add di,cx 77 00001825 4E <1> dec si 78 00001826 4F <1> dec di 79 00001827 FD <1> std 80 <1> @@copy: 81 00001828 F3A4 <1> rep movsb 82 0000182A 0E <1> push cs 83 0000182B 1F <1> pop ds 84 <1> 85 <1> @@exit: 86 0000182C E852FF <1> call draw_screen 87 0000182F F9 <1> stc 88 00001830 C3 <1> ret 89 <1> ;============================================================================= 90 <1> ; fill_mem_block 91 <1> ;----------------------------------------------------------------------------- 92 <1> fill_mem_block: 93 00001831 BE[9863] <1> mov si,fill_data_dialog 94 00001834 E8B40A <1> call init_dialog 95 <1> 96 <1> @@again_: 97 00001837 C606[9F63]00 <1> mov byte [fill_dlg_item],0 98 <1> @@again: 99 0000183C E80D0B <1> call exec_dialog_ 100 0000183F 7445 <1> jz @@exit 101 <1> 102 00001841 BE[C190] <1> mov si,to_string 103 00001844 E8B8EA <1> call get_address_ds 104 00001847 72EE <1> jc @@again_ 105 <1> 106 00001849 E8DD44 <1> call adjust_address 107 <1> 108 0000184C A3[D08B] <1> mov [to_addr],ax 109 0000184F 8916[D28B] <1> mov [to_addr+2],dx 110 <1> 111 00001853 E89DEB <1> call get_counter 112 00001856 C606[9F63]01 <1> mov byte [fill_dlg_item],1 113 0000185B 72DF <1> jc @@again 114 <1> 115 0000185D A3[D48B] <1> mov [count_value],ax 116 <1> 117 00001860 BE[0C91] <1> mov si,fill_string 118 00001863 BF[3F91] <1> mov di,fill_bin 119 00001866 E87C47 <1> call create_bin 120 00001869 7220 <1> jc @@error 121 0000186B 81EF[3F91] <1> sub di,fill_bin 122 0000186F 7415 <1> jz @@exit 123 <1> 124 00001871 97 <1> xchg ax,di 125 00001872 8B0E[D48B] <1> mov cx,[count_value] 126 00001876 C43E[D08B] <1> les di,[to_addr] 127 0000187A FC <1> cld 128 <1> 129 <1> @@next: 130 0000187B 51 <1> push cx 131 0000187C 89C1 <1> mov cx,ax 132 0000187E BE[3F91] <1> mov si,fill_bin 133 00001881 F3A4 <1> rep movsb 134 00001883 59 <1> pop cx 135 00001884 E2F5 <1> loop @@next 136 <1> 137 <1> @@exit: 138 00001886 E8F8FE <1> call draw_screen 139 00001889 F9 <1> stc 140 0000188A C3 <1> ret 141 <1> 142 <1> @@error: 143 0000188B BE[4077] <1> mov si,string_error_msg 144 0000188E E8D3FE <1> call _error_message 145 00001891 C606[9F63]02 <1> mov byte [fill_dlg_item],2 146 00001896 EBA4 <1> jmp @@again 147 <1> ;============================================================================= 148 <1> ; write_mem_block 149 <1> ;----------------------------------------------------------------------------- 150 <1> write_mem_block: 151 00001898 C706[D663][4369] <1> mov word [block_dlg_title],write_title 152 0000189E C706[E863][2167] <1> mov word [block_dlg_label],from_label 153 <1> 154 000018A4 BE[D263] <1> mov si,read_data_dialog 155 000018A7 E8410A <1> call init_dialog 156 <1> 157 <1> @@again_: 158 000018AA C606[D963]00 <1> mov byte [block_dlg_item],0 159 <1> @@again: 160 000018AF E89A0A <1> call exec_dialog_ 161 000018B2 7478 <1> jz rwb_exit 162 <1> 163 000018B4 BE[A890] <1> mov si,from_string 164 000018B7 C606[D963]01 <1> mov byte [block_dlg_item],1 165 000018BC E840EA <1> call get_address_ds 166 000018BF 72EE <1> jc @@again 167 <1> 168 000018C1 A3[CC8B] <1> mov [from_addr],ax 169 000018C4 8916[CE8B] <1> mov [from_addr+2],dx 170 <1> 171 000018C8 FE06[D963] <1> inc byte [block_dlg_item] 172 000018CC E824EB <1> call get_counter 173 000018CF 72DE <1> jc @@again 174 <1> 175 000018D1 E8ADFE <1> call draw_screen 176 <1> 177 000018D4 E81748 <1> call set_24_vector 178 <1> 179 000018D7 BA[038F] <1> mov dx,filename_string 180 000018DA B8023D <1> mov ax,3d02h 181 000018DD CD21 <1> int 21h 182 000018DF 721D <1> jc @@create 183 <1> 184 000018E1 93 <1> xchg ax,bx 185 000018E2 BE[0C64] <1> mov si,question_dialog 186 000018E5 E8030A <1> call init_dialog 187 000018E8 E85A0A <1> call exec_dialog 188 000018EB E893FE <1> call draw_screen 189 000018EE 3C01 <1> cmp al,CM_OK 190 000018F0 7233 <1> jb rwb_close 191 000018F2 7513 <1> jne @@write 192 000018F4 99 <1> cwd 193 000018F5 B80242 <1> mov ax,4202h 194 000018F8 31C9 <1> xor cx,cx 195 000018FA CD21 <1> int 21h 196 000018FC EB09 <1> jmp @@write 197 <1> 198 <1> @@create: 199 000018FE B43C <1> mov ah,3ch 200 00001900 31C9 <1> xor cx,cx 201 00001902 CD21 <1> int 21h 202 00001904 93 <1> xchg ax,bx 203 00001905 722A <1> jc ..@create_error 204 <1> 205 <1> @@write: 206 00001907 8B0E[D48B] <1> mov cx,[count_value] 207 0000190B 1E <1> push ds 208 0000190C C516[CC8B] <1> lds dx,[from_addr] 209 00001910 B440 <1> mov ah,40h 210 00001912 CD21 <1> int 21h 211 00001914 1F <1> pop ds 212 00001915 720B <1> jc rwb_error 213 00001917 31C9 <1> xor cx,cx 214 00001919 B440 <1> mov ah,40h 215 0000191B CD21 <1> int 21h 216 0000191D BE[0276] <1> mov si,write_error_msg 217 <1> read_write_block_exit: 218 00001920 7303 <1> jnc rwb_close 219 <1> 220 <1> rwb_error: 221 00001922 E83FFE <1> call _error_message 222 <1> 223 <1> rwb_close: 224 00001925 B43E <1> mov ah,3eh 225 00001927 CD21 <1> int 21h 226 <1> 227 <1> rwb_restore: 228 00001929 E8CD47 <1> call restore_24_vector 229 <1> 230 <1> rwb_exit: 231 0000192C E852FE <1> call draw_screen 232 0000192F F9 <1> stc 233 00001930 C3 <1> ret 234 <1> 235 <1> ..@create_error: 236 00001931 BE[4776] <1> mov si,create_error_msg 237 00001934 E82DFE <1> call _error_message 238 00001937 EBF0 <1> jmp rwb_restore 239 <1> ;============================================================================= 240 <1> ; read_mem_block 241 <1> ;----------------------------------------------------------------------------- 242 <1> read_mem_block: 243 00001939 C706[D663][3569] <1> mov word [block_dlg_title],read_title 244 0000193F C706[E863][2867] <1> mov word [block_dlg_label],to_label 245 <1> 246 00001945 BE[D263] <1> mov si,read_data_dialog 247 00001948 E8A009 <1> call init_dialog 248 <1> 249 <1> @@again_: 250 0000194B C606[D963]00 <1> mov byte [block_dlg_item],0 251 <1> @@again: 252 00001950 E8F909 <1> call exec_dialog_ 253 00001953 74D7 <1> jz rwb_exit 254 <1> 255 00001955 BE[A890] <1> mov si,from_string 256 00001958 E8A4E9 <1> call get_address_ds 257 0000195B C606[D963]01 <1> mov byte [block_dlg_item],1 258 00001960 72EE <1> jc @@again 259 <1> 260 00001962 A3[CC8B] <1> mov [from_addr],ax 261 00001965 8916[CE8B] <1> mov [from_addr+2],dx 262 <1> 263 00001969 E887EA <1> call get_counter 264 0000196C C606[D963]02 <1> mov byte [block_dlg_item],2 265 00001971 72DD <1> jc @@again 266 <1> 267 00001973 E80BFE <1> call draw_screen 268 <1> 269 00001976 E87547 <1> call set_24_vector 270 <1> 271 00001979 BA[038F] <1> mov dx,filename_string 272 0000197C B8003D <1> mov ax,3d00h 273 0000197F CD21 <1> int 21h 274 00001981 BE[3776] <1> mov si,open_error_msg 275 00001984 729C <1> jc rwb_error 276 <1> 277 00001986 93 <1> xchg ax,bx 278 00001987 8B0E[D48B] <1> mov cx,[count_value] 279 <1> 280 0000198B 1E <1> push ds 281 0000198C C516[CC8B] <1> lds dx,[from_addr] 282 00001990 B43F <1> mov ah,3fh 283 00001992 CD21 <1> int 21h 284 00001994 1F <1> pop ds 285 00001995 BE[1C76] <1> mov si,read_error_msg 286 00001998 7288 <1> jc rwb_error 287 0000199A 39C8 <1> cmp ax,cx 288 0000199C EB82 <1> jmp read_write_block_exit 289 <1> ;============================================================================= 290 <1> ; E0F 291 <1> ;============================================================================= 292 <1> 54 55 %include "system.inc" ;Misc. procedures 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; system.inc 7 <1> ; Misc. system procedures. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; Changelog 28 <1> ;----------------------------------------------------------------------------- 29 <1> ; 2007-02-17 0leg Added comments to all procedures. All variables moved 30 <1> ; to act[u]data.inc. 31 <1> ; 2007-12-02 0leg ascii_to_bin added. 32 <1> ;============================================================================= 33 <1> 34 <1> 35 <1> ;============================================================================= 36 <1> ; pushr 37 <1> ;----------------------------------------------------------------------------- 38 <1> ; Saves all registers. 39 <1> ; In: AX, BX, CX, DX, SI, DI, BP, DS, ES -- registers to save 40 <1> ; Out: --- 41 <1> ; Modf: --- 42 <1> ; Call: --- 43 <1> ; Use: keep_ip 44 <1> ; 45 <1> pushr: 46 0000199E 2E8F06[EC8C] <1> pop word [cs:keep_ip] 47 000019A3 50 <1> push ax 48 000019A4 53 <1> push bx 49 000019A5 51 <1> push cx 50 000019A6 52 <1> push dx 51 000019A7 56 <1> push si 52 000019A8 57 <1> push di 53 000019A9 55 <1> push bp 54 000019AA 1E <1> push ds 55 000019AB 06 <1> push es 56 000019AC 2EFF26[EC8C] <1> jmp word [cs:keep_ip] 57 <1> ;============================================================================= 58 <1> ; popr 59 <1> ;----------------------------------------------------------------------------- 60 <1> ; Restores all registers. 61 <1> ; In: --- 62 <1> ; Out: AX, BX, CX, DX, SI, DI, BP, DS, ES restored 63 <1> ; Modf: AX, BX, CX, DX, SI, DI, BP, DS, ES 64 <1> ; Call: --- 65 <1> ; Use: keep_ip 66 <1> ; 67 <1> popr: 68 000019B1 2E8F06[EC8C] <1> pop word [cs:keep_ip] 69 000019B6 07 <1> pop es 70 000019B7 1F <1> pop ds 71 000019B8 5D <1> pop bp 72 000019B9 5F <1> pop di 73 000019BA 5E <1> pop si 74 000019BB 5A <1> pop dx 75 000019BC 59 <1> pop cx 76 000019BD 5B <1> pop bx 77 000019BE 58 <1> pop ax 78 000019BF 2EFF26[EC8C] <1> jmp word [cs:keep_ip] 79 <1> ;============================================================================= 80 <1> ; calc_prog_size 81 <1> ;----------------------------------------------------------------------------- 82 <1> ; Calculates the size of program. 83 <1> ; In: CX -- amount of additional memory 84 <1> ; Out: CY if error 85 <1> ; NC if no errors: 86 <1> ; AX -- program end 87 <1> ; DX -- program size in paragraphs 88 <1> ; Modf: AX, DX 89 <1> ; Call: --- 90 <1> ; Use: code_end, STACK_SIZE, MAX_PROGRAM_SIZE 91 <1> ; 92 <1> calc_prog_size: 93 000019C4 51 <1> push cx 94 000019C5 A1[2478] <1> mov ax,[code_end] 95 000019C8 01C8 <1> add ax,cx 96 000019CA 721F <1> jc @@exit 97 000019CC A90F00 <1> test ax,0fh 98 000019CF 7408 <1> jz @@calc_size 99 000019D1 83E0F0 <1> and ax,0fff0h 100 000019D4 83C010 <1> add ax,10h 101 000019D7 7212 <1> jc @@exit 102 <1> @@calc_size: 103 000019D9 050008 <1> add ax,STACK_SIZE 104 000019DC 720D <1> jc @@exit 105 000019DE 3DE9FD <1> cmp ax,MAX_PROGRAM_SIZE+1 106 000019E1 F5 <1> cmc 107 000019E2 7207 <1> jc @@exit 108 000019E4 B104 <1> mov cl,4 109 000019E6 89C2 <1> mov dx,ax 110 000019E8 D3EA <1> shr dx,cl 111 000019EA F8 <1> clc 112 <1> @@exit: 113 000019EB 59 <1> pop cx 114 000019EC C3 <1> ret 115 <1> ;============================================================================= 116 <1> ; action_short_jump 117 <1> ;----------------------------------------------------------------------------- 118 <1> ; Searches table for specified key. Format of table: key: word; value: byte, 119 <1> ; end of table: key == 0. 120 <1> ; In: DI -> table - 3 121 <1> ; AX -- key 122 <1> ; Out: CY if key not found 123 <1> ; NC if key found: 124 <1> ; DI -- value 125 <1> ; Modf: DI 126 <1> ; Call: --- 127 <1> ; Use: --- 128 <1> ; 129 <1> action_short_jump: 130 <1> @@next: 131 000019ED 83C703 <1> add di,3 132 000019F0 833D00 <1> cmp word [di],0 133 000019F3 740E <1> je @@exit 134 000019F5 3905 <1> cmp word [di],ax 135 000019F7 75F4 <1> jne @@next 136 000019F9 50 <1> push ax 137 000019FA 31C0 <1> xor ax,ax 138 000019FC 8A4502 <1> mov al,[di+2] 139 000019FF 97 <1> xchg ax,di 140 00001A00 58 <1> pop ax 141 00001A01 F8 <1> clc 142 00001A02 C3 <1> ret 143 <1> @@exit: 144 00001A03 F9 <1> stc 145 00001A04 C3 <1> ret 146 <1> ;============================================================================= 147 <1> ; action_long_jump 148 <1> ;----------------------------------------------------------------------------- 149 <1> ; Searches table for specified key. Format of table: key: word; value: word, 150 <1> ; end of table: key == 0. 151 <1> ; In: DI -> table - 4 152 <1> ; AX -- key 153 <1> ; Out: CY if key not found 154 <1> ; NC if key found: 155 <1> ; DI -- value 156 <1> ; Modf: DI 157 <1> ; Call: --- 158 <1> ; Use: --- 159 <1> ; 160 <1> action_long_jump: 161 <1> @@next: 162 00001A05 83C704 <1> add di,4 163 00001A08 833D00 <1> cmp word [di],0 164 00001A0B 7409 <1> je @@exit 165 00001A0D 3905 <1> cmp word [di],ax 166 00001A0F 75F4 <1> jne @@next 167 <1> ; push ax 168 <1> ; xor ax,ax 169 <1> ; mov al,[di+2] 170 <1> ; xchg ax,di 171 <1> ; pop ax 172 00001A11 8B7D02 <1> mov di,[di+2] 173 00001A14 F8 <1> clc 174 00001A15 C3 <1> ret 175 <1> @@exit: 176 00001A16 F9 <1> stc 177 00001A17 C3 <1> ret 178 <1> ;============================================================================= 179 <1> ; fill_byte_str, fill_word_str, fill_dword_str 180 <1> ;----------------------------------------------------------------------------- 181 <1> ; Stores hexadecimal representation of byte, word or double word in string. 182 <1> ; In: fill_byte_str: 183 <1> ; AL -- byte 184 <1> ; fill_word_str: 185 <1> ; AX -- word 186 <1> ; fill_dword_str: 187 <1> ; DS:SI -> dword 188 <1> ; ES:DI -> string 189 <1> ; Out: --- 190 <1> ; Modf: AX?, SI?, DI 191 <1> ; Call: fill_word_str, fill_byte_str 192 <1> ; Use: --- 193 <1> ; 194 <1> fill_dword_str: 195 00001A18 AD <1> lodsw 196 00001A19 50 <1> push ax 197 00001A1A AD <1> lodsw 198 00001A1B E80100 <1> call fill_word_str 199 00001A1E 58 <1> pop ax 200 <1> 201 <1> fill_word_str: 202 00001A1F 86C4 <1> xchg al,ah 203 00001A21 E80200 <1> call fill_byte_str 204 00001A24 86C4 <1> xchg al,ah 205 <1> 206 <1> fill_byte_str: 207 00001A26 50 <1> push ax 208 00001A27 51 <1> push cx 209 00001A28 B104 <1> mov cl,4 210 <1> @@next: 211 00001A2A 50 <1> push ax 212 00001A2B D2E8 <1> shr al,cl 213 00001A2D 240F <1> and al,0fh 214 00001A2F 3C0A <1> cmp al,10 215 00001A31 1C69 <1> sbb al,69h 216 00001A33 2F <1> das 217 00001A34 AA <1> stosb 218 00001A35 58 <1> pop ax 219 00001A36 80E904 <1> sub cl,4 220 00001A39 74EF <1> jz @@next 221 <1> 222 00001A3B 59 <1> pop cx 223 00001A3C 58 <1> pop ax 224 00001A3D C3 <1> ret 225 <1> ;============================================================================= 226 <1> ; strlen 227 <1> ;----------------------------------------------------------------------------- 228 <1> ; Returns length of string. Terminating \0 not counted. 229 <1> ; In: DS:SI -> string 230 <1> ; DF == 0 231 <1> ; Out: CX -- length 232 <1> ; Modf: CX 233 <1> ; Call: --- 234 <1> ; Use: --- 235 <1> ; 236 <1> strlen: 237 00001A3E 50 <1> push ax 238 00001A3F 56 <1> push si 239 00001A40 31C9 <1> xor cx,cx 240 <1> @@next: 241 00001A42 41 <1> inc cx 242 00001A43 AC <1> lodsb 243 00001A44 08C0 <1> or al,al 244 00001A46 75FA <1> jnz @@next 245 00001A48 49 <1> dec cx 246 00001A49 5E <1> pop si 247 00001A4A 58 <1> pop ax 248 00001A4B C3 <1> ret 249 <1> ;============================================================================= 250 <1> ; upcase 251 <1> ;----------------------------------------------------------------------------- 252 <1> ; Translates character to uppercase. 253 <1> ; In: AL -- char 254 <1> ; Out: AL -- uppercased char 255 <1> ; Modf: AL 256 <1> ; Call: --- 257 <1> ; Use: --- 258 <1> ; 259 <1> upcase: 260 00001A4C 3C61 <1> cmp al,'a' 261 00001A4E 7206 <1> jb @@quit 262 00001A50 3C7A <1> cmp al,'z' 263 00001A52 7702 <1> ja @@quit 264 00001A54 2C20 <1> sub al,20h 265 <1> @@quit: 266 00001A56 C3 <1> ret 267 <1> ;============================================================================= 268 <1> ; lowcase 269 <1> ;----------------------------------------------------------------------------- 270 <1> ; Translates character to lowercase. 271 <1> ; In: AL -- char 272 <1> ; Out: AL -- lowercased char 273 <1> ; Modf: AL 274 <1> ; Call: --- 275 <1> ; Use: --- 276 <1> ; 277 <1> lowcase: 278 00001A57 3C41 <1> cmp al,'A' 279 00001A59 7206 <1> jb @@quit 280 00001A5B 3C5A <1> cmp al,'Z' 281 00001A5D 7702 <1> ja @@quit 282 00001A5F 0420 <1> add al,20h 283 <1> @@quit: 284 00001A61 C3 <1> ret 285 <1> ;============================================================================= 286 <1> ; upline 287 <1> ;----------------------------------------------------------------------------- 288 <1> ; Translates string to uppercase. 289 <1> ; In: DS:SI -> string 290 <1> ; ES == DS 291 <1> ; Out: --- 292 <1> ; Modf: AL 293 <1> ; Call: --- 294 <1> ; Use: --- 295 <1> ; 296 <1> upline: 297 00001A62 56 <1> push si 298 00001A63 57 <1> push di 299 00001A64 89F7 <1> mov di,si 300 <1> @@next: 301 00001A66 AC <1> lodsb 302 00001A67 3C00 <1> cmp al,0 303 00001A69 7406 <1> je @@quit 304 00001A6B E8DEFF <1> call upcase 305 00001A6E AA <1> stosb 306 00001A6F EBF5 <1> jmp @@next 307 <1> @@quit: 308 00001A71 5F <1> pop di 309 00001A72 5E <1> pop si 310 00001A73 C3 <1> ret 311 <1> ;============================================================================= 312 <1> ; beep 313 <1> ;----------------------------------------------------------------------------- 314 <1> ; Produces short beep. 315 <1> ; In: --- 316 <1> ; Out: --- 317 <1> ; Modf: --- 318 <1> ; Call: --- 319 <1> ; Use: --- 320 <1> ; 321 <1> beep: 322 00001A74 D006[8B7E] <1> rol byte [option_beep], 1 323 00001A78 720F <1> jc .port 324 <1> .bios: 325 00001A7A 50 <1> push ax 326 00001A7B 53 <1> push bx 327 00001A7C 55 <1> push bp 328 00001A7D B8070E <1> mov ax, 0E07h 329 00001A80 BB0700 <1> mov bx, 7 330 00001A83 CD10 <1> int 10h 331 00001A85 5D <1> pop bp 332 00001A86 5B <1> pop bx 333 00001A87 58 <1> pop ax 334 00001A88 C3 <1> retn 335 <1> 336 <1> .port: 337 00001A89 50 <1> push ax 338 00001A8A 51 <1> push cx 339 00001A8B E461 <1> in al,61h 340 00001A8D 0C03 <1> or al,3 341 00001A8F E661 <1> out 61h,al 342 00001A91 B0B6 <1> mov al,10110110b 343 00001A93 E643 <1> out 43h,al 344 00001A95 B8BC02 <1> mov ax,700 345 00001A98 E642 <1> out 42h,al 346 00001A9A 88E0 <1> mov al,ah 347 00001A9C E642 <1> out 42h,al 348 <1> 349 00001A9E B900A0 <1> mov cx,0A000h 350 00001AA1 E2FE <1> loop $ 351 <1> 352 00001AA3 E461 <1> in al,61h 353 00001AA5 24FC <1> and al,11111100b 354 00001AA7 E661 <1> out 61h,al 355 00001AA9 59 <1> pop cx 356 00001AAA 58 <1> pop ax 357 00001AAB C3 <1> ret 358 <1> ;============================================================================= 359 <1> ; ascii_to_bin 360 <1> ;----------------------------------------------------------------------------- 361 <1> ; Converts ascii char '0'..'9', 'A'..'F', 'a'..'f' to binary value. 362 <1> ; In: AL -- char 363 <1> ; Out: NC if no errors: 364 <1> ; AL -- binary value 365 <1> ; CY if AL contains invalid char 366 <1> ; AL may be uppercased 367 <1> ; Modf: AX, BX, CL 368 <1> ; Call: upcase 369 <1> ; Use: --- 370 <1> ; 371 <1> ascii_to_bin: 372 00001AAC E89DFF <1> call upcase 373 00001AAF 3C30 <1> cmp al,'0' 374 00001AB1 7211 <1> jb @@error 375 00001AB3 3C39 <1> cmp al,'9' 376 00001AB5 760B <1> jbe @@digit 377 00001AB7 3C41 <1> cmp al,'A' 378 00001AB9 7209 <1> jb @@error 379 00001ABB 3C47 <1> cmp al,'G' 380 00001ABD F5 <1> cmc 381 00001ABE 7204 <1> jc @@error 382 00001AC0 2C07 <1> sub al,7 383 <1> @@digit: 384 00001AC2 2C30 <1> sub al,'0' 385 <1> @@error: 386 00001AC4 C3 <1> ret 387 <1> ;============================================================================= 388 <1> ; E0F 389 <1> ;============================================================================= 390 <1> 391 <1> 56 %include "keyboard.inc" ;Keyboard procedures 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; keyboard.inc 7 <1> ; Procedures for working with keyboard. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; Changelog 28 <1> ;----------------------------------------------------------------------------- 29 <1> ; 2007-02-10 0leg Added comments to all procedures. All variables moved 30 <1> ; to act[u]data.inc 31 <1> ;============================================================================= 32 <1> 33 <1> 34 <1> ;============================================================================= 35 <1> ; key_loop 36 <1> ;----------------------------------------------------------------------------- 37 <1> ; Reads keystrokes and calls corresponding procedures in loop. 38 <1> ; On end of table key_loop calls corresponding proc, if it is not 0. 39 <1> ; If it is 0 or if it return CY, [test_key] called. If [test_key] 40 <1> ; return NC, key_loop terminates, otherwise beep called. 41 <1> ; In: [keys] -> structure: key-code: word, proc: word, 42 <1> ; end of table: key-code == 0, exit: proc == 0 43 <1> ; Out: AX -- key codes 44 <1> ; Modf: AX, BX, CX, DX, SI, DI, BP 45 <1> ; Call: flush_key, read_key, [test_key], [key_loop_sub], beep 46 <1> ; Use: keys, key_loop_sub, cur_test_code, test_key 47 <1> ; 48 <1> key_loop: 49 <1> 50 <1> @@loop: 51 00001AC5 50 <1> push ax 52 00001AC6 53 <1> push bx 53 00001AC7 56 <1> push si 54 00001AC8 8B36[128D] <1> mov si,[keys] 55 00001ACC E88B00 <1> call flush_key 56 00001ACF E84B00 <1> call read_key 57 00001AD2 93 <1> xchg ax,bx 58 <1> @@next: 59 00001AD3 AD <1> lodsw 60 00001AD4 09C0 <1> or ax,ax ;End of table? 61 00001AD6 7418 <1> jz @@not_found ;Yes 62 00001AD8 39D8 <1> cmp ax,bx 63 00001ADA 7403 <1> je @@found 64 00001ADC AD <1> lodsw 65 00001ADD EBF4 <1> jmp @@next 66 <1> 67 <1> @@found: 68 00001ADF AD <1> lodsw 69 00001AE0 09C0 <1> or ax,ax ;Exit? 70 00001AE2 7430 <1> jz @@quit ;Yes 71 00001AE4 A3[108D] <1> mov [key_loop_sub],ax 72 00001AE7 5E <1> pop si 73 00001AE8 5B <1> pop bx 74 00001AE9 58 <1> pop ax 75 00001AEA FF16[108D] <1> call word [key_loop_sub] ;Call procedure 76 00001AEE EBD5 <1> jmp @@loop 77 <1> 78 <1> @@not_found: 79 00001AF0 891E[148D] <1> mov [cur_test_code],bx ;Key codes 80 00001AF4 AD <1> lodsw 81 00001AF5 A3[108D] <1> mov [key_loop_sub],ax ;Procedure for any key 82 00001AF8 09C0 <1> or ax,ax ;Exit? 83 00001AFA 93 <1> xchg ax,bx 84 00001AFB 5E <1> pop si 85 00001AFC 5B <1> pop bx 86 00001AFD 7409 <1> jz @@test_key ;Yes 87 00001AFF FF16[108D] <1> call word [key_loop_sub] ;AX == codes on entry 88 00001B03 7203 <1> jc @@test_key 89 00001B05 58 <1> pop ax 90 00001B06 EBBD <1> jmp @@loop ;Next... 91 <1> 92 <1> @@test_key: 93 00001B08 58 <1> pop ax 94 00001B09 FF16[407E] <1> call word [test_key] 95 00001B0D 730B <1> jnc @@quit_1 96 00001B0F E862FF <1> call beep 97 00001B12 EBB1 <1> jmp @@loop 98 <1> @@quit: 99 00001B14 89D8 <1> mov ax,bx ;Key codes 100 00001B16 5E <1> pop si 101 00001B17 5B <1> pop bx 102 00001B18 44 <1> inc sp 103 00001B19 44 <1> inc sp 104 <1> @@quit_1: 105 00001B1A C3 <1> ret 106 <1> ;============================================================================= 107 <1> ; def_test_key 108 <1> ;----------------------------------------------------------------------------- 109 <1> ; Default key testing procedure. 110 <1> ; In: --- 111 <1> ; Out: CY 112 <1> ; Modf: --- 113 <1> ; Call: --- 114 <1> ; Use: --- 115 <1> ; 116 <1> def_test_key: 117 00001B1B F9 <1> stc 118 00001B1C C3 <1> ret 119 <1> ;============================================================================= 120 <1> ; read_key 121 <1> ;----------------------------------------------------------------------------- 122 <1> ; Reads keystroke. 123 <1> ; In: --- 124 <1> ; Out: AX -- ASCII/scan codes 125 <1> ; Modf: AX 126 <1> ; Call: --- 127 <1> ; Use: --- 128 <1> ; 129 <1> read_key: 130 00001B1D 31C0 <1> xor ax, ax 131 00001B1F 2E8706[0A8C] <1> xchg ax, word [cs:read_key_insert] 132 00001B24 85C0 <1> test ax, ax 133 00001B26 7529 <1> jnz .ret 134 00001B28 53 <1> push bx 135 00001B29 31DB <1> xor bx,bx 136 00001B2B EB03 <1> jmp @F 137 <1> @@next: 138 00001B2D E84500 <1> call idle ; idle while waiting 139 <1> @@: 140 00001B30 B401 <1> mov ah,1 141 00001B32 CD16 <1> int 16h 142 00001B34 7516 <1> jnz @@get 143 00001B36 B402 <1> mov ah,2 144 00001B38 CD16 <1> int 16h 145 00001B3A A808 <1> test al,8 146 00001B3C 7514 <1> jnz @@alt 147 00001B3E 80FB02 <1> cmp bl,2 148 00001B41 7404 <1> je @@ret 149 00001B43 B301 <1> mov bl,1 150 00001B45 EBE6 <1> jmp @@next 151 <1> @@ret: 152 00001B47 B8FEFF <1> mov ax,kbAltAlone 153 00001B4A EB04 <1> jmp @@quit 154 <1> @@get: 155 00001B4C B400 <1> mov ah,0 156 00001B4E CD16 <1> int 16h 157 <1> @@quit: 158 00001B50 5B <1> pop bx 159 <1> .ret: 160 00001B51 C3 <1> ret 161 <1> @@alt: 162 00001B52 09DB <1> or bx,bx 163 00001B54 74D7 <1> jz @@next 164 00001B56 B302 <1> mov bl,2 165 00001B58 EBD3 <1> jmp @@next 166 <1> ;============================================================================= 167 <1> ; in_key 168 <1> ;----------------------------------------------------------------------------- 169 <1> ; Checks if key pressed. 170 <1> ; In: --- 171 <1> ; Out: ZR if no key pressed 172 <1> ; NZ if key pressed: 173 <1> ; AX -- ASCII/scan codes 174 <1> ; Modf: AX 175 <1> ; Call: --- 176 <1> ; Use: --- 177 <1> ; 178 <1> %if 0 179 <1> in_key: 180 <1> 181 <1> mov ah,1 182 <1> int 16h 183 <1> ret 184 <1> %endif 185 <1> ;============================================================================= 186 <1> ; flush_key 187 <1> ;----------------------------------------------------------------------------- 188 <1> ; Flushes keyboard buffer. 189 <1> ; In: --- 190 <1> ; Out: --- 191 <1> ; Modf: AX 192 <1> ; Call: --- 193 <1> ; Use: --- 194 <1> ; 195 <1> flush_key: 196 <1> @@next: 197 00001B5A B401 <1> mov ah,1 198 00001B5C CD16 <1> int 16h 199 00001B5E 7406 <1> jz @@quit 200 00001B60 B400 <1> mov ah,0 201 00001B62 CD16 <1> int 16h 202 00001B64 EBF4 <1> jmp @@next 203 <1> @@quit: 204 00001B66 C3 <1> ret 205 <1> ;============================================================================= 206 <1> ; check_shift 207 <1> ;----------------------------------------------------------------------------- 208 <1> ; Checks if any shift key is pressed. 209 <1> ; In: --- 210 <1> ; Out: ZR if shift key is not pressed 211 <1> ; NZ if shift key is pressed 212 <1> ; Modf: --- 213 <1> ; Call: --- 214 <1> ; Use: --- 215 <1> ; 216 <1> check_shift: 217 00001B67 50 <1> push ax 218 00001B68 1E <1> push ds 219 00001B69 31C0 <1> xor ax,ax 220 00001B6B 8ED8 <1> mov ds,ax 221 00001B6D F606170403 <1> test byte [417h],11b 222 00001B72 1F <1> pop ds 223 00001B73 58 <1> pop ax 224 00001B74 C3 <1> ret 225 <1> 226 <1> 227 <1> ; INP: - 228 <1> ; OUT: - 229 <1> ; CHG: ax 230 <1> ; STT: ds = ss = debugger segment/selector 231 <1> ; 232 <1> ; Idle system, using 2F.1680 or sti \ hlt. 233 <1> idle: 234 <1> ; testopt [options3], opt3_no_idle_2F 235 <1> ; jnz .hlt 236 00001B75 D006[8C7E] <1> rol byte [option_1680], 1 237 00001B79 731F <1> jnc .hlt 238 <1> ; %if _GUARD_86M_INT2F 239 <1> %if 1 240 00001B7B 06 <1> push es 241 00001B7C 31C0 <1> xor ax, ax 242 00001B7E 8EC0 <1> mov es, ax ; (only used in 86 Mode) 243 00001B80 26A1BC00 <1> mov ax, [es:2Fh * 4] 244 00001B84 83F8FF <1> cmp ax, -1 245 00001B87 7405 <1> je @F ; --> (ZR) 246 00001B89 260B06BE00 <1> or ax, [es:2Fh * 4 + 2] 247 <1> @@: 248 00001B8E 07 <1> pop es 249 00001B8F 7409 <1> jz @FF 250 <1> @@: 251 <1> %endif 252 00001B91 B88016 <1> mov ax, 1680h 253 00001B94 CD2F <1> int 2Fh ; release timeslice in multitasker 254 00001B96 84C0 <1> test al, al 255 00001B98 7409 <1> jz .return ; done idling --> 256 <1> @@: 257 <1> .hlt: 258 <1> ; testopt [options], nohlt 259 <1> ; jnz .return 260 00001B9A D006[8D7E] <1> rol byte [option_hlt], 1 261 00001B9E 7303 <1> jnc .return 262 00001BA0 FB <1> sti 263 00001BA1 F4 <1> hlt ; else idle by hlt 264 00001BA2 90 <1> nop 265 <1> .return: 266 00001BA3 C3 <1> retn 267 <1> 268 <1> ;============================================================================= 269 <1> ; E0F 270 <1> ;============================================================================= 57 %include "windows.inc" ;Windows and menus 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; windows.inc 7 <1> ; Procedures for creating windows and menus. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; Changelog 28 <1> ;----------------------------------------------------------------------------- 29 <1> ; 2007-02-06 0leg Added comments to all (?) procedures. 30 <1> ; 2007-02-10 0leg All variables moved to act[u]data.inc 31 <1> ; 2007-03-13 0leg close_window and restore_window now accepts no 32 <1> ; parameters (coordinates saved in window_buffer) 33 <1> ; 2007-11-17 0leg write_point changed to support optimized menu structures 34 <1> ; 2008-03-22 0leg Fixed incorrect shadow color 35 <1> ;============================================================================= 36 <1> 37 <1> 38 <1> ;============================================================================= 39 <1> ; exec_menu 40 <1> ;----------------------------------------------------------------------------- 41 <1> ; Creates horizontal menu. 42 <1> ; In: DS:SI -> menu structure. 43 <1> ; Format of menu structure: 44 <1> ; dw number-of-items 45 <1> ; dw ptr-to-list-of-strings 46 <1> ; dw ptr-to-list-of-submenus 47 <1> ; 48 <1> ; List of strings (menu items): 49 <1> ; db '~F~oo', 0 50 <1> ; db '~B~ar', 0 51 <1> ; db 'Baz', 0 52 <1> ; ... 53 <1> ; Hot keys enclosed in tildes (~). 54 <1> ; 55 <1> ; List of submenus: 56 <1> ; dw SUB_MENU, ptr-to-Foo-submenu-struc 57 <1> ; dw DISABLED, ptr-to-Bar-submenu-struc 58 <1> ; dw 0, ptr-to-Baz-procedure 59 <1> ; ... 60 <1> ; 61 <1> ; Format of submenu structure: 62 <1> ; db left, top, right, bottom ;coordinates 63 <1> ; dw number-of-items 64 <1> ; db number-of-selected-item 65 <1> ; db width-of-cursor 66 <1> ; dw ptr-to-list-of-procedures 67 <1> ; dw ptr-to-list-of-strings 68 <1> ; 69 <1> ; List of procedures: 70 <1> ; dw SUB_MENU, ptr-to-submenu-struc 71 <1> ; dw DISABLED, ptr-to-procedure 72 <1> ; dw 0, ptr-to-procedure 73 <1> ; ... 74 <1> ; 75 <1> ; Out: AX -- exit code 76 <1> ; Modf: AX, BX, CX, DX, SI, DI, BP 77 <1> ; Call: --- 78 <1> ; Use: --- 79 <1> ; 80 <1> exec_menu: 81 00001BA4 31DB <1> xor bx,bx 82 00001BA6 BA4F00 <1> mov dx,USED_COLS-1 83 00001BA9 E84F06 <1> call save_window 84 <1> 85 00001BAC FC <1> cld 86 00001BAD AD <1> lodsw ;Number of menu items 87 00001BAE 89C1 <1> mov cx,ax 88 00001BB0 8B1E[7C7E] <1> mov bx,[h_pos] 89 <1> @@next: 90 00001BB4 E81A01 <1> call update_hmenu 91 <1> @@read: 92 00001BB7 E863FF <1> call read_key 93 00001BBA 3D1B01 <1> cmp ax,kbEsc 94 00001BBD 7456 <1> je @@esc 95 00001BBF 83F8FE <1> cmp ax,kbAltAlone 96 00001BC2 7451 <1> je @@esc 97 00001BC4 3D0044 <1> cmp ax,kbF10 98 00001BC7 744C <1> je @@esc 99 00001BC9 3D0D1C <1> cmp ax,kbEnter 100 00001BCC 7430 <1> je @@enter 101 00001BCE 3D0050 <1> cmp ax,kbDown 102 00001BD1 742B <1> je @@enter 103 00001BD3 3D004D <1> cmp ax,kbRight 104 00001BD6 7415 <1> je @@right 105 00001BD8 3D004B <1> cmp ax,kbLeft 106 00001BDB 7419 <1> je @@left 107 00001BDD 56 <1> push si 108 00001BDE 8B34 <1> mov si,[si] ;Ptr to string list 109 00001BE0 E89404 <1> call find_menu_letter 110 00001BE3 5E <1> pop si 111 00001BE4 72D1 <1> jc @@read 112 00001BE6 89C3 <1> mov bx,ax ;Menu item 113 00001BE8 E8E600 <1> call update_hmenu 114 00001BEB EB11 <1> jmp @@enter 115 <1> @@right: 116 00001BED 43 <1> inc bx 117 00001BEE 39CB <1> cmp bx,cx 118 00001BF0 72C2 <1> jb @@next 119 00001BF2 31DB <1> xor bx,bx 120 00001BF4 EBBE <1> jmp @@next 121 <1> @@left: 122 00001BF6 4B <1> dec bx 123 00001BF7 79BB <1> jns @@next 124 00001BF9 89CB <1> mov bx,cx 125 00001BFB 4B <1> dec bx 126 00001BFC EBB6 <1> jmp @@next 127 <1> @@enter: 128 00001BFE 56 <1> push si 129 00001BFF 8B7402 <1> mov si,[si+2] ;Ptr to list of submenus 130 00001C02 E83A00 <1> call exec_sub_menu 131 00001C05 5E <1> pop si 132 00001C06 83F802 <1> cmp ax,2 133 00001C09 7420 <1> je @@left_exp 134 00001C0B 83F803 <1> cmp ax,3 135 00001C0E 7423 <1> je @@right_exp 136 00001C10 3D0001 <1> cmp ax,100h 137 00001C13 7302 <1> jae @@quit 138 <1> @@esc: 139 00001C15 31C0 <1> xor ax,ax 140 <1> @@quit: 141 00001C17 C706[088D]0000 <1> mov word [point_options],0 142 00001C1D 891E[7C7E] <1> mov [h_pos],bx 143 <1> ; xor bx,bx 144 <1> ; mov dx,79 145 00001C21 E81406 <1> call restore_window 146 00001C24 09C0 <1> or ax,ax 147 00001C26 7402 <1> jz @@ret 148 00001C28 FFD0 <1> call ax 149 <1> @@ret: 150 00001C2A C3 <1> ret 151 <1> @@left_exp: 152 00001C2B 4B <1> dec bx 153 00001C2C 790C <1> jns @@exp 154 00001C2E 89CB <1> mov bx,cx 155 00001C30 4B <1> dec bx 156 00001C31 EB07 <1> jmp @@exp 157 <1> @@right_exp: 158 00001C33 43 <1> inc bx 159 00001C34 39CB <1> cmp bx,cx 160 00001C36 7202 <1> jb @@exp 161 00001C38 31DB <1> xor bx,bx 162 <1> @@exp: 163 00001C3A E89400 <1> call update_hmenu 164 00001C3D EBBF <1> jmp @@enter 165 <1> ;============================================================================= 166 <1> ; exec_sub_menu 167 <1> ;----------------------------------------------------------------------------- 168 <1> ; Creates submenu. 169 <1> ; In: DS:SI -> list of submenus 170 <1> ; BX -- number of current item 171 <1> ; Out: AX -- result: 172 <1> ; 1 -- menu item disabled 173 <1> ; >= 100h -- ptr to procedure 174 <1> ; Modf: AX 175 <1> ; Call: open_window_bord, vert_menu, exec_sub_menu, close_window 176 <1> ; Use: sub_struc, sub_coord, empty_title, point_options 177 <1> ; 178 <1> exec_sub_menu: 179 00001C3F 53 <1> push bx 180 00001C40 51 <1> push cx 181 00001C41 52 <1> push dx 182 00001C42 56 <1> push si 183 00001C43 FF36[EE8C] <1> push word [sub_struc] 184 00001C47 FF36[F08C] <1> push word [sub_coord] 185 00001C4B D1E3 <1> shl bx,1 186 00001C4D D1E3 <1> shl bx,1 187 00001C4F 8B00 <1> mov ax,[bx+si] ;DISABLED, SUB_MENU, etc. 188 00001C51 A802 <1> test al,DISABLED 189 00001C53 7405 <1> jz @@enabled 190 00001C55 B80100 <1> mov ax,1 191 00001C58 EB64 <1> jmp @@quit_2 192 <1> @@enabled: 193 00001C5A 83E0FD <1> and ax,~DISABLED 194 00001C5D 09C0 <1> or ax,ax 195 00001C5F 7505 <1> jnz @@sub_menu ;Submenu if bit 0 is set 196 00001C61 8B4002 <1> mov ax,[bx+si+2] ;Otherwise -- procedure 197 <1> ; call word ptr [bx+si+2] 198 <1> ; xor ax,ax 199 00001C64 EB58 <1> jmp @@quit_2 200 <1> @@sub_menu: 201 00001C66 8B7002 <1> mov si,[bx+si+2] ;Ptr to submenu structure 202 00001C69 AD <1> lodsw 203 00001C6A A3[F08C] <1> mov [sub_coord],ax ;Coordinates of top left corner 204 00001C6D 89C3 <1> mov bx,ax 205 00001C6F AD <1> lodsw 206 00001C70 89C2 <1> mov dx,ax ;Coordinates of lower right corner 207 00001C72 B80170 <1> mov ax,atMenuBorder*256+1 208 00001C75 56 <1> push si 209 00001C76 BE[747E] <1> mov si,empty_title 210 00001C79 B9[F88B] <1> mov cx,single_border 211 00001C7C E8C404 <1> call open_window_bord 212 00001C7F 5E <1> pop si 213 <1> 214 00001C80 8936[EE8C] <1> mov [sub_struc],si 215 <1> @@next_menu: 216 00001C84 AD <1> lodsw 217 00001C85 89C1 <1> mov cx,ax ;Number of items 218 00001C87 AD <1> lodsw 219 00001C88 89C2 <1> mov dx,ax ;Selected/width 220 00001C8A AD <1> lodsw 221 00001C8B 89C5 <1> mov bp,ax ;Ptr to list of procedures 222 00001C8D A3[088D] <1> mov [point_options],ax 223 00001C90 AD <1> lodsw 224 00001C91 89C6 <1> mov si,ax ;Ptr to list of strings 225 00001C93 A1[F08C] <1> mov ax,[sub_coord] 226 00001C96 050101 <1> add ax,0101h 227 00001C99 B370 <1> mov bl,atMenuNorm 228 00001C9B B720 <1> mov bh,atMenuSel 229 00001C9D E8A002 <1> call vert_menu 230 00001CA0 8B36[EE8C] <1> mov si,[sub_struc] 231 00001CA4 886402 <1> mov [si+2],ah 232 00001CA7 3CFD <1> cmp al,-3 ;??? 233 00001CA9 7320 <1> jae @@quit_a ;??? 234 <1> 235 00001CAB 56 <1> push si 236 00001CAC 88C3 <1> mov bl,al 237 00001CAE B700 <1> mov bh,0 238 00001CB0 89EE <1> mov si,bp 239 00001CB2 E88AFF <1> call exec_sub_menu 240 00001CB5 5E <1> pop si 241 00001CB6 83F801 <1> cmp ax,1 242 00001CB9 74C9 <1> je @@next_menu 243 <1> 244 <1> @@quit: 245 00001CBB E87A05 <1> call close_window 246 <1> @@quit_2: 247 00001CBE 8F06[F08C] <1> pop word [sub_coord] 248 00001CC2 8F06[EE8C] <1> pop word [sub_struc] 249 00001CC6 5E <1> pop si 250 00001CC7 5A <1> pop dx 251 00001CC8 59 <1> pop cx 252 00001CC9 5B <1> pop bx 253 00001CCA C3 <1> ret 254 <1> @@quit_a: 255 00001CCB F6D8 <1> neg al 256 00001CCD B400 <1> mov ah,0 257 00001CCF EBEA <1> jmp @@quit 258 <1> ;============================================================================= 259 <1> ; update_hmenu 260 <1> ;----------------------------------------------------------------------------- 261 <1> ; Updates horizontal menu. 262 <1> ; In: DS:SI -> pointer to string list (2nd word in menu structure) 263 <1> ; BX -- number of active item 264 <1> ; CX -- number of items 265 <1> ; Out: --- 266 <1> ; Modf: --- 267 <1> ; Call: pushr, popr 268 <1> ; Use: video_seg 269 <1> ; 270 <1> update_hmenu: 271 00001CD1 E8CAFC <1> call pushr 272 00001CD4 8B34 <1> mov si,[si] 273 00001CD6 8E06[E27E] <1> mov es,[video_seg] 274 00001CDA 31FF <1> xor di,di 275 00001CDC 31ED <1> xor bp,bp 276 00001CDE B470 <1> mov ah,atHMenuNorm 277 00001CE0 B020 <1> mov al,' ' 278 00001CE2 AB <1> stosw 279 <1> @@next_point: 280 00001CE3 B470 <1> mov ah,atHMenuNorm 281 00001CE5 B674 <1> mov dh,atHMenuNormHot 282 00001CE7 39EB <1> cmp bx,bp 283 00001CE9 7504 <1> jne @@1 284 00001CEB B420 <1> mov ah,atHMenuSel 285 00001CED B624 <1> mov dh,atHMenuSelHot 286 <1> @@1: 287 00001CEF B020 <1> mov al,' ' 288 00001CF1 AB <1> stosw 289 <1> @@next: 290 00001CF2 AC <1> lodsb 291 00001CF3 3C00 <1> cmp al,0 292 00001CF5 740B <1> je @@end 293 00001CF7 3C7E <1> cmp al,'~' 294 00001CF9 7403 <1> je @@sw 295 00001CFB AB <1> stosw 296 00001CFC EBF4 <1> jmp @@next 297 <1> @@sw: 298 00001CFE 86E6 <1> xchg ah,dh 299 00001D00 EBF0 <1> jmp @@next 300 <1> @@end: 301 00001D02 B020 <1> mov al,' ' 302 00001D04 AB <1> stosw 303 00001D05 45 <1> inc bp 304 00001D06 39CD <1> cmp bp,cx 305 00001D08 72D9 <1> jb @@next_point 306 <1> 307 00001D0A B9A000 <1> mov cx,160 ;!!! 308 00001D0D 29F9 <1> sub cx,di 309 00001D0F D1E9 <1> shr cx,1 310 00001D11 B020 <1> mov al,' ' 311 00001D13 B470 <1> mov ah,atHMenuNorm 312 00001D15 F3AB <1> rep stosw 313 <1> 314 00001D17 E897FC <1> call popr 315 00001D1A C3 <1> ret 316 <1> ;============================================================================= 317 <1> ; local_menu 318 <1> ;----------------------------------------------------------------------------- 319 <1> ; Creates local menu. 320 <1> ; In: SI -> menu structure 321 <1> ; Out: CY -- ESC pressed 322 <1> ; NC -- Enter pressed: 323 <1> ; AX -> procedure 324 <1> ; Modf: AX 325 <1> ; Call: pushr, get_cursor, no_cursor, exec_sub_menu, set_cursor, popr 326 <1> ; Use: fake_table 327 <1> ; 328 <1> local_menu: 329 00001D1B E880FC <1> call pushr 330 <1> 331 00001D1E E8A605 <1> call get_cursor 332 00001D21 51 <1> push cx 333 00001D22 E8AD05 <1> call no_cursor 334 00001D25 31DB <1> xor bx,bx ;Current item 335 00001D27 8936[7A7E] <1> mov [fake_table+2],si ;Ptr to submenu struc. 336 00001D2B BE[787E] <1> mov si,fake_table 337 00001D2E E80EFF <1> call exec_sub_menu 338 00001D31 A3[7A7E] <1> mov [fake_table+2],ax ;Temp. variable 339 00001D34 59 <1> pop cx 340 00001D35 E8A705 <1> call set_cursor 341 <1> 342 00001D38 E876FC <1> call popr 343 00001D3B A1[7A7E] <1> mov ax,[fake_table+2] 344 00001D3E 3D0001 <1> cmp ax,100h 345 00001D41 C3 <1> ret 346 <1> 347 <1> ;============================================================================= 348 <1> 349 <1> ;~ifndef __ACT__ 350 <1> ;~ReadString proc 351 <1> ;~ ; Expects: al=x, ah=y, di=@buffer, cl=width, ch=maxlen, si=@title 352 <1> ;~ push bx dx 353 <1> ;~ mov bx,ax 354 <1> ;~ mov dx,ax 355 <1> ;~ add dl,cl 356 <1> ;~ add dl,5 357 <1> ;~ add dh,2 358 <1> ;~ push bx dx 359 <1> ;~ push ax 360 <1> ;~ mov ah,atReadWindow 361 <1> ;~ call OpenWindow 362 <1> ;~ pop ax 363 <1> ;~ mov bl,atReadString 364 <1> ;~ mov bh,atsReadString 365 <1> ;~ call ReadLine 366 <1> ;~ pop dx bx 367 <1> ;~ call CloseWindow 368 <1> ;~ pop dx bx 369 <1> ;~ ret 370 <1> ;~endp 371 <1> ;~endif 372 <1> 373 <1> ;============================================================================= 374 <1> ; read_line 375 <1> ;----------------------------------------------------------------------------- 376 <1> ; Reads line. 377 <1> ; In: AL -- column 378 <1> ; AH -- row 379 <1> ; BL -- color (normal) 380 <1> ; BH -- color (selected) 381 <1> ; CL -- length of string 382 <1> ; CH -- max length of string 383 <1> ; DI -> buffer 384 <1> ; Out: AX -- ASCII/scan codes of key used to exit 385 <1> ; Modf: AX 386 <1> ; Call: pushr, get_addr, get_cursor, small_cursor, strlen, update_string, 387 <1> ; read_key, check_exit_read, set_cursor, gotoxy, popr, [test_char] 388 <1> ; Use: string_changed, read_line_attr, str_start, str_length, 389 <1> ; max_str_length, str_buffer, read_line_cur, read_line_cur_c, 390 <1> ; read_line_result 391 <1> ; 392 <1> read_line: 393 00001D42 E859FC <1> call pushr 394 00001D45 0E <1> push cs 395 00001D46 07 <1> pop es 396 00001D47 C606[0A8D]01 <1> mov byte [string_changed],1 397 00001D4C 891E[FC8C] <1> mov [read_line_attr],bx ;word! 398 00001D50 050201 <1> add ax,0102h 399 00001D53 A3[068D] <1> mov [str_start],ax 400 00001D56 57 <1> push di 401 00001D57 E84E05 <1> call get_addr 402 00001D5A 5F <1> pop di 403 <1> ; mov bp,ax 404 00001D5B 880E[0C8D] <1> mov [str_length],cl ;byte! 405 00001D5F 882E[0E8D] <1> mov [max_str_length],ch ;byte! 406 00001D63 893E[048D] <1> mov [str_buffer],di 407 00001D67 89FE <1> mov si,di 408 00001D69 0336[0E8D] <1> add si,[max_str_length] 409 00001D6D C60400 <1> mov byte [si],0 410 00001D70 51 <1> push cx 411 00001D71 E85305 <1> call get_cursor 412 00001D74 890E[008D] <1> mov [read_line_cur],cx 413 00001D78 8916[028D] <1> mov [read_line_cur_c],dx 414 00001D7C E85805 <1> call small_cursor 415 00001D7F 59 <1> pop cx 416 <1> ; mov ch,0 417 <1> 418 00001D80 89FE <1> mov si,di 419 00001D82 E8B9FC <1> call strlen 420 <1> 421 00001D85 31DB <1> xor bx,bx 422 00001D87 31D2 <1> xor dx,dx 423 00001D89 EB05 <1> jmp @@next_1 424 <1> @@next: 425 00001D8B C606[0A8D]00 <1> mov byte [string_changed],0 426 <1> @@next_1: 427 00001D90 E81D01 <1> call update_string 428 <1> @@read: 429 00001D93 E887FD <1> call read_key 430 00001D96 E87C01 <1> call check_exit_read 431 00001D99 7203 <1> jc @@1 432 00001D9B E9FA00 <1> jmp @@ignore 433 <1> @@1: 434 00001D9E 3D004D <1> cmp ax,kbRight 435 00001DA1 745E <1> je @@right 436 00001DA3 3D004B <1> cmp ax,kbLeft 437 00001DA6 7503E98200 <1> je @@left 438 00001DAB 3D0047 <1> cmp ax,kbHome 439 00001DAE 7503 <1> jne @@5 440 00001DB0 E9CD00 <1> jmp @@home 441 <1> @@5: 442 00001DB3 3D004F <1> cmp ax,kbEnd 443 00001DB6 7503 <1> jne @@4 444 00001DB8 E9CC00 <1> jmp @@end 445 <1> @@4: 446 00001DBB 3D0053 <1> cmp ax,kbDel 447 00001DBE 7503E98400 <1> je @@delete 448 00001DC3 3D080E <1> cmp ax,kbBackSpace 449 00001DC6 7473 <1> je @@backspace 450 00001DC8 3A1E[0E8D] <1> cmp bl,[max_str_length] ;byte! 451 00001DCC 73BD <1> jae @@next 452 00001DCE FF16[7E7E] <1> call [test_char] 453 00001DD2 72BF <1> jc @@read 454 00001DD4 803E[0A8D]01 <1> cmp byte [string_changed],1 455 00001DD9 743B <1> je @@clear 456 <1> @@cleared: 457 00001DDB 51 <1> push cx 458 00001DDC 8B0E[0E8D] <1> mov cx,[max_str_length] 459 00001DE0 8B3E[048D] <1> mov di,[str_buffer] 460 00001DE4 01CF <1> add di,cx 461 00001DE6 4F <1> dec di 462 00001DE7 8D75FF <1> lea si,[di-1] 463 00001DEA 29D9 <1> sub cx,bx 464 00001DEC 7404 <1> jz @@3 465 00001DEE 49 <1> dec cx 466 00001DEF FD <1> std 467 00001DF0 F3A4 <1> rep movsb 468 <1> @@3: 469 00001DF2 FC <1> cld 470 00001DF3 8B36[048D] <1> mov si,[str_buffer] 471 <1> ; add si,bx 472 00001DF7 8800 <1> mov [si+bx],al 473 00001DF9 59 <1> pop cx 474 00001DFA 3B0E[0E8D] <1> cmp cx,[max_str_length] 475 00001DFE 7301 <1> jae @@right 476 00001E00 41 <1> inc cx 477 <1> @@right: 478 00001E01 38CB <1> cmp bl,cl 479 00001E03 7502 <1> jne @@2 480 <1> @@loc_read: 481 00001E05 EB8C <1> jmp @@read 482 <1> @@2: 483 00001E07 43 <1> inc bx 484 00001E08 89D8 <1> mov ax,bx 485 00001E0A 29D0 <1> sub ax,dx 486 00001E0C 3B06[0C8D] <1> cmp ax,[str_length] 487 00001E10 7626 <1> jbe @@loc_next 488 00001E12 42 <1> inc dx 489 00001E13 E975FF <1> jmp @@next 490 <1> @@clear: 491 00001E16 E80800 <1> call .clearinternal 492 00001E19 EBC0 <1> jmp @@cleared 493 <1> 494 <1> @@clear_delete: 495 00001E1B E80300 <1> call .clearinternal 496 00001E1E E96AFF <1> jmp @@next 497 <1> 498 <1> .clearinternal: 499 00001E21 8B36[048D] <1> mov si,[str_buffer] 500 00001E25 C60400 <1> mov byte [si],0 501 00001E28 31C9 <1> xor cx,cx 502 00001E2A 31DB <1> xor bx,bx 503 00001E2C C3 <1> retn 504 <1> 505 <1> @@left: 506 00001E2D 08DB <1> or bl,bl 507 00001E2F 7407 <1> je @@loc_next 508 00001E31 4B <1> dec bx 509 00001E32 39D3 <1> cmp bx,dx 510 00001E34 7302 <1> jae @@loc_next 511 00001E36 89DA <1> mov dx,bx 512 <1> @@loc_next: 513 00001E38 E950FF <1> jmp @@next 514 <1> @@backspace: 515 00001E3B 803E[0A8D]01 <1> cmp byte [string_changed],1 516 00001E40 74D9 <1> je @@clear_delete 517 00001E42 09DB <1> or bx,bx 518 00001E44 74BF <1> je @@loc_read 519 00001E46 4B <1> dec bx 520 <1> @@delete: 521 00001E47 803E[0A8D]01 <1> cmp byte [string_changed],1 522 00001E4C 74CD <1> je @@clear_delete 523 00001E4E 09C9 <1> or cx,cx 524 00001E50 74B3 <1> je @@loc_read 525 00001E52 39CB <1> cmp bx,cx 526 00001E54 73AF <1> jae @@loc_read 527 00001E56 8B3E[048D] <1> mov di,[str_buffer] 528 00001E5A 01DF <1> add di,bx 529 00001E5C 8D7501 <1> lea si,[di+1] 530 00001E5F 51 <1> push cx 531 00001E60 8B0E[0E8D] <1> mov cx,[max_str_length] 532 00001E64 29D9 <1> sub cx,bx 533 00001E66 FC <1> cld 534 00001E67 F3A4 <1> rep movsb 535 00001E69 B000 <1> mov al,0 536 00001E6B AA <1> stosb 537 00001E6C 59 <1> pop cx 538 00001E6D 49 <1> dec cx 539 00001E6E 09D2 <1> or dx,dx 540 00001E70 74C6 <1> jz @@loc_next 541 00001E72 89C8 <1> mov ax,cx 542 00001E74 29D0 <1> sub ax,dx 543 00001E76 3B06[0C8D] <1> cmp ax,[str_length] 544 00001E7A 73BC <1> jae @@loc_next 545 00001E7C 4A <1> dec dx 546 00001E7D E90BFF <1> jmp @@next 547 <1> @@home: 548 00001E80 31DB <1> xor bx,bx 549 00001E82 31D2 <1> xor dx,dx 550 00001E84 E904FF <1> jmp @@next 551 <1> @@end: 552 00001E87 89CB <1> mov bx,cx 553 00001E89 3B1E[0C8D] <1> cmp bx,[str_length] 554 00001E8D 76A9 <1> jbe @@loc_next 555 00001E8F 89DA <1> mov dx,bx 556 00001E91 2B16[0C8D] <1> sub dx,[str_length] 557 00001E95 E9F3FE <1> jmp @@next 558 <1> 559 <1> @@ignore: 560 <1> ; mov @@Result,0 561 <1> ; jmp @@Quit 562 <1> @@enter: 563 00001E98 A3[FE8C] <1> mov [read_line_result],ax 564 <1> @@quit: 565 00001E9B 8B0E[008D] <1> mov cx,[read_line_cur] 566 00001E9F E83D04 <1> call set_cursor 567 00001EA2 8B16[028D] <1> mov dx,[read_line_cur_c] 568 00001EA6 E81304 <1> call gotoxy 569 00001EA9 E805FB <1> call popr 570 00001EAC A1[FE8C] <1> mov ax,[read_line_result] 571 00001EAF C3 <1> ret 572 <1> ;============================================================================= 573 <1> ; update_string 574 <1> ;----------------------------------------------------------------------------- 575 <1> ; Updates string. 576 <1> ; In: BX -- position of cursor 577 <1> ; DX -- ??? 578 <1> ; Out: --- 579 <1> ; Modf: --- 580 <1> ; Call: pushr, gotoxy, popr 581 <1> ; Use: str_start, video_seg, str_buffer, read_line_attr, string_changed, 582 <1> ; read_line_sel_attr, str_length 583 <1> ; 584 <1> update_string: 585 00001EB0 E8EBFA <1> call pushr 586 00001EB3 89D0 <1> mov ax,dx 587 00001EB5 8B16[068D] <1> mov dx,[str_start] 588 00001EB9 00DA <1> add dl,bl 589 00001EBB 28C2 <1> sub dl,al 590 00001EBD FEC2 <1> inc dl 591 00001EBF E8FA03 <1> call gotoxy 592 00001EC2 89C2 <1> mov dx,ax 593 00001EC4 89EF <1> mov di,bp 594 00001EC6 8E06[E27E] <1> mov es,[video_seg] 595 00001ECA 8B36[048D] <1> mov si,[str_buffer] 596 00001ECE 01C6 <1> add si,ax 597 00001ED0 8A26[FC8C] <1> mov ah,[read_line_attr] 598 00001ED4 31D2 <1> xor dx,dx 599 00001ED6 B020 <1> mov al,' ' 600 00001ED8 AB <1> stosw 601 00001ED9 803E[0A8D]00 <1> cmp byte [string_changed],0 602 00001EDE 7404 <1> je @@not_sel_1 603 00001EE0 8A26[FD8C] <1> mov ah,[read_line_sel_attr] 604 <1> @@not_sel_1: 605 00001EE4 E30F <1> jcxz @@skip 606 00001EE6 3B0E[0C8D] <1> cmp cx,[str_length] 607 00001EEA 7604 <1> jbe @@next 608 00001EEC 8B0E[0C8D] <1> mov cx,[str_length] 609 <1> @@next: 610 00001EF0 AC <1> lodsb 611 00001EF1 AB <1> stosw 612 00001EF2 42 <1> inc dx 613 00001EF3 E2FB <1> loop @@next 614 <1> @@skip: 615 00001EF5 8A26[FC8C] <1> mov ah,[read_line_attr] 616 00001EF9 2B16[0C8D] <1> sub dx,[str_length] 617 00001EFD 7709 <1> ja @@quit 618 00001EFF 89D1 <1> mov cx,dx 619 00001F01 F7D9 <1> neg cx 620 00001F03 41 <1> inc cx 621 00001F04 B020 <1> mov al,' ' 622 00001F06 F3AB <1> rep stosw 623 <1> @@quit: 624 00001F08 E8A6FA <1> call popr 625 00001F0B C3 <1> ret 626 <1> ;============================================================================= 627 <1> ; default_test_char 628 <1> ;----------------------------------------------------------------------------- 629 <1> ; ??? 630 <1> ; In: --- 631 <1> ; Out: --- 632 <1> ; Modf: AX, BX, CX, DX, SI, DI, BP 633 <1> ; Call: --- 634 <1> ; Use: --- 635 <1> ; 636 <1> default_test_char: 637 <1> ; cmp al,0 638 <1> ; je @@1 639 <1> ; clc 640 <1> ; ret 641 <1> ;@@1: 642 <1> ; stc 643 <1> ; ret 644 <1> 645 00001F0C 3C20 <1> cmp al,' ' 646 00001F0E 7204 <1> jb @@exit 647 00001F10 83F8FE <1> cmp ax,kbAltAlone 648 00001F13 F5 <1> cmc 649 <1> @@exit: 650 00001F14 C3 <1> ret 651 <1> ;============================================================================= 652 <1> ; check_exit_read 653 <1> ;----------------------------------------------------------------------------- 654 <1> ; ??? 655 <1> ; In: --- 656 <1> ; Out: --- 657 <1> ; Modf: AX, BX, CX, DX, SI, DI, BP 658 <1> ; Call: --- 659 <1> ; Use: --- 660 <1> ; 661 <1> check_exit_read: 662 00001F15 50 <1> push ax 663 00001F16 53 <1> push bx 664 00001F17 56 <1> push si 665 00001F18 89C3 <1> mov bx,ax 666 00001F1A 8B36[807E] <1> mov si,[read_exit_keys] 667 <1> @@next: 668 00001F1E AD <1> lodsw 669 00001F1F 39D8 <1> cmp ax,bx 670 00001F21 7419 <1> je @@quit 671 00001F23 85C0 <1> test ax, ax 672 00001F25 75F7 <1> jnz @@next 673 <1> 674 00001F27 BE[148C] <1> mov si, dialog_accelerators ; -> accelerator table 675 <1> @@: 676 00001F2A 3B36[887E] <1> cmp si, word [dialog_accelerators_behind_last] 677 <1> ; done checking table ? 678 00001F2E 7309 <1> jae @@end_zero_ax ; yes --> 679 00001F30 AD <1> lodsw ; load accelerator keycode to check 680 00001F31 39D8 <1> cmp ax, bx ; check 681 00001F33 7407 <1> je @@quit ; found --> (NC) 682 00001F35 AD <1> lodsw ; si += 2 (skip item index) 683 00001F36 AD <1> lodsw ; si += 2 (skip checkbox index) 684 00001F37 EBF1 <1> jmp @B 685 <1> 686 <1> @@end_zero_ax: 687 00001F39 31C0 <1> xor ax, ax 688 <1> 689 <1> @@end: 690 00001F3B F9 <1> stc 691 <1> @@quit: 692 00001F3C 5E <1> pop si 693 00001F3D 5B <1> pop bx 694 00001F3E 58 <1> pop ax 695 00001F3F C3 <1> ret 696 <1> ;============================================================================= 697 <1> ; vert_menu 698 <1> ;----------------------------------------------------------------------------- 699 <1> ; Creates vertical menu. 700 <1> ; In: AH/AL -- row/column of top left corner 701 <1> ; CX -- number of items 702 <1> ; BL -- normal color 703 <1> ; BH -- selected color 704 <1> ; DL -- selected item 705 <1> ; DH -- width 706 <1> ; DS:SI -> list of items (empty string -- separator) 707 <1> ; Out: AL -- number of selected item: 708 <1> ; >= 0 -- number of item 709 <1> ; -1 -- ESC pressed 710 <1> ; -2 -- Left pressed 711 <1> ; -3 -- Right pressed 712 <1> ; AH -- ??? 713 <1> ; Modf: AX 714 <1> ; Call: --- 715 <1> ; Use: --- 716 <1> ; 717 <1> vert_menu: 718 00001F40 E85BFA <1> call pushr 719 00001F43 FF36[128D] <1> push word [keys] 720 00001F47 FF36[407E] <1> push word [test_key] 721 00001F4B E85A03 <1> call get_addr 722 00001F4E 8E06[E27E] <1> mov es,[video_seg] 723 <1> ; mov bp,ax 724 00001F52 E86F00 <1> call write_items 725 00001F55 C706[128D][B27E] <1> mov word [keys],menu_keys 726 00001F5B C706[407E][B31F] <1> mov word [test_key],vm_test_key 727 00001F61 E861FB <1> call key_loop 728 00001F64 3D1B01 <1> cmp ax,kbEsc 729 00001F67 7413 <1> je @@cancel 730 00001F69 3D0044 <1> cmp ax,kbF10 731 00001F6C 740E <1> je @@cancel 732 00001F6E 3D004B <1> cmp ax,kbLeft 733 00001F71 7421 <1> je @@left 734 00001F73 3D004D <1> cmp ax,kbRight 735 00001F76 7420 <1> je @@right 736 00001F78 88D0 <1> mov al,dl 737 00001F7A EB02 <1> jmp @@quit 738 <1> @@cancel: 739 00001F7C B0FF <1> mov al,-1 740 <1> @@quit: 741 00001F7E A2[F48C] <1> mov [vert_menu_result],al 742 00001F81 8816[F58C] <1> mov [vert_menu_result+1],dl 743 00001F85 8F06[407E] <1> pop word [test_key] 744 00001F89 8F06[128D] <1> pop word [keys] 745 00001F8D E821FA <1> call popr 746 00001F90 A1[F48C] <1> mov ax,[vert_menu_result] 747 00001F93 C3 <1> ret 748 <1> @@left: 749 00001F94 B0FE <1> mov al,-2 750 00001F96 EBE6 <1> jmp @@quit 751 <1> @@right: 752 00001F98 B0FD <1> mov al,-3 753 00001F9A EBE2 <1> jmp @@quit 754 <1> 755 <1> vert_menu_down: 756 00001F9C FEC2 <1> inc dl 757 00001F9E 38CA <1> cmp dl,cl 758 00001FA0 7202 <1> jb vert_menu_ret 759 <1> vert_menu_home: 760 00001FA2 B200 <1> mov dl,0 761 <1> vert_menu_ret: 762 00001FA4 EB1E <1> jmp write_items 763 <1> 764 <1> vert_menu_up: 765 00001FA6 FECA <1> dec dl 766 00001FA8 80FAFF <1> cmp dl,-1 767 00001FAB 75F7 <1> jne vert_menu_ret 768 <1> vert_menu_end: 769 00001FAD 88CA <1> mov dl,cl 770 00001FAF FECA <1> dec dl 771 00001FB1 EBF1 <1> jmp vert_menu_ret 772 <1> ;============================================================================= 773 <1> ; vm_test_key 774 <1> ;----------------------------------------------------------------------------- 775 <1> ; ??? 776 <1> ; In: --- 777 <1> ; Out: --- 778 <1> ; Modf: AX, BX, CX, DX, SI, DI, BP 779 <1> ; Call: --- 780 <1> ; Use: --- 781 <1> ; 782 <1> vm_test_key: 783 00001FB3 A0[148D] <1> mov al,[cur_test_code] ;byte! 784 00001FB6 E8BE00 <1> call find_menu_letter 785 00001FB9 7208 <1> jc @@quit 786 00001FBB 88C2 <1> mov dl,al 787 00001FBD E80400 <1> call write_items 788 00001FC0 B80D1C <1> mov ax,kbEnter 789 <1> @@quit: 790 00001FC3 C3 <1> ret 791 <1> ;============================================================================= 792 <1> ; write_items 793 <1> ;----------------------------------------------------------------------------- 794 <1> ; Writes item of vertical menu. 795 <1> ; In: ES:BP -> top left byte of menu in video memory 796 <1> ; CX -- number of items 797 <1> ; BL -- normal color 798 <1> ; BH -- selected color 799 <1> ; DL -- selected item 800 <1> ; DH -- width 801 <1> ; DS:SI -> list of items (empty string -- separator) 802 <1> ; Out: --- 803 <1> ; Modf: BX, DX, DI 804 <1> ; Call: write_point 805 <1> ; Use: point_options, normal_letter, accent_letter 806 <1> ; 807 <1> write_items: 808 00001FC4 50 <1> push ax 809 00001FC5 51 <1> push cx 810 00001FC6 56 <1> push si 811 00001FC7 55 <1> push bp 812 00001FC8 B000 <1> mov al,0 813 <1> @@next: 814 00001FCA 51 <1> push cx 815 <1> @@next_str: 816 00001FCB 89EF <1> mov di,bp 817 00001FCD 88DC <1> mov ah,bl 818 00001FCF 803C00 <1> cmp byte [si],0 819 00001FD2 7442 <1> je @@separator 820 00001FD4 833E[088D]00 <1> cmp word [point_options],0 821 00001FD9 7421 <1> je @@no_opt 822 00001FDB 53 <1> push bx 823 00001FDC 88C3 <1> mov bl,al 824 00001FDE B700 <1> mov bh,0 825 00001FE0 01DB <1> add bx,bx 826 00001FE2 01DB <1> add bx,bx 827 00001FE4 031E[088D] <1> add bx,[point_options] 828 00001FE8 F60702 <1> test byte [bx],DISABLED 829 00001FEB 5B <1> pop bx 830 00001FEC 740E <1> jz @@no_opt 831 00001FEE B578 <1> mov ch,atMenuNormDis 832 00001FF0 B478 <1> mov ah,atMenuNormDis 833 00001FF2 38D0 <1> cmp al,dl 834 00001FF4 7510 <1> jne @@write 835 00001FF6 B528 <1> mov ch,atMenuSelDis 836 00001FF8 B428 <1> mov ah,atMenuSelDis 837 00001FFA EB0A <1> jmp @@write 838 <1> @@no_opt: 839 00001FFC B574 <1> mov ch,atMenuNormHot 840 00001FFE 38D0 <1> cmp al,dl 841 00002000 7504 <1> jne @@write 842 00002002 88FC <1> mov ah,bh 843 00002004 B524 <1> mov ch,atMenuSelHot 844 <1> @@write: 845 00002006 E82A00 <1> call write_point 846 00002009 81C5A000 <1> add bp,SCR_COLS*2 ;160 847 0000200D 40 <1> inc ax 848 0000200E 59 <1> pop cx 849 0000200F E2B9 <1> loop @@next 850 <1> 851 00002011 5D <1> pop bp 852 00002012 5E <1> pop si 853 00002013 59 <1> pop cx 854 00002014 58 <1> pop ax 855 00002015 C3 <1> ret 856 <1> 857 <1> @@separator: 858 <1> ;----------------------------------------------------------------------------- 859 <1> ; Write separator. 860 <1> ; Borland-style: Norton-style: 861 <1> ; (old, as in TC 2.01) 862 <1> ; . . . . . . 863 <1> ; │ Item N │ │ Item N │ 864 <1> ; ├─────────────┤ │ ─────────── │ 865 <1> ; │ Item N+1 │ │ Item N+1 │ 866 <1> ; . . . . . . 867 <1> ;----------------------------------------------------------------------------- 868 00002016 50 <1> push ax 869 00002017 46 <1> inc si 870 <1> %ifdef CONFIG_BORLAND_MENU 871 00002018 4F <1> dec di 872 00002019 4F <1> dec di 873 0000201A B470 <1> mov ah, atMenuBorder 874 <1> drawchoice '├', '+' 875 0000201C A0[E78B] <1> mov al, byte [DRAWADDRESS] 876 0000201F AB <1> stosw 877 <1> drawchoice '─', '-' 878 00002020 A0[E88B] <1> mov al, byte [DRAWADDRESS] 879 00002023 88F1 <1> mov cl,dh 880 00002025 41 <1> inc cx 881 00002026 F3AB <1> rep stosw 882 <1> drawchoice '┤', '+' 883 00002028 A0[E98B] <1> mov al, byte [DRAWADDRESS] 884 0000202B AB <1> stosw 885 <1> %else ;CONFIG_BORLAND_MENU 886 <1> scasw ;Instead of ADD DI,2 887 <1> mov ah, atMenuBorder 888 <1> drawchoice '─', '-' 889 <1> mov al, byte [DRAWADDRESS] 890 <1> mov cl,dh 891 <1> dec cx 892 <1> rep stosw 893 <1> %endif ;CONFIG_BORLAND_MENU 894 0000202C 81C5A000 <1> add bp,SCR_COLS*2 895 00002030 58 <1> pop ax 896 00002031 EB98 <1> jmp @@next_str 897 <1> ;============================================================================= 898 <1> ; write_point 899 <1> ;----------------------------------------------------------------------------- 900 <1> ; Writes menu item. 901 <1> ; In: DS:SI -> string 902 <1> ; ES:DI -> video memory 903 <1> ; AH -- normal color 904 <1> ; CH -- color of hot-key 905 <1> ; DH -- width (0 if don't care) 906 <1> ; Out: SI -> next string 907 <1> ; Modf: SI, DI 908 <1> ; Call: --- 909 <1> ; Use: --- 910 <1> ; 911 <1> write_point: 912 <1> 913 00002033 50 <1> push ax 914 00002034 53 <1> push bx 915 00002035 51 <1> push cx 916 00002036 FC <1> cld 917 00002037 88EB <1> mov bl,ch 918 00002039 88F1 <1> mov cl,dh 919 0000203B B500 <1> mov ch,0 920 0000203D B020 <1> mov al,' ' 921 0000203F AB <1> stosw 922 <1> @@next: 923 00002040 AC <1> lodsb 924 00002041 3C00 <1> cmp al,0 925 00002043 7425 <1> je @@adjust 926 00002045 3C7E <1> cmp al,'~' 927 00002047 741D <1> je @@sw 928 <1> ;----------------------------------------------------------------------------- 929 00002049 3C60 <1> cmp al,'`' 930 0000204B 7515 <1> jne @@stosw 931 0000204D 53 <1> push bx 932 0000204E 89CB <1> mov bx,cx 933 00002050 E8DE08 <1> call point_len 934 00002053 41 <1> inc cx 935 00002054 41 <1> inc cx 936 00002055 F6D9 <1> neg cl 937 00002057 00D9 <1> add cl,bl 938 00002059 28CB <1> sub bl,cl 939 0000205B 53 <1> push bx 940 0000205C B020 <1> mov al,' ' 941 0000205E F3AB <1> rep stosw 942 00002060 59 <1> pop cx 943 00002061 5B <1> pop bx 944 <1> @@stosw: 945 <1> ;----------------------------------------------------------------------------- 946 00002062 AB <1> stosw 947 00002063 49 <1> dec cx 948 00002064 EBDA <1> jmp @@next 949 <1> @@sw: 950 00002066 86E3 <1> xchg ah,bl 951 00002068 EBD6 <1> jmp @@next 952 <1> @@adjust: 953 0000206A 83F900 <1> cmp cx,0 954 0000206D 7E04 <1> jle @@quit 955 0000206F B020 <1> mov al,' ' 956 00002071 F3AB <1> rep stosw 957 <1> @@quit: 958 00002073 59 <1> pop cx 959 00002074 5B <1> pop bx 960 00002075 58 <1> pop ax 961 00002076 C3 <1> ret 962 <1> ;============================================================================= 963 <1> ; find_menu_letter 964 <1> ;------------------------------------------------------------------------------ 965 <1> ; Searches list of strings for hot key. 966 <1> ; In: DS:SI -> list of strings 967 <1> ; CX -- number of items 968 <1> ; AL -- hot key to found 969 <1> ; Out: CY -- hot key not found 970 <1> ; NC -- hot key found: 971 <1> ; AX -- number of item 972 <1> ; Modf: AX 973 <1> ; Call: upcase 974 <1> ; Use: --- 975 <1> ; 976 <1> find_menu_letter: 977 00002077 53 <1> push bx 978 00002078 56 <1> push si 979 00002079 E8D0F9 <1> call upcase 980 0000207C 88C4 <1> mov ah,al 981 0000207E 31DB <1> xor bx,bx 982 <1> @@next: 983 00002080 AC <1> lodsb 984 00002081 3C00 <1> cmp al,0 985 00002083 7411 <1> je @@end_point 986 00002085 3C7E <1> cmp al,'~' 987 00002087 75F7 <1> jne @@next 988 00002089 AC <1> lodsb 989 0000208A 46 <1> inc si 990 0000208B E8BEF9 <1> call upcase 991 0000208E 38E0 <1> cmp al,ah 992 00002090 75EE <1> jne @@next 993 00002092 89D8 <1> mov ax,bx 994 00002094 EB0C <1> jmp @@quit 995 <1> @@end_point: 996 00002096 803C00 <1> cmp byte [si],0 997 00002099 7501 <1> jne @@1 998 0000209B 46 <1> inc si 999 <1> @@1: 1000 0000209C 43 <1> inc bx 1001 0000209D 39CB <1> cmp bx,cx 1002 0000209F 72DF <1> jb @@next 1003 000020A1 F9 <1> stc 1004 <1> @@quit: 1005 000020A2 5E <1> pop si 1006 000020A3 5B <1> pop bx 1007 000020A4 C3 <1> ret 1008 <1> ;============================================================================= 1009 <1> ; error_message 1010 <1> ;----------------------------------------------------------------------------- 1011 <1> ; Creates window w/ error message and waits for a key. 1012 <1> ; In: DS:SI -> message 1013 <1> ; [exec_msg_type] -- options: 1014 <1> ; 0 -- open window, wait for a key, close window 1015 <1> ; 1 -- open window only 1016 <1> ; 2 -- close window only 1017 <1> ; Out: --- 1018 <1> ; Modf: --- 1019 <1> ; Call: exec_message 1020 <1> ; Use: msg_title, error_title, msg_box_attr, message_attr 1021 <1> ; 1022 <1> error_message: 1023 000020A5 C706[F68C][6B7E] <1> mov word [msg_title],error_title 1024 000020AB C606[F88C]4F <1> mov byte [msg_box_attr],atErrorBox 1025 000020B0 C606[F98C]4E <1> mov byte [message_attr],atErrorMsg 1026 000020B5 EB10 <1> jmp exec_message 1027 <1> ;============================================================================= 1028 <1> ; message_box 1029 <1> ;----------------------------------------------------------------------------- 1030 <1> ; Creates window w/ message and waits for a key. 1031 <1> ; In: DS:SI -> message 1032 <1> ; [exec_msg_type] -- options: 1033 <1> ; 0 -- open window, wait for a key, close window 1034 <1> ; 1 -- open window only 1035 <1> ; 2 -- close window only 1036 <1> ; Out: --- 1037 <1> ; Modf: --- 1038 <1> ; Call: exec_message 1039 <1> ; Use: msg_title, message_title, msg_box_attr, message_attr 1040 <1> ; 1041 <1> message_box: 1042 000020B7 C706[F68C][607E] <1> mov word [msg_title],message_title 1043 000020BD C606[F88C]1F <1> mov byte [msg_box_attr],atMessageBox 1044 000020C2 C606[F98C]1E <1> mov byte [message_attr],atMessage 1045 <1> ;============================================================================= 1046 <1> ; exec_message 1047 <1> ;------------------------------------------------------------------------------ 1048 <1> ; Creates window w/ message. If length of the message less than 20 chars, 1049 <1> ; width of window is set to 23 chars. 1050 <1> ; In: DS:SI -> message 1051 <1> ; [msg_title] -> title (see open_window for details) 1052 <1> ; [msg_box_attr] -- color of window 1053 <1> ; [message_attr] -- color of message 1054 <1> ; [exec_msg_type] -- options: 1055 <1> ; 0 -- open window, wait for a key, close window 1056 <1> ; 1 -- open window only 1057 <1> ; 2 -- close window only 1058 <1> ; Out: --- 1059 <1> ; Modf: --- 1060 <1> ; Call: beep, pushr, get_cursor, no_sursor, strlen, open_window, write_string, 1061 <1> ; flush_key, read_key, close_window, set_cursor, popr 1062 <1> ; Use: msg_title, message_title, msg_box_attr, message_attr 1063 <1> ; 1064 <1> exec_message: 1065 000020C7 E8AAF9 <1> call beep 1066 000020CA E8D1F8 <1> call pushr 1067 <1> 1068 000020CD 803E[777E]01 <1> cmp byte [exec_msg_type],1 1069 000020D2 7745 <1> ja @@skip_open 1070 <1> 1071 000020D4 E8F001 <1> call get_cursor 1072 000020D7 890E[F28C] <1> mov [exec_message_cx],cx 1073 000020DB E8F401 <1> call no_cursor 1074 000020DE B70A <1> mov bh,10 1075 000020E0 B60C <1> mov dh,12 1076 000020E2 E859F9 <1> call strlen 1077 000020E5 D1E9 <1> shr cx,1 1078 000020E7 B027 <1> mov al,39 1079 000020E9 28C8 <1> sub al,cl ; al=message X 1080 000020EB 80F90A <1> cmp cl,10 1081 000020EE 7302 <1> jae @@1 1082 000020F0 B10A <1> mov cl,10 1083 <1> 1084 <1> @@1: 1085 000020F2 80C102 <1> add cl,2 1086 000020F5 B327 <1> mov bl,39 1087 000020F7 28CB <1> sub bl,cl 1088 000020F9 B227 <1> mov dl,39 1089 000020FB 00CA <1> add dl,cl 1090 <1> 1091 000020FD 8A26[F88C] <1> mov ah,[msg_box_attr] 1092 <1> 1093 00002101 89F5 <1> mov bp,si 1094 00002103 8B36[F68C] <1> mov si,[msg_title] 1095 <1> 1096 00002107 50 <1> push ax 1097 00002108 B001 <1> mov al,1 1098 <1> 1099 0000210A E82E00 <1> call open_window 1100 0000210D 58 <1> pop ax 1101 <1> 1102 0000210E B40B <1> mov ah,11 1103 00002110 8A3E[F98C] <1> mov bh,[message_attr] 1104 00002114 89EE <1> mov si,bp 1105 00002116 E85601 <1> call write_string 1106 <1> 1107 <1> @@skip_open: 1108 00002119 803E[777E]01 <1> cmp byte [exec_msg_type],1 1109 0000211E 7417 <1> je @@skip_close 1110 <1> 1111 00002120 803E[777E]02 <1> cmp byte [exec_msg_type],2 1112 00002125 7406 <1> je @@skip_read_key 1113 <1> 1114 00002127 E830FA <1> call flush_key 1115 0000212A E8F0F9 <1> call read_key 1116 <1> 1117 <1> @@skip_read_key: 1118 0000212D E80801 <1> call close_window 1119 00002130 8B0E[F28C] <1> mov cx,[exec_message_cx] 1120 00002134 E8A801 <1> call set_cursor 1121 <1> 1122 <1> @@skip_close: 1123 00002137 E877F8 <1> call popr 1124 0000213A C3 <1> ret 1125 <1> ;============================================================================= 1126 <1> ; open_window 1127 <1> ;----------------------------------------------------------------------------- 1128 <1> ; Creates window w/ double border. 1129 <1> ; In: BH/BL -- row/column of top left corner 1130 <1> ; DH/DL -- row/column of lower right corner 1131 <1> ; AH -- color of window 1132 <1> ; AL -- mode: 1133 <1> ; 0 -- do not save text under window in buffer 1134 <1> ; any other value -- save text under window in buffer 1135 <1> ; SI -> title. Format of title: 1136 <1> ; length-of-string: byte, color: byte, string: ? bytes 1137 <1> ; Out: --- 1138 <1> ; Modf: --- 1139 <1> ; Call: pushr, open_window_2 1140 <1> ; Use: --- 1141 <1> ; 1142 <1> open_window: 1143 0000213B E860F8 <1> call pushr 1144 0000213E B9[F08B] <1> mov cx,double_border 1145 00002141 EB03 <1> jmp open_window_2 1146 <1> ;============================================================================= 1147 <1> ; open_window_bord 1148 <1> ;----------------------------------------------------------------------------- 1149 <1> ; Creates window w/ arbitary border. 1150 <1> ; In: BH/BL -- row/column of top left corner 1151 <1> ; DH/DL -- row/column of lower right corner 1152 <1> ; AH -- color of window 1153 <1> ; AL -- mode: 1154 <1> ; 0 -- do not save text under window in buffer 1155 <1> ; any other value -- save text under window in buffer 1156 <1> ; SI -> title. Format of title: 1157 <1> ; length-of-string: byte, color: byte, string: ? bytes 1158 <1> ; CX -> border. Format of border: 1159 <1> ; 8 bytes. For example: '╔═╗║║╚═╝'. 1160 <1> ; Out: --- 1161 <1> ; Modf: --- 1162 <1> ; Call: pushr, save_window, get_addr, popr 1163 <1> ; Use: owb_bp, video_seg 1164 <1> ; 1165 <1> open_window_bord: 1166 00002143 E858F8 <1> call pushr 1167 <1> open_window_2: 1168 00002146 89CD <1> mov bp,cx 1169 00002148 50 <1> push ax 1170 00002149 08C0 <1> or al,al 1171 0000214B 7409 <1> jz @@skip_save_window 1172 0000214D 52 <1> push dx 1173 0000214E 81C20201 <1> add dx,0102h 1174 00002152 E8A600 <1> call save_window 1175 00002155 5A <1> pop dx 1176 <1> @@skip_save_window: 1177 00002156 89D8 <1> mov ax,bx 1178 00002158 55 <1> push bp 1179 00002159 E84C01 <1> call get_addr 1180 0000215C 5D <1> pop bp 1181 <1> ; mov di,ax 1182 0000215D A3[FA8C] <1> mov [owb_bp],ax 1183 00002160 8E06[E27E] <1> mov es,[video_seg] 1184 00002164 58 <1> pop ax 1185 00002165 88D1 <1> mov cl,dl 1186 00002167 28D9 <1> sub cl,bl 1187 00002169 B500 <1> mov ch,0 1188 0000216B 49 <1> dec cx 1189 0000216C 3E8A4600 <1> mov al,[ds:bp] ;'╔' 1190 00002170 AB <1> stosw 1191 <1> 1192 00002171 51 <1> push cx 1193 00002172 2A0C <1> sub cl,[si] 1194 00002174 D1E9 <1> shr cx,1 1195 00002176 88CB <1> mov bl,cl 1196 00002178 3E8A4601 <1> mov al,[ds:bp+1] ;'═' 1197 0000217C F3AB <1> rep stosw 1198 <1> 1199 0000217E 50 <1> push ax 1200 0000217F AD <1> lodsw 1201 00002180 00C3 <1> add bl,al 1202 00002182 88C1 <1> mov cl,al 1203 00002184 E304 <1> jcxz @@skip_2 1204 <1> @@next_2: 1205 00002186 AC <1> lodsb 1206 00002187 AB <1> stosw 1207 00002188 E2FC <1> loop @@next_2 1208 <1> @@skip_2: 1209 0000218A 58 <1> pop ax 1210 0000218B 59 <1> pop cx 1211 0000218C 51 <1> push cx 1212 0000218D 28D9 <1> sub cl,bl 1213 0000218F 3E8A4601 <1> mov al,[ds:bp+1] ;'═' 1214 00002193 F3AB <1> rep stosw 1215 00002195 59 <1> pop cx 1216 00002196 3E8A4602 <1> mov al,[ds:bp+2] ;'╗' 1217 0000219A AB <1> stosw 1218 0000219B FEC7 <1> inc bh 1219 <1> @@next: 1220 0000219D 38F7 <1> cmp bh,dh 1221 0000219F 7424 <1> je @@end_loop 1222 000021A1 FEC7 <1> inc bh 1223 000021A3 8106[FA8C]A000 <1> add word [owb_bp],SCR_COLS*2 ;160 1224 000021A9 8B3E[FA8C] <1> mov di,[owb_bp] 1225 000021AD 3E8A4603 <1> mov al,[ds:bp+3] ;'║' 1226 000021B1 AB <1> stosw 1227 000021B2 51 <1> push cx 1228 000021B3 B020 <1> mov al,' ' 1229 000021B5 F3AB <1> rep stosw 1230 000021B7 59 <1> pop cx 1231 000021B8 3E8A4604 <1> mov al,[ds:bp+4] ;'║' 1232 000021BC AB <1> stosw 1233 000021BD B007 <1> mov al,atShadow 1234 000021BF 47 <1> inc di 1235 000021C0 AA <1> stosb 1236 000021C1 47 <1> inc di 1237 000021C2 AA <1> stosb 1238 <1> 1239 000021C3 EBD8 <1> jmp @@next 1240 <1> @@end_loop: 1241 000021C5 8106[FA8C]A000 <1> add word [owb_bp],SCR_COLS*2 ;160 1242 000021CB 8B3E[FA8C] <1> mov di,[owb_bp] 1243 000021CF 3E8A4605 <1> mov al,[ds:bp+5] ;'╚' 1244 000021D3 AB <1> stosw 1245 000021D4 3E8A4606 <1> mov al,[ds:bp+6] ;'═' 1246 000021D8 51 <1> push cx 1247 000021D9 F3AB <1> rep stosw 1248 000021DB 59 <1> pop cx 1249 000021DC 3E8A4607 <1> mov al,[ds:bp+7] ;'╝' 1250 000021E0 AB <1> stosw 1251 000021E1 B007 <1> mov al,atShadow 1252 000021E3 47 <1> inc di 1253 000021E4 AA <1> stosb 1254 000021E5 47 <1> inc di 1255 000021E6 AA <1> stosb 1256 <1> 1257 000021E7 8106[FA8C]A500 <1> add word [owb_bp],SCR_COLS*2+5 ;165 1258 000021ED 8B3E[FA8C] <1> mov di,[owb_bp] 1259 <1> ; mov al,atShadow ;AL == atShadow... 1260 000021F1 41 <1> inc cx 1261 000021F2 41 <1> inc cx 1262 <1> @@next_1: 1263 000021F3 AA <1> stosb 1264 000021F4 47 <1> inc di 1265 000021F5 E2FC <1> loop @@next_1 1266 <1> 1267 000021F7 E8B7F7 <1> call popr 1268 000021FA C3 <1> ret 1269 <1> ;============================================================================= 1270 <1> ; save_window 1271 <1> ;----------------------------------------------------------------------------- 1272 <1> ; Saves rectangular area of screen. 1273 <1> ; In: BH/BL -- row/column of top left corner 1274 <1> ; DH/DL -- row/column of lower right corner 1275 <1> ; [buf_pos] -> buffer 1276 <1> ; Out: [buf_pos], [buf_pos_mark] -> end of saved data 1277 <1> ; Modf: --- 1278 <1> ; Call: pushr, get_addr, popr 1279 <1> ; Use: buf_pos, video_seg, buf_pos_mark 1280 <1> ; 1281 <1> save_window: 1282 000021FB E8A0F7 <1> call pushr 1283 000021FE 89D8 <1> mov ax,bx 1284 00002200 E8A500 <1> call get_addr 1285 00002203 88D1 <1> mov cl,dl 1286 00002205 28D9 <1> sub cl,bl 1287 00002207 B500 <1> mov ch,0 ;CX == width 1288 00002209 41 <1> inc cx 1289 0000220A 0E <1> push cs 1290 0000220B 07 <1> pop es 1291 0000220C 8B3E[E47E] <1> mov di,[buf_pos] 1292 00002210 8E1E[E27E] <1> mov ds,[video_seg] 1293 00002214 53 <1> push bx ;save left/top 1294 00002215 52 <1> push dx ;save right/bottom 1295 <1> @@next: 1296 00002216 89EE <1> mov si,bp 1297 00002218 51 <1> push cx 1298 00002219 F3A5 <1> rep movsw 1299 0000221B 59 <1> pop cx 1300 0000221C 81C5A000 <1> add bp,SCR_COLS*2 1301 00002220 FEC7 <1> inc bh 1302 00002222 38F7 <1> cmp bh,dh 1303 00002224 76F0 <1> jbe @@next 1304 <1> 1305 00002226 58 <1> pop ax ;buffer: ░░░░░░░░rblt.... 1306 00002227 AB <1> stosw ;buf_pos: -----------^ 1307 00002228 58 <1> pop ax 1308 00002229 AB <1> stosw 1309 0000222A 2E893E[E47E] <1> mov [cs:buf_pos],di 1310 0000222F 2E893E[E67E] <1> mov [cs:buf_pos_mark],di 1311 00002234 E87AF7 <1> call popr 1312 00002237 C3 <1> ret 1313 <1> ;============================================================================= 1314 <1> ; close_window, restore_window 1315 <1> ;----------------------------------------------------------------------------- 1316 <1> ; Restores rectangular area of screen. 1317 <1> ; In: [buf_pos] -> end of buffer 1318 <1> ; Out: [buf_pos] -> buffer 1319 <1> ; Modf: --- 1320 <1> ; Call: pushr, get_addr, popr 1321 <1> ; Use: buf_pos, video_seg 1322 <1> ; 1323 <1> close_window: 1324 <1> restore_window: 1325 00002238 E863F7 <1> call pushr 1326 0000223B 8B36[E47E] <1> mov si,[buf_pos] 1327 0000223F FD <1> std 1328 00002240 AD <1> lodsw 1329 00002241 AD <1> lodsw 1330 00002242 93 <1> xchg ax,bx 1331 00002243 AD <1> lodsw 1332 00002244 89C2 <1> mov dx,ax 1333 <1> 1334 00002246 E85F00 <1> call get_addr 1335 00002249 88D1 <1> mov cl,dl 1336 0000224B 28D9 <1> sub cl,bl 1337 0000224D B500 <1> mov ch,0 ; cx=width 1338 0000224F 41 <1> inc cx 1339 00002250 8E06[E27E] <1> mov es,[video_seg] 1340 00002254 FD <1> std ;get_addr set CF 1341 <1> 1342 <1> @@next: 1343 00002255 89EF <1> mov di,bp 1344 00002257 51 <1> push cx 1345 00002258 F3A5 <1> rep movsw 1346 0000225A 59 <1> pop cx 1347 0000225B 81EDA000 <1> sub bp,SCR_COLS*2 1348 0000225F FEC7 <1> inc bh 1349 00002261 38F7 <1> cmp bh,dh 1350 00002263 76F0 <1> jbe @@next 1351 <1> 1352 00002265 FC <1> cld 1353 00002266 AD <1> lodsw 1354 00002267 8936[E47E] <1> mov [buf_pos],si 1355 0000226B E843F7 <1> call popr 1356 0000226E C3 <1> ret 1357 <1> ;============================================================================= 1358 <1> ; write_string 1359 <1> ;----------------------------------------------------------------------------- 1360 <1> ; Writes zero-terminated string directly to video memory. 1361 <1> ; In: AX -- coordinates of string 1362 <1> ; DS:SI -> string 1363 <1> ; BH -- color 1364 <1> ; Out: --- 1365 <1> ; Modf: AX, SI 1366 <1> ; Call: get_addr 1367 <1> ; Use: video_seg 1368 <1> ; 1369 <1> write_string: 1370 0000226F 57 <1> push di 1371 00002270 55 <1> push bp 1372 00002271 06 <1> push es 1373 00002272 E83300 <1> call get_addr 1374 00002275 8E06[E27E] <1> mov es,[video_seg] 1375 00002279 88FC <1> mov ah,bh 1376 <1> @@next: 1377 0000227B AC <1> lodsb 1378 0000227C 3C00 <1> cmp al,0 1379 0000227E 7403 <1> je @@quit 1380 00002280 AB <1> stosw 1381 00002281 EBF8 <1> jmp @@next 1382 <1> @@quit: 1383 00002283 07 <1> pop es 1384 00002284 5D <1> pop bp 1385 00002285 5F <1> pop di 1386 00002286 C3 <1> ret 1387 <1> ;============================================================================= 1388 <1> ; fill_word, fill_byte 1389 <1> ;----------------------------------------------------------------------------- 1390 <1> ; Stores hexadecimal representation of byte or word in video memory. 1391 <1> ; In: fill_byte: 1392 <1> ; AL -- byte 1393 <1> ; fill_word: 1394 <1> ; AX -- word 1395 <1> ; ES:DI -> video memory 1396 <1> ; BH -- color (attribute) 1397 <1> ; Out: --- 1398 <1> ; Modf: DI 1399 <1> ; Call: fill_byte 1400 <1> ; Use: --- 1401 <1> ; 1402 <1> fill_word: 1403 00002287 86C4 <1> xchg al,ah 1404 00002289 E80200 <1> call fill_byte 1405 0000228C 86C4 <1> xchg al,ah 1406 <1> 1407 <1> fill_byte: 1408 0000228E 50 <1> push ax 1409 0000228F 51 <1> push cx 1410 00002290 88FC <1> mov ah,bh 1411 00002292 B104 <1> mov cl,4 1412 <1> @@next: 1413 00002294 50 <1> push ax 1414 00002295 D2E8 <1> shr al,cl 1415 00002297 240F <1> and al,0fh 1416 00002299 3C0A <1> cmp al,10 1417 0000229B 1C69 <1> sbb al,69h 1418 0000229D 2F <1> das 1419 0000229E AB <1> stosw 1420 0000229F 58 <1> pop ax 1421 000022A0 80E904 <1> sub cl,4 1422 000022A3 74EF <1> jz @@next 1423 <1> 1424 000022A5 59 <1> pop cx 1425 000022A6 58 <1> pop ax 1426 000022A7 C3 <1> ret 1427 <1> ;============================================================================= 1428 <1> ; get_addr 1429 <1> ;----------------------------------------------------------------------------- 1430 <1> ; Returns address (offset) of character in video memory. 1431 <1> ; In: AL -- column 1432 <1> ; AH -- row 1433 <1> ; Out: AX, DI, BP -- offset 1434 <1> ; DF cleared 1435 <1> ; Modf: AX, DI, BP 1436 <1> ; Call: --- 1437 <1> ; Use: --- 1438 <1> ; 1439 <1> get_addr: 1440 000022A8 53 <1> push bx 1441 000022A9 89C3 <1> mov bx,ax 1442 000022AB B0A0 <1> mov al,SCR_COLS*2 1443 000022AD F6E7 <1> mul bh 1444 000022AF B700 <1> mov bh,0 1445 000022B1 01D8 <1> add ax,bx 1446 000022B3 01D8 <1> add ax,bx 1447 000022B5 5B <1> pop bx 1448 000022B6 89C7 <1> mov di,ax 1449 000022B8 89C5 <1> mov bp,ax 1450 000022BA FC <1> cld 1451 000022BB C3 <1> ret 1452 <1> ;============================================================================= 1453 <1> ; gotoxy 1454 <1> ;----------------------------------------------------------------------------- 1455 <1> ; Changes position of cursor. 1456 <1> ; In: DL -- column 1457 <1> ; DH -- row 1458 <1> ; Out: --- 1459 <1> ; Modf: --- 1460 <1> ; Call: --- 1461 <1> ; Use: --- 1462 <1> ; 1463 <1> gotoxy: 1464 000022BC 50 <1> push ax 1465 000022BD 53 <1> push bx 1466 000022BE B402 <1> mov ah,2 1467 000022C0 B700 <1> mov bh,0 1468 000022C2 CD10 <1> int 10h 1469 000022C4 5B <1> pop bx 1470 000022C5 58 <1> pop ax 1471 000022C6 C3 <1> ret 1472 <1> ;============================================================================= 1473 <1> ; get_cursor 1474 <1> ;----------------------------------------------------------------------------- 1475 <1> ; Returns position of cursor. 1476 <1> ; In: --- 1477 <1> ; Out: DL -- column 1478 <1> ; DH -- row 1479 <1> ; CX -- shape 1480 <1> ; Modf: CX, DX 1481 <1> ; Call: --- 1482 <1> ; Use: --- 1483 <1> ; 1484 <1> get_cursor: 1485 000022C7 50 <1> push ax 1486 000022C8 53 <1> push bx 1487 000022C9 B403 <1> mov ah,3 1488 000022CB B700 <1> mov bh,0 1489 000022CD CD10 <1> int 10h 1490 000022CF 5B <1> pop bx 1491 000022D0 58 <1> pop ax 1492 000022D1 C3 <1> ret 1493 <1> ;============================================================================= 1494 <1> ; no_cursor, small_cursor, large_cursor, set_cursor 1495 <1> ;----------------------------------------------------------------------------- 1496 <1> ; Turns cursor off, sets cursor like '_', like '█', or reads parameters from CX 1497 <1> ; In: set_cursor: 1498 <1> ; CX -- shape 1499 <1> ; others: 1500 <1> ; --- 1501 <1> ; Out: --- 1502 <1> ; Modf: --- 1503 <1> ; Call: set_cursor 1504 <1> ; Use: --- 1505 <1> ; 1506 <1> no_cursor: 1507 000022D2 B92020 <1> mov cx,2020h ;### 2000h ? 1508 000022D5 EB08 <1> jmp set_cursor 1509 <1> ; 1510 <1> small_cursor: 1511 000022D7 B90706 <1> mov cx,0607h ;### 0d0eh ? 1512 000022DA EB03 <1> jmp set_cursor 1513 <1> ; 1514 <1> large_cursor: 1515 000022DC B90D00 <1> mov cx,000dh ;### 000fh ? 1516 <1> ; 1517 <1> set_cursor: 1518 000022DF 50 <1> push ax 1519 000022E0 B401 <1> mov ah,1 1520 000022E2 CD10 <1> int 10h 1521 000022E4 58 <1> pop ax 1522 000022E5 C3 <1> ret 1523 <1> ;============================================================================= 1524 <1> ; write_message 1525 <1> ;----------------------------------------------------------------------------- 1526 <1> ; Writes $-terminated string to stdout. 1527 <1> ; In: DS:DX -> string 1528 <1> ; Out: --- 1529 <1> ; Modf: AX 1530 <1> ; Call: --- 1531 <1> ; Use: --- 1532 <1> ; 1533 <1> write_message: 1534 000022E6 B409 <1> mov ah,9 1535 000022E8 CD21 <1> int 21h 1536 000022EA C3 <1> ret 1537 <1> ;============================================================================= 1538 <1> ; E0F 1539 <1> ;============================================================================= 1540 <1> 58 %include "dialogs.inc" ;Dialog windows 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; dialogs.inc 7 <1> ; Procedures for creating dialog windows. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; Changelog 28 <1> ;----------------------------------------------------------------------------- 29 <1> ; 2007-02-15 0leg Added comments to all procedures. All variables moved 30 <1> ; to act[u]data.inc 31 <1> ; 2007-03-18 0leg Changes in init_dialog, exec_dialog to support 32 <1> ; optimized data structures. 33 <1> ; 2007-11-11 0leg init_list/draw_list: highlight default string 34 <1> ;============================================================================= 35 <1> 36 <1> 37 <1> ;============================================================================= 38 <1> ; init_dialog 39 <1> ;----------------------------------------------------------------------------- 40 <1> ; Draws dialog window. 41 <1> ; In: DS:SI -> dialog window structure. 42 <1> ; Format of dialog window structure: 43 <1> ; db left, top, right, bottom ;coordinates 44 <1> ; dw ptr-to-title 45 <1> ; db number-of-elements 46 <1> ; db number-of-initial-element (0-based) 47 <1> ; 48 <1> ; Data of 1st element 49 <1> ; ... 50 <1> ; Data of 2nd element 51 <1> ; ... 52 <1> ; 53 <1> ; Format of header of element's data: 54 <1> ; db type-of-element (eg. PUSH_BUTTON) 55 <1> ; db 0 (for alignment and allow loading as a word) 56 <1> ; 57 <1> ; Out: --- 58 <1> ; Modf: --- 59 <1> ; Call: pushr, open_window, popr, init_* 60 <1> ; Use: dlg_win_a, dlg_win_b, video_seg, dlg_items, dlg_active_item, 61 <1> ; dlg_items_data, items_table 62 <1> ; 63 <1> init_dialog: 64 000022EB E8B0F6 <1> call pushr 65 000022EE FC <1> cld 66 000022EF C606[008C]FF <1> mov byte [in_init_dialog], -1 ; enable recording accelerators 67 000022F4 C706[887E][148C] <1> mov word [dialog_accelerators_behind_last], dialog_accelerators 68 <1> ; reset accelerator list 69 <1> ; Should not need to set this here as we should always 70 <1> ; be entered with the last offset already reset. 71 <1> ; Do it anyway to harden against weird edge cases. 72 000022FA E89D05 <1> call reset_accelerator_checkbox_index 73 <1> ; reset checkbox index so we save a 74 <1> ; uniform -1 for non-checkbox items 75 000022FD AD <1> lodsw ;Top/left 76 000022FE A3[2E8D] <1> mov [dlg_win_a],ax 77 00002301 89C3 <1> mov bx,ax 78 00002303 AD <1> lodsw ;Bottom/right 79 00002304 A3[308D] <1> mov [dlg_win_b],ax 80 00002307 89C2 <1> mov dx,ax 81 00002309 AD <1> lodsw ;Ptr to title 82 0000230A 56 <1> push si 83 0000230B 96 <1> xchg si,ax ;Instead of MOV SI,AX 84 0000230C B8007F <1> mov ax,atDialogWindow*256 ;AL==0: Don't save window 85 0000230F E829FE <1> call open_window 86 00002312 5E <1> pop si 87 00002313 8E06[E27E] <1> mov es,[video_seg] 88 00002317 AC <1> lodsb ;Number of elements 89 00002318 98 <1> cbw 90 00002319 89C1 <1> mov cx,ax 91 0000231B A3[328D] <1> mov [dlg_items],ax 92 0000231E E31C <1> jcxz @@quit ;Exit if no elements 93 <1> 94 00002320 8936[348D] <1> mov [dlg_active_item],si ;Ptr to number of active elem. 95 00002324 AC <1> lodsb ;Skip 1 byte 96 <1> ;Now SI points to data of 97 <1> ;1st element 98 00002325 BF[368D] <1> mov di,dlg_items_data 99 00002328 8326[0E8C]00 <1> and word [accelerator_item_index], 0 100 <1> @@next: 101 0000232D AD <1> lodsw ; index in items_table 102 0000232E 8935 <1> mov [di],si ;SI -> data for init_* 103 00002330 AF <1> scasw ; di += 2 (skip dlg_items_data entry) 104 00002331 93 <1> xchg ax, bx 105 00002332 FF97[4C7E] <1> call near [bx + items_table] ;call init_* function, on entry: 106 <1> ;SI -> data; on exit: 107 <1> ;SI -> next table (ie. data skipped) 108 00002336 FF06[0E8C] <1> inc word [accelerator_item_index] 109 0000233A E2F1 <1> loop @@next 110 <1> @@quit: 111 0000233C C606[008C]00 <1> mov byte [in_init_dialog], 0 112 00002341 E86DF6 <1> call popr 113 00002344 C3 <1> ret 114 <1> ;============================================================================= 115 <1> ; exec_dialog, exec_dialog_ 116 <1> ;----------------------------------------------------------------------------- 117 <1> ; Executes dialog. 118 <1> ; In: [dlg_win_a] -- top left corner 119 <1> ; [dlg_win_b] -- lower right corner 120 <1> ; [dlg_items] -- number of items in dialog window 121 <1> ; [dlg_active_item] -> number of active item 122 <1> ; dlg_items_data -- array of pointers to data of items 123 <1> ; Out: ax = exit reason 124 <1> ; number of command if push button pressed, 125 <1> ; CM_CANCEL = 0 if Esc pressed, 126 <1> ; value returned from checkbox toggle if that indicated exit 127 <1> ; ZF = set (ZR) if ax returned as zero, clear (NZ) else 128 <1> ; Modf: exec_dialog: 129 <1> ; AX, SI 130 <1> ; exec_dialog_: 131 <1> ; AX 132 <1> ; Call: pushr, get_cursor, no_cursor, set_cursor, gotoxy, popr, run_* 133 <1> ; Use: dlg_active_item, exec_dialog_cx, exec_dialog_dx, video_seg, dlg_items, 134 <1> ; dlg_items_data, exec_dialog_res, run_push_button, run_static_text, 135 <1> ; items_table 136 <1> ; 137 <1> exec_dialog: 138 00002345 8B36[348D] <1> mov si,[dlg_active_item] 139 00002349 C60400 <1> mov byte [si],0 ; reset active element 140 <1> 141 <1> exec_dialog_: 142 0000234C E84FF6 <1> call pushr 143 0000234F E875FF <1> call get_cursor 144 00002352 52 <1> push dx 145 00002353 51 <1> push cx 146 00002354 E87BFF <1> call no_cursor 147 00002357 8E06[E27E] <1> mov es,[video_seg] 148 0000235B FC <1> cld 149 0000235C 8B0E[328D] <1> mov cx,[dlg_items] 150 00002360 E373 <1> jcxz @@loc_quit 151 <1> 152 00002362 8B1E[348D] <1> mov bx,[dlg_active_item] 153 00002366 8A1F <1> mov bl,[bx] ;Number of active element 154 00002368 B700 <1> mov bh,0 155 <1> 156 <1> @@next: 157 0000236A 51 <1> push cx 158 0000236B E864FF <1> call no_cursor 159 0000236E 59 <1> pop cx 160 0000236F 89DF <1> mov di,bx 161 00002371 01FF <1> add di,di 162 00002373 8BB5[368D] <1> mov si,[dlg_items_data+di] ;Ptr to real data of element 163 <1> 164 00002377 53 <1> push bx 165 00002378 8B5CFE <1> mov bx, word [si - 2] 166 0000237B FF97[4E7E] <1> call near [bx + items_table + 2] ; call run_* function 167 0000237F 5B <1> pop bx 168 <1> 169 00002380 83F801 <1> cmp ax,1 170 00002383 7278 <1> jb @@quit ; if ESC, quit --> 171 00002385 7503E99500 <1> je @@enter ; Enter --> 172 <1> @@find_next: 173 0000238A 83F802 <1> cmp ax,2 ; Tab ? 174 0000238D 7454 <1> je @@inc ; yes, increment item index 175 0000238F 83F804 <1> cmp ax, 4 ; Shift-Tab or accelerator ? 176 00002392 7243 <1> jb @@dec ; Shift-Tab --> 177 00002394 7407 <1> je .accelerator ; returned 4 = accelerator 178 00002396 83F805 <1> cmp ax, 5 179 00002399 7435 <1> je .quit_from_toggle_checkbox ; returned 5 = box callback 180 0000239B EBCD <1> jmp @@next ; neither --> (error condition) 181 <1> 182 <1> .accelerator: 183 0000239D 8B1E[0E8C] <1> mov bx, word [accelerator_item_index] 184 000023A1 A1[108C] <1> mov ax, word [accelerator_checkbox_index] 185 <1> 186 000023A4 89DF <1> mov di, bx 187 000023A6 01FF <1> add di, di 188 000023A8 8BB5[368D] <1> mov si, [dlg_items_data + di] 189 000023AC BF0D1C <1> mov di, kbEnter ; button accelerator: 190 <1> ; press Enter to push button 191 000023AF 807CFE00 <1> cmp byte [si - 2], PUSH_BUTTON ; is it a button ? 192 000023B3 740E <1> je .accelerator_input ; yes --> 193 000023B5 807CFE0C <1> cmp byte [si - 2], CHECK_BOXES ; is it a checkbox ? 194 000023B9 750C <1> jne .accelerator_no_input ; no --> 195 000023BB 83F8FF <1> cmp ax, -1 ; checkbox label ? 196 000023BE 7407 <1> je .accelerator_no_input ; yes --> 197 000023C0 BF2039 <1> mov di, kbSpace ; specific checkbox accelerator: 198 <1> ; press Space to toggle 199 <1> .accelerator_input: 200 000023C3 893E[0A8C] <1> mov word [read_key_insert], di ; store away the keycode 201 <1> 202 <1> .accelerator_no_input: 203 000023C7 40 <1> inc ax ; is it -1 ? 204 000023C8 7401 <1> jz @F ; yes, leave as zero --> 205 000023CA 48 <1> dec ax ; restore value 206 <1> @@: 207 000023CB A3[128C] <1> mov word [active_checkbox_index], ax ; store 208 <1> 209 000023CE EB9A <1> jmp @@next 210 <1> 211 <1> .quit_from_toggle_checkbox: 212 000023D0 A1[0C8C] <1> mov ax, word [toggle_checkbox_ax] ; pass back the ax value 213 000023D3 EB2A <1> jmp .quit_with_ax 214 <1> 215 <1> 216 <1> @@loc_quit: 217 000023D5 EB26 <1> jmp @@quit 218 <1> 219 <1> @@dec: 220 000023D7 09DB <1> or bx,bx ;First element? 221 000023D9 7403 <1> jz @@end ;Yes, move to last element 222 000023DB 4B <1> dec bx ;(Shift+Tab) 223 000023DC EB0C <1> jmp @@check_static 224 <1> @@end: 225 000023DE 89CB <1> mov bx,cx 226 000023E0 4B <1> dec bx 227 000023E1 EB07 <1> jmp @@check_static 228 <1> @@inc: 229 000023E3 43 <1> inc bx 230 000023E4 39CB <1> cmp bx,cx 231 000023E6 7202 <1> jb @@check_static 232 <1> @@home: 233 000023E8 31DB <1> xor bx,bx 234 <1> 235 <1> @@check_static: 236 000023EA 89DF <1> mov di,bx 237 000023EC 01FF <1> add di,di 238 000023EE 8BB5[368D] <1> mov si,[dlg_items_data+di] 239 000023F2 807CFE08 <1> cmp byte [si-2],STATIC_TEXT 240 000023F6 7403E96FFF <1> jne @@next 241 000023FB EB8D <1> jmp @@find_next 242 <1> 243 <1> @@quit: 244 000023FD 31C0 <1> xor ax,ax ; CM_CANCEL 245 <1> .quit_with_ax: 246 000023FF 8B36[348D] <1> mov si,[dlg_active_item] 247 00002403 8A1C <1> mov bl,[si] 248 <1> 249 <1> @@exit: 250 00002405 8B36[348D] <1> mov si,[dlg_active_item] 251 00002409 881C <1> mov [si],bl 252 <1> 253 <1> @@restore_cursor: 254 0000240B A3[168D] <1> mov [exec_dialog_res],ax 255 0000240E 59 <1> pop cx 256 0000240F E8CDFE <1> call set_cursor 257 00002412 5A <1> pop dx 258 00002413 E8A6FE <1> call gotoxy 259 00002416 E898F5 <1> call popr 260 00002419 A1[168D] <1> mov ax,[exec_dialog_res] 261 0000241C 09C0 <1> or ax,ax 262 0000241E C3 <1> ret 263 <1> @@enter: 264 0000241F B80100 <1> mov ax,CM_DEFAULT 265 <1> 266 00002422 807CFE00 <1> cmp byte [si-2],PUSH_BUTTON 267 00002426 75DD <1> jne @@exit 268 00002428 8B4406 <1> mov ax,[si + 6] ;return CM_* if pushbutton was pressed 269 0000242B EBD8 <1> jmp @@exit 270 <1> ;============================================================================= 271 <1> ; init_push_button 272 <1> ;----------------------------------------------------------------------------- 273 <1> ; Initializes button. 274 <1> ; In: DS:SI -> push button structure 275 <1> ; Format of push button structure (7 bytes): 276 <1> ; db column, row ;relative coordinates 277 <1> ; db width-of-button 278 <1> ; db flags byte, BF_DEFAULT is checked 279 <1> ; dw ptr-to-label 280 <1> ; dw number-of-command 281 <1> ; ES -- segment of video buffer 282 <1> ; Out: SI -> structure of next element 283 <1> ; Modf: BX, DL, SI 284 <1> ; Call: draw_push_button 285 <1> ; Use: --- 286 <1> ; 287 <1> ; Note: It doesn't seem like BF_DEFAULT is set anywhere yet. 288 <1> init_push_button: 289 0000242D B720 <1> mov bh,atPushButton 290 0000242F B32E <1> mov bl,atlPushButton 291 00002431 F6440301 <1> test byte [si + 3],BF_DEFAULT 292 00002435 7404 <1> jz @@1 293 00002437 B721 <1> mov bh,atPushButtonDef 294 00002439 B32E <1> mov bl,atlPushButtonDef 295 <1> @@1: 296 0000243B B200 <1> mov dl,0 297 0000243D E80400 <1> call draw_push_button 298 00002440 83C608 <1> add si,8 299 00002443 C3 <1> ret 300 <1> ;============================================================================= 301 <1> ; draw_push_button 302 <1> ;----------------------------------------------------------------------------- 303 <1> ; Draws button. 304 <1> ; In: DS:SI -> push button structure 305 <1> ; BL -- color of hot letter 306 <1> ; BH -- color of text 307 <1> ; DL -- flag: 308 <1> ; 0 -- draw normal button 309 <1> ; 1 -- draw pressed button 310 <1> ; ES -- segment of video buffer 311 <1> ; Out: --- 312 <1> ; Modf: --- 313 <1> ; Call: pushr, get_addr, point_len, draw_text, popr 314 <1> ; Use: dlg_win_a 315 <1> ; 316 <1> draw_push_button: 317 00002444 E857F5 <1> call pushr 318 00002447 AD <1> lodsw ;Coordinates 319 00002448 0306[2E8D] <1> add ax,[dlg_win_a] 320 0000244C E859FE <1> call get_addr 321 0000244F AC <1> lodsb ;Width 322 00002450 98 <1> cbw 323 00002451 46 <1> inc si 324 00002452 89C1 <1> mov cx,ax 325 00002454 51 <1> push cx 326 00002455 B020 <1> mov al,' ' 327 00002457 08D2 <1> or dl,dl 328 00002459 7403 <1> jz @@2 329 0000245B B47F <1> mov ah,atDialogWindow 330 0000245D AB <1> stosw 331 <1> @@2: 332 0000245E 88FC <1> mov ah,bh 333 00002460 F3AB <1> rep stosw 334 00002462 B470 <1> mov ah,atButtonShadow 335 00002464 08D2 <1> or dl,dl 336 00002466 7507 <1> jnz @@3 337 <1> drawchoice '▄','_' 338 00002468 A0[EA8B] <1> mov al, byte [DRAWADDRESS] 339 0000246B AB <1> stosw 340 <1> drawchoice '▀','=' 341 0000246C A0[EB8B] <1> mov al, byte [DRAWADDRESS] 342 <1> @@3: 343 0000246F 89EF <1> mov di,bp 344 00002471 81C7A200 <1> add di,(SCR_COLS+1)*2 ;162 345 00002475 59 <1> pop cx 346 00002476 51 <1> push cx 347 00002477 F3AB <1> rep stosw 348 00002479 AD <1> lodsw ;Ptr to label 349 0000247A 89C6 <1> mov si,ax 350 0000247C E8B204 <1> call point_len 351 0000247F 58 <1> pop ax 352 00002480 D1E8 <1> shr ax,1 353 00002482 D1E9 <1> shr cx,1 354 00002484 29C8 <1> sub ax,cx 355 00002486 7902 <1> jns @@1 356 00002488 31C0 <1> xor ax,ax 357 <1> @@1: 358 0000248A 00D0 <1> add al,dl 359 0000248C 89EF <1> mov di,bp 360 0000248E 01C7 <1> add di,ax 361 00002490 01C7 <1> add di,ax 362 00002492 88FC <1> mov ah,bh 363 00002494 E80400 <1> call draw_text 364 00002497 E817F5 <1> call popr 365 0000249A C3 <1> ret 366 <1> ;============================================================================= 367 <1> ; draw_text 368 <1> ;----------------------------------------------------------------------------- 369 <1> ; Prints ASCIIZ-string using another color for chars enclosed in tildes. 370 <1> ; In: DS:SI -> string 371 <1> ; AH -- main color 372 <1> ; BL -- color for highlighting 373 <1> ; ES:DI -> video buffer 374 <1> ; Out: --- 375 <1> ; Modf: AX, SI, DI 376 <1> ; Call: --- 377 <1> ; Use: --- 378 <1> ; 379 <1> draw_text: 380 0000249B C606[018C]00 <1> mov byte [draw_text_found_accelerator], 0 381 <1> @@next: 382 000024A0 AC <1> lodsb 383 <1> .next_already_loaded: 384 000024A1 3C00 <1> cmp al,0 385 000024A3 7463 <1> je @@done 386 000024A5 3C7E <1> cmp al,'~' 387 000024A7 755C <1> jne @@store 388 000024A9 AC <1> lodsb ; load the potential accelerator 389 000024AA 50 <1> push ax 390 000024AB 06 <1> push es 391 000024AC 57 <1> push di 392 000024AD 1E <1> push ds 393 000024AE 07 <1> pop es 394 000024AF D006[008C] <1> rol byte [in_init_dialog], 1 395 000024B3 7349 <1> jnc .skip ; not recording accelerators --> 396 000024B5 D006[018C] <1> rol byte [draw_text_found_accelerator], 1 397 000024B9 7243 <1> jc .skip ; already found the accelerator --> 398 <1> .accelerator_check: 399 000024BB E88EF5 <1> call upcase ; normalise small letters 400 000024BE 3C30 <1> cmp al, '0' 401 000024C0 723C <1> jb .skip ; neither digit nor letter --> 402 000024C2 3C39 <1> cmp al, '9' 403 000024C4 760B <1> jbe .accelerator_digit ; digit --> 404 000024C6 3C41 <1> cmp al, 'A' 405 000024C8 7234 <1> jb .skip ; neither digit nor letter --> 406 000024CA 3C5A <1> cmp al, 'Z' 407 000024CC 7730 <1> ja .skip ; neither digit nor letter --> 408 <1> ; letter 409 <1> .accelerator_letter: 410 000024CE 2C41 <1> sub al, 'A' ; get 0-based index into alphabet 411 000024D0 A9 <1> db __TEST_IMM16 ; (skip sub) 412 <1> .accelerator_digit: 413 000024D1 2C16 <1> sub al, '0' - 26 ; get 26-based index into digits 414 <1> .accelerator: 415 000024D3 B400 <1> mov ah, 0 ; ax = index into letter table 416 000024D5 93 <1> xchg ax, bx 417 000024D6 8ABF[8E7E] <1> mov bh, byte [accelerator_letter_to_scancode + bx] 418 000024DA B300 <1> mov bl, 0 ; bx = scancode (all of them have low byte = 0) 419 000024DC 93 <1> xchg ax, bx ; ax = scancode 420 000024DD BF[108C] <1> mov di, dialog_accelerators - 4 421 <1> @@: 422 000024E0 AF <1> scasw ; skip item index (in subsequent iterations) 423 000024E1 AF <1> scasw ; skip checkbox index (in subsequent iterations) 424 000024E2 3B3E[887E] <1> cmp di, word [dialog_accelerators_behind_last] 425 000024E6 7305 <1> jae @F ; if reached end of accelerators list yet --> 426 000024E8 AF <1> scasw ; matching this accelerator ? 427 000024E9 75F5 <1> jne @B ; no, continue looking through list --> 428 000024EB EB11 <1> jmp .skip ; error condition: doubled accelerator 429 <1> ; This condition should be checked to avoid overflowing the 430 <1> ; accelerators table, which only holds enough space for 431 <1> ; the 36 possible accelerators (26 letters, 10 digits). 432 <1> 433 <1> @@: 434 000024ED AB <1> stosw ; store scancode 435 000024EE A1[0E8C] <1> mov ax, word [accelerator_item_index] 436 000024F1 AB <1> stosw ; store item index 437 000024F2 A1[108C] <1> mov ax, word [accelerator_checkbox_index] 438 000024F5 AB <1> stosw ; store checkbox index 439 000024F6 893E[887E] <1> mov word [dialog_accelerators_behind_last], di 440 <1> ; -> behind the one we stored 441 000024FA FE0E[018C] <1> dec byte [draw_text_found_accelerator] 442 <1> ; = -1, indicate accelerator found 443 <1> .skip: 444 000024FE 5F <1> pop di 445 000024FF 07 <1> pop es 446 00002500 58 <1> pop ax 447 00002501 86E3 <1> xchg ah, bl ; swap accelerator/normal attribute 448 00002503 EB9C <1> jmp .next_already_loaded 449 <1> @@store: 450 00002505 AB <1> stosw 451 00002506 EB98 <1> jmp @@next 452 <1> @@done: 453 00002508 C3 <1> ret 454 <1> ;============================================================================= 455 <1> ; run_push_button 456 <1> ;----------------------------------------------------------------------------- 457 <1> ; Runs push button. 458 <1> ; In: DS:SI -> push button structure 459 <1> ; ES -- segment of video buffer 460 <1> ; Out: AX -- result: 461 <1> ; 0 -- ESC 462 <1> ; 1 -- Enter 463 <1> ; 2 -- Tab 464 <1> ; 3 -- Shift+Tab 465 <1> ; 4 -- Accelerator 466 <1> ; Modf: AX, DX 467 <1> ; Call: draw_push_button, read_key, check_move_key 468 <1> ; Use: --- 469 <1> ; 470 <1> run_push_button: 471 00002509 53 <1> push bx 472 0000250A 51 <1> push cx 473 0000250B B72F <1> mov bh,atsPushButton 474 0000250D B32E <1> mov bl,atlsPushButton 475 0000250F B200 <1> mov dl,0 476 00002511 E830FF <1> call draw_push_button 477 <1> @@again: 478 00002514 E806F6 <1> call read_key 479 00002517 E82804 <1> call check_move_key 480 0000251A 72F8 <1> jc @@again 481 <1> 482 0000251C B720 <1> mov bh,atPushButton 483 0000251E B32E <1> mov bl,atlPushButton 484 00002520 83F801 <1> cmp ax,1 ;Enter? 485 00002523 7521 <1> jne @@quit 486 00002525 B201 <1> mov dl,1 ;Draw pressed button 487 00002527 E81AFF <1> call draw_push_button 488 0000252A 1E <1> push ds 489 0000252B 50 <1> push ax 490 0000252C 53 <1> push bx 491 0000252D 31C0 <1> xor ax, ax 492 0000252F 8ED8 <1> mov ds, ax 493 00002531 B90400 <1> mov cx, 4 494 <1> .loop_outer: 495 00002534 8B1E6C04 <1> mov bx, word [46Ch] 496 <1> .loop_inner: 497 00002538 E83AF6 <1> call idle 498 0000253B 3B1E6C04 <1> cmp bx, word [46Ch] 499 0000253F 74F7 <1> je .loop_inner 500 00002541 E2F1 <1> loop .loop_outer 501 00002543 5B <1> pop bx 502 00002544 58 <1> pop ax 503 00002545 1F <1> pop ds 504 <1> @@quit: 505 00002546 F6440301 <1> test byte [si + 3],BF_DEFAULT 506 0000254A 7404 <1> jz @@1 507 0000254C B721 <1> mov bh,atPushButtonDef 508 0000254E B32E <1> mov bl,atlPushButtonDef 509 <1> @@1: 510 00002550 B200 <1> mov dl,0 ;Redraw button 511 00002552 E8EFFE <1> call draw_push_button 512 00002555 59 <1> pop cx 513 00002556 5B <1> pop bx 514 00002557 C3 <1> ret 515 <1> ;============================================================================= 516 <1> ; init_input_line 517 <1> ;----------------------------------------------------------------------------- 518 <1> ; Initializes input line. 519 <1> ; In: DS:SI -> input line structure 520 <1> ; Format of input line structure (8 bytes): 521 <1> ; db column, row ;relative coordinates 522 <1> ; dw ptr-to-label 523 <1> ; db width-of-input_line, length-of-string 524 <1> ; dw ptr-to-buffer 525 <1> ; ES -- segment of video buffer 526 <1> ; Out: SI -> structure of next element 527 <1> ; Modf: SI 528 <1> ; Call: draw_input_line 529 <1> ; Use: --- 530 <1> ; 531 <1> init_input_line: 532 00002558 E80400 <1> call draw_input_line 533 0000255B 83C608 <1> add si,8 534 0000255E C3 <1> ret 535 <1> ;============================================================================= 536 <1> ; draw_input_line 537 <1> ;----------------------------------------------------------------------------- 538 <1> ; Draws input line. 539 <1> ; In: DS:SI -> input line structure 540 <1> ; ES -- segment of video buffer 541 <1> ; Out: --- 542 <1> ; Modf: --- 543 <1> ; Call: pushr, get_addr, draw_label, popr 544 <1> ; Use: dlg_win_a 545 <1> ; 546 <1> draw_input_line: 547 0000255F E83CF4 <1> call pushr 548 00002562 AD <1> lodsw ;Coordinates 549 00002563 0306[2E8D] <1> add ax,[dlg_win_a] 550 00002567 E83EFD <1> call get_addr 551 0000256A AD <1> lodsw ;Ptr to label 552 0000256B B200 <1> mov dl,0 ;Normal label 553 0000256D E85A00 <1> call draw_label 554 00002570 B8201F <1> mov ax,atInputLine*256+' ' 555 00002573 AB <1> stosw 556 00002574 AD <1> lodsw ;Width of input line 557 00002575 98 <1> cbw 558 00002576 89C1 <1> mov cx,ax 559 00002578 AD <1> lodsw ;Ptr to buffer 560 00002579 89C6 <1> mov si,ax 561 0000257B B41F <1> mov ah,atInputLine 562 <1> @@next: 563 0000257D AC <1> lodsb 564 0000257E 3C00 <1> cmp al,0 565 00002580 7403 <1> je @@done 566 00002582 AB <1> stosw 567 00002583 E2F8 <1> loop @@next 568 <1> @@done: 569 00002585 B020 <1> mov al,' ' 570 00002587 41 <1> inc cx 571 00002588 F3AB <1> rep stosw 572 0000258A E824F4 <1> call popr 573 0000258D C3 <1> ret 574 <1> ;============================================================================= 575 <1> ; run_input_line 576 <1> ;----------------------------------------------------------------------------- 577 <1> ; Runs input line. 578 <1> ; In: DS:SI -> input line structure 579 <1> ; ES -- segment of video buffer 580 <1> ; Out: AX -- result: 581 <1> ; 0 -- ESC 582 <1> ; 1 -- Enter 583 <1> ; 2 -- Tab 584 <1> ; 3 -- Shift+Tab 585 <1> ; 4 -- Accelerator 586 <1> ; Modf: AX, DI 587 <1> ; Call: get_addr, draw_label, read_line, check_move_key, draw_input_line 588 <1> ; Use: read_exit_keys, dlg_win_a 589 <1> ; 590 <1> run_input_line: 591 0000258E FF36[807E] <1> push word [read_exit_keys] 592 00002592 53 <1> push bx 593 00002593 51 <1> push cx 594 00002594 56 <1> push si 595 00002595 55 <1> push bp 596 00002596 C706[807E][427E] <1> mov word [read_exit_keys],inp_line_exit_keys 597 0000259C AD <1> lodsw ;Coordinates 598 0000259D 0306[2E8D] <1> add ax,[dlg_win_a] 599 000025A1 50 <1> push ax 600 000025A2 E803FD <1> call get_addr 601 000025A5 AD <1> lodsw ;Label 602 000025A6 B201 <1> mov dl,1 ;Selected 603 000025A8 E81F00 <1> call draw_label 604 000025AB AD <1> lodsw ;Width/length 605 000025AC 89C1 <1> mov cx,ax 606 000025AE AD <1> lodsw ;Ptr to buffer 607 000025AF 89C7 <1> mov di,ax 608 000025B1 58 <1> pop ax 609 000025B2 2D0201 <1> sub ax,0102h 610 000025B5 BB1F2F <1> mov bx,atsInputLine*256+atInputLine 611 000025B8 E887F7 <1> call read_line 612 000025BB E88403 <1> call check_move_key 613 000025BE 5D <1> pop bp 614 000025BF 5E <1> pop si 615 000025C0 59 <1> pop cx 616 000025C1 5B <1> pop bx 617 000025C2 E89AFF <1> call draw_input_line 618 000025C5 8F06[807E] <1> pop word [read_exit_keys] 619 000025C9 C3 <1> ret 620 <1> ;============================================================================= 621 <1> ; draw_label 622 <1> ;----------------------------------------------------------------------------- 623 <1> ; Draws label. 624 <1> ; In: AX -> string 625 <1> ; ES:DI -> video memory. Label will be written one row above. 626 <1> ; DL -- flag: 627 <1> ; 0 -- draw normal label 628 <1> ; not 0 -- draw selected label 629 <1> ; Out: --- 630 <1> ; Modf: --- 631 <1> ; Call: pushr, draw_text, popr 632 <1> ; Use: --- 633 <1> ; 634 <1> draw_label: 635 000025CA E8D1F3 <1> call pushr 636 000025CD 81EFA000 <1> sub di,SCR_COLS*2 ;160 637 000025D1 89C6 <1> mov si,ax 638 000025D3 B470 <1> mov ah,atLabel 639 000025D5 B37E <1> mov bl,atlLabel 640 000025D7 08D2 <1> or dl,dl 641 000025D9 7404 <1> jz @@1 642 000025DB B47F <1> mov ah,atsLabel 643 000025DD B37E <1> mov bl,atlsLabel 644 <1> @@1: 645 000025DF E8B9FE <1> call draw_text 646 000025E2 E8CCF3 <1> call popr 647 000025E5 C3 <1> ret 648 <1> ;============================================================================= 649 <1> ; init_list 650 <1> ;----------------------------------------------------------------------------- 651 <1> ; Initializes string list. 652 <1> ; In: DS:SI -> string list structure 653 <1> ; Format of string list structure (8 bytes): 654 <1> ; db column, row ;relative coordinates 655 <1> ; dw ptr-to-label 656 <1> ; dw height-of-list 657 <1> ; dw ptr-to-input-line-structure ;If 0, then 658 <1> ; input line not used 659 <1> ; ES -- segment of video buffer 660 <1> ; Out: SI -> structure of next element 661 <1> ; Out: --- 662 <1> ; Modf: DL, SI 663 <1> ; Call: draw_list 664 <1> ; Use: list_choice, list_first 665 <1> ; 666 <1> init_list: 667 000025E6 C706[268D]FFFF <1> mov word [list_choice],-1 668 000025EC C706[288D]0000 <1> mov word [list_first],0 669 000025F2 C706[2A8D]0000 <1> mov word [cur_str],0 670 000025F8 B200 <1> mov dl,0 671 000025FA E80400 <1> call draw_list 672 000025FD 83C608 <1> add si,8 673 00002600 C3 <1> ret 674 <1> ;============================================================================= 675 <1> ; draw_list 676 <1> ;----------------------------------------------------------------------------- 677 <1> ; Draws string list. 678 <1> ; In: DS:SI -> string list structure 679 <1> ; ES -- segment of video buffer 680 <1> ; DL -- flag: 681 <1> ; 0 -- draw normal list 682 <1> ; not 0 -- draw active list 683 <1> ; [list_first] -- number of top string 684 <1> ; [cur_str] -- number of current string 685 <1> ; Out: --- 686 <1> ; Modf: --- 687 <1> ; Call: pushr, get_addr, draw_label, get_string_addr, popr 688 <1> ; Use: dlg_win_a, list_start, list_height, list_first, string_size, 689 <1> ; string_count, cur_str 690 <1> ; 691 <1> draw_list: 692 00002601 8816[2C8D] <1> mov [list_act],dl 693 00002605 E896F3 <1> call pushr 694 00002608 AD <1> lodsw ;Coordinates 695 00002609 0306[2E8D] <1> add ax,[dlg_win_a] 696 0000260D E898FC <1> call get_addr 697 <1> 698 00002610 AD <1> lodsw ;Ptr to label 699 00002611 E8B6FF <1> call draw_label ;DL used 700 <1> 701 00002614 AD <1> lodsw ;Height of list 702 00002615 A3[228D] <1> mov [list_height],ax 703 00002618 AD <1> lodsw ;Ptr to input line structure 704 00002619 A3[248D] <1> mov [link_string],ax 705 0000261C A1[288D] <1> mov ax,[list_first] 706 0000261F E80503 <1> call get_string_addr 707 00002622 89C6 <1> mov si,ax ;Ptr to first (top) string 708 00002624 8B0E[208D] <1> mov cx,[string_size] 709 00002628 8B16[1C8D] <1> mov dx,[string_count] 710 0000262C 8B1E[228D] <1> mov bx,[list_height] 711 00002630 39DA <1> cmp dx,bx 712 00002632 7602 <1> jbe @@ns 713 00002634 89DA <1> mov dx,bx 714 <1> @@ns: 715 00002636 29D3 <1> sub bx,dx 716 00002638 53 <1> push bx 717 00002639 8B1E[288D] <1> mov bx,[list_first] 718 0000263D 09D2 <1> or dx,dx 719 0000263F 7426 <1> jz @@clear 720 <1> @@next_line: 721 00002641 B430 <1> mov ah,atListNormal 722 00002643 3B1E[2A8D] <1> cmp bx,[cur_str] 723 00002647 750B <1> jne @@2 724 <1> 725 00002649 B43E <1> mov ah,atListDefault 726 0000264B 803E[2C8D]00 <1> cmp byte [list_act],0 727 00002650 7402 <1> je @@2 728 <1> 729 00002652 B42F <1> mov ah,atListSelected 730 <1> @@2: 731 00002654 51 <1> push cx 732 00002655 89EF <1> mov di,bp 733 00002657 B020 <1> mov al,' ' 734 00002659 AB <1> stosw 735 <1> @@next1: 736 0000265A AC <1> lodsb 737 0000265B AB <1> stosw 738 0000265C E2FC <1> loop @@next1 739 <1> 740 0000265E 59 <1> pop cx 741 0000265F 43 <1> inc bx 742 00002660 81C5A000 <1> add bp,SCR_COLS*2 743 00002664 4A <1> dec dx 744 00002665 75DA <1> jnz @@next_line 745 <1> @@clear: 746 00002667 5B <1> pop bx 747 00002668 09DB <1> or bx,bx 748 0000266A 7412 <1> jz @@all 749 <1> @@next_clear: 750 0000266C B430 <1> mov ah,atListNormal 751 0000266E 89EF <1> mov di,bp 752 00002670 51 <1> push cx 753 00002671 41 <1> inc cx 754 00002672 B020 <1> mov al,' ' 755 00002674 F3AB <1> rep stosw 756 00002676 59 <1> pop cx 757 00002677 81C5A000 <1> add bp,SCR_COLS*2 758 0000267B 4B <1> dec bx 759 0000267C 75EE <1> jnz @@next_clear 760 <1> @@all: 761 0000267E E830F3 <1> call popr 762 00002681 C3 <1> ret 763 <1> ;============================================================================= 764 <1> ; run_list 765 <1> ;----------------------------------------------------------------------------- 766 <1> ; Runs string list. 767 <1> ; In: DS:SI -> string list structure 768 <1> ; ES -- segment of video buffer 769 <1> ; Out: AX -- result: 770 <1> ; 0 -- ESC 771 <1> ; 1 -- Enter 772 <1> ; 2 -- Tab 773 <1> ; 3 -- Shift+Tab 774 <1> ; 4 -- Accelerator 775 <1> ; [list_choice] -- selected item 776 <1> ; Modf: AX, DX, DI 777 <1> ; Call: draw_list, read_key, check_move_key, get_string_addr, trim_spaces, 778 <1> ; draw_input_line 779 <1> ; Use: string_count, cur_str, list_first, list_height, list_choice, cur_str, 780 <1> ; link_string, string_size 781 <1> ; 782 <1> run_list: 783 00002682 53 <1> push bx 784 00002683 51 <1> push cx 785 <1> ; xor bx,bx 786 <1> ; xor cx,cx 787 00002684 8B1E[2A8D] <1> mov bx,[cur_str] ;\ 2007-11-12 788 00002688 8B0E[288D] <1> mov cx,[list_first] ;/ 789 0000268C 8B16[1C8D] <1> mov dx,[string_count] 790 <1> @@again: 791 00002690 E8CC00 <1> call @@set_link 792 00002693 891E[2A8D] <1> mov [cur_str],bx 793 00002697 890E[288D] <1> mov [list_first],cx 794 0000269B 52 <1> push dx 795 0000269C B201 <1> mov dl,1 796 0000269E E860FF <1> call draw_list 797 000026A1 5A <1> pop dx 798 000026A2 E878F4 <1> call read_key 799 000026A5 09D2 <1> or dx,dx 800 <1> ; jnz @@not_cmk 801 <1> ; jmp @@cmk 802 <1> ;@@not_cmk: 803 000026A7 747C <1> jz @@cmk ;!!! 804 000026A9 3D0050 <1> cmp ax,kbDown 805 000026AC 750B <1> jne @@1 806 000026AE 43 <1> inc bx 807 000026AF 39D3 <1> cmp bx,dx 808 000026B1 7203 <1> jb @@loc_correct 809 <1> @@end: 810 000026B3 89D3 <1> mov bx,dx 811 000026B5 4B <1> dec bx 812 <1> @@loc_correct: 813 000026B6 E98900 <1> jmp @@correct 814 <1> @@1: 815 000026B9 3D0048 <1> cmp ax,kbUp 816 000026BC 7507 <1> jne @@2 817 000026BE 09DB <1> or bx,bx 818 000026C0 74CE <1> jz @@again 819 000026C2 4B <1> dec bx 820 <1> 821 000026C3 EB7D <1> jmp @@correct 822 <1> @@2: 823 000026C5 3D0047 <1> cmp ax,kbHome 824 000026C8 7504 <1> jne @@3 825 <1> @@home: 826 000026CA 31DB <1> xor bx,bx 827 000026CC EB74 <1> jmp @@correct 828 <1> @@3: 829 000026CE 3D004F <1> cmp ax,kbEnd 830 000026D1 74E0 <1> je @@end 831 000026D3 3D0049 <1> cmp ax,kbPgUp 832 000026D6 751B <1> jne @@4 833 000026D8 09C9 <1> or cx,cx 834 000026DA 74EE <1> jz @@home 835 000026DC 3B0E[228D] <1> cmp cx,[list_height] 836 000026E0 770B <1> ja @@big_up 837 000026E2 31C9 <1> xor cx,cx 838 <1> @@pg_corr: 839 000026E4 89CB <1> mov bx,cx 840 000026E6 031E[228D] <1> add bx,[list_height] 841 000026EA 4B <1> dec bx 842 000026EB EB55 <1> jmp @@correct 843 <1> @@big_up: 844 000026ED 2B0E[228D] <1> sub cx,[list_height] 845 000026F1 EBF1 <1> jmp @@pg_corr 846 <1> @@4: 847 000026F3 3D0051 <1> cmp ax,kbPgDn 848 000026F6 752D <1> jne @@cmk 849 000026F8 3B16[228D] <1> cmp dx,[list_height] 850 000026FC 76B5 <1> jbe @@end 851 000026FE 51 <1> push cx 852 000026FF 030E[228D] <1> add cx,[list_height] 853 00002703 39D1 <1> cmp cx,dx 854 00002705 7503 <1> jne @@5 855 00002707 59 <1> pop cx 856 00002708 EBA9 <1> jmp @@end 857 <1> @@5: 858 0000270A 030E[228D] <1> add cx,[list_height] 859 0000270E 39D1 <1> cmp cx,dx 860 00002710 59 <1> pop cx 861 00002711 760A <1> jbe @@big_down 862 00002713 89D1 <1> mov cx,dx 863 00002715 2B0E[228D] <1> sub cx,[list_height] 864 00002719 89CB <1> mov bx,cx 865 0000271B EB25 <1> jmp @@correct 866 <1> @@big_down: 867 0000271D 030E[228D] <1> add cx,[list_height] 868 00002721 89CB <1> mov bx,cx 869 00002723 EB1D <1> jmp @@correct 870 <1> @@cmk: 871 00002725 E81A02 <1> call check_move_key 872 00002728 7232 <1> jc @@loc_again 873 0000272A 83F801 <1> cmp ax,1 874 0000272D 7507 <1> jne @@quit 875 0000272F 891E[268D] <1> mov [list_choice],bx 876 00002733 E82900 <1> call @@set_link 877 <1> @@quit: 878 00002736 891E[268D] <1> mov [list_choice],bx ;0leg, 2007-02-08 879 <1> ; mov word [cur_str],1 ;!!! 880 0000273A B200 <1> mov dl,0 881 0000273C E8C2FE <1> call draw_list 882 0000273F 59 <1> pop cx 883 00002740 5B <1> pop bx 884 00002741 C3 <1> ret 885 <1> @@correct: 886 00002742 39CB <1> cmp bx,cx 887 00002744 7214 <1> jb @@lower 888 00002746 51 <1> push cx 889 00002747 030E[228D] <1> add cx,[list_height] 890 0000274B 39CB <1> cmp bx,cx 891 0000274D 59 <1> pop cx 892 0000274E 720C <1> jb @@loc_again 893 <1> @@upper: 894 00002750 89D9 <1> mov cx,bx 895 00002752 2B0E[228D] <1> sub cx,[list_height] 896 00002756 41 <1> inc cx 897 00002757 E936FF <1> jmp @@again 898 <1> @@lower: 899 0000275A 89D9 <1> mov cx,bx 900 <1> @@loc_again: 901 0000275C E931FF <1> jmp @@again 902 <1> @@set_link: 903 0000275F 833E[248D]00 <1> cmp word [link_string],0 904 00002764 742C <1> je @@skip_link 905 00002766 09D2 <1> or dx,dx 906 00002768 7428 <1> jz @@skip_link 907 0000276A 50 <1> push ax 908 0000276B 51 <1> push cx 909 0000276C 56 <1> push si 910 0000276D 06 <1> push es 911 0000276E 0E <1> push cs 912 0000276F 07 <1> pop es 913 00002770 8B3E[248D] <1> mov di,[link_string] 914 00002774 57 <1> push di 915 00002775 8B7D06 <1> mov di,[di+6] 916 00002778 89D8 <1> mov ax,bx 917 0000277A E8AA01 <1> call get_string_addr 918 0000277D 89C6 <1> mov si,ax 919 0000277F 8B0E[208D] <1> mov cx,[string_size] 920 00002783 51 <1> push cx 921 00002784 F3A4 <1> rep movsb 922 00002786 59 <1> pop cx 923 00002787 E80900 <1> call trim_spaces 924 0000278A 5E <1> pop si 925 0000278B 07 <1> pop es 926 0000278C E8D0FD <1> call draw_input_line 927 0000278F 5E <1> pop si 928 00002790 59 <1> pop cx 929 00002791 58 <1> pop ax 930 <1> @@skip_link: 931 00002792 C3 <1> ret 932 <1> ;============================================================================= 933 <1> ; trim_spaces 934 <1> ;----------------------------------------------------------------------------- 935 <1> ; Cuts trailing spaces and puts 0 at the end of string. 936 <1> ; In: ES:DI -> end of string 937 <1> ; CX -- length of string 938 <1> ; Out: --- 939 <1> ; Modf: AX, CX 940 <1> ; Call: --- 941 <1> ; Use: --- 942 <1> ; 943 <1> trim_spaces: 944 00002793 57 <1> push di 945 00002794 FD <1> std 946 00002795 4F <1> dec di 947 00002796 B020 <1> mov al,' ' 948 00002798 F3AE <1> repe scasb 949 0000279A 7401 <1> je @@emp 950 0000279C 47 <1> inc di 951 <1> @@emp: 952 0000279D 47 <1> inc di 953 0000279E B000 <1> mov al,0 954 000027A0 FC <1> cld 955 000027A1 AA <1> stosb 956 000027A2 5F <1> pop di 957 000027A3 C3 <1> ret 958 <1> ;============================================================================= 959 <1> ; init_string_list 960 <1> ;----------------------------------------------------------------------------- 961 <1> ; Initializes string list. 962 <1> ; In: AX -- size of string 963 <1> ; Out: --- 964 <1> ; Modf: --- 965 <1> ; Call: --- 966 <1> ; Use: string_size, string_count, string_ptr, string_buffer 967 <1> ; 968 <1> init_string_list: 969 000027A4 A3[208D] <1> mov [string_size],ax 970 000027A7 C706[1C8D]0000 <1> mov word [string_count],0 971 000027AD C706[1E8D][467F] <1> mov word [string_ptr],string_buffer 972 000027B3 C3 <1> ret 973 <1> ;============================================================================= 974 <1> ; add_string 975 <1> ;----------------------------------------------------------------------------- 976 <1> ; Adds string to list. 977 <1> ; In: DS:SI -> string 978 <1> ; Out: CY if string buffer is full 979 <1> ; NC if string added successfully 980 <1> ; Modf: AX 981 <1> ; Call: pushr, popr 982 <1> ; Use: string_buffer, string_size, string_ptr, string_count 983 <1> ; 984 <1> add_string: 985 000027B4 B8[3687] <1> mov ax,string_buffer+STRING_BUF_SIZE 986 000027B7 2B06[208D] <1> sub ax,[string_size] 987 000027BB 3906[1E8D] <1> cmp [string_ptr],ax 988 000027BF 7202 <1> jb @@1 989 000027C1 F9 <1> stc 990 000027C2 C3 <1> ret 991 <1> @@1: 992 000027C3 E8D8F1 <1> call pushr 993 000027C6 0E <1> push cs 994 000027C7 07 <1> pop es 995 000027C8 8B3E[1E8D] <1> mov di,[string_ptr] 996 000027CC FC <1> cld 997 000027CD 8B0E[208D] <1> mov cx,[string_size] 998 <1> @@next: 999 000027D1 AC <1> lodsb 1000 000027D2 3C00 <1> cmp al,0 1001 000027D4 7410 <1> je @@done 1002 000027D6 AA <1> stosb 1003 000027D7 E2F8 <1> loop @@next 1004 <1> @@end: 1005 000027D9 893E[1E8D] <1> mov [string_ptr],di 1006 000027DD FF06[1C8D] <1> inc word [string_count] 1007 000027E1 E8CDF1 <1> call popr 1008 000027E4 F8 <1> clc 1009 000027E5 C3 <1> ret 1010 <1> @@done: 1011 000027E6 B020 <1> mov al,' ' 1012 000027E8 F3AA <1> rep stosb 1013 000027EA EBED <1> jmp @@end 1014 <1> ;============================================================================= 1015 <1> ; init_static_text 1016 <1> ;----------------------------------------------------------------------------- 1017 <1> ; Initializes static text. 1018 <1> ; In: DS:SI -> static text structure 1019 <1> ; Format of static text structure (2 bytes): 1020 <1> ; dw ptr-to-array-of-label-structures 1021 <1> ; 1022 <1> ; Format of array of label structures: 1023 <1> ; db column1, row1 ;relative coordinates 1024 <1> ; dw ptr-to-1st-string 1025 <1> ; ... 1026 <1> ; db columnN, rowN ;relative coordinates 1027 <1> ; dw ptr-to-Nth-string 1028 <1> ; ... 1029 <1> ; dw 0 ;End of array 1030 <1> ; 1031 <1> ; ES -- segment of video buffer 1032 <1> ; Out: SI -> structure of next element 1033 <1> ; Modf: AX, DL 1034 <1> ; Call: get_addr, draw_label 1035 <1> ; Use: dlg_win_a 1036 <1> ; 1037 <1> init_static_text: 1038 000027EC AD <1> lodsw ;Ptr to array 1039 000027ED 56 <1> push si 1040 000027EE 57 <1> push di 1041 000027EF 55 <1> push bp 1042 000027F0 96 <1> xchg ax,si ;Instead of MOV SI,AX 1043 <1> @@next: 1044 000027F1 AD <1> lodsw ;Coordinates 1045 000027F2 09C0 <1> or ax,ax ;0? 1046 000027F4 740F <1> jz @@exit ;Yes, exit 1047 000027F6 0306[2E8D] <1> add ax,[dlg_win_a] 1048 000027FA E8ABFA <1> call get_addr 1049 000027FD AD <1> lodsw ;Ptr to string 1050 000027FE B200 <1> mov dl,0 ;Normal label 1051 00002800 E8C7FD <1> call draw_label 1052 00002803 EBEC <1> jmp @@next 1053 <1> @@exit: 1054 00002805 5D <1> pop bp 1055 00002806 5F <1> pop di 1056 00002807 5E <1> pop si 1057 00002808 C3 <1> ret 1058 <1> ;============================================================================= 1059 <1> ; run_static_text 1060 <1> ;----------------------------------------------------------------------------- 1061 <1> ; Runs static text. 1062 <1> ; In: --- 1063 <1> ; Out: AX -- result: Tab pressed 1064 <1> ; Modf: AX 1065 <1> ; Call: --- 1066 <1> ; Use: --- 1067 <1> ; 1068 <1> run_static_text: 1069 00002809 B80200 <1> mov ax,2 1070 0000280C C3 <1> ret 1071 <1> ;============================================================================= 1072 <1> ; init_check_boxes 1073 <1> ;----------------------------------------------------------------------------- 1074 <1> ; Initializes check boxes. 1075 <1> ; In: DS:SI -> check boxes structure 1076 <1> ; Format of check boxes structure: 1077 <1> ; db column, row ;relative coordinates 1078 <1> ; dw ptr-to-main-label 1079 <1> ; dw number-of-checkboxes 1080 <1> ; dw width-of-labels 1081 <1> ; dw result: 16 bits, 0 bit -- 1st checkbox, 1082 <1> ; 1 bit -- 2nd checkbox, etc. 1083 <1> ; (This is no longer used by default. Legacy 1084 <1> ; users can set the option pointers and masks 1085 <1> ; in order to still use this word.) 1086 <1> ; d? option data, one entry per checkbox 1087 <1> ; For each checkbox, an 8-byte entry of option data: 1088 <1> ; dw pointer to label (ASCIZ string, may contain accelerator) 1089 <1> ; dw pointer to option bits 1090 <1> ; dw mask of option bits 1091 <1> ; dw pointer to call near when toggling option 1092 <1> ; If any of the mask of option bits is set in the word [pointer to option bits] 1093 <1> ; then the checkbox is considered set. To toggle the option, the mask is 1094 <1> ; bitwise XORed into the option bits word. (This implies that all bits of 1095 <1> ; the mask should be in the same state, all set or all cleared.) 1096 <1> ; 1097 <1> ; ES -- segment of video buffer 1098 <1> ; Out: SI -> structure of next element 1099 <1> ; Modf: DL, SI 1100 <1> ; Call: draw_check_boxes 1101 <1> ; Use: cb_cur, cb_si 1102 <1> ; 1103 <1> init_check_boxes: 1104 0000280D B200 <1> mov dl,0 1105 0000280F C606[1A8D]FF <1> mov byte [cb_cur],-1 1106 00002814 E80500 <1> call draw_check_boxes 1107 00002817 8B36[188D] <1> mov si,[cb_si] ;Ptr to structure of next element 1108 0000281B C3 <1> ret 1109 <1> ;============================================================================= 1110 <1> ; draw_check_boxes 1111 <1> ;----------------------------------------------------------------------------- 1112 <1> ; Draws check boxes. 1113 <1> ; In: DS:SI -> check boxes structure 1114 <1> ; ES -- segment of video buffer 1115 <1> ; [cb_cur] -- current check box 1116 <1> ; Out: [cb_si] -> structure of next element 1117 <1> ; Modf: --- 1118 <1> ; Call: pushr, get_addr, draw_label, draw_text, popr 1119 <1> ; Use: dlg_win_a, cb_cur, cb_max, cb_si 1120 <1> ; 1121 <1> draw_check_boxes: 1122 0000281C E87FF1 <1> call pushr 1123 0000281F E87800 <1> call reset_accelerator_checkbox_index 1124 <1> ; reset checkbox index, get -1 for 1125 <1> ; the checkboxes label 1126 00002822 AD <1> lodsw ;Coordinates 1127 00002823 0306[2E8D] <1> add ax,[dlg_win_a] 1128 00002827 E87EFA <1> call get_addr 1129 0000282A AD <1> lodsw ;Ptr to label 1130 0000282B E89CFD <1> call draw_label 1131 0000282E AD <1> lodsw ;Number of checkboxes 1132 0000282F 89C1 <1> mov cx,ax 1133 00002831 2A06[1A8D] <1> sub al,[cb_cur] 1134 00002835 A2[1A8D] <1> mov [cb_cur],al 1135 00002838 AD <1> lodsw ;Width of labels 1136 00002839 A3[188D] <1> mov [cb_max],ax 1137 0000283C AD <1> lodsw ; skip legacy settings word 1138 <1> 1139 <1> @@next: 1140 0000283D D006[008C] <1> rol byte [in_init_dialog], 1 1141 00002841 7304 <1> jnc @F 1142 00002843 FF06[108C] <1> inc word [accelerator_checkbox_index] 1143 <1> ; increment checkbox index (0, 1, ...) 1144 <1> @@: 1145 00002847 AD <1> lodsw ;Ptr to label 1146 00002848 93 <1> xchg ax, bx 1147 00002849 AD <1> lodsw 1148 0000284A 93 <1> xchg ax, bx ; bx -> at word with the option bits 1149 0000284B 92 <1> xchg ax, dx 1150 0000284C AD <1> lodsw 1151 0000284D 92 <1> xchg ax, dx ; dx = option bits 1152 0000284E 46 <1> inc si 1153 0000284F 46 <1> inc si ; skip function pointer 1154 00002850 56 <1> push si 1155 00002851 96 <1> xchg ax,si 1156 <1> 1157 00002852 B430 <1> mov ah,atCheckBoxes 1158 00002854 380E[1A8D] <1> cmp [cb_cur],cl ;Selected? 1159 00002858 7502 <1> jne @@2 1160 0000285A B43F <1> mov ah,atsCheckBoxes;Yes 1161 <1> @@2: 1162 0000285C B020 <1> mov al,' ' 1163 0000285E AB <1> stosw 1164 0000285F B05B <1> mov al,'[' 1165 00002861 AB <1> stosw 1166 00002862 B020 <1> mov al,' ' ; default to write blank 1167 00002864 8517 <1> test word [bx], dx ; currently enabled ? 1168 00002866 7402 <1> jz @@1 ; no --> 1169 00002868 B058 <1> mov al,'X' ; yes, write X 1170 <1> @@1: 1171 0000286A AB <1> stosw 1172 0000286B B05D <1> mov al,']' 1173 0000286D AB <1> stosw 1174 0000286E B020 <1> mov al,' ' 1175 00002870 AB <1> stosw 1176 00002871 B33E <1> mov bl,atlCheckBoxes 1177 00002873 51 <1> push cx 1178 00002874 89F9 <1> mov cx,di 1179 00002876 030E[188D] <1> add cx,[cb_max] 1180 0000287A 030E[188D] <1> add cx,[cb_max] 1181 <1> 1182 0000287E E81AFC <1> call draw_text ;Draw label 1183 <1> 1184 00002881 29F9 <1> sub cx,di 1185 00002883 D1E9 <1> shr cx,1 1186 00002885 B020 <1> mov al,' ' 1187 00002887 F3AB <1> rep stosw 1188 00002889 59 <1> pop cx 1189 0000288A 81C5A000 <1> add bp,SCR_COLS*2 ;160 ;Next line 1190 0000288E 89EF <1> mov di,bp 1191 00002890 5E <1> pop si ;Ptr to next label 1192 <1> 1193 00002891 E2AA <1> loop @@next 1194 <1> 1195 00002893 8936[188D] <1> mov [cb_si],si ;Ptr to structure of next element 1196 00002897 E817F1 <1> call popr 1197 <1> ; Fall through here. 1198 <1> ; reset checkbox index so other 1199 <1> ; items get a uniform -1 1200 <1> reset_accelerator_checkbox_index: 1201 0000289A D006[008C] <1> rol byte [in_init_dialog], 1 1202 0000289E 7305 <1> jnc @F 1203 000028A0 830E[108C]FF <1> or word [accelerator_checkbox_index], -1 1204 <1> @@: 1205 000028A5 C3 <1> retn 1206 <1> 1207 <1> ;============================================================================= 1208 <1> ; run_check_boxes 1209 <1> ;----------------------------------------------------------------------------- 1210 <1> ; Runs check boxes. 1211 <1> ; In: DS:SI -> check boxes structure 1212 <1> ; ES -- segment of video buffer 1213 <1> ; Out: AX -- result: 1214 <1> ; 0 -- ESC 1215 <1> ; 1 -- Enter 1216 <1> ; 2 -- Tab 1217 <1> ; 3 -- Shift+Tab 1218 <1> ; 4 -- Accelerator 1219 <1> ; 5 -- Checkbox toggle callback indicated to exit 1220 <1> ; `result' field in check boxes structure contains result 1221 <1> ; Modf: AX, DX 1222 <1> ; Call: small_cursor, gotoxy, draw_check_boxes, read_key, check_move_key 1223 <1> ; Use: dlg_win_a, cb_cur 1224 <1> ; 1225 <1> run_check_boxes: 1226 000028A6 53 <1> push bx 1227 000028A7 51 <1> push cx 1228 000028A8 E82CFA <1> call small_cursor 1229 000028AB 31C9 <1> xor cx, cx 1230 000028AD 870E[128C] <1> xchg cx, word [active_checkbox_index] 1231 <1> @@again: 1232 000028B1 8B14 <1> mov dx,[si] ;Coordinates 1233 000028B3 0316[2E8D] <1> add dx,[dlg_win_a] 1234 000028B7 00CE <1> add dh,cl ;Current checkbox 1235 000028B9 42 <1> inc dx 1236 000028BA 42 <1> inc dx 1237 000028BB E8FEF9 <1> call gotoxy 1238 000028BE B201 <1> mov dl,1 1239 000028C0 880E[1A8D] <1> mov [cb_cur],cl ;Current checkbox 1240 000028C4 E855FF <1> call draw_check_boxes 1241 <1> 1242 000028C7 E853F2 <1> call read_key 1243 000028CA 3D0050 <1> cmp ax,kbDown 1244 000028CD 750A <1> jne @@d 1245 000028CF 41 <1> inc cx 1246 000028D0 3B4C04 <1> cmp cx,[si+4] ;Number of check boxes 1247 000028D3 72DC <1> jb @@again 1248 000028D5 31C9 <1> xor cx,cx 1249 000028D7 EBD8 <1> jmp @@again 1250 <1> @@d: 1251 000028D9 3D0048 <1> cmp ax,kbUp 1252 000028DC 7509 <1> jne @@u 1253 000028DE 49 <1> dec cx 1254 000028DF 79D0 <1> jns @@again 1255 000028E1 8B4C04 <1> mov cx,[si+4] ;Number of check boxes 1256 000028E4 49 <1> dec cx 1257 000028E5 EBCA <1> jmp @@again 1258 <1> @@u: 1259 000028E7 3D2039 <1> cmp ax,kbSpace 1260 000028EA 7529 <1> jne @@s 1261 000028EC 89CB <1> mov bx, cx 1262 000028EE 01DB <1> add bx, bx ; times 2 1263 000028F0 01DB <1> add bx, bx ; times 4 1264 000028F2 01DB <1> add bx, bx ; times 8 1265 000028F4 8D580C <1> lea bx, [si + 10 + bx + 2] ; si + 10 -> checkbox labels/pointers 1266 <1> ; bx indicates which checkbox 1267 <1> ; + 2 to skip label 1268 000028F7 8B4702 <1> mov ax, word [bx + 2] ; get bit mask to toggle 1269 000028FA 53 <1> push bx 1270 000028FB 8B1F <1> mov bx, word [bx] ; get pointer to option data 1271 000028FD 3107 <1> xor word [bx], ax ; toggle option 1272 000028FF 5B <1> pop bx 1273 00002900 31C0 <1> xor ax, ax ; (NC) 1274 00002902 FF5704 <1> call near [bx + 4] ; call function pointer after toggling 1275 00002905 7202 <1> jc @F ; if CY exit with result == 5 --> 1276 00002907 EBA8 <1> jmp @@again 1277 <1> 1278 <1> @@: 1279 00002909 A3[0C8C] <1> mov word [toggle_checkbox_ax], ax 1280 <1> ; pass ax to exec_dialog caller 1281 0000290C 890E[128C] <1> mov word [active_checkbox_index], cx 1282 <1> ; remember the active checkbox 1283 00002910 B80500 <1> mov ax, 5 ; result 5 1284 00002913 EB0F <1> jmp .exit 1285 <1> @@s: 1286 00002915 E82A00 <1> call check_move_key 1287 00002918 7297 <1> jc @@again 1288 0000291A B200 <1> mov dl,0 ;Inactive label 1289 0000291C C606[1A8D]FF <1> mov byte [cb_cur],-1;Inactive check boxes 1290 00002921 E8F8FE <1> call draw_check_boxes 1291 <1> .exit: 1292 00002924 59 <1> pop cx 1293 00002925 5B <1> pop bx 1294 <1> emptyfunction: 1295 00002926 C3 <1> retn 1296 <1> ;============================================================================= 1297 <1> 1298 <1> ;~ifndef __ACT__ 1299 <1> ;~;---------------------------- Radio Buttons ----------------------------------- 1300 <1> ;~;------------------------------------------------------------------------------ 1301 <1> ;~InitRadioButtons proc 1302 <1> ;~ mov dl,0 1303 <1> ;~ call DrawRadioButtons 1304 <1> ;~ mov si,CBSI 1305 <1> ;~ ret 1306 <1> ;~endp 1307 <1> ;~ 1308 <1> ;~DrawRadioButtons proc 1309 <1> ;~ call pushr 1310 <1> ;~ lodsw 1311 <1> ;~ add ax,DlgWinA 1312 <1> ;~ call get_addr 1313 <1> ;~; mov di,ax 1314 <1> ;~; mov bp,ax 1315 <1> ;~ lodsw 1316 <1> ;~ call DrawLabel 1317 <1> ;~ lodsw 1318 <1> ;~ mov cx,ax 1319 <1> ;~; sub al,CBcur 1320 <1> ;~; mov CBcur,al 1321 <1> ;~ lodsw 1322 <1> ;~ mov CBmax,ax 1323 <1> ;~ lodsw 1324 <1> ;~ mov bl,dl 1325 <1> ;~ mov dx,cx 1326 <1> ;~ sub dx,ax ; pos 1327 <1> ;~ mov dh,bl 1328 <1> ;~@@Next: 1329 <1> ;~ mov ah,atRadioButtons 1330 <1> ;~ mov bh,' ' 1331 <1> ;~ cmp dl,cl 1332 <1> ;~ jne @@2 1333 <1> ;~ mov bh,7 1334 <1> ;~ or dh,dh 1335 <1> ;~ jz @@2 1336 <1> ;~ mov ah,atsRadioButtons 1337 <1> ;~@@2: 1338 <1> ;~ mov al,' ' 1339 <1> ;~ stosw 1340 <1> ;~ mov al,'(' 1341 <1> ;~ stosw 1342 <1> ;~ mov al,bh 1343 <1> ;~ stosw 1344 <1> ;~ mov al,')' 1345 <1> ;~ stosw 1346 <1> ;~ mov al,' ' 1347 <1> ;~ stosw 1348 <1> ;~ mov bl,atlRadioButtons 1349 <1> ;~ push cx 1350 <1> ;~ mov cx,di 1351 <1> ;~ add cx,CBmax 1352 <1> ;~ add cx,CBmax 1353 <1> ;~ call DrawText 1354 <1> ;~ sub cx,di 1355 <1> ;~ shr cx,1 1356 <1> ;~ mov al,' ' 1357 <1> ;~ rep stosw 1358 <1> ;~ pop cx 1359 <1> ;~ add bp,160 1360 <1> ;~ mov di,bp 1361 <1> ;~ loop @@Next 1362 <1> ;~ 1363 <1> ;~ mov CBSI,si 1364 <1> ;~ call popr 1365 <1> ;~ ret 1366 <1> ;~endp 1367 <1> ;~ 1368 <1> ;~RunRadioButtons proc 1369 <1> ;~ push bx cx 1370 <1> ;~ mov cx,0607h 1371 <1> ;~ call set_cursor 1372 <1> ;~ mov cx,[si+8] 1373 <1> ;~@@Again: 1374 <1> ;~ mov dx,[si] 1375 <1> ;~ add dx,DlgWinA 1376 <1> ;~ add dh,cl 1377 <1> ;~ inc dx 1378 <1> ;~ inc dx 1379 <1> ;~ call gotoxy 1380 <1> ;~ mov dl,1 1381 <1> ;~ mov [si+8],cx 1382 <1> ;~ call DrawRadioButtons 1383 <1> ;~ 1384 <1> ;~ call read_key 1385 <1> ;~ cmp ax,kbDown 1386 <1> ;~ jne @@D 1387 <1> ;~ inc cx 1388 <1> ;~ cmp cx,[si+4] 1389 <1> ;~ jb @@Again 1390 <1> ;~ xor cx,cx 1391 <1> ;~ jmp @@Again 1392 <1> ;~@@D: 1393 <1> ;~ cmp ax,kbUp 1394 <1> ;~ jne @@U 1395 <1> ;~ dec cx 1396 <1> ;~ jns @@Again 1397 <1> ;~ mov cx,[si+4] 1398 <1> ;~ dec cx 1399 <1> ;~ jmp @@Again 1400 <1> ;~@@U: 1401 <1> ;~ call CheckMoveKey 1402 <1> ;~ jc @@Again 1403 <1> ;~ mov dl,0 1404 <1> ;~ mov CBcur,-1 1405 <1> ;~ call DrawRadioButtons 1406 <1> ;~ pop cx bx 1407 <1> ;~ ret 1408 <1> ;~endp 1409 <1> ;~ 1410 <1> ;~endif 1411 <1> 1412 <1> ;============================================================================= 1413 <1> ; get_string_addr 1414 <1> ;----------------------------------------------------------------------------- 1415 <1> ; Returns address of string in string buffer. 1416 <1> ; In: AX -- number of string 1417 <1> ; Out: AX -> string 1418 <1> ; Modf: AX 1419 <1> ; Call: --- 1420 <1> ; Use: string_size, string_buffer 1421 <1> ; 1422 <1> get_string_addr: 1423 00002927 52 <1> push dx 1424 00002928 F726[208D] <1> mul word [string_size] 1425 0000292C 05[467F] <1> add ax,string_buffer 1426 0000292F 5A <1> pop dx 1427 00002930 C3 <1> ret 1428 <1> ;============================================================================= 1429 <1> ; point_len 1430 <1> ;----------------------------------------------------------------------------- 1431 <1> ; Returns length of string, not counting tildes. 1432 <1> ; In: DS:SI -> string 1433 <1> ; Out: CX -- length 1434 <1> ; Modf: AL, CX 1435 <1> ; Call: --- 1436 <1> ; Use: --- 1437 <1> ; 1438 <1> point_len: 1439 00002931 31C9 <1> xor cx,cx 1440 00002933 56 <1> push si 1441 <1> @@next: 1442 00002934 AC <1> lodsb 1443 00002935 3C00 <1> cmp al,0 1444 00002937 7407 <1> je @@done 1445 00002939 3C7E <1> cmp al,'~' 1446 0000293B 74F7 <1> je @@next 1447 0000293D 41 <1> inc cx 1448 0000293E EBF4 <1> jmp @@next 1449 <1> @@done: 1450 00002940 5E <1> pop si 1451 00002941 C3 <1> ret 1452 <1> ;============================================================================= 1453 <1> ; check_move_key 1454 <1> ;----------------------------------------------------------------------------- 1455 <1> ; Checks if ESC, Enter, Tab or Shift+Tab was pressed. 1456 <1> ; In: AX -- ASCII/scan codes 1457 <1> ; Out: NC -- one of the following keys was pressed 1458 <1> ; AX -- result: 1459 <1> ; 0 -- ESC 1460 <1> ; 1 -- Enter 1461 <1> ; 2 -- Tab 1462 <1> ; 3 -- Shift+Tab 1463 <1> ; 4 -- accelerator, 1464 <1> ; item index in word [accelerator_item_index], 1465 <1> ; checkbox index in word [accelerator_checkbox_index] 1466 <1> ; (-1 if checkbox label or non-checkbox item) 1467 <1> ; CY -- another key was pressed 1468 <1> ; Modf: AX 1469 <1> ; Call: --- 1470 <1> ; Use: --- 1471 <1> ; 1472 <1> check_move_key: 1473 00002942 3D1B01 <1> cmp ax,kbEsc 1474 00002945 7439 <1> je @@0 1475 00002947 3D0D1C <1> cmp ax,kbEnter 1476 0000294A 7437 <1> je @@1 1477 0000294C 3D090F <1> cmp ax,kbTab 1478 0000294F 7436 <1> je @@2 1479 00002951 3D000F <1> cmp ax,kbShiftTab 1480 00002954 7435 <1> je @@3 1481 <1> 1482 00002956 56 <1> push si 1483 00002957 53 <1> push bx 1484 00002958 52 <1> push dx 1485 00002959 93 <1> xchg bx, ax ; bx = keycode entered 1486 0000295A BE[148C] <1> mov si, dialog_accelerators ; -> accelerator table 1487 <1> @@: 1488 0000295D 3B36[887E] <1> cmp si, word [dialog_accelerators_behind_last] 1489 <1> ; done checking table ? 1490 00002961 7317 <1> jae .end ; yes --> 1491 00002963 AD <1> lodsw ; load accelerator keycode to check 1492 00002964 39D8 <1> cmp ax, bx ; check 1493 00002966 AD <1> lodsw ; skip / load item index 1494 00002967 92 <1> xchg ax, dx 1495 00002968 AD <1> lodsw ; skip / load checkbox index 1496 00002969 92 <1> xchg ax, dx 1497 0000296A 75F1 <1> jne @B ; not yet found, loop --> 1498 <1> ; (ZR, NC) 1499 <1> .accelerator: 1500 0000296C A3[0E8C] <1> mov word [accelerator_item_index], ax 1501 0000296F 8916[108C] <1> mov word [accelerator_checkbox_index], dx 1502 00002973 5A <1> pop dx 1503 00002974 5B <1> pop bx 1504 00002975 5E <1> pop si 1505 00002976 B80400 <1> mov ax, 4 1506 00002979 C3 <1> retn 1507 <1> 1508 <1> .end: 1509 0000297A 93 <1> xchg ax, bx ; restore ax (in case anyone uses it) 1510 0000297B 5A <1> pop dx 1511 0000297C 5B <1> pop bx 1512 0000297D 5E <1> pop si 1513 0000297E F9 <1> stc 1514 0000297F C3 <1> ret 1515 <1> @@0: 1516 00002980 31C0 <1> xor ax,ax 1517 00002982 C3 <1> ret 1518 <1> @@1: 1519 00002983 B80100 <1> mov ax,1 1520 00002986 C3 <1> ret 1521 <1> @@2: 1522 00002987 B80200 <1> mov ax,2 1523 0000298A C3 <1> ret 1524 <1> @@3: 1525 0000298B B80300 <1> mov ax,3 1526 0000298E C3 <1> ret 1527 <1> ;============================================================================= 1528 <1> ; E0F 1529 <1> ;============================================================================= 1530 <1> 1531 <1> 59 %include "video.inc" ;Saving/restoring screen 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ; Some procedures based on code by M.Martynov, A.Ilyushin, S.Gorokhov. 6 <1> ;----------------------------------------------------------------------------- 7 <1> ; video.inc 8 <1> ; Procedures for saving/restoring screen and font. 9 <1> ;----------------------------------------------------------------------------- 10 <1> ; This program is free software; you can redistribute it and/or 11 <1> ; modify it under the terms of the GNU General Public License 12 <1> ; as published by the Free Software Foundation; either version 2 13 <1> ; of the License, or (at your option) any later version. 14 <1> ; 15 <1> ; This program is distributed in the hope that it will be useful, 16 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 <1> ; GNU General Public License for more details. 19 <1> ; 20 <1> ; You should have received a copy of the GNU General Public License 21 <1> ; along with this program; if not, write to the Free Software 22 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 23 <1> ; 02110-1301 USA 24 <1> ;============================================================================= 25 <1> 26 <1> 27 <1> ;============================================================================= 28 <1> ; Changelog 29 <1> ;----------------------------------------------------------------------------- 30 <1> ; 2007-02-27 0leg {save,restore}_screen: SCR_ROWS -> MAX_SCR_ROWS. 31 <1> ;============================================================================= 32 <1> 33 <1> 34 <1> ;============================================================================= 35 <1> ; Format of table used by save_mode/set_mode 36 <1> ;----------------------------------------------------------------------------- 37 <1> ; V G A r e g i s t e r s 38 <1> ;Sequencer registers 05h bytes +00h 39 <1> ;CRT controller registers 1ah bytes +05h 40 <1> ;Attribute controller registers 15h bytes +1fh 41 <1> ;Graphics controller registers 0ah bytes +34h 42 <1> ;DAC registers 30h bytes +3eh 43 <1> ;Feature register 01h byte +6eh 44 <1> ;Miscellaneous 01h byte +6fh 45 <1> ;PEL mask 01h byte +70h 46 <1> ;----------------------------------------------------------------------------- 47 <1> ; B I O S v a r i a b l e s 48 <1> ;Cursor position for page 0 02h bytes +71h 49 <1> ;Screen width in columns 02h bytes +73h 50 <1> ;Lines per char 02h bytes +75h 51 <1> ;Last line number 01h byte +77h 52 <1> ;Video mode number 01h byte +78h 53 <1> ;----------------------------------------------------------------------------- 54 <1> ; Total bytes: 79h (121 dec) 55 <1> ;----------------------------------------------------------------------------- 56 <1> 57 <1> 58 <1> ;============================================================================= 59 <1> ; xchg_planes 60 <1> ;----------------------------------------------------------------------------- 61 <1> ; Exchanges font, chars, and attributes 62 <1> ; 63 <1> xchg_planes: 64 0000298F FC <1> cld 65 00002990 1E <1> push ds 66 00002991 06 <1> push es 67 00002992 1E <1> push ds 68 00002993 07 <1> pop es ;ES:DI -> data 69 00002994 BF[94A5] <1> mov di,font 70 00002997 B800A0 <1> mov ax,0a000h 71 0000299A 8ED8 <1> mov ds,ax 72 0000299C 31F6 <1> xor si,si ;DS:SI -> screen 73 0000299E BB0204 <1> mov bx,0402h ;2nd plane (font) 74 000029A1 E84100 <1> call set_regs 75 000029A4 BB0001 <1> mov bx,256 ;Number of characters 76 <1> @@10: 77 000029A7 B91000 <1> mov cx,16 ;Bytes per character 78 <1> @@20: 79 000029AA E82400 <1> call xchg_esdi_dssi 80 000029AD A6 <1> cmpsb ;OPTIMIZE: instead of INC SI; INC DI 81 000029AE E2FA <1> loop @@20 82 000029B0 83C610 <1> add si,16 83 000029B3 4B <1> dec bx 84 000029B4 75F1 <1> jnz @@10 85 <1> 86 000029B6 BF[F395] <1> mov di,old_screen 87 000029B9 BB0001 <1> mov bx,0100h 88 000029BC E82600 <1> call set_regs 89 000029BF E81700 <1> call video_xchg 90 <1> 91 000029C2 BF[F495] <1> mov di,old_screen+1 92 000029C5 BB0102 <1> mov bx,0201h 93 000029C8 E81A00 <1> call set_regs 94 000029CB E80B00 <1> call video_xchg 95 <1> 96 000029CE 07 <1> pop es 97 000029CF 1F <1> pop ds 98 000029D0 C3 <1> ret 99 <1> ;============================================================================= 100 <1> ; xchg_esdi_dssi 101 <1> ;----------------------------------------------------------------------------- 102 <1> xchg_esdi_dssi: 103 000029D1 8A04 <1> mov al,[si] 104 000029D3 268605 <1> xchg al,[es:di] 105 000029D6 8804 <1> mov [si],al 106 000029D8 C3 <1> ret 107 <1> ;============================================================================= 108 <1> ; video_xchg 109 <1> ;----------------------------------------------------------------------------- 110 <1> ; Exchanges or saves chars or attributes 111 <1> ; 112 <1> video_xchg: 113 000029D9 B9D007 <1> mov cx,SCR_COLS*SCR_ROWS 114 000029DC 31F6 <1> xor si,si 115 <1> @@30: 116 000029DE E8F0FF <1> call xchg_esdi_dssi 117 000029E1 A7 <1> cmpsw ;OPTIMIZE: instead of 118 000029E2 E2FA <1> loop @@30 ;2*[INC SI; INC DI] 119 000029E4 C3 <1> ret 120 <1> ;============================================================================= 121 <1> ; set_regs 122 <1> ;----------------------------------------------------------------------------- 123 <1> ; Performs VGA registers setting to read/write font/chars 124 <1> ; 125 <1> set_regs: 126 000029E5 BAC403 <1> mov dx,03c4h 127 000029E8 B002 <1> mov al,02h ;Map enable 128 000029EA 88FC <1> mov ah,bh 129 000029EC EF <1> out dx,ax 130 000029ED E8E300 <1> call dummy 131 000029F0 B80407 <1> mov ax,0704h 132 000029F3 EF <1> out dx,ax 133 000029F4 E8DC00 <1> call dummy 134 000029F7 B001 <1> mov al,01h 135 000029F9 EE <1> out dx,al 136 000029FA E8D600 <1> call dummy 137 000029FD 42 <1> inc dx 138 000029FE EC <1> in al,dx 139 000029FF E8D100 <1> call dummy 140 00002A02 0C20 <1> or al,20h 141 00002A04 EE <1> out dx,al 142 00002A05 E8CB00 <1> call dummy 143 <1> 144 00002A08 BACE03 <1> mov dx,03ceh 145 00002A0B B004 <1> mov al,04h 146 00002A0D 88DC <1> mov ah,bl ;Plane to read 147 00002A0F EF <1> out dx,ax 148 00002A10 E8C000 <1> call dummy 149 00002A13 B80500 <1> mov ax,0005h 150 00002A16 EF <1> out dx,ax 151 00002A17 E8B900 <1> call dummy 152 00002A1A B80604 <1> mov ax,0406h 153 00002A1D EF <1> out dx,ax 154 00002A1E E8B200 <1> call dummy 155 00002A21 B80100 <1> mov ax,0001h 156 00002A24 EF <1> out dx,ax 157 00002A25 E8AB00 <1> call dummy 158 00002A28 B003 <1> mov al,03h 159 00002A2A EF <1> out dx,ax 160 00002A2B E8A500 <1> call dummy 161 00002A2E B808FF <1> mov ax,0ff08h 162 00002A31 EF <1> out dx,ax 163 00002A32 C3 <1> ret 164 <1> ;============================================================================= 165 <1> ; save_mode 166 <1> ;----------------------------------------------------------------------------- 167 <1> ; Saves video mode 168 <1> ; 169 <1> save_mode: 170 00002A33 FC <1> cld 171 <1> ;----------------------------------------------------------------------------- 172 <1> ; MISCELLANEOUS 173 <1> ;----------------------------------------------------------------------------- 174 00002A34 BACC03 <1> mov dx,03cch ;for reading 175 00002A37 EC <1> in al,dx 176 00002A38 E89800 <1> call dummy 177 00002A3B 2688456F <1> mov [es:di+6fh],al 178 00002A3F 0C01 <1> or al,1 ;color adapter (3d?h) 179 00002A41 B2C2 <1> mov dl,0c2h ;for writing 180 00002A43 EE <1> out dx,al 181 00002A44 E88C00 <1> call dummy 182 <1> ;----------------------------------------------------------------------------- 183 <1> ; Wait for vertical retrace 184 <1> ;----------------------------------------------------------------------------- 185 00002A47 B2DA <1> mov dl,0dah 186 <1> @@90: 187 00002A49 EC <1> in al,dx 188 00002A4A A808 <1> test al,00001000b 189 00002A4C 75FB <1> jnz @@90 190 <1> @@91: 191 00002A4E EC <1> in al,dx 192 00002A4F A808 <1> test al,00001000b 193 00002A51 74FB <1> jz @@91 194 <1> ;----------------------------------------------------------------------------- 195 <1> ; SEQUENCER 196 <1> ;----------------------------------------------------------------------------- 197 00002A53 B2C4 <1> mov dl,0c4h 198 00002A55 B90400 <1> mov cx,4 199 00002A58 B401 <1> mov ah,01 200 00002A5A E87700 <1> call save_vga_regs 201 <1> ;----------------------------------------------------------------------------- 202 <1> ; CRTC 203 <1> ;----------------------------------------------------------------------------- 204 00002A5D B2D4 <1> mov dl,0d4h 205 00002A5F B119 <1> mov cl,19h 206 00002A61 B400 <1> mov ah,00 207 00002A63 E86E00 <1> call save_vga_regs 208 <1> ;----------------------------------------------------------------------------- 209 <1> ; AC 210 <1> ;----------------------------------------------------------------------------- 211 00002A66 B2C0 <1> mov dl,0c0h 212 00002A68 B115 <1> mov cl,15h 213 00002A6A B400 <1> mov ah,00 214 <1> @@30: 215 00002A6C 52 <1> push dx 216 00002A6D B2DA <1> mov dl,0dah 217 00002A6F EC <1> in al,dx ; clear flip/flop 218 00002A70 5A <1> pop dx 219 00002A71 88E0 <1> mov al,ah 220 00002A73 EE <1> out dx,al 221 00002A74 E85C00 <1> call dummy 222 00002A77 42 <1> inc dx 223 00002A78 FEC4 <1> inc ah 224 00002A7A EC <1> in al,dx 225 00002A7B 4A <1> dec dx 226 00002A7C AA <1> stosb 227 00002A7D E2ED <1> loop @@30 228 <1> 229 00002A7F B2DA <1> mov dl,0dah 230 00002A81 EC <1> in al,dx ; clear flip/flop 231 00002A82 E84E00 <1> call dummy 232 00002A85 B2C0 <1> mov dl,0c0h 233 00002A87 B020 <1> mov al,20h 234 00002A89 EE <1> out dx,al 235 00002A8A E84600 <1> call dummy 236 <1> ;----------------------------------------------------------------------------- 237 <1> ; GC 238 <1> ;----------------------------------------------------------------------------- 239 00002A8D B2CE <1> mov dl,0ceh 240 00002A8F B109 <1> mov cl,9 241 00002A91 B400 <1> mov ah,00 242 00002A93 E83E00 <1> call save_vga_regs 243 <1> ;----------------------------------------------------------------------------- 244 <1> ; DAC 245 <1> ;----------------------------------------------------------------------------- 246 00002A96 B2C7 <1> mov dl,0c7h 247 00002A98 B110 <1> mov cl,10h 248 00002A9A B400 <1> mov ah,00 249 <1> @@50: 250 00002A9C 88E0 <1> mov al,ah 251 00002A9E EE <1> out dx,al 252 00002A9F E83100 <1> call dummy 253 00002AA2 42 <1> inc dx 254 00002AA3 42 <1> inc dx 255 <1> 256 00002AA4 EC <1> in al,dx 257 00002AA5 AA <1> stosb 258 00002AA6 EC <1> in al,dx 259 00002AA7 AA <1> stosb 260 00002AA8 EC <1> in al,dx 261 00002AA9 AA <1> stosb 262 <1> 263 00002AAA 4A <1> dec dx 264 00002AAB 4A <1> dec dx 265 00002AAC FEC4 <1> inc ah 266 00002AAE E2EC <1> loop @@50 267 <1> ;----------------------------------------------------------------------------- 268 <1> ; FEATURE 269 <1> ;----------------------------------------------------------------------------- 270 00002AB0 B2CA <1> mov dl,0cah 271 00002AB2 EC <1> in al,dx 272 00002AB3 AA <1> stosb 273 <1> ;----------------------------------------------------------------------------- 274 <1> ; PEL MASK 275 <1> ;----------------------------------------------------------------------------- 276 00002AB4 47 <1> inc di ;skip MISC reg 277 00002AB5 B2C6 <1> mov dl,0c6h 278 00002AB7 EC <1> in al,dx 279 00002AB8 AA <1> stosb 280 <1> ;----------------------------------------------------------------------------- 281 <1> ; BIOS variables 282 <1> ;----------------------------------------------------------------------------- 283 00002AB9 1E <1> push ds 284 00002ABA 31C0 <1> xor ax,ax 285 00002ABC 8ED8 <1> mov ds,ax 286 00002ABE A15004 <1> mov ax,[450h] 287 00002AC1 AB <1> stosw 288 00002AC2 A14A04 <1> mov ax,[44ah] 289 00002AC5 AB <1> stosw 290 00002AC6 A18504 <1> mov ax,[485h] 291 00002AC9 AB <1> stosw 292 00002ACA A08404 <1> mov al,[484h] 293 00002ACD 8A264904 <1> mov ah,[449h] 294 00002AD1 AB <1> stosw 295 00002AD2 1F <1> pop ds 296 <1> dummy: 297 00002AD3 C3 <1> ret 298 <1> ;============================================================================= 299 <1> ; save_vga_regs 300 <1> ;----------------------------------------------------------------------------- 301 <1> save_vga_regs: 302 00002AD4 EC <1> in al,dx 303 00002AD5 AA <1> stosb 304 <1> @@20: 305 00002AD6 88E0 <1> mov al,ah 306 00002AD8 EE <1> out dx,al 307 00002AD9 E8F7FF <1> call dummy 308 00002ADC 42 <1> inc dx 309 00002ADD FEC4 <1> inc ah 310 00002ADF EC <1> in al,dx 311 00002AE0 4A <1> dec dx 312 00002AE1 AA <1> stosb 313 00002AE2 E2F2 <1> loop @@20 314 00002AE4 C3 <1> ret 315 <1> ;============================================================================= 316 <1> ; set_mode 317 <1> ;----------------------------------------------------------------------------- 318 <1> ; Sets video mode 319 <1> ; 320 <1> set_mode: 321 00002AE5 FC <1> cld 322 00002AE6 BACC03 <1> mov dx,03cch 323 00002AE9 EC <1> in al,dx 324 00002AEA E8E6FF <1> call dummy 325 00002AED 0C01 <1> or al,1 ;Miscellaneous ( 3D? ) 326 00002AEF B2C2 <1> mov dl,0c2h 327 00002AF1 EE <1> out dx,al 328 00002AF2 E8DEFF <1> call dummy 329 <1> ;----------------------------------------------------------------------------- 330 <1> ; Wait for retrace 331 <1> ;----------------------------------------------------------------------------- 332 00002AF5 B2DA <1> mov dl,0dah 333 <1> @@90l: 334 00002AF7 EC <1> in al,dx 335 00002AF8 A808 <1> test al,00001000b 336 00002AFA 75FB <1> jnz @@90l 337 <1> @@91l: 338 00002AFC EC <1> in al,dx 339 00002AFD A808 <1> test al,00001000b 340 00002AFF 74FB <1> jz @@91l 341 <1> ;----------------------------------------------------------------------------- 342 00002B01 EC <1> in al,dx ;Clear flip/flop 343 00002B02 E8CEFF <1> call dummy 344 00002B05 30C0 <1> xor al,al 345 00002B07 B2C0 <1> mov dl,0c0h 346 00002B09 EE <1> out dx,al ;Disable screen 347 00002B0A E8C6FF <1> call dummy 348 <1> ;----------------------------------------------------------------------------- 349 <1> ; SEQUENCER 350 <1> ;----------------------------------------------------------------------------- 351 00002B0D FA <1> cli 352 00002B0E B80001 <1> mov ax,0100h 353 00002B11 B2C4 <1> mov dl,0c4h 354 00002B13 EF <1> out dx,ax ;Sequencer synchronous reset 355 00002B14 E8BCFF <1> call dummy 356 00002B17 B90400 <1> mov cx,4 357 00002B1A E89200 <1> call set_vga_regs ;!! AH == 01h !! 358 <1> ;----------------------------------------------------------------------------- 359 00002B1D B80003 <1> mov ax,0300h 360 00002B20 B2C4 <1> mov dl,0c4h 361 00002B22 EF <1> out dx,ax ;Enable sequencer 362 00002B23 E8ADFF <1> call dummy 363 00002B26 FB <1> sti 364 <1> ;----------------------------------------------------------------------------- 365 <1> ; CRTC 366 <1> ;----------------------------------------------------------------------------- 367 00002B27 B2D4 <1> mov dl,0d4h 368 00002B29 B81100 <1> mov ax,0011h 369 00002B2C EF <1> out dx,ax ;Enable write to CRT controller 370 00002B2D E8A3FF <1> call dummy 371 00002B30 B119 <1> mov cl,19h 372 00002B32 E87A00 <1> call set_vga_regs ;!! AH == 00h !! 373 <1> ;----------------------------------------------------------------------------- 374 <1> ; AC 375 <1> ;----------------------------------------------------------------------------- 376 00002B35 B2DA <1> mov dl,0dah 377 00002B37 EC <1> in al,dx ;Clear flip/flop 378 00002B38 31C0 <1> xor ax,ax 379 00002B3A B115 <1> mov cl,15h 380 00002B3C B2C0 <1> mov dl,0c0h 381 <1> @@40: 382 00002B3E 88E0 <1> mov al,ah ;Attribute controller registers 383 00002B40 EE <1> out dx,al ;Register number 384 00002B41 E88FFF <1> call dummy 385 00002B44 FEC4 <1> inc ah 386 00002B46 AC <1> lodsb 387 00002B47 EE <1> out dx,al ;Register data 388 00002B48 E888FF <1> call dummy 389 00002B4B E2F1 <1> loop @@40 390 <1> ;----------------------------------------------------------------------------- 391 00002B4D 31C0 <1> xor ax,ax 392 00002B4F B2CC <1> mov dl,0cch 393 00002B51 EE <1> out dx,al ;(03CC) <- 00 394 00002B52 E87EFF <1> call dummy 395 00002B55 40 <1> inc ax 396 00002B56 B2CA <1> mov dl,0cah 397 00002B58 EE <1> out dx,al ;(03CA) <- 01 398 00002B59 E877FF <1> call dummy 399 <1> ;----------------------------------------------------------------------------- 400 <1> ; GC 401 <1> ;----------------------------------------------------------------------------- 402 00002B5C B2CE <1> mov dl,0ceh 403 00002B5E B109 <1> mov cl,9 404 00002B60 E84C00 <1> call set_vga_regs ;!! AH == 00h !! 405 <1> ;----------------------------------------------------------------------------- 406 <1> ; DAC 407 <1> ;----------------------------------------------------------------------------- 408 00002B63 B2C8 <1> mov dl,0c8h 409 00002B65 31C0 <1> xor ax,ax 410 00002B67 EE <1> out dx,al 411 00002B68 E868FF <1> call dummy 412 00002B6B B130 <1> mov cl,30h 413 00002B6D 42 <1> inc dx 414 <1> @@80: 415 00002B6E AC <1> lodsb 416 00002B6F EE <1> out dx,al ;DAC registers 417 00002B70 E2FC <1> loop @@80 ;RGB 418 <1> ;----------------------------------------------------------------------------- 419 <1> ; FEATURE 420 <1> ;----------------------------------------------------------------------------- 421 00002B72 AC <1> lodsb 422 00002B73 B2DA <1> mov dl,0dah 423 00002B75 EE <1> out dx,al 424 00002B76 E85AFF <1> call dummy 425 <1> ;----------------------------------------------------------------------------- 426 <1> ; MISCELLANEOUS 427 <1> ;----------------------------------------------------------------------------- 428 00002B79 AC <1> lodsb 429 00002B7A B2C2 <1> mov dl,0c2h 430 00002B7C EE <1> out dx,al 431 00002B7D E853FF <1> call dummy 432 <1> ;----------------------------------------------------------------------------- 433 <1> ; PEL MASK 434 <1> ;----------------------------------------------------------------------------- 435 00002B80 AC <1> lodsb 436 00002B81 B2C6 <1> mov dl,0c6h 437 00002B83 EE <1> out dx,al 438 00002B84 E84CFF <1> call dummy 439 <1> ;----------------------------------------------------------------------------- 440 00002B87 B2DA <1> mov dl,0dah 441 00002B89 EC <1> in al,dx 442 00002B8A B2C0 <1> mov dl,0c0h 443 00002B8C B020 <1> mov al,20h 444 00002B8E EE <1> out dx,al ;Enable screen 445 <1> ;----------------------------------------------------------------------------- 446 <1> ; BIOS variables 447 <1> ;----------------------------------------------------------------------------- 448 00002B8F 06 <1> push es 449 00002B90 31C0 <1> xor ax,ax 450 00002B92 8EC0 <1> mov es,ax 451 00002B94 AD <1> lodsw 452 00002B95 26A35004 <1> mov [es:450h],ax 453 00002B99 AD <1> lodsw 454 00002B9A 26A34A04 <1> mov [es:44ah],ax 455 00002B9E AD <1> lodsw 456 00002B9F 26A38504 <1> mov [es:485h],ax 457 00002BA3 AD <1> lodsw 458 00002BA4 26A28404 <1> mov [es:484h],al 459 00002BA8 2688264904 <1> mov [es:449h],ah 460 00002BAD 07 <1> pop es 461 00002BAE C3 <1> ret 462 <1> ;============================================================================= 463 <1> ; set_vga_regs 464 <1> ;----------------------------------------------------------------------------- 465 <1> set_vga_regs: 466 00002BAF AC <1> lodsb 467 00002BB0 50 <1> push ax 468 <1> @@30: 469 00002BB1 AC <1> lodsb 470 00002BB2 86C4 <1> xchg al,ah 471 00002BB4 EF <1> out dx,ax 472 00002BB5 40 <1> inc ax 473 00002BB6 88C4 <1> mov ah,al 474 00002BB8 E2F7 <1> loop @@30 475 00002BBA 58 <1> pop ax 476 00002BBB EE <1> out dx,al 477 00002BBC C3 <1> ret 478 <1> ;============================================================================= 479 <1> ; save_screen 480 <1> ;----------------------------------------------------------------------------- 481 <1> ; Saves user screen and font; sets mode 03h and loads new font 482 <1> ; 483 <1> save_screen: 484 00002BBD 803E[2C78]00 <1> cmp byte [user_screen_mode],0 485 00002BC2 746F <1> je @@exit 486 00002BC4 C606[2C78]00 <1> mov byte [user_screen_mode],0 487 <1> 488 00002BC9 E8D2ED <1> call pushr 489 00002BCC 803E[8E8B]01 <1> cmp byte [video_type],1 ;1 == VGA 490 00002BD1 7511 <1> jne @@not_vga 491 <1> ;----------------------------------------------------------------------------- 492 <1> ; VGA 493 <1> ;----------------------------------------------------------------------------- 494 00002BD3 BF[7995] <1> mov di,old_video_regs 495 00002BD6 E85AFE <1> call save_mode 496 00002BD9 E8B3FD <1> call xchg_planes 497 00002BDC BE[BA2C] <1> mov si,mode_80x25 498 00002BDF E803FF <1> call set_mode 499 00002BE2 EB4C <1> jmp @@quit 500 <1> ;----------------------------------------------------------------------------- 501 <1> ; EGA and older 502 <1> ;----------------------------------------------------------------------------- 503 <1> @@not_vga: 504 00002BE4 E8E0F6 <1> call get_cursor 505 00002BE7 8916[7595] <1> mov [old_cursor],dx 506 00002BEB 890E[7795] <1> mov [old_cur_shape],cx 507 00002BEF B40F <1> mov ah,0fh 508 00002BF1 CD10 <1> int 10h 509 00002BF3 247F <1> and al,7fh 510 00002BF5 A2[7495] <1> mov [old_mode_num],al 511 00002BF8 3C02 <1> cmp al,2 512 00002BFA 7409 <1> je @@mode_ok 513 00002BFC 3C03 <1> cmp al,3 514 00002BFE 7405 <1> je @@mode_ok 515 00002C00 B88300 <1> mov ax,83h 516 00002C03 CD10 <1> int 10h 517 <1> @@mode_ok: 518 00002C05 8E1E[E27E] <1> mov ds,[video_seg] 519 00002C09 31F6 <1> xor si,si 520 00002C0B BF[F395] <1> mov di,old_screen 521 00002C0E B9A00F <1> mov cx,SCR_COLS*MAX_SCR_ROWS 522 00002C11 FC <1> cld 523 00002C12 F3A5 <1> rep movsw 524 00002C14 31C0 <1> xor ax,ax 525 00002C16 8ED8 <1> mov ds,ax 526 00002C18 802687047F <1> and byte [487h],7fh 527 00002C1D A08404 <1> mov al,[484h] ;Number of last line on the screen 528 00002C20 98 <1> cbw 529 00002C21 2EA3[2E78] <1> mov [cs:screen_height],ax 530 00002C25 83E813 <1> sub ax,CPU_HEIGHT+2 531 00002C28 2EA3[3078] <1> mov [cs:dump_height],ax 532 00002C2C 2EA3[3278] <1> mov [cs:e_dump_height],ax 533 <1> @@quit: 534 00002C30 E87EED <1> call popr 535 <1> @@exit: 536 00002C33 C3 <1> ret 537 <1> ;============================================================================= 538 <1> ; restore_screen 539 <1> ;----------------------------------------------------------------------------- 540 <1> ; Restores user screen, font, and video mode 541 <1> ; 542 <1> restore_screen: 543 00002C34 C606[2C78]01 <1> mov byte [user_screen_mode],1 544 00002C39 E862ED <1> call pushr 545 00002C3C 803E[8E8B]01 <1> cmp byte [video_type],1 546 00002C41 750B <1> jne @@not_vga 547 <1> ;----------------------------------------------------------------------------- 548 <1> ; VGA 549 <1> ;----------------------------------------------------------------------------- 550 00002C43 E849FD <1> call xchg_planes 551 00002C46 BE[7995] <1> mov si,old_video_regs 552 00002C49 E899FE <1> call set_mode 553 00002C4C EB37 <1> jmp @@quit 554 <1> ;----------------------------------------------------------------------------- 555 <1> ; EGA and older 556 <1> ;----------------------------------------------------------------------------- 557 <1> @@not_vga: 558 00002C4E 8E06[E27E] <1> mov es,[video_seg] 559 00002C52 31FF <1> xor di,di 560 00002C54 BE[F395] <1> mov si,old_screen 561 00002C57 B9A00F <1> mov cx,SCR_COLS*MAX_SCR_ROWS 562 00002C5A FC <1> cld 563 00002C5B F3A5 <1> rep movsw 564 00002C5D B400 <1> mov ah,0 565 00002C5F A0[7495] <1> mov al,[old_mode_num] 566 00002C62 3C02 <1> cmp al,2 567 00002C64 7408 <1> je @@mode_ok 568 00002C66 3C03 <1> cmp al,3 569 00002C68 7404 <1> je @@mode_ok 570 00002C6A 0C80 <1> or al,80h 571 00002C6C CD10 <1> int 10h 572 <1> @@mode_ok: 573 00002C6E 8B16[7595] <1> mov dx,[old_cursor] 574 00002C72 E847F6 <1> call gotoxy 575 00002C75 8B0E[7795] <1> mov cx,[old_cur_shape] 576 00002C79 E863F6 <1> call set_cursor 577 00002C7C 31C0 <1> xor ax,ax 578 00002C7E 8ED8 <1> mov ds,ax 579 00002C80 802687047F <1> and byte [487h],7fh 580 <1> @@quit: 581 00002C85 E829ED <1> call popr 582 00002C88 C3 <1> ret 583 <1> ;============================================================================= 584 <1> ; save_font 585 <1> ;----------------------------------------------------------------------------- 586 <1> save_font: 587 00002C89 803E[8E8B]01 <1> cmp byte [video_type],1 588 00002C8E 7529 <1> jne @@quit 589 00002C90 1E <1> push ds 590 00002C91 06 <1> push es 591 00002C92 B83011 <1> mov ax,1130h 592 00002C95 B706 <1> mov bh,06h 593 00002C97 CD10 <1> int 10h 594 00002C99 06 <1> push es 595 00002C9A 1F <1> pop ds 596 00002C9B 89EE <1> mov si,bp 597 00002C9D BF[94A5] <1> mov di,font 598 00002CA0 0E <1> push cs 599 00002CA1 07 <1> pop es 600 00002CA2 B90010 <1> mov cx,4096 601 00002CA5 F3A4 <1> rep movsb 602 00002CA7 BF[F395] <1> mov di,old_screen 603 00002CAA BE0000 <1> mov si,0 604 00002CAD 268E1E[E27E] <1> mov ds,[es:video_seg] 605 00002CB2 B9D007 <1> mov cx,SCR_COLS*SCR_ROWS 606 00002CB5 F3A5 <1> rep movsw 607 00002CB7 07 <1> pop es 608 00002CB8 1F <1> pop ds 609 <1> @@quit: 610 00002CB9 C3 <1> ret 611 <1> ; 612 <1> ;----------------------------------------------------------------------------- 613 <1> 614 <1> 615 <1> ;----------------------------------------------------------------------------- 616 <1> mode_80x25: 617 <1> 618 <1> %if SCR_WIDTH==80 619 <1> 620 <1> ;Sequencer registers 621 00002CBA 00 <1> db 0 622 00002CBB 00030002 <1> db 000h, 003h, 000h, 002h 623 <1> ;CRT controller registers 624 00002CBF 00 <1> db 0 625 00002CC0 5F4F508255 <1> db 05fh, 04fh, 050h, 082h, 055h 626 00002CC5 81BF1F004F <1> db 081h, 0bfh, 01fh, 000h, 04fh 627 00002CCA 0D0E000000 <1> db 00dh, 00eh, 000h, 000h, 000h 628 00002CCF 009C8E8F28 <1> db 000h, 09ch, 08eh, 08fh, 028h 629 00002CD4 1F96B9A3FF <1> db 01fh, 096h, 0b9h, 0a3h, 0ffh 630 <1> ;Attribute controller registers 631 00002CD9 0001020304050607 <1> db 000h, 001h, 002h, 003h, 004h, 005h, 006h, 007h 632 00002CE1 08090A0B0C0D0E0F <1> db 008h, 009h, 00ah, 00bh, 00ch, 00dh, 00eh, 00fh 633 00002CE9 0C000F0800 <1> db 00ch, 000h, 00fh, 008h, 000h 634 <1> ;Graphics controller registers 635 00002CEE 00 <1> db 0 636 00002CEF 0000000000100E00FF <1> db 000h, 000h, 000h, 000h, 000h, 010h, 00eh, 000h, 0ffh 637 <1> ;DAC registers 638 00002CF8 000000 <1> db 00h, 00h, 00h ;00 639 00002CFB 00002A <1> db 00h, 00h, 2ah ;01 640 00002CFE 002A00 <1> db 00h, 2ah, 00h ;02 641 00002D01 002A2A <1> db 00h, 2ah, 2ah ;03 642 00002D04 2A0000 <1> db 2ah, 00h, 00h ;04 643 00002D07 2A002A <1> db 2ah, 00h, 2ah ;05 644 00002D0A 2A2A00 <1> db 2ah, 2ah, 00h ;14 645 00002D0D 2A2A2A <1> db 2ah, 2ah, 2ah ;07 646 <1> 647 00002D10 151515 <1> db 15h, 15h, 15h ;38 648 00002D13 15153F <1> db 15h, 15h, 3fh ;39 649 00002D16 153F15 <1> db 15h, 3fh, 15h ;3A 650 00002D19 153F3F <1> db 15h, 3fh, 3fh ;3B 651 00002D1C 3F1515 <1> db 3fh, 15h, 15h ;3C 652 00002D1F 3F153F <1> db 3fh, 15h, 3fh ;3D 653 00002D22 3F3F15 <1> db 3fh, 3fh, 15h ;3E 654 00002D25 3F3F3F <1> db 3fh, 3fh, 3fh ;3F 655 <1> ;Feature 656 00002D28 00 <1> db 000h 657 <1> ;Miscelianeous 658 00002D29 67 <1> db 067h 659 <1> ;Pel mask 660 00002D2A FF <1> db 0ffh 661 <1> ;BIOS variables 662 00002D2B 0000 <1> word_0450h dw 0 ;Cursor position for 1st page 663 00002D2D 5000 <1> word_044ah dw 80 ;Screen width in columns 664 00002D2F 1000 <1> word_0485h dw 16 ;Lines per char 665 00002D31 18 <1> byte_0484h db 24 ;Last line number 666 00002D32 03 <1> byte_0449h db 3 ;Video mode 667 <1> 668 <1> %elif SCR_WIDTH==90 669 <1> 670 <1> ;Sequencer registers 671 <1> db 0 672 <1> db 001h, 003h, 000h, 002h 673 <1> ;CRT controller registers 674 <1> db 0 675 <1> db 06bh, 059h, 05ah, 08eh, 060h 676 <1> db 08dh, 0bfh, 01fh, 000h, 04fh 677 <1> db 00dh, 00eh, 000h, 000h, 008h 678 <1> db 070h, 09ch, 093h, 08fh, 02dh 679 <1> db 01fh, 096h, 0b9h, 0a3h, 0ffh 680 <1> ;Attribute controller registers 681 <1> db 000h, 001h, 002h, 003h, 004h, 005h, 006h, 007h 682 <1> db 008h, 009h, 00ah, 00bh, 00ch, 00dh, 00eh, 00fh 683 <1> db 00ch, 000h, 00fh, 000h, 000h 684 <1> ;Graphics controller registers 685 <1> db 0 686 <1> db 000h, 000h, 000h, 000h, 000h, 010h, 00eh, 000h, 0ffh 687 <1> ;DAC registers 688 <1> db 00h, 00h, 00h ;00 689 <1> db 00h, 00h, 2ah ;01 690 <1> db 00h, 2ah, 00h ;02 691 <1> db 00h, 2ah, 2ah ;03 692 <1> db 2ah, 00h, 00h ;04 693 <1> db 2ah, 00h, 2ah ;05 694 <1> db 2ah, 2ah, 00h ;14 695 <1> db 2ah, 2ah, 2ah ;07 696 <1> 697 <1> db 15h, 15h, 15h ;38 698 <1> db 15h, 15h, 3fh ;39 699 <1> db 15h, 3fh, 15h ;3A 700 <1> db 15h, 3fh, 3fh ;3B 701 <1> db 3fh, 15h, 15h ;3C 702 <1> db 3fh, 15h, 3fh ;3D 703 <1> db 3fh, 3fh, 15h ;3E 704 <1> db 3fh, 3fh, 3fh ;3F 705 <1> ;Feature 706 <1> db 000h 707 <1> ;Miscelianeous 708 <1> db 067h 709 <1> ;Pel mask 710 <1> db 0ffh 711 <1> ;BIOS variables 712 <1> word_0450h dw 0 ;Cursor position for 1st page 713 <1> word_044ah dw 90 ;Screen width in columns 714 <1> word_0485h dw 16 ;Lines per char 715 <1> byte_0484h db 24 ;Last line number 716 <1> byte_0449h db 3 ;Video mode 717 <1> 718 <1> %else 719 <1> 720 <1> ;Sequencer registers 721 <1> db 0 722 <1> db 000h, 003h, 000h, 002h 723 <1> ;CRT controller registers 724 <1> db 0 725 <1> db 05fh, 04fh, 050h, 082h, 055h 726 <1> db 081h, 0bfh, 01fh, 000h, 04fh 727 <1> db 00dh, 00eh, 000h, 000h, 000h 728 <1> db 000h, 09ch, 08eh, 08fh, 028h 729 <1> db 01fh, 096h, 0b9h, 0a3h, 0ffh 730 <1> ;Attribute controller registers 731 <1> db 000h, 001h, 002h, 003h, 004h, 005h, 006h, 007h 732 <1> db 008h, 009h, 00ah, 00bh, 00ch, 00dh, 00eh, 00fh 733 <1> db 00ch, 000h, 00fh, 008h, 000h 734 <1> ;Graphics controller registers 735 <1> db 0 736 <1> db 000h, 000h, 000h, 000h, 000h, 010h, 00eh, 000h, 0ffh 737 <1> ;DAC registers 738 <1> db 00h, 00h, 00h ;00 739 <1> db 00h, 00h, 2ah ;01 740 <1> db 00h, 2ah, 00h ;02 741 <1> db 00h, 2ah, 2ah ;03 742 <1> db 2ah, 00h, 00h ;04 743 <1> db 2ah, 00h, 2ah ;05 744 <1> db 2ah, 2ah, 00h ;14 745 <1> db 2ah, 2ah, 2ah ;07 746 <1> 747 <1> db 15h, 15h, 15h ;38 748 <1> db 15h, 15h, 3fh ;39 749 <1> db 15h, 3fh, 15h ;3A 750 <1> db 15h, 3fh, 3fh ;3B 751 <1> db 3fh, 15h, 15h ;3C 752 <1> db 3fh, 15h, 3fh ;3D 753 <1> db 3fh, 3fh, 15h ;3E 754 <1> db 3fh, 3fh, 3fh ;3F 755 <1> ;Feature 756 <1> db 000h 757 <1> ;Miscelianeous 758 <1> db 067h 759 <1> ;Pel mask 760 <1> db 0ffh 761 <1> ;BIOS variables 762 <1> word_0450h dw 0 ;Cursor position for 1st page 763 <1> word_044ah dw 80 ;Screen width in columns 764 <1> word_0485h dw 16 ;Lines per char 765 <1> byte_0484h db 24 ;Last line number 766 <1> byte_0449h db 3 ;Video mode 767 <1> 768 <1> %endif 769 <1> ; 770 <1> ;----------------------------------------------------------------------------- 771 <1> 772 <1> 773 <1> ;============================================================================= 774 <1> ; E0F 775 <1> ;============================================================================= 776 <1> 60 61 %include "inst.inc" ; 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; inst.inc 7 <1> ; ... 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 00002D33 01 <1> s_sw7 db 00000001b 27 <1> 28 <1> S_SW78 equ 00000101b 29 <1> S_SW7M equ 00000010b 30 <1> S_SW8 equ 00000100b 31 <1> S_JMP equ 00001000b 32 <1> S_EM equ 00010000b 33 <1> ;$em8 equ 00100000b 34 <1> ;$em78 equ 00110000b 35 <1> S_PREFIX equ 01000000b 36 <1> S_GRP equ 10000000b 37 <1> 38 <1> ;============================================================================= 39 <1> ; check_swap 40 <1> ;----------------------------------------------------------------------------- 41 <1> ; Expects: dl=0 (Single Step), dl=1 (Proc Trace), dl=2 (Other) 42 <1> check_swap: 43 00002D34 50 <1> push ax 44 00002D35 53 <1> push bx 45 00002D36 56 <1> push si 46 00002D37 06 <1> push es 47 <1> 48 00002D38 803E[946C]00 <1> cmp byte [swap_mode],0 49 00002D3D 742D <1> je @@not 50 00002D3F 803E[946C]02 <1> cmp byte [swap_mode],2 51 00002D44 7434 <1> je @@swap 52 00002D46 80FA02 <1> cmp dl,2 53 00002D49 732F <1> jae @@swap 54 <1> 55 00002D4B 8B36[008B] <1> mov si,[cpu_regs+REG_IP] 56 00002D4F 8E06[E88A] <1> mov es,[cpu_regs+REG_CS] 57 00002D53 E84500 <1> call get_inst_desc 58 <1> 59 00002D56 8406[332D] <1> test al,[s_sw7] 60 00002D5A 751E <1> jnz @@swap 61 00002D5C A804 <1> test al,S_SW8 62 00002D5E 7516 <1> jnz @@swap_8 63 00002D60 A802 <1> test al,S_SW7M 64 00002D62 7408 <1> jz @@not 65 00002D64 26AC <1> es lodsb 66 00002D66 24C0 <1> and al,11000000b 67 00002D68 3CC0 <1> cmp al,11000000b 68 00002D6A 750E <1> jne @@swap 69 <1> @@not: 70 00002D6C C606[812D]00 <1> mov byte [swap_flag],0 71 <1> @@quit: 72 00002D71 07 <1> pop es 73 00002D72 5E <1> pop si 74 00002D73 5B <1> pop bx 75 00002D74 58 <1> pop ax 76 00002D75 C3 <1> ret 77 <1> @@swap_8: 78 00002D76 08D2 <1> or dl,dl 79 00002D78 74F2 <1> jz @@not 80 <1> @@swap: 81 00002D7A C606[812D]01 <1> mov byte [swap_flag],1 82 00002D7F EBF0 <1> jmp @@quit 83 <1> 84 00002D81 00 <1> swap_flag db 0 85 <1> ;============================================================================= 86 <1> ; check_jump 87 <1> ;----------------------------------------------------------------------------- 88 <1> check_jump: 89 00002D82 50 <1> push ax 90 00002D83 53 <1> push bx 91 00002D84 56 <1> push si 92 00002D85 06 <1> push es 93 00002D86 8B36[008B] <1> mov si,[cpu_regs+REG_IP] 94 00002D8A 8E06[E88A] <1> mov es,[cpu_regs+REG_CS] 95 00002D8E E80A00 <1> call get_inst_desc 96 00002D91 A808 <1> test al,S_JMP 97 00002D93 7401 <1> jz @@quit 98 00002D95 F9 <1> stc 99 <1> @@quit: 100 00002D96 07 <1> pop es 101 00002D97 5E <1> pop si 102 00002D98 5B <1> pop bx 103 00002D99 58 <1> pop ax 104 00002D9A C3 <1> ret 105 <1> ;============================================================================= 106 <1> 107 <1> 108 <1> ;~;------------------------------------------------------------------------------ 109 <1> ;~CheckEmul proc 110 <1> ;~ ; Expects: dl=0 (Single Step), dl=1 (Proc Trace) 111 <1> ;~ ; Returns: CF set if emulation needed 112 <1> ;~ push ax bx si es 113 <1> ;~ mov si,_IP 114 <1> ;~ mov es,_CS 115 <1> ;~ call GetInstDesc 116 <1> ;~ test al,S_EM78 117 <1> ;~ jz @@Quit 118 <1> ;~ or dl,dl 119 <1> ;~ jz @@SS 120 <1> ;~ test al,S_EM8 121 <1> ;~ jz @@Quit 122 <1> ;~@@Emul: 123 <1> ;~ stc 124 <1> ;~@@Quit: 125 <1> ;~ pop es si bx ax 126 <1> ;~ ret 127 <1> ;~@@SS: 128 <1> ;~ test al,S_EM7 129 <1> ;~ jz @@Quit 130 <1> ;~ jmp @@Emul 131 <1> ;~endp 132 <1> ;~# 133 <1> 134 <1> ;============================================================================= 135 <1> ; get_inst_desc 136 <1> ;----------------------------------------------------------------------------- 137 <1> get_inst_desc: 138 00002D9B BB[BC2D] <1> mov bx,inst_desc 139 00002D9E FC <1> cld 140 <1> @@pref: 141 00002D9F 26AC <1> es lodsb 142 00002DA1 D7 <1> xlat 143 00002DA2 A840 <1> test al,S_PREFIX 144 00002DA4 75F9 <1> jnz @@pref 145 00002DA6 A880 <1> test al,S_GRP 146 00002DA8 7411 <1> jz @@quit 147 <1> @@grp: 148 00002DAA 268A04 <1> mov al,[es:si] 149 00002DAD BB[BC2E] <1> mov bx,s_grjump 150 00002DB0 88C4 <1> mov ah,al 151 00002DB2 D0E8 <1> shr al,1 152 00002DB4 D0E8 <1> shr al,1 153 00002DB6 D0E8 <1> shr al,1 154 00002DB8 2407 <1> and al,0111b 155 00002DBA D7 <1> xlat 156 <1> @@quit: 157 00002DBB C3 <1> ret 158 <1> ;============================================================================= 159 <1> inst_desc: 160 00002DBC 02 <1> db S_SW7M ; 00 161 00002DBD 02 <1> db S_SW7M 162 00002DBE 00 <1> db 0 163 00002DBF 00 <1> db 0 164 00002DC0 00 <1> db 0 165 00002DC1 00 <1> db 0 166 00002DC2 00 <1> db 0 167 00002DC3 00 <1> db 0 168 <1> 169 00002DC4 02 <1> db S_SW7M ; 08 170 00002DC5 02 <1> db S_SW7M 171 00002DC6 00 <1> db 0 172 00002DC7 00 <1> db 0 173 00002DC8 00 <1> db 0 174 00002DC9 00 <1> db 0 175 00002DCA 00 <1> db 0 176 00002DCB 08 <1> db S_JMP ;s_second 177 <1> 178 00002DCC 02 <1> db S_SW7M ; 10 179 00002DCD 02 <1> db S_SW7M 180 00002DCE 00 <1> db 0 181 00002DCF 00 <1> db 0 182 00002DD0 00 <1> db 0 183 00002DD1 00 <1> db 0 184 00002DD2 00 <1> db 0 185 00002DD3 00 <1> db 0 186 <1> 187 00002DD4 02 <1> db S_SW7M ; 18 188 00002DD5 02 <1> db S_SW7M 189 00002DD6 00 <1> db 0 190 00002DD7 00 <1> db 0 191 00002DD8 00 <1> db 0 192 00002DD9 00 <1> db 0 193 00002DDA 00 <1> db 0 194 00002DDB 00 <1> db 0 195 <1> 196 00002DDC 02 <1> db S_SW7M ; 20 197 00002DDD 02 <1> db S_SW7M 198 00002DDE 00 <1> db 0 199 00002DDF 00 <1> db 0 200 00002DE0 00 <1> db 0 201 00002DE1 00 <1> db 0 202 00002DE2 40 <1> db S_PREFIX 203 00002DE3 00 <1> db 0 204 <1> 205 00002DE4 02 <1> db S_SW7M ; 28 206 00002DE5 02 <1> db S_SW7M 207 00002DE6 00 <1> db 0 208 00002DE7 00 <1> db 0 209 00002DE8 00 <1> db 0 210 00002DE9 00 <1> db 0 211 00002DEA 40 <1> db S_PREFIX 212 00002DEB 00 <1> db 0 213 <1> 214 00002DEC 02 <1> db S_SW7M ; 30 215 00002DED 02 <1> db S_SW7M 216 00002DEE 00 <1> db 0 217 00002DEF 00 <1> db 0 218 00002DF0 00 <1> db 0 219 00002DF1 00 <1> db 0 220 00002DF2 40 <1> db S_PREFIX 221 00002DF3 00 <1> db 0 222 <1> 223 00002DF4 02 <1> db S_SW7M ; 38 224 00002DF5 02 <1> db S_SW7M 225 00002DF6 00 <1> db 0 226 00002DF7 00 <1> db 0 227 00002DF8 00 <1> db 0 228 00002DF9 00 <1> db 0 229 00002DFA 40 <1> db S_PREFIX 230 00002DFB 00 <1> db 0 231 <1> 232 00002DFC 00 <1> db 0 ; 40 233 00002DFD 00 <1> db 0 234 00002DFE 00 <1> db 0 235 00002DFF 00 <1> db 0 236 00002E00 00 <1> db 0 237 00002E01 00 <1> db 0 238 00002E02 00 <1> db 0 239 00002E03 00 <1> db 0 240 <1> 241 00002E04 00 <1> db 0 ; 48 242 00002E05 00 <1> db 0 243 00002E06 00 <1> db 0 244 00002E07 00 <1> db 0 245 00002E08 00 <1> db 0 246 00002E09 00 <1> db 0 247 00002E0A 00 <1> db 0 248 00002E0B 00 <1> db 0 249 <1> 250 00002E0C 00 <1> db 0 ; 50 251 00002E0D 00 <1> db 0 252 00002E0E 00 <1> db 0 253 00002E0F 00 <1> db 0 254 00002E10 00 <1> db 0 255 00002E11 00 <1> db 0 256 00002E12 00 <1> db 0 257 00002E13 00 <1> db 0 258 <1> 259 00002E14 00 <1> db 0 ; 58 260 00002E15 00 <1> db 0 261 00002E16 00 <1> db 0 262 00002E17 00 <1> db 0 263 00002E18 00 <1> db 0 264 00002E19 00 <1> db 0 265 00002E1A 00 <1> db 0 266 00002E1B 00 <1> db 0 267 <1> 268 00002E1C 00 <1> db 0 ; 60 269 00002E1D 00 <1> db 0 270 00002E1E 00 <1> db 0 271 00002E1F 00 <1> db 0 272 00002E20 00 <1> db 0 273 00002E21 00 <1> db 0 274 00002E22 00 <1> db 0 275 00002E23 00 <1> db 0 276 <1> 277 00002E24 00 <1> db 0 ; 68 278 00002E25 00 <1> db 0 279 00002E26 00 <1> db 0 280 00002E27 00 <1> db 0 281 00002E28 00 <1> db 0 282 00002E29 00 <1> db 0 283 00002E2A 00 <1> db 0 284 00002E2B 00 <1> db 0 285 <1> 286 00002E2C 08 <1> db S_JMP ; 70 287 00002E2D 08 <1> db S_JMP 288 00002E2E 08 <1> db S_JMP 289 00002E2F 08 <1> db S_JMP 290 00002E30 08 <1> db S_JMP 291 00002E31 08 <1> db S_JMP 292 00002E32 08 <1> db S_JMP 293 00002E33 08 <1> db S_JMP 294 <1> 295 00002E34 08 <1> db S_JMP ; 78 296 00002E35 08 <1> db S_JMP 297 00002E36 08 <1> db S_JMP 298 00002E37 08 <1> db S_JMP 299 00002E38 08 <1> db S_JMP 300 00002E39 08 <1> db S_JMP 301 00002E3A 08 <1> db S_JMP 302 00002E3B 08 <1> db S_JMP 303 <1> 304 00002E3C 02 <1> db S_SW7M ; 80 305 00002E3D 02 <1> db S_SW7M 306 00002E3E 02 <1> db S_SW7M 307 00002E3F 02 <1> db S_SW7M 308 00002E40 00 <1> db 0 309 00002E41 00 <1> db 0 310 00002E42 02 <1> db S_SW7M 311 00002E43 02 <1> db S_SW7M 312 <1> 313 00002E44 02 <1> db S_SW7M ; 88 314 00002E45 02 <1> db S_SW7M 315 00002E46 00 <1> db 0 316 00002E47 00 <1> db 0 317 00002E48 02 <1> db S_SW7M 318 00002E49 00 <1> db 0 319 00002E4A 00 <1> db 0 320 00002E4B 02 <1> db S_SW7M 321 <1> 322 00002E4C 00 <1> db 0 ; 90 323 00002E4D 00 <1> db 0 324 00002E4E 00 <1> db 0 325 00002E4F 00 <1> db 0 326 00002E50 00 <1> db 0 327 00002E51 00 <1> db 0 328 00002E52 00 <1> db 0 329 00002E53 00 <1> db 0 330 <1> 331 00002E54 00 <1> db 0 ; 98 332 00002E55 00 <1> db 0 333 00002E56 04 <1> db S_SW8 334 00002E57 00 <1> db 0 335 00002E58 10 <1> db S_EM 336 00002E59 10 <1> db S_EM 337 00002E5A 00 <1> db 0 338 00002E5B 00 <1> db 0 339 <1> 340 00002E5C 00 <1> db 0 ; A0 341 00002E5D 00 <1> db 0 342 00002E5E 05 <1> db S_SW78 343 00002E5F 05 <1> db S_SW78 344 00002E60 05 <1> db S_SW78 345 00002E61 05 <1> db S_SW78 346 00002E62 00 <1> db 0 347 00002E63 00 <1> db 0 348 <1> 349 00002E64 00 <1> db 0 ; A8 350 00002E65 00 <1> db 0 351 00002E66 05 <1> db S_SW78 352 00002E67 05 <1> db S_SW78 353 00002E68 00 <1> db 0 354 00002E69 00 <1> db 0 355 00002E6A 00 <1> db 0 356 00002E6B 00 <1> db 0 357 <1> 358 00002E6C 00 <1> db 0 ; B0 359 00002E6D 00 <1> db 0 360 00002E6E 00 <1> db 0 361 00002E6F 00 <1> db 0 362 00002E70 00 <1> db 0 363 00002E71 00 <1> db 0 364 00002E72 00 <1> db 0 365 00002E73 00 <1> db 0 366 <1> 367 00002E74 00 <1> db 0 ; B8 368 00002E75 00 <1> db 0 369 00002E76 00 <1> db 0 370 00002E77 00 <1> db 0 371 00002E78 00 <1> db 0 372 00002E79 00 <1> db 0 373 00002E7A 00 <1> db 0 374 00002E7B 00 <1> db 0 375 <1> 376 00002E7C 00 <1> db 0 ; C0 377 00002E7D 00 <1> db 0 378 00002E7E 08 <1> db S_JMP 379 00002E7F 08 <1> db S_JMP 380 00002E80 00 <1> db 0 381 00002E81 00 <1> db 0 382 00002E82 02 <1> db S_SW7M 383 00002E83 02 <1> db S_SW7M 384 <1> 385 00002E84 00 <1> db 0 ; C8 386 00002E85 00 <1> db 0 387 00002E86 08 <1> db S_JMP 388 00002E87 08 <1> db S_JMP 389 00002E88 00 <1> db 0 390 00002E89 14 <1> db S_EM+S_SW8 391 00002E8A 14 <1> db S_EM+S_SW8 392 00002E8B 18 <1> db S_EM+S_JMP 393 <1> 394 00002E8C 02 <1> db S_SW7M ; D0 395 00002E8D 02 <1> db S_SW7M 396 00002E8E 02 <1> db S_SW7M 397 00002E8F 02 <1> db S_SW7M 398 00002E90 00 <1> db 0 399 00002E91 00 <1> db 0 400 00002E92 00 <1> db 0 401 00002E93 00 <1> db 0 402 <1> 403 00002E94 00 <1> db 0 ; D8 404 00002E95 00 <1> db 0 405 00002E96 00 <1> db 0 406 00002E97 00 <1> db 0 407 00002E98 00 <1> db 0 408 00002E99 00 <1> db 0 409 00002E9A 00 <1> db 0 410 00002E9B 00 <1> db 0 411 <1> 412 00002E9C 04 <1> db S_SW8 ; E0 413 00002E9D 04 <1> db S_SW8 414 00002E9E 04 <1> db S_SW8 415 00002E9F 08 <1> db S_JMP 416 00002EA0 00 <1> db 0 417 00002EA1 00 <1> db 0 418 00002EA2 00 <1> db 0 419 00002EA3 00 <1> db 0 420 <1> 421 00002EA4 04 <1> db S_SW8 ; E8 422 00002EA5 08 <1> db S_JMP 423 00002EA6 08 <1> db S_JMP 424 00002EA7 08 <1> db S_JMP 425 00002EA8 00 <1> db 0 426 00002EA9 00 <1> db 0 427 00002EAA 00 <1> db 0 428 00002EAB 00 <1> db 0 429 <1> 430 00002EAC 40 <1> db S_PREFIX ; F0 431 00002EAD 40 <1> db S_PREFIX 432 00002EAE 40 <1> db S_PREFIX 433 00002EAF 40 <1> db S_PREFIX 434 00002EB0 00 <1> db 0 435 00002EB1 00 <1> db 0 436 00002EB2 00 <1> db 0 437 00002EB3 00 <1> db 0 438 <1> 439 00002EB4 00 <1> db 0 ; F8 440 00002EB5 00 <1> db 0 441 00002EB6 00 <1> db 0 442 00002EB7 00 <1> db 0 443 00002EB8 00 <1> db 0 444 00002EB9 00 <1> db 0 445 00002EBA 80 <1> db S_GRP 446 00002EBB 80 <1> db S_GRP 447 <1> 448 <1> 449 00002EBC 0202040408080000 <1> s_grjump: db S_SW7M, S_SW7M, S_SW8, S_SW8, S_JMP, S_JMP, 0, 0 450 <1> 451 <1> ;============================================================================= 452 <1> ; E0F 453 <1> ;============================================================================= 454 <1> 455 <1> 62 %include "unasm.inc" ;Disassembler 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; unasm.inc 7 <1> ; Disassembler. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 00002EC4 70 <1> cpu_type db a86 27 <1> 28 <1> ;============================================================================= 29 <1> ; unassemble 30 <1> ;----------------------------------------------------------------------------- 31 <1> ; Unassembles command from unasm_seg:SI 32 <1> unassemble: 33 00002EC5 50 <1> push ax 34 00002EC6 53 <1> push bx 35 00002EC7 51 <1> push cx 36 00002EC8 52 <1> push dx 37 00002EC9 57 <1> push di 38 00002ECA 1E <1> push ds 39 00002ECB 06 <1> push es 40 00002ECC FC <1> cld 41 00002ECD 31C0 <1> xor ax,ax 42 00002ECF A2[7A8B] <1> mov [memory_flag],al 43 00002ED2 A3[7C8B] <1> mov [mem_disp_offs],ax 44 00002ED5 A2[A38B] <1> mov [jcnear],al 45 00002ED8 C606[7B8B]08 <1> mov byte [mem_disp_type],8 46 00002EDD A3[7E8B] <1> mov [mem_prefix],ax 47 00002EE0 2E8E1E[9B8B] <1> mov ds,[cs:unasm_seg] 48 00002EE5 0E <1> push cs 49 00002EE6 07 <1> pop es 50 00002EE7 2E8936[908B] <1> mov [cs:unasm_cur_ip],si 51 00002EEC 2EA2[9A8B] <1> mov [cs:ignore_prefix],al 52 <1> get_next_cmd: 53 00002EF0 E81E0B <1> call clear_buffer 54 00002EF3 BF[BF8D] <1> mov di,CMD_X 55 00002EF6 31C0 <1> xor ax,ax 56 00002EF8 2EA2[9E8B] <1> mov [cs:op_size_flag],al 57 00002EFC 2EA2[9F8B] <1> mov [cs:addr_size_flag],al 58 00002F00 2EA2[A08B] <1> mov [cs:str_flag],al 59 00002F04 2EA3[A18B] <1> mov [cs:cur_rep],ax 60 00002F08 2EA2[A48B] <1> mov [cs:db_flag],al 61 <1> get_next_byte: 62 00002F0C AC <1> lodsb 63 00002F0D 2EA2[928B] <1> mov [cs:cur_cmd],al 64 00002F11 31DB <1> xor bx,bx 65 00002F13 88C3 <1> mov bl,al 66 00002F15 D1E3 <1> shl bx,1 67 00002F17 2EC606[9D8B]00 <1> mov byte [cs:inst_286],0 68 00002F1D 2EC606[978B]00 <1> mov byte [cs:print_flag],0 69 00002F23 2E8B97[5B40] <1> mov dx,[cs:cmd_parameters+bx] 70 00002F28 2E8916[938B] <1> mov [cs:cur_param],dx 71 00002F2D 2E8B97[D53D] <1> mov dx,[cs:cmd_addrs+bx] 72 00002F32 81FA[D33D] <1> cmp dx,size_prefixes 73 00002F36 7203 <1> jb not_size_prefix 74 00002F38 E9DC00 <1> jmp analyze_size_prefix 75 <1> not_size_prefix: 76 00002F3B 81FA[BB3D] <1> cmp dx,seg_prefixes 77 00002F3F 7203 <1> jb not_seg_prefix 78 00002F41 E90C01 <1> jmp analyze_seg_prefix 79 <1> not_seg_prefix: 80 00002F44 81FA[A93D] <1> cmp dx,unasm_rep_prefixes 81 00002F48 7203 <1> jb get_code_name 82 00002F4A E92D01 <1> jmp analyze_rep_prefix 83 <1> get_code_name: 84 00002F4D E83A01 <1> call analyze_code 85 00002F50 2E8B16[938B] <1> mov dx,[cs:cur_param] 86 00002F55 2E803E[9D8B]00 <1> cmp byte [cs:inst_286],0 87 00002F5B 7410 <1> je param_8086 88 <1> 89 00002F5D 88F3 <1> mov bl,dh 90 00002F5F B700 <1> mov bh,0 91 00002F61 01DB <1> add bx,bx 92 00002F63 2E8B97[4540] <1> mov dx,[cs:table_286_param+bx] 93 00002F68 2E8916[938B] <1> mov [cs:cur_param],dx 94 <1> 95 <1> param_8086: 96 00002F6D 09D2 <1> or dx,dx 97 00002F6F 7435 <1> jz no_params 98 00002F71 08F6 <1> or dh,dh 99 00002F73 7506 <1> jne @@no_print 100 00002F75 2EC606[978B]01 <1> mov byte [cs:print_flag],1 101 <1> @@no_print: 102 00002F7B 88D0 <1> mov al,dl 103 00002F7D E8E804 <1> call analyze_param 104 00002F80 2E803E[A48B]00 <1> cmp byte [cs:db_flag],0 105 00002F86 7535 <1> jne make_db_command 106 00002F88 2E8B16[938B] <1> mov dx,[cs:cur_param] 107 00002F8D 08F6 <1> or dh,dh 108 00002F8F 7415 <1> jz unasm_one_param 109 00002F91 80FE3F <1> cmp dh,aemp 110 00002F94 7410 <1> je unasm_one_param 111 00002F96 E8420A <1> call delimit 112 00002F99 88F0 <1> mov al,dh 113 00002F9B E8CA04 <1> call analyze_param 114 00002F9E 2E803E[A48B]00 <1> cmp byte [cs:db_flag],0 115 00002FA4 7517 <1> jne make_db_command 116 <1> no_params: 117 <1> unasm_one_param: 118 00002FA6 2E833E[A18B]00 <1> cmp word [cs:cur_rep],0 119 00002FAC 7428 <1> je no_rep 120 00002FAE 2E803E[A08B]01 <1> cmp byte [cs:str_flag],1 121 00002FB4 7420 <1> je no_rep 122 00002FB6 2EC706[A18B]0000 <1> mov word [cs:cur_rep],0 123 <1> make_db_command: 124 00002FBD E8510A <1> call clear_buffer 125 00002FC0 BA[9D3D] <1> mov dx,cdb 126 00002FC3 2EC706[938B]0000 <1> mov word [cs:cur_param],0 127 00002FCA BF[BF8D] <1> mov di,CMD_X 128 00002FCD 2E8B36[908B] <1> mov si,[cs:unasm_cur_ip] 129 00002FD2 AC <1> lodsb 130 00002FD3 E977FF <1> jmp get_code_name 131 <1> no_rep: 132 00002FD6 2E833E[988B]00 <1> cmp word [cs:cur_prefix],0 133 00002FDC 755D <1> jne prefix_not_used 134 <1> 135 <1> prefix_now_used: 136 <1> ;[1245 - 1.01] 137 00002FDE 2E803E[9E8B]00 <1> cmp byte [cs:op_size_flag],0 138 00002FE4 7406 <1> je @@skip_param_32 139 00002FE6 2EC606[7A8B]03 <1> mov byte [cs:memory_flag],3 140 <1> 141 <1> @@skip_param_32: 142 <1> ;[1245 - 1.01] 143 00002FEC 57 <1> push di 144 00002FED 89F1 <1> mov cx,si 145 00002FEF 2E2B0E[908B] <1> sub cx,[cs:unasm_cur_ip] 146 00002FF4 2E890E[1530] <1> mov [cs:cmd_length],cx 147 00002FF9 BF[B08D] <1> mov di,buffer+6 148 00002FFC E8E909 <1> call fill_codes 149 00002FFF BF[AA8D] <1> mov di,buffer 150 00003002 E8DC09 <1> call fill_addr 151 00003005 5F <1> pop di 152 00003006 07 <1> pop es 153 00003007 1F <1> pop ds 154 00003008 8D854171 <1> lea ax,[di-(CMD_X-offset_0100h+100h)] 155 <1> ; lea ax,[di-(CMD_X-OFFS100H+100h)] 156 0000300C A3[808B] <1> mov [cmd_text_size],ax 157 0000300F 5F <1> pop di 158 00003010 5A <1> pop dx 159 00003011 59 <1> pop cx 160 00003012 5B <1> pop bx 161 00003013 58 <1> pop ax 162 00003014 C3 <1> ret 163 <1> 164 00003015 0000 <1> cmd_length dw 0 165 <1> 166 <1> ; Return from unassemble -------------------------- 167 <1> analyze_size_prefix: 168 00003017 2E8A26[938B] <1> mov ah,[cs:cur_param] 169 0000301C 2E3A26[C42E] <1> cmp ah,[cs:cpu_type] 170 00003021 7739 <1> ja bad_prefix 171 00003023 81FA[D33D] <1> cmp dx,op_size 172 00003027 7409 <1> je set_op_size 173 00003029 2EC606[9F8B]01 <1> mov byte [cs:addr_size_flag],1 174 0000302F E9DAFE <1> jmp get_next_byte 175 <1> set_op_size: 176 00003032 2EC606[9E8B]01 <1> mov byte [cs:op_size_flag],1 177 00003038 E9D1FE <1> jmp get_next_byte 178 <1> 179 <1> prefix_not_used: 180 <1> many_prefs: 181 0000303B 2E8B36[908B] <1> mov si,[cs:unasm_cur_ip] 182 00003040 2EC706[988B]0000 <1> mov word [cs:cur_prefix],0 183 00003047 2EC606[9A8B]01 <1> mov byte [cs:ignore_prefix],1 184 0000304D E9A0FE <1> jmp get_next_cmd 185 <1> 186 <1> analyze_seg_prefix: 187 00003050 2E8A26[938B] <1> mov ah,[cs:cur_param] 188 00003055 2E3A26[C42E] <1> cmp ah,[cs:cpu_type] 189 0000305A 7606 <1> jbe pref_ok 190 <1> bad_prefix: 191 0000305C BA[9D3D] <1> mov dx,cdb 192 <1> loc_get_code_name: 193 0000305F E9EBFE <1> jmp get_code_name 194 <1> pref_ok: 195 00003062 2E803E[9A8B]01 <1> cmp byte [cs:ignore_prefix],1 196 00003068 74F5 <1> je loc_get_code_name 197 0000306A 2E833E[988B]00 <1> cmp word [cs:cur_prefix],0 198 00003070 75C9 <1> jne many_prefs 199 00003072 2E8916[988B] <1> mov [cs:cur_prefix],dx 200 00003077 E992FE <1> jmp get_next_byte 201 <1> 202 <1> analyze_rep_prefix: 203 0000307A 89D3 <1> mov bx,dx 204 0000307C E85009 <1> call fill_csbx 205 0000307F BF[C78D] <1> mov di,OPER_X 206 00003082 2E8916[A18B] <1> mov [cs:cur_rep],dx 207 00003087 E982FE <1> jmp get_next_byte 208 <1> 209 <1> ;============================================================================= 210 <1> ; analyze_code 211 <1> ;----------------------------------------------------------------------------- 212 <1> analyze_code: 213 0000308A 3C0F <1> cmp al,0fh 214 0000308C 7431 <1> je check_pm_inst 215 0000308E 2E8B1E[938B] <1> mov bx,[cs:cur_param] 216 00003093 80FB70 <1> cmp bl,a86 217 00003096 7632 <1> jbe not_286 218 <1> 219 <1> check_286_inst: 220 00003098 80FB80 <1> cmp bl,80h 221 0000309B 732D <1> jae not_286 222 0000309D 2E3A1E[C42E] <1> cmp bl,[cs:cpu_type] 223 000030A2 7605 <1> jbe @@ok 224 000030A4 BA[9D3D] <1> mov dx,cdb 225 000030A7 EB56 <1> jmp ..@go_ahead 226 <1> 227 <1> @@ok: 228 000030A9 2EC606[9D8B]01 <1> mov byte [cs:inst_286],1 229 000030AF EB21 <1> jmp ..@test_ext 230 <1> 231 <1> ch_second: 232 000030B1 AC <1> lodsb 233 000030B2 3C0A <1> cmp al,0ah 234 000030B4 7449 <1> je ..@go_ahead 235 000030B6 2EC606[938B]03 <1> mov byte [cs:cur_param],aim8 236 000030BC 4E <1> dec si 237 000030BD EB40 <1> jmp ..@go_ahead 238 <1> 239 <1> check_pm_inst: 240 000030BF 2E803E[C42E]70 <1> cmp byte [cs:cpu_type],a86 241 000030C5 7403 <1> je not_286 242 000030C7 E9C200 <1> jmp analyze_pm_inst 243 <1> 244 <1> not_286: 245 000030CA 3CD4 <1> cmp al,0d4h 246 000030CC 74E3 <1> je ch_second 247 000030CE 3CD5 <1> cmp al,0d5h 248 000030D0 74DF <1> je ch_second 249 <1> ..@test_ext: 250 000030D2 2E803E[9F8B]00 <1> cmp byte [cs:addr_size_flag],0 251 000030D8 7404 <1> je @@skip_addr 252 000030DA 3CE3 <1> cmp al,0e3h 253 000030DC 7447 <1> je check_jecxz 254 <1> @@skip_addr: 255 000030DE 2E803E[9E8B]00 <1> cmp byte [cs:op_size_flag],0 256 000030E4 7419 <1> je @@skip_op 257 000030E6 BB[5D32] <1> mov bx,ext_table 258 <1> @@next_ext: 259 000030E9 2E8A27 <1> mov ah,[cs:bx] 260 000030EC 08E4 <1> or ah,ah 261 000030EE 740F <1> jz ..@go_ahead 262 000030F0 38E0 <1> cmp al,ah 263 000030F2 7405 <1> je @@found_ext 264 000030F4 83C303 <1> add bx,3 265 000030F7 EBF0 <1> jmp @@next_ext 266 <1> @@found_ext: 267 000030F9 2E8B5701 <1> mov dx,[cs:bx+1] 268 000030FD EB00 <1> jmp ..@go_ahead 269 <1> @@skip_op: 270 <1> ; cmp al,0D8h 271 <1> ; jb @@Go_ahead 272 <1> ; cmp al,0DFh 273 <1> ; jbe Coprocessor 274 <1> ..@go_ahead: 275 000030FF 56 <1> push si 276 00003100 83FA06 <1> cmp dx,6 277 00003103 7625 <1> jbe groups 278 <1> make_db: 279 00003105 89D6 <1> mov si,dx 280 00003107 81FA[9D3D] <1> cmp dx,cdb 281 0000310B 756F <1> jne ..@quit_00 282 0000310D E8B208 <1> call unasm_fill_str 283 00003110 5E <1> pop si 284 00003111 2E8B36[908B] <1> mov si,[cs:unasm_cur_ip] 285 00003116 AC <1> lodsb 286 00003117 BF[C78D] <1> mov di,OPER_X 287 0000311A E809E9 <1> call fill_byte_str 288 0000311D 2EC706[938B]0000 <1> mov word [cs:cur_param],0 289 00003124 C3 <1> ret 290 <1> check_jecxz: 291 00003125 BA[463D] <1> mov dx,cjecxz 292 00003128 EBD5 <1> jmp ..@go_ahead 293 <1> 294 <1> groups: 295 0000312A 2EC606[978B]01 <1> mov byte [cs:print_flag],1 296 00003130 8A04 <1> mov al,[si] 297 00003132 31DB <1> xor bx,bx 298 00003134 88C3 <1> mov bl,al 299 00003136 80E338 <1> and bl,00111000b 300 00003139 83FA03 <1> cmp dx,grp_1 301 0000313C 7519 <1> jne @@1 302 0000313E 80FB00 <1> cmp bl,00000000b 303 00003141 7514 <1> jne @@1 304 00003143 2EC606[948B]03 <1> mov byte [cs:cur_param+1],aim8 305 00003149 2E803E[938B]01 <1> cmp byte [cs:cur_param],arm8 306 0000314F 7406 <1> je @@1 307 00003151 2EC606[948B]83 <1> mov byte [cs:cur_param+1],aim16 308 <1> @@1: 309 00003157 D0EB <1> shr bl,1 310 00003159 D0EB <1> shr bl,1 311 0000315B D1E2 <1> shl dx,1 312 0000315D D1E2 <1> shl dx,1 313 0000315F D1E2 <1> shl dx,1 314 00003161 D1E2 <1> shl dx,1 315 00003163 01D3 <1> add bx,dx 316 00003165 2E8BB7[D53F] <1> mov si,[cs:grp_commands+bx] 317 0000316A 81FE[A03D] <1> cmp si,qqq 318 0000316E 750C <1> jne ..@quit_00 319 00003170 BA[9D3D] <1> mov dx,cdb 320 00003173 2EC706[938B]0000 <1> mov word [cs:cur_param],0 321 0000317A EB89 <1> jmp make_db 322 <1> ..@quit_00: 323 0000317C E84308 <1> call unasm_fill_str 324 0000317F 5E <1> pop si 325 00003180 81FF[C78D] <1> cmp di,OPER_X 326 00003184 7704 <1> ja @@exit 327 00003186 BF[C78D] <1> mov di,OPER_X 328 00003189 C3 <1> ret 329 <1> @@exit: 330 0000318A 47 <1> inc di 331 0000318B C3 <1> ret 332 <1> 333 <1> analyze_pm_inst: 334 0000318C 56 <1> push si 335 0000318D AC <1> lodsb 336 0000318E 3C01 <1> cmp al,1 337 00003190 763D <1> jbe pm_group 338 00003192 3C06 <1> cmp al,6 339 00003194 762F <1> jbe pm_cmd 340 00003196 BB[203C] <1> mov bx,cud0 341 00003199 3CFF <1> cmp al,0ffh ;ud0 342 0000319B 741A <1> je ud_cmd 343 0000319D BB[243C] <1> mov bx,cud1 344 000031A0 3CB9 <1> cmp al,0b9h ;ud1 345 000031A2 7413 <1> je ud_cmd 346 000031A4 BB[283C] <1> mov bx,cud2 347 000031A7 3C0B <1> cmp al,00bh ;ud2 348 000031A9 740C <1> je ud_cmd 349 000031AB 2E803E[C42E]72 <1> cmp byte [cs:cpu_type],a386 350 000031B1 7358 <1> jae analyze_386_inst 351 <1> bad_pm_command: 352 000031B3 5E <1> pop si 353 000031B4 E948FF <1> jmp ..@go_ahead 354 <1> ud_cmd: 355 000031B7 89DA <1> mov dx,bx 356 000031B9 B80000 <1> mov ax,ano*100h+ano 357 000031BC 2EA3[938B] <1> mov [cs:cur_param],ax 358 000031C0 5E <1> pop si 359 000031C1 46 <1> inc si 360 000031C2 E93AFF <1> jmp ..@go_ahead 361 <1> pm_cmd: 362 000031C5 040E <1> add al,14 363 000031C7 88C3 <1> mov bl,al 364 000031C9 B700 <1> mov bh,0 365 000031CB D1E3 <1> shl bx,1 366 000031CD EB11 <1> jmp get_pm_name 367 <1> pm_group: 368 000031CF 88C3 <1> mov bl,al 369 000031D1 AC <1> lodsb 370 000031D2 2438 <1> and al,00111000b 371 000031D4 D0E8 <1> shr al,1 372 000031D6 D0E8 <1> shr al,1 373 000031D8 B104 <1> mov cl,4 374 000031DA D2E3 <1> shl bl,cl 375 000031DC 08C3 <1> or bl,al 376 000031DE B700 <1> mov bh,0 377 <1> get_pm_name: 378 000031E0 2E8B97[8832] <1> mov dx,[cs:pm_commands+bx] 379 000031E5 81FA[9D3D] <1> cmp dx,cdb 380 000031E9 74C8 <1> je bad_pm_command 381 000031EB 81FA[833D] <1> cmp dx,cinvlpg 382 000031EF 740E <1> je check_invlpg 383 <1> invlpg_ok: 384 000031F1 2E8B87[B232] <1> mov ax,[cs:pm_param+bx] 385 000031F6 2EA3[938B] <1> mov [cs:cur_param],ax 386 000031FA 5E <1> pop si 387 000031FB 46 <1> inc si 388 000031FC E900FF <1> jmp ..@go_ahead 389 <1> check_invlpg: 390 000031FF 803E[C42E]73 <1> cmp byte [cpu_type],a486 391 00003204 73EB <1> jae invlpg_ok 392 00003206 BA[9D3D] <1> mov dx,cdb 393 00003209 EBA8 <1> jmp bad_pm_command 394 <1> 395 <1> analyze_386_inst: 396 0000320B 57 <1> push di 397 0000320C 06 <1> push es 398 0000320D 0E <1> push cs 399 0000320E 07 <1> pop es 400 0000320F BF[EC32] <1> mov di,table_386_loc 401 00003212 B93E00 <1> mov cx,T3_LENGTH 402 00003215 2E803E[C42E]73 <1> cmp byte [cs:cpu_type],a486 403 0000321B 7503 <1> jne @@3 404 0000321D B94C00 <1> mov cx,T4_LENGTH 405 <1> @@3: 406 00003220 F2AE <1> repne scasb 407 00003222 89FB <1> mov bx,di 408 00003224 07 <1> pop es 409 00003225 5F <1> pop di 410 00003226 758B <1> jne bad_pm_command 411 00003228 81EB[ED32] <1> sub bx,table_386_loc+1 412 0000322C 01DB <1> add bx,bx 413 0000322E 2E8B97[3833] <1> mov dx,[cs:name_386+bx] 414 00003233 2E8B87[D033] <1> mov ax,[cs:param_386+bx] 415 00003238 2EA3[938B] <1> mov [cs:cur_param],ax 416 0000323C 83FA06 <1> cmp dx,bt_grp 417 0000323F 740B <1> je analyze_bt_grp 418 <1> done_bt: 419 00003241 5E <1> pop si 420 00003242 46 <1> inc si 421 00003243 2EC606[A38B]01 <1> mov byte [cs:jcnear],1 422 00003249 E9B3FE <1> jmp ..@go_ahead 423 <1> analyze_bt_grp: 424 0000324C AC <1> lodsb 425 0000324D 2438 <1> and al,00111000b 426 0000324F D0E8 <1> shr al,1 427 00003251 D0E8 <1> shr al,1 428 00003253 98 <1> cbw 429 00003254 89C3 <1> mov bx,ax 430 00003256 2E8B97[DC32] <1> mov dx,[cs:bt_cmd+bx] 431 0000325B EBE4 <1> jmp done_bt 432 <1> ;============================================================================= 433 <1> ext_table: 434 0000325D 60 <1> db 60h 435 0000325E [523D] <1> dw cpushad 436 00003260 61 <1> db 61h 437 00003261 [593D] <1> dw cpopad 438 00003263 6D <1> db 6Dh 439 00003264 [D13C] <1> dw cinsd 440 00003266 6F <1> db 6Fh 441 00003267 [D63C] <1> dw coutsd 442 00003269 98 <1> db 98h 443 0000326A [9B3C] <1> dw ccwde 444 0000326C 99 <1> db 99h 445 0000326D [A03C] <1> dw ccdq 446 0000326F 9C <1> db 9Ch 447 00003270 [5F3D] <1> dw cpushfd 448 00003272 9D <1> db 9Dh 449 00003273 [663D] <1> dw cpopfd 450 00003275 A5 <1> db 0A5h 451 00003276 [DC3C] <1> dw cmovsd 452 00003278 A7 <1> db 0A7h 453 00003279 [E23C] <1> dw ccmpsd 454 0000327B AB <1> db 0ABh 455 0000327C [CB3C] <1> dw cstosd 456 0000327E AD <1> db 0ADh 457 0000327F [C53C] <1> dw clodsd 458 00003281 AF <1> db 0AFh 459 00003282 [E83C] <1> dw cscasd 460 00003284 CF <1> db 0CFh 461 00003285 [4C3D] <1> dw ciretd 462 00003287 00 <1> db 0 463 <1> ;============================================================================= 464 <1> pm_commands: 465 00003288 [453C] <1> dw csldt 466 0000328A [583C] <1> dw cstr 467 0000328C [403C] <1> dw clldt 468 0000328E [543C] <1> dw cltr 469 00003290 [693C] <1> dw cverr 470 00003292 [6E3C] <1> dw cverw 471 00003294 [9D3D] <1> dw cdb 472 00003296 [9D3D] <1> dw cdb 473 <1> 474 00003298 [313C] <1> dw csgdt 475 0000329A [3B3C] <1> dw csidt 476 0000329C [2C3C] <1> dw clgdt 477 0000329E [363C] <1> dw clidt 478 000032A0 [4F3C] <1> dw csmsw 479 000032A2 [9D3D] <1> dw cdb 480 000032A4 [4A3C] <1> dw clmsw 481 000032A6 [833D] <1> dw cinvlpg 482 <1> 483 <1> ; Skipped 2 words 484 000032A8 [5C3C] <1> dw clar 485 000032AA [603C] <1> dw clsl 486 000032AC [9D3D] <1> dw cdb 487 000032AE [783C] <1> dw cloadall286 488 000032B0 [733C] <1> dw cclts 489 <1> ; Skipped 1 word 490 <1> ;============================================================================= 491 <1> pm_param: 492 000032B2 813F <1> db arm16, aemp 493 000032B4 813F <1> db arm16, aemp 494 000032B6 813F <1> db arm16, aemp 495 000032B8 813F <1> db arm16, aemp 496 000032BA 813F <1> db arm16, aemp 497 000032BC 813F <1> db arm16, aemp 498 000032BE 0000 <1> db ano, ano 499 000032C0 0000 <1> db ano, ano 500 <1> 501 000032C2 813F <1> db arm16, aemp 502 000032C4 813F <1> db arm16, aemp 503 000032C6 813F <1> db arm16, aemp 504 000032C8 813F <1> db arm16, aemp 505 000032CA 813F <1> db arm16, aemp 506 000032CC 0000 <1> db ano, ano 507 000032CE 813F <1> db arm16, aemp 508 000032D0 813F <1> db arm16, aemp 509 <1> 510 <1> ; Skipped 2 words 511 000032D2 8B3F <1> db ar16rm, aemp 512 000032D4 8B3F <1> db ar16rm, aemp 513 000032D6 0000 <1> db ano, ano 514 000032D8 0000 <1> db ano, ano 515 000032DA 0000 <1> db ano, ano 516 <1> ; Skipped 1 word 517 <1> ;============================================================================= 518 <1> bt_cmd: 519 000032DC [9D3D] <1> dw cdb 520 000032DE [9D3D] <1> dw cdb 521 000032E0 [9D3D] <1> dw cdb 522 000032E2 [9D3D] <1> dw cdb 523 000032E4 [AE3C] <1> dw cbt 524 000032E6 [B13C] <1> dw cbts 525 000032E8 [B53C] <1> dw cbtr 526 000032EA [B93C] <1> dw cbtc 527 <1> ;============================================================================= 528 <1> table_386_loc: 529 000032EC 07 <1> db 07 ;loadall386 530 <1> 531 000032ED 202122232426 <1> db 20h, 21h, 22h, 23h, 24h, 26h ; mov CR, DR, TR 532 <1> 533 000032F3 8081828384858687 <1> db 80h, 81h, 82h, 83h, 84h, 85h, 86h, 87h 534 000032FB 88898A8B8C8D8E8F <1> db 88h, 89h, 8Ah, 8Bh, 8Ch, 8Dh, 8Eh, 8Fh 535 <1> 536 00003303 9091929394959697 <1> db 90h, 91h, 92h, 93h, 94h, 95h, 96h, 97h 537 0000330B 98999A9B9C9D9E9F <1> db 98h, 99h, 9Ah, 9Bh, 9Ch, 9Dh, 9Eh, 9Fh 538 <1> 539 00003313 A0A1 <1> db 0A0h, 0A1h 540 00003315 A3A4A5 <1> db 0A3h, 0A4h, 0A5h 541 00003318 A8A9 <1> db 0A8h, 0A9h 542 0000331A ABACADAFB2 <1> db 0ABh, 0ACh, 0ADh, 0AFh, 0B2h 543 0000331F B3B4B5B6B7BABB <1> db 0B3h, 0B4h, 0B5h, 0B6h, 0B7h, 0BAh, 0BBh 544 00003326 BCBDBEBF <1> db 0BCh, 0BDh, 0BEh, 0BFh 545 <1> 546 <1> T3_LENGTH equ $-table_386_loc 547 <1> ;============================================================================= 548 <1> table_486_loc: 549 0000332A 0809B0B1C0C1 <1> db 08h, 09h, 0B0h, 0B1h, 0C0h, 0C1h 550 00003330 C8C9CACBCCCDCECF <1> db 0C8h, 0C9h, 0CAh, 0CBh, 0CCh, 0CDh, 0CEh, 0CFh 551 <1> 552 <1> T4_LENGTH equ $-table_386_loc 553 <1> ;============================================================================= 554 <1> name_386: 555 00003338 [6C3D] <1> dw cloadall386 556 <1> 557 0000333A [7A3A] <1> dw cmov 558 0000333C [7A3A] <1> dw cmov 559 0000333E [7A3A] <1> dw cmov 560 00003340 [7A3A] <1> dw cmov 561 00003342 [7A3A] <1> dw cmov 562 00003344 [7A3A] <1> dw cmov 563 <1> 564 00003346 [B53B] <1> dw cjo 565 00003348 [B83B] <1> dw cjno 566 0000334A [BC3B] <1> dw cjb 567 0000334C [BF3B] <1> dw cjnb 568 0000334E [C33B] <1> dw cjz 569 00003350 [C63B] <1> dw cjnz 570 00003352 [CA3B] <1> dw cjbe 571 00003354 [CE3B] <1> dw cja 572 00003356 [D13B] <1> dw cjs 573 00003358 [D43B] <1> dw cjns 574 0000335A [D83B] <1> dw cjp 575 0000335C [DB3B] <1> dw cjnp 576 0000335E [DF3B] <1> dw cjl 577 00003360 [E23B] <1> dw cjge 578 00003362 [E63B] <1> dw cjle 579 00003364 [EA3B] <1> dw cjg 580 <1> 581 00003366 [3B3D] <1> dw cseto 582 00003368 [403D] <1> dw csetno 583 0000336A [F93C] <1> dw csetb 584 0000336C [F33C] <1> dw csetae 585 0000336E [043D] <1> dw csete 586 00003370 [093D] <1> dw csetne 587 00003372 [FE3C] <1> dw csetbe 588 00003374 [EE3C] <1> dw cseta 589 00003376 [303D] <1> dw csets 590 00003378 [353D] <1> dw csetns 591 0000337A [0F3D] <1> dw csetp 592 0000337C [143D] <1> dw csetnp 593 0000337E [253D] <1> dw csetl 594 00003380 [1F3D] <1> dw csetge 595 00003382 [2A3D] <1> dw csetle 596 00003384 [1A3D] <1> dw csetg 597 <1> 598 00003386 [713A] <1> dw cpush 599 00003388 [763A] <1> dw cpop 600 <1> 601 0000338A [AE3C] <1> dw cbt 602 0000338C [A43C] <1> dw cshld 603 0000338E [A43C] <1> dw cshld 604 <1> 605 00003390 [713A] <1> dw cpush 606 00003392 [763A] <1> dw cpop 607 <1> 608 00003394 [B13C] <1> dw cbts 609 00003396 [A93C] <1> dw cshrd 610 00003398 [A93C] <1> dw cshrd 611 0000339A [B03A] <1> dw cimul 612 0000339C [973C] <1> dw clss 613 0000339E [B53C] <1> dw cbtr 614 000033A0 [8F3C] <1> dw clfs 615 000033A2 [933C] <1> dw clgs 616 000033A4 [893C] <1> dw cmovzx 617 000033A6 [893C] <1> dw cmovzx 618 000033A8 0600 <1> dw bt_grp 619 000033AA [B93C] <1> dw cbtc 620 000033AC [BD3C] <1> dw cbsf 621 000033AE [C13C] <1> dw cbsr 622 000033B0 [833C] <1> dw cmovsx 623 000033B2 [833C] <1> dw cmovsx 624 <1> ;============================================================================= 625 <1> name_486: 626 000033B4 [773D] <1> dw cinvd 627 000033B6 [7C3D] <1> dw cwbinvd 628 000033B8 [8A3D] <1> dw ccmpxchg 629 000033BA [8A3D] <1> dw ccmpxchg 630 000033BC [923D] <1> dw cxadd 631 000033BE [923D] <1> dw cxadd 632 <1> 633 000033C0 [973D] <1> dw cbswap 634 000033C2 [973D] <1> dw cbswap 635 000033C4 [973D] <1> dw cbswap 636 000033C6 [973D] <1> dw cbswap 637 000033C8 [973D] <1> dw cbswap 638 000033CA [973D] <1> dw cbswap 639 000033CC [973D] <1> dw cbswap 640 000033CE [973D] <1> dw cbswap 641 <1> ;============================================================================= 642 <1> param_386: 643 000033D0 0000 <1> db ano,ano 644 <1> 645 000033D2 133F <1> db r_cr, aemp 646 000033D4 153F <1> db r_dr, aemp 647 000033D6 143F <1> db cr_r, aemp 648 000033D8 163F <1> db dr_r, aemp 649 000033DA 173F <1> db r_tr, aemp 650 000033DC 183F <1> db tr_r, aemp 651 <1> 652 000033DE 0700 <1> db anear, ano 653 000033E0 0700 <1> db anear, ano 654 000033E2 0700 <1> db anear, ano 655 000033E4 0700 <1> db anear, ano 656 000033E6 0700 <1> db anear, ano 657 000033E8 0700 <1> db anear, ano 658 000033EA 0700 <1> db anear, ano 659 000033EC 0700 <1> db anear, ano 660 000033EE 0700 <1> db anear, ano 661 000033F0 0700 <1> db anear, ano 662 000033F2 0700 <1> db anear, ano 663 000033F4 0700 <1> db anear, ano 664 000033F6 0700 <1> db anear, ano 665 000033F8 0700 <1> db anear, ano 666 000033FA 0700 <1> db anear, ano 667 000033FC 0700 <1> db anear, ano 668 <1> 669 000033FE 0100 <1> db arm8, ano 670 00003400 0100 <1> db arm8, ano 671 00003402 0100 <1> db arm8, ano 672 00003404 0100 <1> db arm8, ano 673 00003406 0100 <1> db arm8, ano 674 00003408 0100 <1> db arm8, ano 675 0000340A 0100 <1> db arm8, ano 676 0000340C 0100 <1> db arm8, ano 677 0000340E 0100 <1> db arm8, ano 678 00003410 0100 <1> db arm8, ano 679 00003412 0100 <1> db arm8, ano 680 00003414 0100 <1> db arm8, ano 681 00003416 0100 <1> db arm8, ano 682 00003418 0100 <1> db arm8, ano 683 0000341A 0100 <1> db arm8, ano 684 0000341C 0100 <1> db arm8, ano 685 <1> 686 0000341E 5400 <1> db afs, ano 687 00003420 5400 <1> db afs,ano 688 <1> 689 00003422 8A3F <1> db arm16r, aemp 690 00003424 8A03 <1> db arm16r, aim8 691 00003426 8A49 <1> db arm16r, acl 692 <1> 693 00003428 5500 <1> db ags, ano 694 0000342A 5500 <1> db ags, ano 695 <1> 696 0000342C 8A3F <1> db arm16r, aemp 697 0000342E 8A03 <1> db arm16r, aim8 698 00003430 8A49 <1> db arm16r, acl 699 00003432 8B3F <1> db ar16rm, aemp 700 00003434 8B3F <1> db ar16rm, aemp 701 00003436 8A3F <1> db arm16r, aemp 702 00003438 8B3F <1> db ar16rm, aemp 703 0000343A 8B3F <1> db ar16rm, aemp 704 0000343C 103F <1> db ar8_16, aemp 705 0000343E 113F <1> db ar16_32, aemp 706 00003440 8103 <1> db arm16, aim8 707 00003442 8A3F <1> db arm16r, aemp 708 00003444 8B3F <1> db ar16rm, aemp 709 00003446 8B3F <1> db ar16rm, aemp 710 00003448 103F <1> db ar8_16, aemp 711 0000344A 113F <1> db ar16_32, aemp 712 <1> ;============================================================================= 713 <1> param_486: 714 0000344C 0000 <1> db ano, ano 715 0000344E 0000 <1> db ano, ano 716 00003450 0A3F <1> db arm8r, aemp 717 00003452 8A3F <1> db arm16r, aemp 718 00003454 0A3F <1> db arm8r, aemp 719 00003456 8A3F <1> db arm16r, aemp 720 <1> 721 00003458 4000 <1> db aax, ano 722 0000345A 4100 <1> db acx, ano 723 0000345C 4200 <1> db adx, ano 724 0000345E 4300 <1> db abx, ano 725 00003460 4400 <1> db aspa, ano 726 00003462 4500 <1> db abp, ano 727 00003464 4600 <1> db asi, ano 728 00003466 4700 <1> db adi, ano 729 <1> 730 <1> ;Coprocessor: 731 <1> ; and al,111b 732 <1> ; mov bl,al 733 <1> ; mov bh,0 734 <1> ; lodsb 735 <1> ; and al,00111000b 736 <1> ; or bl,al 737 <1> ; add bx,bx 738 <1> ; mov si,cs:CoprocCmd[bx] 739 <1> ; jmp @@Quit 740 <1> 741 <1> ;============================================================================= 742 <1> ; analyze_param 743 <1> ;----------------------------------------------------------------------------- 744 <1> analyze_param: 745 00003468 2EC606[958B]00 <1> mov byte [cs:word_flag],0 746 0000346E 2EC606[968B]00 <1> mov byte [cs:dword_flag],0 747 00003474 A880 <1> test al,80h 748 00003476 7405 <1> jz @@byte 749 00003478 2EFE06[958B] <1> inc byte [cs:word_flag] 750 <1> @@byte: 751 0000347D 247F <1> and al,7fh 752 <1> 753 0000347F 3C40 <1> cmp al,40h 754 00003481 735C <1> jae immed_reg 755 <1> 756 00003483 BB[9934] <1> mov bx,sub_table 757 <1> next_param: 758 00003486 2E8A27 <1> mov ah,[cs:bx] 759 00003489 38E0 <1> cmp al,ah 760 0000348B 7408 <1> je execute 761 0000348D 83C303 <1> add bx,3 762 00003490 08E4 <1> or ah,ah 763 00003492 75F2 <1> jnz next_param 764 00003494 C3 <1> ret 765 <1> execute: 766 00003495 2EFF6701 <1> jmp [cs:bx+1] 767 <1> ;----------------------------------------------------------------------------- 768 <1> sub_table: 769 00003499 03 <1> db aim8 770 0000349A [FC34] <1> dw immed_value 771 <1> 772 0000349C 05 <1> db a1 773 0000349D [2535] <1> dw immed_1 774 <1> 775 0000349F 04 <1> db amem8 776 000034A0 [2935] <1> dw memory 777 <1> 778 000034A2 06 <1> db asht 779 000034A3 [BC35] <1> dw jump_short 780 <1> 781 000034A5 07 <1> db anear 782 000034A6 [0936] <1> dw jump_near 783 <1> 784 000034A8 08 <1> db afar 785 000034A9 [2536] <1> dw jump_far 786 <1> 787 000034AB 01 <1> db arm8 788 000034AC [5736] <1> dw reg_mem 789 <1> 790 000034AE 0A <1> db arm8r 791 000034AF [7F36] <1> dw reg_mem_reg 792 <1> 793 000034B1 0B <1> db ar8rm 794 000034B2 [8936] <1> dw reg_reg_mem 795 <1> 796 000034B4 0C <1> db arm_seg 797 000034B5 [9336] <1> dw reg_mem_seg 798 <1> 799 000034B7 0D <1> db aseg_rm 800 000034B8 [A336] <1> dw seg_reg_mem 801 <1> 802 000034BA 0E <1> db aesc 803 000034BB [B236] <1> dw esc_param 804 <1> 805 000034BD 0F <1> db aim8_16 806 000034BE [1235] <1> dw im8_to_16 807 <1> 808 000034C0 10 <1> db ar8_16 809 000034C1 [5A35] <1> dw reg8_to_16 810 <1> 811 000034C3 11 <1> db ar16_32 812 000034C4 [7C35] <1> dw reg16_to_32 813 <1> 814 000034C6 13 <1> db r_cr 815 000034C7 [C736] <1> dw cr_to_reg 816 <1> 817 000034C9 14 <1> db cr_r 818 000034CA [E236] <1> dw reg_to_cr 819 <1> 820 000034CC 15 <1> db r_dr 821 000034CD [CF36] <1> dw dr_to_reg 822 <1> 823 000034CF 16 <1> db dr_r 824 000034D0 [E736] <1> dw reg_to_dr 825 <1> 826 000034D2 17 <1> db r_tr 827 000034D3 [D736] <1> dw tr_to_reg 828 <1> 829 000034D5 18 <1> db tr_r 830 000034D6 [EC36] <1> dw reg_to_tr 831 <1> 832 000034D8 19 <1> db astr 833 000034D9 [9E35] <1> dw str_param 834 <1> 835 000034DB 1A <1> db astrn 836 000034DC [B535] <1> dw str_nparam 837 <1> 838 000034DE 00 <1> db 0 839 <1> ;============================================================================= 840 <1> ; immed_reg 841 <1> ;----------------------------------------------------------------------------- 842 <1> immed_reg: 843 000034DF 3C48 <1> cmp al,aal 844 000034E1 7306 <1> jae @@byte_reg 845 000034E3 2EC606[958B]01 <1> mov byte [cs:word_flag],1 846 <1> @@byte_reg: 847 000034E9 31DB <1> xor bx,bx 848 000034EB 88C3 <1> mov bl,al 849 000034ED 80EB40 <1> sub bl,40h 850 000034F0 D1E3 <1> shl bx,1 851 000034F2 E88003 <1> call insert_op_size 852 000034F5 2E8B87[1E3A] <1> mov ax,[cs:registers+bx] 853 000034FA AB <1> stosw 854 000034FB C3 <1> ret 855 <1> ;============================================================================= 856 <1> ; immed_value 857 <1> ;----------------------------------------------------------------------------- 858 <1> immed_value: 859 000034FC 2E803E[958B]00 <1> cmp byte [cs:word_flag],0 860 00003502 7408 <1> je im8 861 00003504 2E803E[9E8B]01 <1> cmp byte [cs:op_size_flag],1 862 0000350A 7403 <1> je im32 863 <1> im8: 864 0000350C E9F204 <1> jmp fill_wb 865 <1> im32: 866 0000350F E906E5 <1> jmp fill_dword_str 867 <1> ;============================================================================= 868 <1> ; im8_to_16 869 <1> ;----------------------------------------------------------------------------- 870 <1> im8_to_16: 871 00003512 AC <1> lodsb 872 00003513 98 <1> cbw 873 00003514 2E803E[9E8B]01 <1> cmp byte [cs:op_size_flag],1 874 0000351A 7506 <1> jne im816 875 0000351C 99 <1> cwd 876 0000351D 92 <1> xchg ax,dx 877 0000351E E8FEE4 <1> call fill_word_str 878 00003521 92 <1> xchg ax,dx 879 <1> im816: 880 00003522 E9FAE4 <1> jmp fill_word_str 881 <1> 882 <1> immed_1: 883 00003525 B031 <1> mov al,'1' 884 00003527 AA <1> stosb 885 00003528 C3 <1> ret 886 <1> ;============================================================================= 887 <1> ; memory 888 <1> ;----------------------------------------------------------------------------- 889 <1> memory: 890 00003529 E83F04 <1> call print_ptr 891 0000352C B05B <1> mov al,'[' 892 0000352E AA <1> stosb 893 0000352F 2E803E[9F8B]00 <1> cmp byte [cs:addr_size_flag],0 894 00003535 7405 <1> je @@1 895 00003537 E8DEE4 <1> call fill_dword_str 896 0000353A EB1A <1> jmp @@2 897 <1> @@1: 898 0000353C AD <1> lodsw 899 0000353D 2EA3[7C8B] <1> mov [cs:mem_disp_offs],ax 900 00003541 2EC606[7B8B]08 <1> mov byte [cs:mem_disp_type],8 901 00003547 2E8A2E[958B] <1> mov ch,[cs:word_flag] 902 0000354C FEC5 <1> inc ch 903 0000354E 2E882E[7A8B] <1> mov [cs:memory_flag],ch 904 00003553 E8C9E4 <1> call fill_word_str 905 <1> @@2: 906 00003556 B05D <1> mov al,']' 907 00003558 AA <1> stosb 908 00003559 C3 <1> ret 909 <1> ;============================================================================= 910 <1> ; reg8_to_16 911 <1> ;----------------------------------------------------------------------------- 912 <1> reg8_to_16: 913 0000355A AC <1> lodsb 914 0000355B 2EC606[958B]01 <1> mov byte [cs:word_flag],1 915 00003561 E8E302 <1> call analyze_rm_reg 916 00003564 E87404 <1> call delimit 917 00003567 2EC606[958B]00 <1> mov byte [cs:word_flag],0 918 <1> ;[1245 - 1.01] 919 0000356D 2EC606[9E8B]00 <1> mov byte [cs:op_size_flag],0 920 00003573 2EC606[978B]01 <1> mov byte [cs:print_flag],1 921 <1> ;[1245 - 1.01] 922 00003579 E9A101 <1> jmp analyze_rm_disp 923 <1> ;============================================================================= 924 <1> ; reg16_to_32 925 <1> ;----------------------------------------------------------------------------- 926 <1> reg16_to_32: 927 0000357C AC <1> lodsb 928 0000357D 2EC606[9E8B]01 <1> mov byte [cs:op_size_flag],1 929 00003583 2EC606[958B]01 <1> mov byte [cs:word_flag],1 930 00003589 E8BB02 <1> call analyze_rm_reg 931 0000358C E84C04 <1> call delimit 932 0000358F 2EC606[9E8B]00 <1> mov byte [cs:op_size_flag],0 933 00003595 2EC606[978B]01 <1> mov byte [cs:print_flag],1 934 0000359B E97F01 <1> jmp analyze_rm_disp 935 <1> ;============================================================================= 936 <1> ; str_param 937 <1> ;----------------------------------------------------------------------------- 938 <1> str_param: 939 0000359E 2E833E[988B]00 <1> cmp word [cs:cur_prefix],0 940 000035A4 740F <1> je str_nparam 941 000035A6 2E8B1E[988B] <1> mov bx,[cs:cur_prefix] 942 000035AB 2EC706[988B]0000 <1> mov word [cs:cur_prefix],0 943 000035B2 E81A04 <1> call fill_csbx 944 <1> str_nparam: 945 000035B5 2EC606[A08B]01 <1> mov byte [cs:str_flag],1 946 000035BB C3 <1> ret 947 <1> ;============================================================================= 948 <1> ; jump_short 949 <1> ;----------------------------------------------------------------------------- 950 <1> jump_short: 951 000035BC 2E803E[928B]EB <1> cmp byte [cs:cur_cmd],0ebh 952 000035C2 7506 <1> jne not_print 953 000035C4 BB[FD35] <1> mov bx,short_str 954 000035C7 E80504 <1> call fill_csbx 955 <1> not_print: 956 000035CA AC <1> lodsb 957 000035CB 98 <1> cbw 958 <1> ..@print_jump: 959 000035CC E80800 <1> call check$ 960 000035CF 7205 <1> jc @@ret1 961 000035D1 01F0 <1> add ax,si 962 000035D3 E849E4 <1> call fill_word_str 963 <1> @@ret1: 964 000035D6 C3 <1> ret 965 <1> check$: 966 000035D7 09C0 <1> or ax,ax 967 000035D9 7412 <1> jz @@$p 968 000035DB 2E8B1E[908B] <1> mov bx,[cs:unasm_cur_ip] 969 000035E0 29F3 <1> sub bx,si 970 000035E2 39D8 <1> cmp ax,bx 971 000035E4 7402 <1> je @@$ 972 000035E6 F8 <1> clc 973 000035E7 C3 <1> ret 974 <1> @@$: 975 000035E8 B024 <1> mov al,'$' 976 000035EA AA <1> stosb 977 000035EB F9 <1> stc 978 000035EC C3 <1> ret 979 <1> @@$p: 980 000035ED B8242B <1> mov ax,'$+' 981 000035F0 AB <1> stosw 982 000035F1 89F0 <1> mov ax,si 983 000035F3 2E2B06[908B] <1> sub ax,[cs:unasm_cur_ip] 984 000035F8 0430 <1> add al,'0' 985 000035FA AA <1> stosb 986 000035FB F9 <1> stc 987 000035FC C3 <1> ret 988 <1> 989 000035FD 73686F72742000 <1> short_str db 'short ',0 990 <1> ;near_str db 'near ',0 991 00003604 6661722000 <1> far_str db 'far ',0 992 <1> 993 <1> ;============================================================================= 994 <1> ; jump_near 995 <1> ;----------------------------------------------------------------------------- 996 <1> jump_near: 997 <1> ; call Fill_CS_BX 998 00003609 2E803E[9F8B]01 <1> cmp byte [cs:addr_size_flag],1 999 0000360F 7403 <1> je near_far 1000 00003611 AD <1> lodsw 1001 00003612 EBB8 <1> jmp ..@print_jump 1002 <1> near_far: 1003 00003614 AD <1> lodsw 1004 00003615 89C3 <1> mov bx,ax 1005 00003617 AD <1> lodsw 1006 00003618 01F3 <1> add bx,si 1007 0000361A 83D000 <1> adc ax,0 1008 0000361D E8FFE3 <1> call fill_word_str 1009 00003620 89D8 <1> mov ax,bx 1010 00003622 E9FAE3 <1> jmp fill_word_str 1011 <1> ;============================================================================= 1012 <1> ; jump_far 1013 <1> ;----------------------------------------------------------------------------- 1014 <1> jump_far: 1015 00003625 BB[0436] <1> mov bx,far_str 1016 00003628 E8A403 <1> call fill_csbx 1017 0000362B 2E803E[9F8B]01 <1> cmp byte [cs:addr_size_flag],1 1018 00003631 740D <1> je far_far 1019 00003633 AD <1> lodsw 1020 00003634 93 <1> xchg ax,bx 1021 00003635 AD <1> lodsw 1022 00003636 E8E6E3 <1> call fill_word_str 1023 00003639 B03A <1> mov al,':' 1024 0000363B AA <1> stosb 1025 0000363C 93 <1> xchg ax,bx 1026 0000363D E9DFE3 <1> jmp fill_word_str 1027 <1> far_far: 1028 00003640 AD <1> lodsw 1029 00003641 89C3 <1> mov bx,ax 1030 00003643 AD <1> lodsw 1031 00003644 89C1 <1> mov cx,ax 1032 00003646 AD <1> lodsw 1033 00003647 E8D5E3 <1> call fill_word_str 1034 0000364A B03A <1> mov al,':' 1035 0000364C AA <1> stosb 1036 0000364D 89C8 <1> mov ax,cx 1037 0000364F E8CDE3 <1> call fill_word_str 1038 00003652 89D8 <1> mov ax,bx 1039 00003654 E9C8E3 <1> jmp fill_word_str 1040 <1> 1041 <1> reg_mem: 1042 00003657 AC <1> lodsb 1043 00003658 2E803E[928B]FE <1> cmp byte [cs:cur_cmd],0feh 1044 0000365E 7303 <1> jae @@jumps 1045 <1> @@reg_mem: 1046 00003660 E9BA00 <1> jmp analyze_rm_disp 1047 <1> @@jumps: 1048 00003663 50 <1> push ax 1049 00003664 2438 <1> and al,00111000b 1050 00003666 3C18 <1> cmp al,00011000b 1051 00003668 7508 <1> jne @@ch_jump 1052 0000366A 2EC606[968B]01 <1> mov byte [cs:dword_flag],1 1053 00003670 EB0A <1> jmp @@ret 1054 <1> @@ch_jump: 1055 00003672 3C28 <1> cmp al,00101000b 1056 00003674 7506 <1> jne @@ret 1057 00003676 2EC606[968B]01 <1> mov byte [cs:dword_flag],1 1058 <1> @@ret: 1059 0000367C 58 <1> pop ax 1060 0000367D EBE1 <1> jmp @@reg_mem 1061 <1> ;============================================================================= 1062 <1> ; reg_mem_reg 1063 <1> ;----------------------------------------------------------------------------- 1064 <1> reg_mem_reg: 1065 0000367F AC <1> lodsb 1066 00003680 E89A00 <1> call analyze_rm_disp 1067 00003683 E85503 <1> call delimit 1068 00003686 E9BE01 <1> jmp analyze_rm_reg 1069 <1> ;============================================================================= 1070 <1> ; reg_reg_mem 1071 <1> ;----------------------------------------------------------------------------- 1072 <1> reg_reg_mem: 1073 00003689 AC <1> lodsb 1074 0000368A E8BA01 <1> call analyze_rm_reg 1075 0000368D E84B03 <1> call delimit 1076 00003690 E98A00 <1> jmp analyze_rm_disp 1077 <1> ;============================================================================= 1078 <1> ; reg_mem_seg 1079 <1> ;----------------------------------------------------------------------------- 1080 <1> reg_mem_seg: 1081 00003693 AC <1> lodsb 1082 00003694 2EC606[958B]01 <1> mov byte [cs:word_flag],1 1083 0000369A E88000 <1> call analyze_rm_disp 1084 0000369D E83B03 <1> call delimit 1085 000036A0 E9E801 <1> jmp analyze_rm_seg 1086 <1> ;============================================================================= 1087 <1> ; seg_reg_mem 1088 <1> ;----------------------------------------------------------------------------- 1089 <1> seg_reg_mem: 1090 000036A3 AC <1> lodsb 1091 000036A4 2EC606[958B]01 <1> mov byte [cs:word_flag],1 1092 000036AA E8DE01 <1> call analyze_rm_seg 1093 000036AD E82B03 <1> call delimit 1094 000036B0 EB6B <1> jmp analyze_rm_disp 1095 <1> ;============================================================================= 1096 <1> ; esc_param 1097 <1> ;----------------------------------------------------------------------------- 1098 <1> esc_param: 1099 000036B2 4E <1> dec si 1100 000036B3 AC <1> lodsb 1101 000036B4 2407 <1> and al,00000111b 1102 000036B6 88C4 <1> mov ah,al 1103 000036B8 AC <1> lodsb 1104 000036B9 50 <1> push ax 1105 000036BA 2438 <1> and al,00111000b 1106 000036BC 08E0 <1> or al,ah 1107 000036BE E865E3 <1> call fill_byte_str 1108 000036C1 58 <1> pop ax 1109 000036C2 E81603 <1> call delimit 1110 000036C5 EB56 <1> jmp analyze_rm_disp 1111 <1> ;============================================================================= 1112 <1> ; cr_to_reg 1113 <1> ;----------------------------------------------------------------------------- 1114 <1> cr_to_reg: 1115 000036C7 AC <1> lodsb 1116 000036C8 E82C00 <1> call get_cr_reg 1117 000036CB B463 <1> mov ah,'c' 1118 000036CD EB0E <1> jmp ..@get_cr_num 1119 <1> dr_to_reg: 1120 000036CF AC <1> lodsb 1121 000036D0 E82400 <1> call get_cr_reg 1122 000036D3 B464 <1> mov ah,'d' 1123 000036D5 EB06 <1> jmp ..@get_cr_num 1124 <1> tr_to_reg: 1125 000036D7 AC <1> lodsb 1126 000036D8 E81C00 <1> call get_cr_reg 1127 000036DB B474 <1> mov ah,'t' 1128 <1> ..@get_cr_num: 1129 000036DD E8FB02 <1> call delimit 1130 000036E0 EB28 <1> jmp get_cr_num 1131 <1> reg_to_cr: 1132 000036E2 AC <1> lodsb 1133 000036E3 B463 <1> mov ah,'c' 1134 000036E5 EB08 <1> jmp ..@get_cr_reg 1135 <1> reg_to_dr: 1136 000036E7 AC <1> lodsb 1137 000036E8 B464 <1> mov ah,'d' 1138 000036EA EB03 <1> jmp ..@get_cr_reg 1139 <1> reg_to_tr: 1140 000036EC AC <1> lodsb 1141 000036ED B474 <1> mov ah,'t' 1142 <1> ..@get_cr_reg: 1143 000036EF E81800 <1> call get_cr_num 1144 000036F2 E8E602 <1> call delimit 1145 000036F5 EB00 <1> jmp get_cr_reg 1146 <1> get_cr_reg: 1147 000036F7 50 <1> push ax 1148 000036F8 2407 <1> and al,00000111b 1149 000036FA D0E0 <1> shl al,1 1150 000036FC 98 <1> cbw 1151 000036FD 89C3 <1> mov bx,ax 1152 000036FF B065 <1> mov al,'e' 1153 00003701 AA <1> stosb 1154 00003702 2E8B87[1E3A] <1> mov ax,[cs:registers+bx] 1155 00003707 AB <1> stosw 1156 00003708 58 <1> pop ax 1157 00003709 C3 <1> ret 1158 <1> get_cr_num: 1159 0000370A 50 <1> push ax 1160 0000370B 2438 <1> and al,00111000b 1161 0000370D D0E8 <1> shr al,1 1162 0000370F D0E8 <1> shr al,1 1163 00003711 D0E8 <1> shr al,1 1164 00003713 0430 <1> add al,'0' 1165 00003715 86C4 <1> xchg al,ah 1166 00003717 AA <1> stosb 1167 00003718 B072 <1> mov al,'r' 1168 0000371A AB <1> stosw 1169 0000371B 58 <1> pop ax 1170 0000371C C3 <1> ret 1171 <1> ;============================================================================= 1172 <1> ; analyze_rm_disp 1173 <1> ;----------------------------------------------------------------------------- 1174 <1> analyze_rm_disp: 1175 0000371D 50 <1> push ax 1176 0000371E 2E8A2E[958B] <1> mov ch,[cs:word_flag] 1177 00003723 FEC5 <1> inc ch 1178 00003725 2E022E[968B] <1> add ch,[cs:dword_flag] 1179 0000372A 2E882E[7A8B] <1> mov [cs:memory_flag],ch 1180 0000372F 2E803E[9F8B]01 <1> cmp byte [cs:addr_size_flag],1 1181 <1> ; jne @@not_disp_32_bit 1182 <1> ; jmp disp_32_bit 1183 <1> ;@@not_disp_32_bit: 1184 00003735 747C <1> je disp_32_bit ;!!! 1185 00003737 88C5 <1> mov ch,al 1186 00003739 24C0 <1> and al,11000000b 1187 0000373B 3C00 <1> cmp al,00000000b 1188 0000373D 7447 <1> je no_offs 1189 0000373F 3C40 <1> cmp al,01000000b 1190 00003741 7425 <1> je byte_offs 1191 00003743 3C80 <1> cmp al,10000000b 1192 00003745 7416 <1> je word_offs 1193 <1> reg_2: 1194 00003747 2EC606[7A8B]00 <1> mov byte [cs:memory_flag],0 1195 0000374D 88E8 <1> mov al,ch ; r/m = Register 1196 0000374F 2407 <1> and al,00000111b 1197 00003751 D0E0 <1> shl al,1 1198 00003753 98 <1> cbw 1199 00003754 E81E01 <1> call insert_op_size 1200 00003757 E8FE00 <1> call get_register 1201 0000375A AB <1> stosw 1202 0000375B EB54 <1> jmp ..@exit_00 1203 <1> word_offs: 1204 0000375D 88E8 <1> mov al,ch 1205 0000375F E85301 <1> call get_disp 1206 00003762 B02B <1> mov al,'+' 1207 00003764 AA <1> stosb 1208 00003765 AD <1> lodsw 1209 00003766 EB3A <1> jmp ..@fill_word 1210 <1> byte_offs: 1211 00003768 88E8 <1> mov al,ch 1212 0000376A E84801 <1> call get_disp 1213 0000376D AC <1> lodsb 1214 0000376E 98 <1> cbw 1215 0000376F 2EA3[7C8B] <1> mov [cs:mem_disp_offs],ax 1216 00003773 B42B <1> mov ah,'+' 1217 00003775 A880 <1> test al,80h 1218 00003777 7404 <1> jz plus_8 1219 00003779 B42D <1> mov ah,'-' 1220 0000377B F6D8 <1> neg al 1221 <1> plus_8: 1222 0000377D 268825 <1> mov [es:di],ah 1223 00003780 47 <1> inc di 1224 00003781 E8A2E2 <1> call fill_byte_str 1225 00003784 EB28 <1> jmp ..@quit_01 1226 <1> no_offs: 1227 00003786 2EC706[7C8B]0000 <1> mov word [cs:mem_disp_offs],0 1228 0000378D 88E8 <1> mov al,ch 1229 0000378F 2407 <1> and al,00000111b 1230 00003791 3C06 <1> cmp al,00000110b 1231 00003793 7516 <1> jne read_disp 1232 00003795 E8D301 <1> call print_ptr 1233 00003798 B05B <1> mov al,'[' 1234 0000379A AA <1> stosb 1235 0000379B AD <1> lodsw 1236 0000379C 2EC606[7B8B]08 <1> mov byte [cs:mem_disp_type],8 1237 <1> 1238 <1> ..@fill_word: 1239 <1> 1240 000037A2 2EA3[7C8B] <1> mov [cs:mem_disp_offs],ax 1241 000037A6 E876E2 <1> call fill_word_str 1242 000037A9 EB03 <1> jmp ..@quit_01 1243 <1> read_disp: 1244 000037AB E80701 <1> call get_disp 1245 <1> ..@quit_01: 1246 000037AE B05D <1> mov al,']' 1247 000037B0 AA <1> stosb 1248 <1> ..@exit_00: 1249 000037B1 58 <1> pop ax 1250 000037B2 C3 <1> ret 1251 <1> 1252 <1> disp_32_bit: 1253 000037B3 88C5 <1> mov ch,al 1254 000037B5 24C0 <1> and al,11000000b 1255 000037B7 3CC0 <1> cmp al,11000000b 1256 000037B9 748C <1> je reg_2 1257 <1> 1258 000037BB 88C1 <1> mov cl,al 1259 000037BD 88E8 <1> mov al,ch 1260 000037BF 2407 <1> and al,00000111b 1261 000037C1 3C04 <1> cmp al,00000100b 1262 000037C3 7439 <1> je analyze_sib 1263 <1> 1264 000037C5 86C1 <1> xchg al,cl 1265 000037C7 3C00 <1> cmp al,00000000b 1266 000037C9 741F <1> je no_ofs_32 1267 000037CB 3C80 <1> cmp al,10000000b 1268 000037CD 740E <1> je ofs_32 1269 <1> ofs_8: 1270 000037CF 88C8 <1> mov al,cl 1271 000037D1 E83301 <1> call get_32_disp 1272 000037D4 B02B <1> mov al,'+' 1273 000037D6 AA <1> stosb 1274 000037D7 AC <1> lodsb 1275 000037D8 E84BE2 <1> call fill_byte_str 1276 000037DB EBD1 <1> jmp ..@quit_01 1277 <1> ofs_32: 1278 000037DD 88C8 <1> mov al,cl 1279 000037DF E82501 <1> call get_32_disp 1280 000037E2 B02B <1> mov al,'+' 1281 000037E4 AA <1> stosb 1282 000037E5 E830E2 <1> call fill_dword_str 1283 000037E8 EBC4 <1> jmp ..@quit_01 1284 <1> ;; 1285 <1> no_ofs_32: 1286 000037EA 80F905 <1> cmp cl,00000101b 1287 000037ED 7508 <1> jne no_disp_32 1288 000037EF B05B <1> mov al,'[' 1289 000037F1 AA <1> stosb 1290 000037F2 E823E2 <1> call fill_dword_str 1291 000037F5 EBB7 <1> jmp ..@quit_01 1292 <1> no_disp_32: 1293 000037F7 88C8 <1> mov al,cl 1294 000037F9 E80B01 <1> call get_32_disp 1295 000037FC EBB0 <1> jmp ..@quit_01 1296 <1> analyze_sib: 1297 000037FE AC <1> lodsb 1298 000037FF 88C5 <1> mov ch,al 1299 00003801 80F900 <1> cmp cl,00000000b 1300 00003804 7415 <1> je sib_no_ofs 1301 00003806 80F940 <1> cmp cl,01000000b 1302 00003809 742A <1> je sib_ofs_8 1303 <1> sib_ofs_32: 1304 0000380B 2407 <1> and al,00000111b 1305 0000380D E8F700 <1> call get_32_disp 1306 00003810 E81401 <1> call get_scale 1307 00003813 B02B <1> mov al,'+' 1308 00003815 AA <1> stosb 1309 00003816 E8FFE1 <1> call fill_dword_str 1310 00003819 EB93 <1> jmp ..@quit_01 1311 <1> sib_no_ofs: 1312 0000381B 2407 <1> and al,00000111b 1313 0000381D 3C05 <1> cmp al,00000101b 1314 0000381F 750B <1> jne get_sib_disp 1315 00003821 E84701 <1> call print_ptr 1316 00003824 B05B <1> mov al,'[' 1317 00003826 AA <1> stosb 1318 00003827 E8EEE1 <1> call fill_dword_str 1319 0000382A EB03 <1> jmp ..@get_scale 1320 <1> get_sib_disp: 1321 0000382C E8D800 <1> call get_32_disp 1322 <1> ..@get_scale: 1323 0000382F E8F500 <1> call get_scale 1324 00003832 E979FF <1> jmp ..@quit_01 1325 <1> sib_ofs_8: 1326 00003835 2407 <1> and al,00000111b 1327 00003837 E8CD00 <1> call get_32_disp 1328 0000383A E8EA00 <1> call get_scale 1329 0000383D B02B <1> mov al,'+' 1330 0000383F AA <1> stosb 1331 00003840 AC <1> lodsb 1332 00003841 E8E2E1 <1> call fill_byte_str 1333 00003844 E967FF <1> jmp ..@quit_01 1334 <1> ;============================================================================= 1335 <1> ; analyze_rm_reg 1336 <1> ;----------------------------------------------------------------------------- 1337 <1> analyze_rm_reg: 1338 00003847 50 <1> push ax 1339 00003848 2438 <1> and al,00111000b 1340 0000384A D0E8 <1> shr al,1 1341 0000384C D0E8 <1> shr al,1 1342 0000384E 98 <1> cbw 1343 0000384F E82300 <1> call insert_op_size 1344 00003852 E80300 <1> call get_register 1345 00003855 AB <1> stosw 1346 00003856 58 <1> pop ax 1347 00003857 C3 <1> ret 1348 <1> ;============================================================================= 1349 <1> ; get_register 1350 <1> ;----------------------------------------------------------------------------- 1351 <1> get_register: 1352 00003858 53 <1> push bx 1353 00003859 2E8A1E[958B] <1> mov bl,[cs:word_flag] 1354 0000385E 80F301 <1> xor bl,1 1355 00003861 30FF <1> xor bh,bh 1356 00003863 D1E3 <1> shl bx,1 1357 00003865 D1E3 <1> shl bx,1 1358 00003867 D1E3 <1> shl bx,1 1359 00003869 D1E3 <1> shl bx,1 1360 0000386B 01C3 <1> add bx,ax 1361 0000386D 2E8B87[1E3A] <1> mov ax,[cs:registers+bx] 1362 00003872 43 <1> inc bx 1363 00003873 5B <1> pop bx 1364 00003874 C3 <1> ret 1365 <1> ;============================================================================= 1366 <1> ; insert_op_size 1367 <1> ;----------------------------------------------------------------------------- 1368 <1> insert_op_size: 1369 00003875 2E803E[9E8B]00 <1> cmp byte [cs:op_size_flag],0 1370 0000387B 740D <1> je @@ret 1371 0000387D 2E803E[958B]00 <1> cmp byte [cs:word_flag],0 1372 00003883 7405 <1> je @@ret 1373 00003885 50 <1> push ax 1374 00003886 B065 <1> mov al,'e' 1375 00003888 AA <1> stosb 1376 00003889 58 <1> pop ax 1377 <1> @@ret: 1378 0000388A C3 <1> ret 1379 <1> ;============================================================================= 1380 <1> ; analyze_rm_seg 1381 <1> ;----------------------------------------------------------------------------- 1382 <1> analyze_rm_seg: 1383 0000388B 50 <1> push ax 1384 0000388C 2438 <1> and al,00111000b 1385 0000388E 2E803E[C42E]72 <1> cmp byte [cs:cpu_type],a386 1386 00003894 730C <1> jae @@3 1387 00003896 3C18 <1> cmp al,00011000b 1388 00003898 760C <1> jbe @@1 1389 <1> @@bad_seg_reg: 1390 0000389A 2EC606[A48B]01 <1> mov byte [cs:db_flag],1 1391 000038A0 58 <1> pop ax 1392 000038A1 C3 <1> ret 1393 <1> @@3: 1394 000038A2 3C28 <1> cmp al,00101000b 1395 000038A4 77F4 <1> ja @@bad_seg_reg 1396 <1> @@1: 1397 000038A6 D0E8 <1> shr al,1 1398 000038A8 D0E8 <1> shr al,1 1399 000038AA 98 <1> cbw 1400 000038AB 89C3 <1> mov bx,ax 1401 000038AD 2E8B87[3E3A] <1> mov ax,[cs:seg_regs+bx] 1402 000038B2 AB <1> stosw 1403 000038B3 58 <1> pop ax 1404 000038B4 C3 <1> ret 1405 <1> ;============================================================================= 1406 <1> ; get_disp 1407 <1> ;----------------------------------------------------------------------------- 1408 <1> get_disp: 1409 000038B5 E8B300 <1> call print_ptr 1410 000038B8 2407 <1> and al,00000111b 1411 000038BA 98 <1> cbw 1412 000038BB 2EA2[7B8B] <1> mov [cs:mem_disp_type],al 1413 000038BF D1E0 <1> shl ax,1 1414 000038C1 89C3 <1> mov bx,ax 1415 000038C3 2E8B9F[CB38] <1> mov bx,[cs:disp_adrs+bx] 1416 000038C8 E90401 <1> jmp fill_csbx 1417 <1> ;============================================================================= 1418 <1> disp_adrs: 1419 000038CB [DB38] <1> dw of000 1420 000038CD [E238] <1> dw of001 1421 000038CF [E938] <1> dw of010 1422 000038D1 [F038] <1> dw of011 1423 000038D3 [F738] <1> dw of100 1424 000038D5 [FB38] <1> dw of101 1425 000038D7 [FF38] <1> dw of110 1426 000038D9 [0339] <1> dw of111 1427 <1> 1428 000038DB 5B62782B736900 <1> of000 db '[bx+si',0 1429 000038E2 5B62782B646900 <1> of001 db '[bx+di',0 1430 000038E9 5B62702B736900 <1> of010 db '[bp+si',0 1431 000038F0 5B62702B646900 <1> of011 db '[bp+di',0 1432 000038F7 5B736900 <1> of100 db '[si',0 1433 000038FB 5B646900 <1> of101 db '[di',0 1434 000038FF 5B627000 <1> of110 db '[bp',0 1435 00003903 5B627800 <1> of111 db '[bx',0 1436 <1> 1437 <1> ;============================================================================= 1438 <1> ; get_32_disp 1439 <1> ;----------------------------------------------------------------------------- 1440 <1> get_32_disp: 1441 00003907 2E803E[9E8B]00 <1> cmp byte [cs:op_size_flag],0 1442 0000390D 7405 <1> je @@1 1443 0000390F C606[968B]01 <1> mov byte [dword_flag],1 1444 <1> @@1: 1445 00003914 E85400 <1> call print_ptr 1446 00003917 98 <1> cbw 1447 00003918 89C3 <1> mov bx,ax 1448 0000391A 01DB <1> add bx,bx 1449 0000391C B85B65 <1> mov ax,'[e' 1450 0000391F AB <1> stosw 1451 00003920 2E8B87[1E3A] <1> mov ax,[cs:registers+bx] 1452 00003925 AB <1> stosw 1453 00003926 C3 <1> ret 1454 <1> ;============================================================================= 1455 <1> ; get_scale 1456 <1> ;----------------------------------------------------------------------------- 1457 <1> get_scale: 1458 00003927 88E8 <1> mov al,ch 1459 00003929 2438 <1> and al,00111000b 1460 0000392B 3C20 <1> cmp al,00100000b 1461 0000392D 7425 <1> je no_scale 1462 0000392F D0E8 <1> shr al,1 1463 00003931 D0E8 <1> shr al,1 1464 00003933 98 <1> cbw 1465 00003934 89C3 <1> mov bx,ax 1466 00003936 B82B65 <1> mov ax,'+e' 1467 00003939 AB <1> stosw 1468 0000393A 2E8B87[1E3A] <1> mov ax,[cs:registers+bx] 1469 0000393F AB <1> stosw 1470 00003940 B02A <1> mov al,'*' 1471 00003942 AA <1> stosb 1472 00003943 88E8 <1> mov al,ch 1473 00003945 24C0 <1> and al,11000000b 1474 00003947 D0C0 <1> rol al,1 1475 00003949 D0C0 <1> rol al,1 1476 0000394B 98 <1> cbw 1477 0000394C 89C3 <1> mov bx,ax 1478 0000394E 2E8A87[5539] <1> mov al,[cs:scaler+bx] 1479 00003953 AA <1> stosb 1480 <1> no_scale: 1481 00003954 C3 <1> ret 1482 <1> 1483 00003955 31323438 <1> scaler db '1248' 1484 <1> 1485 <1> 1486 00003959 627974652000 <1> pt_byte db 'byte ',0 1487 0000395F 64 <1> pt_dword db 'd' 1488 00003960 776F72642000 <1> pt_word db 'word ',0 1489 00003966 7074722000 <1> pt_ptr db 'ptr ',0 1490 <1> ;============================================================================= 1491 <1> ; print_ptr 1492 <1> ;----------------------------------------------------------------------------- 1493 <1> print_ptr: 1494 0000396B 50 <1> push ax 1495 0000396C 56 <1> push si 1496 0000396D 2E803E[978B]00 <1> cmp byte [cs:print_flag],0 1497 00003973 742E <1> je @@quit 1498 00003975 BE[5939] <1> mov si,pt_byte 1499 00003978 2E803E[958B]00 <1> cmp byte [cs:word_flag],0 1500 0000397E 741A <1> je @@byte 1501 00003980 BE[6039] <1> mov si,pt_word 1502 <1> ;[1245 - 1.01] 1503 00003983 2E803E[9E8B]00 <1> cmp byte [cs:op_size_flag],0 1504 00003989 7406 <1> je @@check_dword 1505 0000398B 2EC606[968B]01 <1> mov byte [cs:dword_flag],1 1506 <1> ; mov cs:memory_flag,3 1507 <1> @@check_dword: 1508 <1> ;[1245 - 1.01] 1509 00003991 2E803E[968B]00 <1> cmp byte [cs:dword_flag],0 1510 00003997 7401 <1> je @@byte 1511 00003999 4E <1> dec si 1512 <1> @@byte: 1513 0000399A E82500 <1> call unasm_fill_str 1514 0000399D BE[6639] <1> mov si,pt_ptr 1515 000039A0 E81F00 <1> call unasm_fill_str 1516 <1> @@quit: 1517 000039A3 2E833E[988B]00 <1> cmp word [cs:cur_prefix],0 1518 000039A9 740D <1> je @@exit 1519 000039AB 2E8B36[988B] <1> mov si,[cs:cur_prefix] 1520 000039B0 2E8936[7E8B] <1> mov [cs:mem_prefix],si 1521 000039B5 E80A00 <1> call unasm_fill_str 1522 <1> @@exit: 1523 000039B8 2EC706[988B]0000 <1> mov word [cs:cur_prefix],0 1524 000039BF 5E <1> pop si 1525 000039C0 58 <1> pop ax 1526 000039C1 C3 <1> ret 1527 <1> ;============================================================================= 1528 <1> ; unasm_fill_str 1529 <1> ;----------------------------------------------------------------------------- 1530 <1> unasm_fill_str: 1531 000039C2 1E <1> push ds 1532 000039C3 0E <1> push cs 1533 000039C4 1F <1> pop ds 1534 <1> @@next: 1535 000039C5 AC <1> lodsb 1536 000039C6 08C0 <1> or al,al 1537 000039C8 7403 <1> jz @@quit 1538 000039CA AA <1> stosb 1539 000039CB EBF8 <1> jmp @@next 1540 <1> @@quit: 1541 000039CD 1F <1> pop ds 1542 000039CE C3 <1> ret 1543 <1> ;============================================================================= 1544 <1> ; fill_csbx 1545 <1> ;----------------------------------------------------------------------------- 1546 <1> fill_csbx: 1547 <1> @@next: 1548 000039CF 2E8A07 <1> mov al,[cs:bx] 1549 000039D2 08C0 <1> or al,al 1550 000039D4 7404 <1> jz @@quit 1551 000039D6 AA <1> stosb 1552 000039D7 43 <1> inc bx 1553 000039D8 EBF5 <1> jmp @@next 1554 <1> @@quit: 1555 000039DA C3 <1> ret 1556 <1> ;============================================================================= 1557 <1> ; delimit 1558 <1> ;----------------------------------------------------------------------------- 1559 <1> delimit: 1560 000039DB 50 <1> push ax 1561 000039DC B02C <1> mov al,',' 1562 000039DE AA <1> stosb 1563 000039DF 58 <1> pop ax 1564 000039E0 C3 <1> ret 1565 <1> ;============================================================================= 1566 <1> ; fill_addr 1567 <1> ;----------------------------------------------------------------------------- 1568 <1> fill_addr: 1569 000039E1 2EA1[908B] <1> mov ax,[cs:unasm_cur_ip] 1570 000039E5 E937E0 <1> jmp fill_word_str 1571 <1> ;============================================================================= 1572 <1> ; fill_codes 1573 <1> ;----------------------------------------------------------------------------- 1574 <1> fill_codes: 1575 000039E8 56 <1> push si 1576 000039E9 2E8B36[908B] <1> mov si,[cs:unasm_cur_ip] 1577 <1> @@next_byte: 1578 000039EE 81FF[BE8D] <1> cmp di,CMD_X-1 1579 000039F2 7308 <1> jae @@trunc 1580 000039F4 AC <1> lodsb 1581 000039F5 E82EE0 <1> call fill_byte_str 1582 000039F8 E2F4 <1> loop @@next_byte 1583 <1> @@quit: 1584 000039FA 5E <1> pop si 1585 000039FB C3 <1> ret 1586 <1> @@trunc: 1587 000039FC B02B <1> mov al,'+' 1588 000039FE AA <1> stosb 1589 000039FF EBF9 <1> jmp @@quit 1590 <1> ;============================================================================= 1591 <1> ; fill_wb 1592 <1> ;----------------------------------------------------------------------------- 1593 <1> fill_wb: 1594 00003A01 2E803E[958B]01 <1> cmp byte [cs:word_flag],1 1595 00003A07 7404 <1> je @@out_word 1596 00003A09 AC <1> lodsb 1597 00003A0A E919E0 <1> jmp fill_byte_str 1598 <1> @@out_word: 1599 00003A0D AD <1> lodsw 1600 00003A0E E90EE0 <1> jmp fill_word_str 1601 <1> ;------------------------------------------------------------------------------- 1602 <1> ; Print_Command proc near 1603 <1> ; push si 1604 <1> ; mov ax,0A0Dh 1605 <1> ; stosw 1606 <1> ; mov cx,di 1607 <1> ; mov dx,offset Buffer 1608 <1> ; sub cx,dx 1609 <1> ; mov ah,40h 1610 <1> ; mov bx,1 1611 <1> ; int 21h 1612 <1> ; pop si 1613 <1> ; ret 1614 <1> ; Print_Command endp 1615 <1> 1616 <1> ;============================================================================= 1617 <1> ; clear_buffer 1618 <1> ;----------------------------------------------------------------------------- 1619 <1> clear_buffer: 1620 00003A11 BF[AA8D] <1> mov di,buffer 1621 00003A14 57 <1> push di 1622 00003A15 B020 <1> mov al,' ' 1623 00003A17 B95000 <1> mov cx,BUF_SIZE 1624 00003A1A F3AA <1> rep stosb 1625 00003A1C 5F <1> pop di 1626 00003A1D C3 <1> ret 1627 <1> ;============================================================================= 1628 00003A1E 617863786478627873- <1> registers db 'axcxdxbxspbpsidi' 1628 00003A27 70627073696469 <1> 1629 00003A2E 616C636C646C626C61- <1> db 'alcldlblahchdhbh' 1629 00003A37 68636864686268 <1> 1630 <1> 1631 00003A3E 657363737373647366- <1> seg_regs db 'escsssdsfsgs' 1631 00003A47 736773 <1> 1632 <1> 1633 <1> 1634 <1> commands: 1635 00003A4A 61646400 <1> cadd db 'add',0 1636 00003A4E 6F7200 <1> cor db 'or',0 1637 00003A51 61646300 <1> cadc db 'adc',0 1638 00003A55 73626200 <1> csbb db 'sbb',0 1639 00003A59 616E6400 <1> cand db 'and',0 1640 00003A5D 73756200 <1> csub db 'sub',0 1641 00003A61 786F7200 <1> cxor db 'xor',0 1642 00003A65 636D7000 <1> ccmp db 'cmp',0 1643 00003A69 696E6300 <1> cinc db 'inc',0 1644 00003A6D 64656300 <1> cdec db 'dec',0 1645 00003A71 7075736800 <1> cpush db 'push',0 1646 00003A76 706F7000 <1> cpop db 'pop',0 1647 00003A7A 6D6F7600 <1> cmov db 'mov',0 1648 00003A7E 7863686700 <1> cxchg db 'xchg',0 1649 00003A83 73686C00 <1> cshl db 'shl',0 1650 00003A87 73687200 <1> cshr db 'shr',0 1651 00003A8B 72636C00 <1> crcl db 'rcl',0 1652 00003A8F 72637200 <1> crcr db 'rcr',0 1653 00003A93 73617200 <1> csar db 'sar',0 1654 00003A97 726F6C00 <1> crol db 'rol',0 1655 00003A9B 726F7200 <1> cror db 'ror',0 1656 00003A9F 7465737400 <1> ctest db 'test',0 1657 00003AA4 6E6F7400 <1> cnot db 'not',0 1658 00003AA8 6E656700 <1> cneg db 'neg',0 1659 00003AAC 6D756C00 <1> cmul db 'mul',0 1660 00003AB0 696D756C00 <1> cimul db 'imul',0 1661 00003AB5 64697600 <1> cdiv db 'div',0 1662 00003AB9 6964697600 <1> cidiv db 'idiv',0 1663 00003ABE 63627700 <1> ccbw db 'cbw',0 1664 00003AC2 63776400 <1> ccwd db 'cwd',0 1665 00003AC6 61616100 <1> caaa db 'aaa',0 1666 00003ACA 61616400 <1> caad db 'aad',0 1667 00003ACE 61616D00 <1> caam db 'aam',0 1668 00003AD2 61617300 <1> caas db 'aas',0 1669 00003AD6 64616100 <1> cdaa db 'daa',0 1670 00003ADA 64617300 <1> cdas db 'das',0 1671 00003ADE 73616C6300 <1> csalc db 'salc',0 1672 00003AE3 6D6F76736200 <1> cmovsb db 'movsb',0 1673 00003AE9 6D6F76737700 <1> cmovsw db 'movsw',0 1674 00003AEF 73746F736200 <1> cstosb db 'stosb',0 1675 00003AF5 73746F737700 <1> cstosw db 'stosw',0 1676 00003AFB 6C6F64736200 <1> clodsb db 'lodsb',0 1677 00003B01 6C6F64737700 <1> clodsw db 'lodsw',0 1678 00003B07 636D70736200 <1> ccmpsb db 'cmpsb',0 1679 00003B0D 636D70737700 <1> ccmpsw db 'cmpsw',0 1680 00003B13 736361736200 <1> cscasb db 'scasb',0 1681 00003B19 736361737700 <1> cscasw db 'scasw',0 1682 <1> 1683 00003B1F 63616C6C00 <1> ccall db 'call',0 1684 00003B24 6A6D7000 <1> cjmp db 'jmp',0 1685 00003B28 72657400 <1> cret db 'ret',0 1686 00003B2C 7265746600 <1> cretf db 'retf',0 1687 00003B31 6C6F6F7000 <1> cloop db 'loop',0 1688 00003B36 6C6F6F706500 <1> cloope db 'loope',0 1689 00003B3C 6C6F6F706E6500 <1> cloopne db 'loopne',0 1690 00003B43 696E7400 <1> cint db 'int',0 1691 00003B47 696E746F00 <1> cinto db 'into',0 1692 00003B4C 696E743300 <1> cint3 db 'int3',0 1693 00003B51 6972657400 <1> ciret db 'iret',0 1694 00003B56 707573686600 <1> cpushf db 'pushf',0 1695 00003B5C 706F706600 <1> cpopf db 'popf',0 1696 00003B61 7361686600 <1> csahf db 'sahf',0 1697 00003B66 6C61686600 <1> clahf db 'lahf',0 1698 00003B6B 636C6300 <1> cclc db 'clc',0 1699 00003B6F 636D6300 <1> ccmc db 'cmc',0 1700 00003B73 73746300 <1> cstc db 'stc',0 1701 00003B77 636C6400 <1> ccld db 'cld',0 1702 00003B7B 73746400 <1> cstd db 'std',0 1703 00003B7F 636C6900 <1> ccli db 'cli',0 1704 00003B83 73746900 <1> csti db 'sti',0 1705 00003B87 686C7400 <1> chlt db 'hlt',0 1706 00003B8B 6E6F7000 <1> cnop db 'nop',0 1707 00003B8F 6C656100 <1> clea db 'lea',0 1708 00003B93 6C657300 <1> cles db 'les',0 1709 00003B97 6C647300 <1> clds db 'lds',0 1710 00003B9B 786C617400 <1> cxlat db 'xlat',0 1711 00003BA0 6A63787A00 <1> cjcxz db 'jcxz',0 1712 00003BA5 696E00 <1> cin db 'in',0 1713 00003BA8 6F757400 <1> cout db 'out',0 1714 00003BAC 65736300 <1> cesc db 'esc',0 1715 00003BB0 7761697400 <1> cwait db 'wait',0 1716 <1> 1717 00003BB5 6A6F00 <1> cjo db 'jo',0 1718 00003BB8 6A6E6F00 <1> cjno db 'jno',0 1719 00003BBC 6A6200 <1> cjb db 'jb',0 1720 00003BBF 6A6E6200 <1> cjnb db 'jnb',0 1721 00003BC3 6A7A00 <1> cjz db 'jz',0 1722 00003BC6 6A6E7A00 <1> cjnz db 'jnz',0 1723 00003BCA 6A626500 <1> cjbe db 'jbe',0 1724 00003BCE 6A6100 <1> cja db 'ja',0 1725 00003BD1 6A7300 <1> cjs db 'js',0 1726 00003BD4 6A6E7300 <1> cjns db 'jns',0 1727 00003BD8 6A7000 <1> cjp db 'jp',0 1728 00003BDB 6A6E7000 <1> cjnp db 'jnp',0 1729 00003BDF 6A6C00 <1> cjl db 'jl',0 1730 00003BE2 6A676500 <1> cjge db 'jge',0 1731 00003BE6 6A6C6500 <1> cjle db 'jle',0 1732 00003BEA 6A6700 <1> cjg db 'jg',0 1733 <1> 1734 <1> ; 286 instructions 1735 <1> 1736 00003BED 707573686100 <1> cpusha db 'pusha',0 1737 00003BF3 706F706100 <1> cpopa db 'popa',0 1738 00003BF8 626F756E6400 <1> cbound db 'bound',0 1739 00003BFE 696E736200 <1> cinsb db 'insb',0 1740 00003C03 6F7574736200 <1> coutsb db 'outsb',0 1741 00003C09 696E737700 <1> cinsw db 'insw',0 1742 00003C0E 6F7574737700 <1> coutsw db 'outsw',0 1743 00003C14 656E74657200 <1> center db 'enter',0 1744 00003C1A 6C6561766500 <1> cleave db 'leave',0 1745 <1> 1746 00003C20 75643000 <1> cud0 db 'ud0', 0 1747 00003C24 75643100 <1> cud1 db 'ud1', 0 1748 00003C28 75643200 <1> cud2 db 'ud2', 0 1749 <1> 1750 <1> ; 286 Protected Mode instructions 1751 <1> 1752 00003C2C 6C67647400 <1> clgdt db 'lgdt',0 1753 00003C31 7367647400 <1> csgdt db 'sgdt',0 1754 00003C36 6C69647400 <1> clidt db 'lidt',0 1755 00003C3B 7369647400 <1> csidt db 'sidt',0 1756 00003C40 6C6C647400 <1> clldt db 'lldt',0 1757 00003C45 736C647400 <1> csldt db 'sldt',0 1758 00003C4A 6C6D737700 <1> clmsw db 'lmsw',0 1759 00003C4F 736D737700 <1> csmsw db 'smsw',0 1760 00003C54 6C747200 <1> cltr db 'ltr',0 1761 00003C58 73747200 <1> cstr db 'str',0 1762 00003C5C 6C617200 <1> clar db 'lar',0 1763 00003C60 6C736C00 <1> clsl db 'lsl',0 1764 00003C64 6172706C00 <1> carpl db 'arpl',0 1765 00003C69 7665727200 <1> cverr db 'verr',0 1766 00003C6E 7665727700 <1> cverw db 'verw',0 1767 00003C73 636C747300 <1> cclts db 'clts',0 1768 00003C78 6C6F6164616C6C3238- <1> cloadall286 db 'loadall286',0 1768 00003C81 3600 <1> 1769 <1> ; c db '',0 1770 <1> 1771 <1> ; 386 instructions 1772 <1> 1773 00003C83 6D6F76737800 <1> cmovsx db 'movsx',0 1774 00003C89 6D6F767A7800 <1> cmovzx db 'movzx',0 1775 00003C8F 6C667300 <1> clfs db 'lfs',0 1776 00003C93 6C677300 <1> clgs db 'lgs',0 1777 00003C97 6C737300 <1> clss db 'lss',0 1778 00003C9B 6377646500 <1> ccwde db 'cwde',0 1779 00003CA0 63647100 <1> ccdq db 'cdq',0 1780 00003CA4 73686C6400 <1> cshld db 'shld',0 1781 00003CA9 7368726400 <1> cshrd db 'shrd',0 1782 00003CAE 627400 <1> cbt db 'bt',0 1783 00003CB1 62747300 <1> cbts db 'bts',0 1784 00003CB5 62747200 <1> cbtr db 'btr',0 1785 00003CB9 62746300 <1> cbtc db 'btc',0 1786 00003CBD 62736600 <1> cbsf db 'bsf',0 1787 00003CC1 62737200 <1> cbsr db 'bsr',0 1788 00003CC5 6C6F64736400 <1> clodsd db 'lodsd',0 1789 00003CCB 73746F736400 <1> cstosd db 'stosd',0 1790 00003CD1 696E736400 <1> cinsd db 'insd',0 1791 00003CD6 6F7574736400 <1> coutsd db 'outsd',0 1792 00003CDC 6D6F76736400 <1> cmovsd db 'movsd',0 1793 00003CE2 636D70736400 <1> ccmpsd db 'cmpsd',0 1794 00003CE8 736361736400 <1> cscasd db 'scasd',0 1795 <1> 1796 00003CEE 7365746100 <1> cseta db 'seta',0 1797 00003CF3 736574616500 <1> csetae db 'setae',0 1798 00003CF9 7365746200 <1> csetb db 'setb',0 1799 00003CFE 736574626500 <1> csetbe db 'setbe',0 1800 00003D04 7365746500 <1> csete db 'sete',0 1801 00003D09 7365746E6500 <1> csetne db 'setne',0 1802 00003D0F 7365747000 <1> csetp db 'setp',0 1803 00003D14 7365746E7000 <1> csetnp db 'setnp',0 1804 00003D1A 7365746700 <1> csetg db 'setg',0 1805 00003D1F 736574676500 <1> csetge db 'setge',0 1806 00003D25 7365746C00 <1> csetl db 'setl',0 1807 00003D2A 7365746C6500 <1> csetle db 'setle',0 1808 00003D30 7365747300 <1> csets db 'sets',0 1809 00003D35 7365746E7300 <1> csetns db 'setns',0 1810 00003D3B 7365746F00 <1> cseto db 'seto',0 1811 00003D40 7365746E6F00 <1> csetno db 'setno',0 1812 <1> 1813 00003D46 6A6563787A00 <1> cjecxz db 'jecxz',0 1814 00003D4C 697265746400 <1> ciretd db 'iretd',0 1815 00003D52 70757368616400 <1> cpushad db 'pushad',0 1816 00003D59 706F70616400 <1> cpopad db 'popad',0 1817 00003D5F 70757368666400 <1> cpushfd db 'pushfd',0 1818 00003D66 706F70666400 <1> cpopfd db 'popfd',0 1819 <1> 1820 00003D6C 6C6F6164616C6C3338- <1> cloadall386 db 'loadall386',0 1820 00003D75 3600 <1> 1821 <1> 1822 <1> ; 486 instructions 1823 <1> 1824 00003D77 696E766400 <1> cinvd db 'invd',0 1825 00003D7C 7762696E766400 <1> cwbinvd db 'wbinvd',0 1826 00003D83 696E766C706700 <1> cinvlpg db 'invlpg',0 1827 00003D8A 636D707863686700 <1> ccmpxchg db 'cmpxchg',0 1828 00003D92 7861646400 <1> cxadd db 'xadd',0 1829 00003D97 627377617000 <1> cbswap db 'bswap',0 1830 <1> ; c db '',0 1831 <1> 1832 <1> ;~comment # 1833 <1> ;~ 1834 <1> ;~ Cfld db 'fld',0 1835 <1> ;~ cfst db 'fst',0 1836 <1> ;~ cfstp db 'fstp',0 1837 <1> ;~ cfxch db 'fxch',0 1838 <1> ;~ cfcom db 'fcom',0 1839 <1> ;~ cfcomp db 'fcomp',0 1840 <1> ;~ cfcompp db 'fcompp',0 1841 <1> ;~ cftst db 'ftst',0 1842 <1> ;~ cfxam db 'fxam',0 1843 <1> ;~ cfadd db 'fadd',0 1844 <1> ;~ cfsub db 'fsub',0 1845 <1> ;~ cfmul db 'fmul',0 1846 <1> ;~ cfdiv db 'fdiv',0 1847 <1> ;~ cfsqrt db 'fsqrt',0 1848 <1> ;~ cfscale db 'fscale',0 1849 <1> ;~ cfprem db 'fprem',0 1850 <1> ;~ cfrndint db 'frndint',0 1851 <1> ;~ cfxtract db 'fxtract',0 1852 <1> ;~ cfabs db 'fabs',0 1853 <1> ;~ cfchs db 'fchs',0 1854 <1> ;~ cfptan db 'fptan',0 1855 <1> ;~ cfpatan db 'fpatan',0 1856 <1> ;~ cf2xm1 db 'f2xm1',0 1857 <1> ;~ cfyl2x db 'fyl2x',0 1858 <1> ;~ cfyl2xp1 db 'fyl2xp1',0 1859 <1> ;~ cfldz db 'fldz',0 1860 <1> ;~ cfld1 db 'fld1',0 1861 <1> ;~ cfldpi db 'fldpi',0 1862 <1> ;~ cfldl2t db 'fldl2t',0 1863 <1> ;~ cfldl2e db 'fldl2e',0 1864 <1> ;~ cfldlg2 db 'fldlg2',0 1865 <1> ;~ cfldln2 db 'fldln2',0 1866 <1> ;~ cfinit db 'finit',0 1867 <1> ;~ cfeni db 'feni',0 1868 <1> ;~ cfdisi db 'fdisi',0 1869 <1> ;~ cfldcw db 'fldcw',0 1870 <1> ;~ cfstcw db 'fstcw',0 1871 <1> ;~ cfldsw db 'fldsw',0 1872 <1> ;~ cfstsw db 'fstsw',0 1873 <1> ;~ cfclex db 'fclex',0 1874 <1> ;~ cfstenv db 'fstenv',0 1875 <1> ;~ cfldenv db 'fldenv',0 1876 <1> ;~ cfsave db 'fsave',0 1877 <1> ;~ cfrstor db 'frstor',0 1878 <1> ;~ cfincstp db 'fincstp',0 1879 <1> ;~ cfdecstp db 'fdecstp',0 1880 <1> ;~ cffree db 'ffree',0 1881 <1> ;~ cffnop db 'fnop',0 1882 <1> ;~# 1883 <1> 1884 00003D9D 646200 <1> cdb db 'db',0 1885 00003DA0 3F3F3F00 <1> qqq db '???',0 1886 <1> 1887 <1> prefixes: 1888 <1> 1889 00003DA4 6C6F636B00 <1> plock db 'lock',0 1890 <1> unasm_rep_prefixes: 1891 00003DA9 7265702000 <1> prep db 'rep ',0 1892 00003DAE 726570652000 <1> prepe db 'repe ',0 1893 00003DB4 7265706E652000 <1> prepne db 'repne ',0 1894 <1> seg_prefixes: 1895 00003DBB 63733A00 <1> pcs db 'cs:',0 1896 00003DBF 64733A00 <1> pds db 'ds:',0 1897 00003DC3 65733A00 <1> pes db 'es:',0 1898 00003DC7 73733A00 <1> pss db 'ss:',0 1899 00003DCB 66733A00 <1> pfs db 'fs:',0 1900 00003DCF 67733A00 <1> pgs db 'gs:',0 1901 <1> size_prefixes: 1902 00003DD3 00 <1> op_size db 0 1903 00003DD4 00 <1> AddrSize db 0 1904 <1> 1905 <1> ; db '',0 1906 <1> ArOp1 equ 0 1907 <1> ArOp2 equ 1 1908 <1> ShiftOp equ 2 1909 <1> grp_1 equ 3 1910 <1> Grp2 equ 4 1911 <1> Grp3 equ 5 1912 <1> MovGrp equ 6 1913 <1> 1914 <1> bt_grp equ 6 1915 <1> 1916 <1> cmd_addrs: 1917 00003DD5 [4A3A] <1> dw cadd ; 0 1918 00003DD7 [4A3A] <1> dw cadd 1919 00003DD9 [4A3A] <1> dw cadd 1920 00003DDB [4A3A] <1> dw cadd 1921 00003DDD [4A3A] <1> dw cadd 1922 00003DDF [4A3A] <1> dw cadd 1923 00003DE1 [713A] <1> dw cpush 1924 00003DE3 [763A] <1> dw cpop 1925 <1> 1926 00003DE5 [4E3A] <1> dw cor 1927 00003DE7 [4E3A] <1> dw cor 1928 00003DE9 [4E3A] <1> dw cor 1929 00003DEB [4E3A] <1> dw cor 1930 00003DED [4E3A] <1> dw cor 1931 00003DEF [4E3A] <1> dw cor 1932 00003DF1 [713A] <1> dw cpush 1933 00003DF3 [9D3D] <1> dw cdb 1934 <1> 1935 00003DF5 [513A] <1> dw cadc ; 1 1936 00003DF7 [513A] <1> dw cadc 1937 00003DF9 [513A] <1> dw cadc 1938 00003DFB [513A] <1> dw cadc 1939 00003DFD [513A] <1> dw cadc 1940 00003DFF [513A] <1> dw cadc 1941 00003E01 [713A] <1> dw cpush 1942 00003E03 [763A] <1> dw cpop 1943 <1> 1944 00003E05 [553A] <1> dw csbb 1945 00003E07 [553A] <1> dw csbb 1946 00003E09 [553A] <1> dw csbb 1947 00003E0B [553A] <1> dw csbb 1948 00003E0D [553A] <1> dw csbb 1949 00003E0F [553A] <1> dw csbb 1950 00003E11 [713A] <1> dw cpush 1951 00003E13 [763A] <1> dw cpop 1952 <1> 1953 00003E15 [593A] <1> dw cand ; 2 1954 00003E17 [593A] <1> dw cand 1955 00003E19 [593A] <1> dw cand 1956 00003E1B [593A] <1> dw cand 1957 00003E1D [593A] <1> dw cand 1958 00003E1F [593A] <1> dw cand 1959 00003E21 [C33D] <1> dw pes 1960 00003E23 [D63A] <1> dw cdaa 1961 <1> 1962 00003E25 [5D3A] <1> dw csub 1963 00003E27 [5D3A] <1> dw csub 1964 00003E29 [5D3A] <1> dw csub 1965 00003E2B [5D3A] <1> dw csub 1966 00003E2D [5D3A] <1> dw csub 1967 00003E2F [5D3A] <1> dw csub 1968 00003E31 [BB3D] <1> dw pcs 1969 00003E33 [DA3A] <1> dw cdas 1970 <1> 1971 00003E35 [613A] <1> dw cxor ; 3 1972 00003E37 [613A] <1> dw cxor 1973 00003E39 [613A] <1> dw cxor 1974 00003E3B [613A] <1> dw cxor 1975 00003E3D [613A] <1> dw cxor 1976 00003E3F [613A] <1> dw cxor 1977 00003E41 [C73D] <1> dw pss 1978 00003E43 [C63A] <1> dw caaa 1979 <1> 1980 00003E45 [653A] <1> dw ccmp 1981 00003E47 [653A] <1> dw ccmp 1982 00003E49 [653A] <1> dw ccmp 1983 00003E4B [653A] <1> dw ccmp 1984 00003E4D [653A] <1> dw ccmp 1985 00003E4F [653A] <1> dw ccmp 1986 00003E51 [BF3D] <1> dw pds 1987 00003E53 [D23A] <1> dw caas 1988 <1> 1989 00003E55 [693A] <1> dw cinc ; 4 1990 00003E57 [693A] <1> dw cinc 1991 00003E59 [693A] <1> dw cinc 1992 00003E5B [693A] <1> dw cinc 1993 00003E5D [693A] <1> dw cinc 1994 00003E5F [693A] <1> dw cinc 1995 00003E61 [693A] <1> dw cinc 1996 00003E63 [693A] <1> dw cinc 1997 <1> 1998 00003E65 [6D3A] <1> dw cdec 1999 00003E67 [6D3A] <1> dw cdec 2000 00003E69 [6D3A] <1> dw cdec 2001 00003E6B [6D3A] <1> dw cdec 2002 00003E6D [6D3A] <1> dw cdec 2003 00003E6F [6D3A] <1> dw cdec 2004 00003E71 [6D3A] <1> dw cdec 2005 00003E73 [6D3A] <1> dw cdec 2006 <1> 2007 00003E75 [713A] <1> dw cpush ; 5 2008 00003E77 [713A] <1> dw cpush 2009 00003E79 [713A] <1> dw cpush 2010 00003E7B [713A] <1> dw cpush 2011 00003E7D [713A] <1> dw cpush 2012 00003E7F [713A] <1> dw cpush 2013 00003E81 [713A] <1> dw cpush 2014 00003E83 [713A] <1> dw cpush 2015 <1> 2016 00003E85 [763A] <1> dw cpop 2017 00003E87 [763A] <1> dw cpop 2018 00003E89 [763A] <1> dw cpop 2019 00003E8B [763A] <1> dw cpop 2020 00003E8D [763A] <1> dw cpop 2021 00003E8F [763A] <1> dw cpop 2022 00003E91 [763A] <1> dw cpop 2023 00003E93 [763A] <1> dw cpop 2024 <1> 2025 00003E95 [ED3B] <1> dw cpusha ; 6 2026 00003E97 [F33B] <1> dw cpopa 2027 00003E99 [F83B] <1> dw cbound 2028 00003E9B [643C] <1> dw carpl 2029 00003E9D [CB3D] <1> dw pfs 2030 00003E9F [CF3D] <1> dw pgs 2031 00003EA1 [D33D] <1> dw op_size 2032 00003EA3 [D43D] <1> dw AddrSize 2033 <1> 2034 00003EA5 [713A] <1> dw cpush 2035 00003EA7 [B03A] <1> dw cimul 2036 00003EA9 [713A] <1> dw cpush 2037 00003EAB [B03A] <1> dw cimul 2038 00003EAD [FE3B] <1> dw cinsb 2039 00003EAF [093C] <1> dw cinsw 2040 00003EB1 [033C] <1> dw coutsb 2041 00003EB3 [0E3C] <1> dw coutsw 2042 <1> 2043 00003EB5 [B53B] <1> dw cjo ; 7 2044 00003EB7 [B83B] <1> dw cjno 2045 00003EB9 [BC3B] <1> dw cjb 2046 00003EBB [BF3B] <1> dw cjnb 2047 00003EBD [C33B] <1> dw cjz 2048 00003EBF [C63B] <1> dw cjnz 2049 00003EC1 [CA3B] <1> dw cjbe 2050 00003EC3 [CE3B] <1> dw cja 2051 <1> 2052 00003EC5 [D13B] <1> dw cjs 2053 00003EC7 [D43B] <1> dw cjns 2054 00003EC9 [D83B] <1> dw cjp 2055 00003ECB [DB3B] <1> dw cjnp 2056 00003ECD [DF3B] <1> dw cjl 2057 00003ECF [E23B] <1> dw cjge 2058 00003ED1 [E63B] <1> dw cjle 2059 00003ED3 [EA3B] <1> dw cjg 2060 <1> 2061 00003ED5 0000 <1> dw ArOp1 ; 8 2062 00003ED7 0000 <1> dw ArOp1 2063 00003ED9 0100 <1> dw ArOp2 2064 00003EDB 0100 <1> dw ArOp2 2065 00003EDD [9F3A] <1> dw ctest 2066 00003EDF [9F3A] <1> dw ctest 2067 00003EE1 [7E3A] <1> dw cxchg 2068 00003EE3 [7E3A] <1> dw cxchg 2069 <1> 2070 00003EE5 [7A3A] <1> dw cmov 2071 00003EE7 [7A3A] <1> dw cmov 2072 00003EE9 [7A3A] <1> dw cmov 2073 00003EEB [7A3A] <1> dw cmov 2074 00003EED [7A3A] <1> dw cmov 2075 00003EEF [8F3B] <1> dw clea 2076 00003EF1 [7A3A] <1> dw cmov 2077 00003EF3 [763A] <1> dw cpop 2078 <1> 2079 00003EF5 [8B3B] <1> dw cnop ; 9 2080 00003EF7 [7E3A] <1> dw cxchg 2081 00003EF9 [7E3A] <1> dw cxchg 2082 00003EFB [7E3A] <1> dw cxchg 2083 00003EFD [7E3A] <1> dw cxchg 2084 00003EFF [7E3A] <1> dw cxchg 2085 00003F01 [7E3A] <1> dw cxchg 2086 00003F03 [7E3A] <1> dw cxchg 2087 <1> 2088 00003F05 [BE3A] <1> dw ccbw 2089 00003F07 [C23A] <1> dw ccwd 2090 00003F09 [1F3B] <1> dw ccall 2091 00003F0B [B03B] <1> dw cwait 2092 00003F0D [563B] <1> dw cpushf 2093 00003F0F [5C3B] <1> dw cpopf 2094 00003F11 [613B] <1> dw csahf 2095 00003F13 [663B] <1> dw clahf 2096 <1> 2097 00003F15 [7A3A] <1> dw cmov ; A 2098 00003F17 [7A3A] <1> dw cmov 2099 00003F19 [7A3A] <1> dw cmov 2100 00003F1B [7A3A] <1> dw cmov 2101 00003F1D [E33A] <1> dw cmovsb 2102 00003F1F [E93A] <1> dw cmovsw 2103 00003F21 [073B] <1> dw ccmpsb 2104 00003F23 [0D3B] <1> dw ccmpsw 2105 <1> 2106 00003F25 [9F3A] <1> dw ctest 2107 00003F27 [9F3A] <1> dw ctest 2108 00003F29 [EF3A] <1> dw cstosb 2109 00003F2B [F53A] <1> dw cstosw 2110 00003F2D [FB3A] <1> dw clodsb 2111 00003F2F [013B] <1> dw clodsw 2112 00003F31 [133B] <1> dw cscasb 2113 00003F33 [193B] <1> dw cscasw 2114 <1> 2115 00003F35 [7A3A] <1> dw cmov ; B 2116 00003F37 [7A3A] <1> dw cmov 2117 00003F39 [7A3A] <1> dw cmov 2118 00003F3B [7A3A] <1> dw cmov 2119 00003F3D [7A3A] <1> dw cmov 2120 00003F3F [7A3A] <1> dw cmov 2121 00003F41 [7A3A] <1> dw cmov 2122 00003F43 [7A3A] <1> dw cmov 2123 <1> 2124 00003F45 [7A3A] <1> dw cmov 2125 00003F47 [7A3A] <1> dw cmov 2126 00003F49 [7A3A] <1> dw cmov 2127 00003F4B [7A3A] <1> dw cmov 2128 00003F4D [7A3A] <1> dw cmov 2129 00003F4F [7A3A] <1> dw cmov 2130 00003F51 [7A3A] <1> dw cmov 2131 00003F53 [7A3A] <1> dw cmov 2132 <1> 2133 00003F55 0200 <1> dw ShiftOp ; C 2134 00003F57 0200 <1> dw ShiftOp 2135 00003F59 [283B] <1> dw cret 2136 00003F5B [283B] <1> dw cret 2137 00003F5D [933B] <1> dw cles 2138 00003F5F [973B] <1> dw clds 2139 00003F61 0600 <1> dw MovGrp 2140 00003F63 0600 <1> dw MovGrp 2141 <1> 2142 00003F65 [143C] <1> dw center 2143 00003F67 [1A3C] <1> dw cleave 2144 00003F69 [2C3B] <1> dw cretf 2145 00003F6B [2C3B] <1> dw cretf 2146 00003F6D [4C3B] <1> dw cint3 2147 00003F6F [433B] <1> dw cint 2148 00003F71 [473B] <1> dw cinto 2149 00003F73 [513B] <1> dw ciret 2150 <1> 2151 00003F75 0200 <1> dw ShiftOp ; D 2152 00003F77 0200 <1> dw ShiftOp 2153 00003F79 0200 <1> dw ShiftOp 2154 00003F7B 0200 <1> dw ShiftOp 2155 00003F7D [CE3A] <1> dw caam 2156 00003F7F [CA3A] <1> dw caad 2157 00003F81 [DE3A] <1> dw csalc 2158 00003F83 [9B3B] <1> dw cxlat 2159 <1> 2160 00003F85 [AC3B] <1> dw cesc 2161 00003F87 [AC3B] <1> dw cesc 2162 00003F89 [AC3B] <1> dw cesc 2163 00003F8B [AC3B] <1> dw cesc 2164 00003F8D [AC3B] <1> dw cesc 2165 00003F8F [AC3B] <1> dw cesc 2166 00003F91 [AC3B] <1> dw cesc 2167 00003F93 [AC3B] <1> dw cesc 2168 <1> 2169 00003F95 [3C3B] <1> dw cloopne ; E 2170 00003F97 [363B] <1> dw cloope 2171 00003F99 [313B] <1> dw cloop 2172 00003F9B [A03B] <1> dw cjcxz 2173 00003F9D [A53B] <1> dw cin 2174 00003F9F [A53B] <1> dw cin 2175 00003FA1 [A83B] <1> dw cout 2176 00003FA3 [A83B] <1> dw cout 2177 <1> 2178 00003FA5 [1F3B] <1> dw ccall 2179 00003FA7 [243B] <1> dw cjmp 2180 00003FA9 [243B] <1> dw cjmp 2181 00003FAB [243B] <1> dw cjmp 2182 00003FAD [A53B] <1> dw cin 2183 00003FAF [A53B] <1> dw cin 2184 00003FB1 [A83B] <1> dw cout 2185 00003FB3 [A83B] <1> dw cout 2186 <1> 2187 00003FB5 [A43D] <1> dw plock ; F 2188 00003FB7 [9D3D] <1> dw cdb 2189 00003FB9 [B43D] <1> dw prepne 2190 00003FBB [AE3D] <1> dw prepe 2191 00003FBD [873B] <1> dw chlt 2192 00003FBF [6F3B] <1> dw ccmc 2193 00003FC1 0300 <1> dw grp_1 2194 00003FC3 0300 <1> dw grp_1 2195 <1> 2196 00003FC5 [6B3B] <1> dw cclc 2197 00003FC7 [733B] <1> dw cstc 2198 00003FC9 [7F3B] <1> dw ccli 2199 00003FCB [833B] <1> dw csti 2200 00003FCD [773B] <1> dw ccld 2201 00003FCF [7B3B] <1> dw cstd 2202 00003FD1 0400 <1> dw Grp2 2203 00003FD3 0500 <1> dw Grp3 2204 <1> 2205 <1> grp_commands: 2206 00003FD5 [4A3A][4E3A][513A]- <1> OpArOp1 dw cadd, cor, cadc, csbb, cand, csub, cxor,ccmp 2206 00003FDB [553A][593A][5D3A]- <1> 2206 00003FE1 [613A][653A] <1> 2207 00003FE5 [4A3A][4E3A][513A]- <1> OpArOp2 dw cadd, cor, cadc, csbb, cand, csub, cxor,ccmp 2207 00003FEB [553A][593A][5D3A]- <1> 2207 00003FF1 [613A][653A] <1> 2208 00003FF5 [973A][9B3A][8B3A]- <1> OpShiftOp dw crol, cror,crcl, crcr, cshl, cshr, qqq, csar 2208 00003FFB [8F3A][833A][873A]- <1> 2208 00004001 [A03D][933A] <1> 2209 00004005 [9F3A][A03D][A43A]- <1> OpGrp1 dw ctest,qqq, cnot, cneg, cmul, cimul,cdiv,cidiv 2209 0000400B [A83A][AC3A][B03A]- <1> 2209 00004011 [B53A][B93A] <1> 2210 00004015 [693A][6D3A][1F3B]- <1> OpGrp2 dw cinc, cdec,ccall,ccall,cjmp, cjmp, cpush,qqq 2210 0000401B [1F3B][243B][243B]- <1> 2210 00004021 [713A][A03D] <1> 2211 00004025 [693A][6D3A][1F3B]- <1> OpGrp3 dw cinc, cdec,ccall,ccall,cjmp, cjmp, cpush,qqq 2211 0000402B [1F3B][243B][243B]- <1> 2211 00004031 [713A][A03D] <1> 2212 00004035 [7A3A][A03D][A03D]- <1> OpMovGrp dw cmov, qqq, qqq, qqq, qqq, qqq, qqq, qqq 2212 0000403B [A03D][A03D][A03D]- <1> 2212 00004041 [A03D][A03D] <1> 2213 <1> 2214 <1> 2215 <1> ano equ 00h 2216 <1> aemp equ 3Fh 2217 <1> arm8 equ 01h 2218 <1> arm16 equ 81h 2219 <1> 2220 <1> aim8 equ 03h 2221 <1> aim16 equ 83h 2222 <1> amem8 equ 04h 2223 <1> amem16 equ 84h 2224 <1> a1 equ 05h 2225 <1> asht equ 06h 2226 <1> anear equ 07h 2227 <1> afar equ 08h 2228 <1> ;aseg equ 09h 2229 <1> arm8r equ 0Ah 2230 <1> arm16r equ 8Ah 2231 <1> ar8rm equ 0Bh 2232 <1> ar16rm equ 8Bh 2233 <1> arm_seg equ 0Ch 2234 <1> aseg_rm equ 0Dh 2235 <1> aesc equ 0Eh 2236 <1> aim8_16 equ 0Fh 2237 <1> ar8_16 equ 10h 2238 <1> ar16_32 equ 11h 2239 <1> arm16r8 equ 12h 2240 <1> r_cr equ 13h 2241 <1> cr_r equ 14h 2242 <1> r_dr equ 15h 2243 <1> dr_r equ 16h 2244 <1> r_tr equ 17h 2245 <1> tr_r equ 18h 2246 <1> astr equ 19h 2247 <1> astrn equ 1Ah 2248 <1> 2249 <1> aax equ 40h 2250 <1> acx equ 41h 2251 <1> adx equ 42h 2252 <1> abx equ 43h 2253 <1> aspa equ 44h 2254 <1> abp equ 45h 2255 <1> asi equ 46h 2256 <1> adi equ 47h 2257 <1> 2258 <1> aal equ 48h 2259 <1> acl equ 49h 2260 <1> adl equ 4Ah 2261 <1> abl equ 4Bh 2262 <1> aah equ 4Ch 2263 <1> ach equ 4Dh 2264 <1> adh equ 4Eh 2265 <1> abh equ 4Fh 2266 <1> 2267 <1> aes equ 50h 2268 <1> acs equ 51h 2269 <1> ass equ 52h 2270 <1> ads equ 53h 2271 <1> afs equ 54h 2272 <1> ags equ 55h 2273 <1> 2274 <1> a86 equ 70h 2275 <1> a286 equ 71h 2276 <1> a386 equ 72h 2277 <1> a486 equ 73h 2278 <1> aprot equ 7Fh 2279 <1> 2280 <1> table_286_param: 2281 <1> 2282 <1> $nopar equ 0 2283 00004045 0000 <1> db 0, 0 2284 <1> $bound equ 1 2285 00004047 8B3F <1> db ar16rm, aemp 2286 <1> $push16 equ 2 2287 00004049 8300 <1> db aim16, 0 2288 <1> $push8 equ 3 2289 0000404B 0300 <1> db aim8, 0 2290 <1> $imul16 equ 4 2291 0000404D 8B83 <1> db ar16rm, aim16 2292 <1> $imul8 equ 5 2293 0000404F 8B03 <1> db ar16rm, aim8 2294 <1> $enter equ 6 2295 00004051 8303 <1> db aim16, aim8 2296 <1> $shift8 equ 7 2297 00004053 0103 <1> db arm8, aim8 2298 <1> $shift16 equ 8 2299 00004055 8103 <1> db arm16, aim8 2300 <1> $arpl equ 9 2301 00004057 8A3F <1> db arm16r, aemp 2302 <1> $strn equ 10 2303 00004059 1A00 <1> db astrn, ano 2304 <1> 2305 <1> 2306 <1> cmd_parameters: 2307 0000405B 0A3F <1> db arm8r,aemp ; 0 2308 0000405D 8A3F <1> db arm16r,aemp 2309 0000405F 0B3F <1> db ar8rm,aemp 2310 00004061 8B3F <1> db ar16rm,aemp 2311 00004063 4803 <1> db aal,aim8 2312 00004065 4083 <1> db aax,aim16 2313 00004067 5000 <1> db aes,ano 2314 00004069 5000 <1> db aes,ano 2315 <1> 2316 0000406B 0A3F <1> db arm8r,aemp 2317 0000406D 8A3F <1> db arm16r,aemp 2318 0000406F 0B3F <1> db ar8rm,aemp 2319 00004071 8B3F <1> db ar16rm,aemp 2320 00004073 4803 <1> db aal,aim8 2321 00004075 4083 <1> db aax,aim16 2322 00004077 5100 <1> db acs,ano 2323 00004079 7F00 <1> db aprot,ano 2324 <1> 2325 0000407B 0A3F <1> db arm8r,aemp ; 1 2326 0000407D 8A3F <1> db arm16r,aemp 2327 0000407F 0B3F <1> db ar8rm,aemp 2328 00004081 8B3F <1> db ar16rm,aemp 2329 00004083 4803 <1> db aal,aim8 2330 00004085 4083 <1> db aax,aim16 2331 00004087 5200 <1> db ass,ano 2332 00004089 5200 <1> db ass,ano 2333 <1> 2334 0000408B 0A3F <1> db arm8r,aemp 2335 0000408D 8A3F <1> db arm16r,aemp 2336 0000408F 0B3F <1> db ar8rm,aemp 2337 00004091 8B3F <1> db ar16rm,aemp 2338 00004093 4803 <1> db aal,aim8 2339 00004095 4083 <1> db aax,aim16 2340 00004097 5300 <1> db ads,ano 2341 00004099 5300 <1> db ads,ano 2342 <1> 2343 0000409B 0A3F <1> db arm8r,aemp ; 2 2344 0000409D 8A3F <1> db arm16r,aemp 2345 0000409F 0B3F <1> db ar8rm,aemp 2346 000040A1 8B3F <1> db ar16rm,aemp 2347 000040A3 4803 <1> db aal,aim8 2348 000040A5 4083 <1> db aax,aim16 2349 000040A7 0000 <1> db ano,ano 2350 000040A9 0000 <1> db ano,ano 2351 <1> 2352 000040AB 0A3F <1> db arm8r,aemp 2353 000040AD 8A3F <1> db arm16r,aemp 2354 000040AF 0B3F <1> db ar8rm,aemp 2355 000040B1 8B3F <1> db ar16rm,aemp 2356 000040B3 4803 <1> db aal,aim8 2357 000040B5 4083 <1> db aax,aim16 2358 000040B7 0000 <1> db ano,ano 2359 000040B9 0000 <1> db ano,ano 2360 <1> 2361 000040BB 0A3F <1> db arm8r,aemp ; 3 2362 000040BD 8A3F <1> db arm16r,aemp 2363 000040BF 0B3F <1> db ar8rm,aemp 2364 000040C1 8B3F <1> db ar16rm,aemp 2365 000040C3 4803 <1> db aal,aim8 2366 000040C5 4083 <1> db aax,aim16 2367 000040C7 0000 <1> db ano,ano 2368 000040C9 0000 <1> db ano,ano 2369 <1> 2370 000040CB 0A3F <1> db arm8r,aemp 2371 000040CD 8A3F <1> db arm16r,aemp 2372 000040CF 0B3F <1> db ar8rm,aemp 2373 000040D1 8B3F <1> db ar16rm,aemp 2374 000040D3 4803 <1> db aal,aim8 2375 000040D5 4083 <1> db aax,aim16 2376 000040D7 0000 <1> db ano,ano 2377 000040D9 0000 <1> db ano,ano 2378 <1> 2379 000040DB 4000 <1> db aax,ano ; 4 2380 000040DD 4100 <1> db acx,ano 2381 000040DF 4200 <1> db adx,ano 2382 000040E1 4300 <1> db abx,ano 2383 000040E3 4400 <1> db aspa,ano 2384 000040E5 4500 <1> db abp,ano 2385 000040E7 4600 <1> db asi,ano 2386 000040E9 4700 <1> db adi,ano 2387 <1> 2388 000040EB 4000 <1> db aax,ano 2389 000040ED 4100 <1> db acx,ano 2390 000040EF 4200 <1> db adx,ano 2391 000040F1 4300 <1> db abx,ano 2392 000040F3 4400 <1> db aspa,ano 2393 000040F5 4500 <1> db abp,ano 2394 000040F7 4600 <1> db asi,ano 2395 000040F9 4700 <1> db adi,ano 2396 <1> 2397 000040FB 4000 <1> db aax,ano ; 5 2398 000040FD 4100 <1> db acx,ano 2399 000040FF 4200 <1> db adx,ano 2400 00004101 4300 <1> db abx,ano 2401 00004103 4400 <1> db aspa,ano 2402 00004105 4500 <1> db abp,ano 2403 00004107 4600 <1> db asi,ano 2404 00004109 4700 <1> db adi,ano 2405 <1> 2406 0000410B 4000 <1> db aax,ano 2407 0000410D 4100 <1> db acx,ano 2408 0000410F 4200 <1> db adx,ano 2409 00004111 4300 <1> db abx,ano 2410 00004113 4400 <1> db aspa,ano 2411 00004115 4500 <1> db abp,ano 2412 00004117 4600 <1> db asi,ano 2413 00004119 4700 <1> db adi,ano 2414 <1> 2415 0000411B 7100 <1> db a286,$nopar ; 6 2416 0000411D 7100 <1> db a286,$nopar 2417 0000411F 7101 <1> db a286,$bound 2418 00004121 7109 <1> db a286,$arpl 2419 00004123 7200 <1> db a386,ano 2420 00004125 7200 <1> db a386,ano 2421 00004127 7200 <1> db a386,ano 2422 00004129 7200 <1> db a386,ano 2423 <1> 2424 0000412B 7102 <1> db a286,$push16 2425 0000412D 7104 <1> db a286,$imul16 2426 0000412F 7103 <1> db a286,$push8 2427 00004131 7105 <1> db a286,$imul8 2428 00004133 710A <1> db a286,$strn 2429 00004135 710A <1> db a286,$strn 2430 00004137 710A <1> db a286,$strn 2431 00004139 710A <1> db a286,$strn 2432 <1> 2433 0000413B 0600 <1> db asht,ano ; 7 2434 0000413D 0600 <1> db asht,ano 2435 0000413F 0600 <1> db asht,ano 2436 00004141 0600 <1> db asht,ano 2437 00004143 0600 <1> db asht,ano 2438 00004145 0600 <1> db asht,ano 2439 00004147 0600 <1> db asht,ano 2440 00004149 0600 <1> db asht,ano 2441 <1> 2442 0000414B 0600 <1> db asht,ano 2443 0000414D 0600 <1> db asht,ano 2444 0000414F 0600 <1> db asht,ano 2445 00004151 0600 <1> db asht,ano 2446 00004153 0600 <1> db asht,ano 2447 00004155 0600 <1> db asht,ano 2448 00004157 0600 <1> db asht,ano 2449 00004159 0600 <1> db asht,ano 2450 <1> 2451 0000415B 0103 <1> db arm8,aim8 ; 8 2452 0000415D 8183 <1> db arm16,aim16 ; 8, 16 2453 0000415F 0103 <1> db arm8,aim8 2454 00004161 810F <1> db arm16,aim8_16 ;; 2455 00004163 0A3F <1> db arm8r,aemp 2456 00004165 8A3F <1> db arm16r,aemp 2457 00004167 0B3F <1> db ar8rm,aemp 2458 00004169 8B3F <1> db ar16rm,aemp 2459 <1> 2460 0000416B 0A3F <1> db arm8r,aemp 2461 0000416D 8A3F <1> db arm16r,aemp 2462 0000416F 0B3F <1> db ar8rm,aemp 2463 00004171 8B3F <1> db ar16rm,aemp 2464 00004173 0C3F <1> db arm_seg,aemp 2465 00004175 8B3F <1> db ar16rm,aemp 2466 00004177 0D3F <1> db aseg_rm,aemp 2467 00004179 8100 <1> db arm16,ano 2468 <1> 2469 0000417B 0000 <1> db ano,ano ; 9 2470 0000417D 4041 <1> db aax,acx 2471 0000417F 4042 <1> db aax,adx 2472 00004181 4043 <1> db aax,abx 2473 00004183 4044 <1> db aax,aspa 2474 00004185 4045 <1> db aax,abp 2475 00004187 4046 <1> db aax,asi 2476 00004189 4047 <1> db aax,adi 2477 <1> 2478 0000418B 0000 <1> db ano,ano 2479 0000418D 0000 <1> db ano,ano 2480 0000418F 0800 <1> db afar,ano 2481 00004191 0000 <1> db ano,ano 2482 00004193 0000 <1> db ano,ano 2483 00004195 0000 <1> db ano,ano 2484 00004197 0000 <1> db ano,ano 2485 00004199 0000 <1> db ano,ano 2486 <1> 2487 0000419B 4804 <1> db aal,amem8 ; A 2488 0000419D 4084 <1> db aax,amem16 2489 0000419F 0448 <1> db amem8,aal 2490 000041A1 8440 <1> db amem16,aax 2491 000041A3 1900 <1> db astr,ano 2492 000041A5 1900 <1> db astr,ano 2493 000041A7 1900 <1> db astr,ano 2494 000041A9 1900 <1> db astr,ano 2495 <1> 2496 000041AB 4803 <1> db aal,aim8 2497 000041AD 4083 <1> db aax,aim16 2498 000041AF 1A00 <1> db astrn,ano 2499 000041B1 1A00 <1> db astrn,ano 2500 000041B3 1900 <1> db astr,ano 2501 000041B5 1900 <1> db astr,ano 2502 000041B7 1A00 <1> db astrn,ano 2503 000041B9 1A00 <1> db astrn,ano 2504 <1> 2505 000041BB 4803 <1> db aal,aim8 ; B 2506 000041BD 4903 <1> db acl,aim8 2507 000041BF 4A03 <1> db adl,aim8 2508 000041C1 4B03 <1> db abl,aim8 2509 000041C3 4C03 <1> db aah,aim8 2510 000041C5 4D03 <1> db ach,aim8 2511 000041C7 4E03 <1> db adh,aim8 2512 000041C9 4F03 <1> db abh,aim8 2513 <1> 2514 000041CB 4083 <1> db aax,aim16 2515 000041CD 4183 <1> db acx,aim16 2516 000041CF 4283 <1> db adx,aim16 2517 000041D1 4383 <1> db abx,aim16 2518 000041D3 4483 <1> db aspa,aim16 2519 000041D5 4583 <1> db abp,aim16 2520 000041D7 4683 <1> db asi,aim16 2521 000041D9 4783 <1> db adi,aim16 2522 <1> 2523 000041DB 7107 <1> db a286,$shift8 ; C 2524 000041DD 7108 <1> db a286,$shift16 2525 000041DF 8300 <1> db aim16,ano 2526 000041E1 0000 <1> db ano,ano 2527 000041E3 8B3F <1> db ar16rm,aemp 2528 000041E5 8B3F <1> db ar16rm,aemp 2529 000041E7 0103 <1> db arm8,aim8 2530 000041E9 8183 <1> db arm16,aim16 2531 <1> 2532 000041EB 7106 <1> db a286,$enter 2533 000041ED 7100 <1> db a286,$nopar 2534 000041EF 8300 <1> db aim16,ano 2535 000041F1 0000 <1> db ano,ano 2536 000041F3 0000 <1> db ano,ano 2537 000041F5 0300 <1> db aim8,ano 2538 000041F7 0000 <1> db ano,ano 2539 000041F9 0000 <1> db ano,ano 2540 <1> 2541 000041FB 0105 <1> db arm8,a1 ; D 2542 000041FD 8105 <1> db arm16,a1 2543 000041FF 0149 <1> db arm8,acl 2544 00004201 8149 <1> db arm16,acl 2545 00004203 0000 <1> db ano,ano 2546 00004205 0000 <1> db ano,ano 2547 00004207 0000 <1> db ano,ano 2548 00004209 0000 <1> db ano,ano 2549 <1> 2550 0000420B 0E3F <1> db aesc,aemp 2551 0000420D 0E3F <1> db aesc,aemp 2552 0000420F 0E3F <1> db aesc,aemp 2553 00004211 0E3F <1> db aesc,aemp 2554 00004213 0E3F <1> db aesc,aemp 2555 00004215 0E3F <1> db aesc,aemp 2556 00004217 0E3F <1> db aesc,aemp 2557 00004219 0E3F <1> db aesc,aemp 2558 <1> 2559 0000421B 0600 <1> db asht,ano ; E 2560 0000421D 0600 <1> db asht,ano 2561 0000421F 0600 <1> db asht,ano 2562 00004221 0600 <1> db asht,ano 2563 00004223 4803 <1> db aal,aim8 2564 00004225 4003 <1> db aax,aim8 2565 00004227 0348 <1> db aim8,aal 2566 00004229 0340 <1> db aim8,aax 2567 <1> 2568 0000422B 0700 <1> db anear,ano 2569 0000422D 0700 <1> db anear,ano 2570 0000422F 0800 <1> db afar,ano 2571 00004231 0600 <1> db asht,ano 2572 00004233 4842 <1> db aal,adx 2573 00004235 4042 <1> db aax,adx 2574 00004237 4248 <1> db adx,aal 2575 00004239 4240 <1> db adx,aax 2576 <1> 2577 0000423B 0000 <1> db ano,ano ; F 2578 0000423D 0000 <1> db ano,ano 2579 0000423F 0000 <1> db ano,ano 2580 00004241 0000 <1> db ano,ano 2581 00004243 0000 <1> db ano,ano 2582 00004245 0000 <1> db ano,ano 2583 00004247 0100 <1> db arm8,ano 2584 00004249 8100 <1> db arm16,ano 2585 <1> 2586 0000424B 0000 <1> db ano,ano 2587 0000424D 0000 <1> db ano,ano 2588 0000424F 0000 <1> db ano,ano 2589 00004251 0000 <1> db ano,ano 2590 00004253 0000 <1> db ano,ano 2591 00004255 0000 <1> db ano,ano 2592 00004257 0100 <1> db arm8,ano 2593 00004259 8100 <1> db arm16,ano 2594 <1> 2595 <1> ;~ifndef __ACT__ 2596 <1> ;~Buffer db BUF_SIZE dup (' ') 2597 <1> ;~ db -1 2598 <1> ;~endif 2599 <1> ;~ 2600 <1> ;~endif 2601 <1> ;~ 2602 <1> ;~ifdef _CommandLength 2603 <1> ;~ 2604 <1> ;~CommandLength proc 2605 <1> ;~ ret 2606 <1> ;~endp 2607 <1> ;~ 2608 <1> ;~LengthTable label byte 2609 <1> ;~ db -1, -1, -1, -1, -1, -1, 1, 1 ; 0 2610 <1> ;~ db -1, -1, -1, -1, -1, -1, 1, 1 2611 <1> ;~ db -1, -1, -1, -1, -1, -1, 1, 1 ; 1 2612 <1> ;~ db -1, -1, -1, -1, -1, -1, 1, 1 2613 <1> ;~ 2614 <1> ;~ db -1, -1, -1, -1, -1, -1, 0, 1 ; 2 2615 <1> ;~ db -1, -1, -1, -1, -1, -1, 0, 1 2616 <1> ;~ db -1, -1, -1, -1, -1, -1, 0, 1 ; 3 2617 <1> ;~ db -1, -1, -1, -1, -1, -1, 0, 1 2618 <1> ;~ 2619 <1> ;~ db 1, 1, 1, 1, 1, 1, 1, 1 ; 4 2620 <1> ;~ db 1, 1, 1, 1, 1, 1, 1, 1 2621 <1> ;~ db 1, 1, 1, 1, 1, 1, 1, 1 ; 5 2622 <1> ;~ db 1, 1, 1, 1, 1, 1, 1, 1 2623 <1> ;~ 2624 <1> ;~ db 1, 1, 1, 1, 1, 1, 1, 1 ; 6 2625 <1> ;~ db 1, 1, 1, 1, 1, 1, 1, 1 2626 <1> ;~ 2627 <1> ;~ db 2, 2, 2, 2, 2, 2, 2, 2 ; 7 2628 <1> ;~ db 2, 2, 2, 2, 2, 2, 2, 2 2629 <1> ;~ 2630 <1> ;~ db -2, -2, -2, -2, -1, -1, -1, -1 ; 8 2631 <1> ;~ db -1, -1, -1, -1, -1, -1, -1, -1 2632 <1> ;~ 2633 <1> ;~ db 1, 1, 1, 1, 1, 1, 1, 1 ; 9 2634 <1> ;~ db 1, 1, 5, 1, 1, 1, 1, 1 2635 <1> ;~ 2636 <1> ;~ db 3, 3, 3, 3, 1, 1, 1, 1 ; A 2637 <1> ;~ db -2, -2, 1, 1, 1, 1, 1, 1 2638 <1> ;~ 2639 <1> ;~ db 2, 2, 2, 2, 2, 2, 2, 2 ; B 2640 <1> ;~ db 3, 3, 3, 3, 3, 3, 3, 3 2641 <1> ;~ 2642 <1> ;~ db 1, 1, 3, 1, -1, -1, -1, -1 ; C 2643 <1> ;~ db 1, 1, 3, 1, 1, 2, 1, 1 2644 <1> ;~ 2645 <1> ;~ db -1, -1, -1, -1, 2, 2, 1, 1 ; D 2646 <1> ;~ db -1, -1, -1, -1, -1, -1, -1, -1 2647 <1> ;~ 2648 <1> ;~ db 2, 2, 2, 2, 2, 2, 2, 2 ; E 2649 <1> ;~ db 3, 3, 5, 2, 1, 1, 1, 1 2650 <1> ;~ 2651 <1> ;~ db 0, 1, 0, 0, 1, 1, 81h, 81h ; F 2652 <1> ;~ db 1, 1, 1, 1, 1, 1, 82h, 83h 2653 <1> ;~ 2654 <1> ;~LengthTable2 label byte 2655 <1> ;~ db 1, 2, 3, 1 2656 <1> ;~ 2657 <1> ;~endif 2658 <1> 2659 <1> ;============================================================================= 2660 <1> ; E0F 2661 <1> ;============================================================================= 2662 <1> 2663 <1> 63 %include "asm.inc" ;Assembler 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; asm.inc 7 <1> ; Assembler. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; assemble 28 <1> ;----------------------------------------------------------------------------- 29 <1> ;ds:si -> assembling line 30 <1> ;es:di -> result buffer 31 <1> ;bx = jump/call offset origin 32 <1> assemble: 33 0000425B FC <1> cld 34 0000425C 8C06[7343] <1> mov [asm_seg],es 35 00004260 893E[7543] <1> mov [asm_offs],di 36 00004264 891E[7943] <1> mov [jump_origin_offs],bx 37 00004268 8926[7743] <1> mov [asm_sp],sp 38 0000426C 0E <1> push cs 39 0000426D 07 <1> pop es 40 0000426E C606[C98B]00 <1> mov byte [rep_pref],0 41 <1> @@find_next: 42 00004273 E87A01 <1> call find_name 43 <1> 44 00004276 81FB[0F4B] <1> cmp bx,rep_prefixes 45 0000427A 7208 <1> jb not_rep 46 0000427C 8A4705 <1> mov al,[bx+5] 47 0000427F A2[C98B] <1> mov [rep_pref],al 48 00004282 EBEF <1> jmp @@find_next 49 <1> not_rep: 50 00004284 E8DBD7 <1> call upline 51 <1> 52 00004287 803E[C98B]00 <1> cmp byte [rep_pref],0 53 0000428C 7409 <1> je @@no_rep 54 0000428E 807F06FF <1> cmp byte [bx+6],-1 55 00004292 7403 <1> je @@no_rep 56 00004294 E9C400 <1> jmp rep_error 57 <1> @@no_rep: 58 00004297 C606[C78B]00 <1> mov byte [jump_flag],0 59 0000429C 81FB[F149] <1> cmp bx,jumps_and_calls 60 000042A0 7205 <1> jb not_jumps 61 000042A2 C606[C78B]01 <1> mov byte [jump_flag],1 62 <1> not_jumps: 63 000042A7 8326[7B43]00 <1> and word [db_dw_done], 0 64 000042AC 81FB[5B48] <1> cmp bx, asm_table_db 65 000042B0 7503E9C800 <1> je handle_db 66 000042B5 81FB[6248] <1> cmp bx, asm_table_dw 67 000042B9 7503E9BF00 <1> je handle_dw 68 000042BE C606[C88B]00 <1> mov byte [param_count],0 69 000042C3 C606[0852]FF <1> mov byte [curr_prefix],-1 70 000042C8 BF[0952] <1> mov di,parameter_1 71 000042CB E87101 <1> call get_parameter 72 000042CE 7232 <1> jc ..@no_params 73 000042D0 FE06[C88B] <1> inc byte [param_count] 74 000042D4 BF[1252] <1> mov di,parameter_2 75 000042D7 E86501 <1> call get_parameter 76 000042DA 7226 <1> jc one_param 77 000042DC FE06[C88B] <1> inc byte [param_count] 78 000042E0 A0[1152] <1> mov al,[parameter_1+AP_WORD_FLAG] 79 000042E3 8A26[1A52] <1> mov ah,[parameter_2+AP_WORD_FLAG] 80 <1> ; or ax,ax 81 <1> ; jz TypeWarning 82 000042E7 81FB[A349] <1> cmp bx,diff_types 83 000042EB 730D <1> jae @@1 84 000042ED 3C00 <1> cmp al,0 85 000042EF 7409 <1> je @@1 86 000042F1 80FC00 <1> cmp ah,0 87 000042F4 7404 <1> je @@1 88 000042F6 38E0 <1> cmp al,ah 89 000042F8 7566 <1> jne reg_error 90 <1> @@1: 91 000042FA E81B04 <1> call skip_spaces 92 000042FD 7403 <1> jz one_param 93 000042FF E9F901 <1> jmp extra_error 94 <1> one_param: 95 <1> ; cmp Parameter1.WordFlag,0 96 <1> ; jz TypeWarning 97 <1> ..@no_params: 98 00004302 BF[968D] <1> mov di,asm_buffer 99 00004305 8A0F <1> mov cl,[bx] 100 00004307 8D7703 <1> lea si,[bx+3] 101 0000430A B500 <1> mov ch,0 102 <1> next_proc: 103 0000430C 51 <1> push cx 104 0000430D 8A1E[0C52] <1> mov bl,[parameter_1+AP_MEM_FLAG] 105 00004311 8A3E[1552] <1> mov bh,[parameter_2+AP_MEM_FLAG] 106 00004315 8A0E[0952] <1> mov cl,[parameter_1+AP_REG_NUMBER] 107 00004319 8A2E[1252] <1> mov ch,[parameter_2+AP_REG_NUMBER] 108 0000431D AD <1> lodsw 109 0000431E 92 <1> xchg ax,dx 110 0000431F AD <1> lodsw 111 00004320 FFD2 <1> call dx 112 00004322 59 <1> pop cx 113 00004323 E0E7 <1> loopne next_proc 114 00004325 753E <1> jne wrong_param 115 <1> 116 <1> write_asm_buffer: 117 00004327 8E06[7343] <1> mov es,[asm_seg] 118 0000432B 8B3E[7543] <1> mov di,[asm_offs] 119 0000432F 033E[7B43] <1> add di, word [db_dw_done] 120 00004333 BE[968D] <1> mov si,asm_buffer 121 00004336 AC <1> lodsb 122 00004337 88C1 <1> mov cl,al 123 00004339 B500 <1> mov ch,0 124 0000433B 803E[C98B]00 <1> cmp byte [rep_pref],0 125 00004340 7404 <1> jz @@ch_pr 126 00004342 A0[C98B] <1> mov al,[rep_pref] 127 00004345 AA <1> stosb 128 <1> @@ch_pr: 129 00004346 803E[0852]FF <1> cmp byte [curr_prefix],-1 130 0000434B 7408 <1> je @@copy 131 <1> ; cmp Parameter1.MemFlag,0 132 <1> ; jne @@Mem1 133 <1> ; cmp Parameter2.MemFlag,0 134 <1> ; je @@Copy 135 <1> ;@@Mem1: 136 0000434D A0[0852] <1> mov al,[curr_prefix] 137 00004350 BB[9751] <1> mov bx,pref_codes 138 00004353 D7 <1> xlat 139 00004354 AA <1> stosb 140 <1> @@copy: 141 00004355 51 <1> push cx 142 00004356 F3A4 <1> rep movsb 143 00004358 59 <1> pop cx 144 00004359 F8 <1> clc 145 0000435A C3 <1> ret 146 <1> 147 <1> rep_error: 148 0000435B B80800 <1> mov ax,ER_REP_ERROR 149 0000435E EB0D <1> jmp asm_error 150 <1> ;TypeWarning: 151 <1> ; mov ax,erParamType 152 <1> ; jmp AsmError 153 <1> reg_error: 154 00004360 B80700 <1> mov ax,ER_REG_BITS 155 00004363 EB08 <1> jmp asm_error 156 <1> wrong_param: 157 00004365 B80300 <1> mov ax,ER_INV_PARAM 158 00004368 EB03 <1> jmp asm_error 159 <1> mnem_error: 160 0000436A B80200 <1> mov ax,ER_MNEMONIC 161 <1> asm_error: ; SI=error place 162 0000436D 8B26[7743] <1> mov sp,[asm_sp] ; AX=error code 163 00004371 F9 <1> stc 164 00004372 C3 <1> ret 165 <1> ;============================================================================= 166 00004373 0000 <1> asm_seg dw 0 167 00004375 0000 <1> asm_offs dw 0 168 00004377 0000 <1> asm_sp dw 0 169 00004379 0000 <1> jump_origin_offs dw 0 170 0000437B 0000 <1> db_dw_done: dw 0 171 <1> ; db_dw_size: db 0 172 <1> 173 <1> handle_db: 174 <1> ; mov byte [db_dw_size], 1 175 <1> ; jmp @F 176 <1> 177 <1> handle_dw: 178 <1> ; mov byte [db_dw_size], 2 179 <1> @@: 180 0000437D C606[C88B]00 <1> mov byte [param_count],0 181 00004382 C606[0852]FF <1> mov byte [curr_prefix],-1 182 00004387 56 <1> push si 183 <1> @@: 184 00004388 BF[0952] <1> mov di,parameter_1 185 0000438B E8B100 <1> call get_parameter 186 0000438E A0[1152] <1> mov al,[parameter_1+AP_WORD_FLAG] 187 00004391 7220 <1> jc @F 188 00004393 56 <1> push si 189 00004394 53 <1> push bx 190 00004395 BF[968D] <1> mov di,asm_buffer 191 00004398 8D7703 <1> lea si,[bx+3] 192 <1> 193 0000439B 8A1E[0C52] <1> mov bl,[parameter_1+AP_MEM_FLAG] 194 0000439F B700 <1> mov bh, 0 195 000043A1 8A0E[0952] <1> mov cl,[parameter_1+AP_REG_NUMBER] 196 000043A5 B500 <1> mov ch, 0 197 000043A7 AD <1> lodsw 198 000043A8 92 <1> xchg ax,dx 199 000043A9 AD <1> lodsw 200 000043AA F9 <1> stc ; just check size and type 201 000043AB FFD2 <1> call dx 202 000043AD 75B6 <1> jne wrong_param 203 000043AF 5B <1> pop bx 204 000043B0 5E <1> pop si 205 000043B1 EBD5 <1> jmp @B 206 <1> 207 <1> @@: 208 000043B3 E86203 <1> call skip_spaces 209 000043B6 7403E94001 <1> jnz extra_error 210 000043BB 5E <1> pop si 211 <1> 212 <1> @@: 213 000043BC BF[0952] <1> mov di,parameter_1 214 000043BF E87D00 <1> call get_parameter 215 000043C2 A0[1152] <1> mov al,[parameter_1+AP_WORD_FLAG] 216 000043C5 7227 <1> jc @F 217 000043C7 56 <1> push si 218 000043C8 53 <1> push bx 219 000043C9 BF[968D] <1> mov di,asm_buffer 220 000043CC 8D7703 <1> lea si,[bx+3] 221 <1> 222 000043CF 8A1E[0C52] <1> mov bl,[parameter_1+AP_MEM_FLAG] 223 000043D3 B700 <1> mov bh, 0 224 000043D5 8A0E[0952] <1> mov cl,[parameter_1+AP_REG_NUMBER] 225 000043D9 B500 <1> mov ch, 0 226 000043DB AD <1> lodsw 227 000043DC 92 <1> xchg ax,dx 228 000043DD AD <1> lodsw 229 000043DE F8 <1> clc ; actually write now 230 000043DF FFD2 <1> call dx 231 000043E1 7582 <1> jne wrong_param 232 000043E3 E841FF <1> call write_asm_buffer 233 000043E6 010E[7B43] <1> add word [db_dw_done], cx 234 000043EA 5B <1> pop bx 235 000043EB 5E <1> pop si 236 000043EC EBCE <1> jmp @B 237 <1> 238 <1> @@: 239 000043EE F8 <1> clc 240 000043EF C3 <1> retn 241 <1> 242 <1> 243 <1> ;============================================================================= 244 <1> ; find_name 245 <1> ;----------------------------------------------------------------------------- 246 <1> find_name: 247 000043F0 E82503 <1> call skip_spaces 248 000043F3 7444 <1> jz no_name 249 000043F5 BF[FA8D] <1> mov di,name_buf 250 000043F8 B90700 <1> mov cx,MAX_LETTER 251 <1> @@next_letter: 252 000043FB AC <1> lodsb 253 000043FC E82A03 <1> call test_space 254 000043FF 7409 <1> jz end_name 255 00004401 E853D6 <1> call lowcase 256 00004404 AA <1> stosb 257 00004405 E2F4 <1> loop @@next_letter 258 00004407 E960FF <1> jmp mnem_error 259 <1> end_name: 260 0000440A 4E <1> dec si 261 0000440B B000 <1> mov al,0 262 0000440D AA <1> stosb 263 0000440E 56 <1> push si 264 0000440F 89F9 <1> mov cx,di 265 00004411 BB[3847] <1> mov bx,asm_table 266 00004414 BE[FA8D] <1> mov si,name_buf 267 00004417 29F1 <1> sub cx,si 268 <1> next_mnem: 269 00004419 8B7F01 <1> mov di,[bx+1] 270 0000441C 51 <1> push cx 271 0000441D 56 <1> push si 272 0000441E F3A6 <1> repe cmpsb 273 00004420 5E <1> pop si 274 00004421 59 <1> pop cx 275 00004422 7413 <1> je @@found 276 00004424 8A07 <1> mov al,[bx] 277 00004426 98 <1> cbw 278 00004427 D1E0 <1> shl ax,1 279 00004429 D1E0 <1> shl ax,1 280 0000442B 01C3 <1> add bx,ax 281 0000442D 83C303 <1> add bx,3 282 00004430 09C0 <1> or ax,ax 283 00004432 75E5 <1> jne next_mnem 284 00004434 E933FF <1> jmp mnem_error 285 <1> @@found: 286 <1> ; mov CurCmd,bx 287 00004437 5E <1> pop si 288 00004438 C3 <1> ret 289 <1> no_name: 290 00004439 B80100 <1> mov ax,ER_EMPTY 291 0000443C E92EFF <1> jmp asm_error 292 <1> ;============================================================================= 293 <1> ; get_parameter 294 <1> ;----------------------------------------------------------------------------- 295 <1> get_parameter: 296 0000443F E8D602 <1> call skip_spaces 297 00004442 7504 <1> jnz @@1 298 00004444 F9 <1> stc 299 00004445 E98C01 <1> jmp get_parameter_quit 300 <1> @@1: 301 00004448 31C0 <1> xor ax,ax 302 0000444A 884503 <1> mov [di+AP_MEM_FLAG],al 303 0000444D 884508 <1> mov [di+AP_WORD_FLAG],al 304 00004450 894501 <1> mov [di+AP_VALUE],ax 305 00004453 C605FF <1> mov byte [di+AP_REG_NUMBER],-1 306 00004456 A2[C48B] <1> mov [minus_flag],al 307 <1> ..@next: 308 00004459 8B04 <1> mov ax,[si] 309 0000445B E87D01 <1> call get_xptr 310 0000445E 74F9 <1> jz ..@next 311 00004460 3C24 <1> cmp al,'$' 312 00004462 7446 <1> je @@j$ 313 00004464 3C5B <1> cmp al,'[' 314 00004466 7503 <1> jne @@skip 315 00004468 E9C800 <1> jmp ..@mem_start ;jump out of range 316 <1> @@skip: 317 0000446B E81602 <1> call find_seg_reg 318 0000446E 7441 <1> jz seg_reg_param 319 00004470 E82E02 <1> call find_reg 320 00004473 745A <1> je reg_param ;jump out of range 321 00004475 3C2D <1> cmp al,'-' 322 00004477 7508 <1> jne @@nm 323 00004479 C606[C48B]01 <1> mov byte [minus_flag],1 324 0000447E 46 <1> inc si 325 <1> @@next_val: 326 0000447F 8B04 <1> mov ax,[si] 327 <1> @@nm: 328 00004481 E85202 <1> call test_hex 329 00004484 7246 <1> jc jump_to_wrong_param_1 ;jump out of range 330 00004486 E86102 <1> call get_value 331 <1> @@add_offs: 332 00004489 803E[C48B]00 <1> cmp byte [minus_flag],0 333 0000448E 7407 <1> je @@pl 334 00004490 F7DA <1> neg dx 335 00004492 C606[C48B]00 <1> mov byte [minus_flag],0 336 <1> @@pl: 337 00004497 015501 <1> add [di+AP_VALUE],dx 338 0000449A AC <1> lodsb 339 0000449B 3C2B <1> cmp al,'+' 340 0000449D 74E0 <1> je @@next_val 341 0000449F 3C2D <1> cmp al,'-' 342 000044A1 753D <1> jne ..@emp 343 000044A3 C606[C48B]01 <1> mov byte [minus_flag],1 344 000044A8 EBD5 <1> jmp @@next_val 345 <1> 346 <1> @@j$: 347 <1> 348 <1> ; mov dx,asm_offs 349 000044AA 8B16[7943] <1> mov dx,[jump_origin_offs] 350 <1> 351 000044AE 46 <1> inc si 352 000044AF EBD8 <1> jmp @@add_offs 353 <1> 354 <1> seg_reg_param: 355 000044B1 807C023A <1> cmp byte [si+2],':' 356 000044B5 7469 <1> je ..@prefix 357 000044B7 8B5701 <1> mov dx,[bx+1] 358 000044BA 81FA[7A3A] <1> cmp dx,cmov 359 000044BE 7456 <1> je ..@okp 360 000044C0 81FA[713A] <1> cmp dx,cpush 361 000044C4 7450 <1> je ..@okp 362 000044C6 81FA[763A] <1> cmp dx,cpop 363 000044CA 744A <1> je ..@okp 364 <1> jump_to_wrong_param_1: 365 000044CC E996FE <1> jmp wrong_param 366 <1> 367 <1> reg_param: 368 000044CF 8805 <1> mov [di+AP_REG_NUMBER],al 369 000044D1 B201 <1> mov dl,1 370 000044D3 A808 <1> test al,1000b 371 000044D5 7402 <1> jz byte_reg 372 000044D7 FEC2 <1> inc dl 373 <1> byte_reg: 374 000044D9 885508 <1> mov [di+AP_WORD_FLAG],dl 375 <1> ..@check_extra: 376 000044DC 46 <1> inc si 377 000044DD 46 <1> inc si 378 000044DE EB0E <1> jmp check_extra 379 <1> 380 <1> ..@emp: 381 000044E0 4E <1> dec si 382 000044E1 803E[C78B]00 <1> cmp byte [jump_flag],0 383 000044E6 7406 <1> je check_extra 384 000044E8 AC <1> lodsb 385 000044E9 3C3A <1> cmp al,':' 386 000044EB 7414 <1> je far_jump 387 000044ED 4E <1> dec si 388 <1> check_extra: 389 000044EE E82702 <1> call skip_spaces 390 000044F1 7405 <1> jz @@jump_to_ok_quit ;jump out of range 391 000044F3 3C2C <1> cmp al,',' 392 000044F5 7504 <1> jnz extra_error ;jump out of range 393 000044F7 46 <1> inc si 394 <1> @@jump_to_ok_quit: 395 000044F8 E9D800 <1> jmp ..@ok_quit 396 <1> 397 <1> extra_error: 398 000044FB B80500 <1> mov ax,ER_EXTRA 399 000044FE E96CFE <1> jmp asm_error 400 <1> 401 <1> far_jump: 402 00004501 8A04 <1> mov al,[si] 403 00004503 E8D001 <1> call test_hex 404 00004506 72E6 <1> jc check_extra 405 00004508 E8DF01 <1> call get_value 406 0000450B 8916[CA8B] <1> mov [far_value],dx 407 0000450F C606[C78B]02 <1> mov byte [jump_flag],2 408 00004514 EBD8 <1> jmp check_extra 409 <1> 410 <1> ..@okp: 411 00004516 0410 <1> add al,10h 412 00004518 8805 <1> mov [di+AP_REG_NUMBER],al 413 0000451A C6450802 <1> mov byte [di+AP_WORD_FLAG],2 414 0000451E EBBC <1> jmp ..@check_extra 415 <1> ..@prefix: 416 00004520 803E[0852]FF <1> cmp byte [curr_prefix],-1 417 00004525 75A5 <1> jne jump_to_wrong_param_1 ;jump out of range 418 00004527 A2[0852] <1> mov [curr_prefix],al 419 0000452A 83C603 <1> add si,3 420 0000452D E8E801 <1> call skip_spaces 421 00004530 E926FF <1> jmp ..@next 422 <1> 423 <1> ..@mem_start: 424 00004533 C6450301 <1> mov byte [di+AP_MEM_FLAG],1 425 00004537 31C0 <1> xor ax,ax 426 00004539 894504 <1> mov [di+AP_BX_FLAG],ax ;Also clear [di+AP_BP_FLAG] 427 0000453C 894506 <1> mov [di+AP_SI_FLAG],ax ;Also clear [di+AP_DI_FLAG] 428 0000453F 46 <1> inc si 429 <1> ..@plus: 430 <1> next_mem_param: 431 00004540 E8D501 <1> call skip_spaces 432 00004543 7441 <1> jz jump_to_bad_mem_param ;jump out of range 433 <1> 434 00004545 8B04 <1> mov ax,[si] 435 00004547 3C24 <1> cmp al,'$' 436 00004549 7420 <1> je @@$ 437 0000454B E85301 <1> call find_reg 438 0000454E 7444 <1> je mem_reg 439 <1> ..@get_value: 440 00004550 E88301 <1> call test_hex 441 00004553 7231 <1> jc jump_to_bad_mem_param ;jump out of range 442 00004555 E89201 <1> call get_value 443 00004558 803E[C48B]00 <1> cmp byte [minus_flag],0 444 0000455D 7407 <1> je @@2 445 0000455F F7DA <1> neg dx 446 00004561 C606[C48B]00 <1> mov byte [minus_flag],0 447 <1> @@2: 448 00004566 015501 <1> add [di+AP_VALUE],dx 449 00004569 EB09 <1> jmp ..@3 450 <1> @@$: 451 <1> 452 <1> ; mov dx,asm_offs 453 0000456B 8B16[7943] <1> mov dx,[jump_origin_offs] 454 <1> 455 0000456F 46 <1> inc si 456 00004570 EBF4 <1> jmp @@2 457 <1> mem_next: 458 00004572 46 <1> inc si 459 00004573 46 <1> inc si 460 <1> ..@3: 461 00004574 E8A101 <1> call skip_spaces 462 00004577 740D <1> jz jump_to_bad_mem_param 463 <1> 464 00004579 AC <1> lodsb 465 0000457A 3C5D <1> cmp al,']' 466 0000457C 7452 <1> je mem_end 467 0000457E 3C2B <1> cmp al,'+' 468 00004580 74BE <1> je ..@plus 469 00004582 3C2D <1> cmp al,'-' 470 00004584 7402 <1> je ..@minus 471 <1> jump_to_bad_mem_param: 472 00004586 EB4D <1> jmp bad_mem_param 473 <1> ..@minus: 474 00004588 C606[C48B]01 <1> mov byte [minus_flag],1 475 0000458D E88801 <1> call skip_spaces 476 00004590 75BE <1> jnz ..@get_value 477 00004592 EB41 <1> jmp bad_mem_param 478 <1> mem_reg: 479 00004594 3C0B <1> cmp al,regBX 480 00004596 750B <1> jne @@bp 481 00004598 837D0400 <1> cmp word [di+AP_BX_FLAG],0 482 0000459C 7537 <1> jne bad_mem_param 483 0000459E FE4504 <1> inc byte [di+AP_BX_FLAG] 484 000045A1 EBCF <1> jmp mem_next 485 <1> @@bp: 486 000045A3 3C0D <1> cmp al,regBP 487 000045A5 750B <1> jne @@si 488 000045A7 837D0400 <1> cmp word [di+AP_BX_FLAG],0 489 000045AB 7528 <1> jne bad_mem_param 490 000045AD FE4505 <1> inc byte [di+AP_BP_FLAG] 491 000045B0 EBC0 <1> jmp mem_next 492 <1> @@si: 493 000045B2 3C0E <1> cmp al,regSI 494 000045B4 750B <1> jne @@di 495 000045B6 837D0600 <1> cmp word [di+AP_SI_FLAG],0 496 000045BA 7519 <1> jne bad_mem_param 497 000045BC FE4506 <1> inc byte [di+AP_SI_FLAG] 498 000045BF EBB1 <1> jmp mem_next 499 <1> @@di: 500 000045C1 3C0F <1> cmp al,regDI 501 000045C3 7510 <1> jne bad_mem_param 502 000045C5 837D0600 <1> cmp word [di+AP_SI_FLAG],0 503 000045C9 750A <1> jne bad_mem_param 504 000045CB FE4507 <1> inc byte [di+AP_DI_FLAG] 505 000045CE EBA2 <1> jmp mem_next 506 <1> 507 <1> mem_end: 508 000045D0 E91BFF <1> jmp check_extra 509 <1> ..@ok_quit: 510 000045D3 F8 <1> clc 511 <1> get_parameter_quit: 512 000045D4 C3 <1> ret 513 <1> bad_mem_param: 514 000045D5 B80400 <1> mov ax,ER_MEM_PARAM 515 000045D8 E992FD <1> jmp asm_error 516 <1> ;============================================================================= 517 <1> ; get_xptr 518 <1> ;----------------------------------------------------------------------------- 519 <1> get_xptr: 520 000045DB 807D0800 <1> cmp byte [di+AP_WORD_FLAG],0 521 000045DF 750F <1> jne @@4 522 000045E1 3C57 <1> cmp al,'W' 523 000045E3 744F <1> je ..@check_word 524 000045E5 803E[C78B]01 <1> cmp byte [jump_flag],1 525 000045EA 7405 <1> je jump_xptr 526 000045EC 3C42 <1> cmp al,'B' 527 000045EE 7437 <1> je ..@check_byte 528 <1> @@4: 529 000045F0 C3 <1> ret 530 <1> jump_xptr: 531 000045F1 3D4641 <1> cmp ax,'FA' 532 000045F4 7419 <1> je @@check_far 533 000045F6 3D4457 <1> cmp ax,'DW' 534 000045F9 741D <1> je @@check_dw 535 000045FB 3D5348 <1> cmp ax,'SH' 536 000045FE 7401 <1> je @@check_short 537 00004600 C3 <1> ret 538 <1> @@check_short: 539 00004601 AD <1> lodsw 540 00004602 AD <1> lodsw 541 00004603 3D4F52 <1> cmp ax,'OR' 542 00004606 7401 <1> je @@cs_1 543 00004608 C3 <1> ret 544 <1> @@cs_1: 545 00004609 AC <1> lodsb 546 0000460A 3C54 <1> cmp al,'T' 547 0000460C 7450 <1> je @@check_ptr 548 0000460E C3 <1> ret 549 <1> @@check_far: 550 0000460F AD <1> lodsw 551 00004610 AC <1> lodsb 552 00004611 B203 <1> mov dl,3 553 00004613 3C52 <1> cmp al,'R' 554 00004615 7447 <1> je @@check_ptr 555 00004617 C3 <1> ret 556 <1> @@check_dw: 557 00004618 AD <1> lodsw 558 00004619 AD <1> lodsw 559 0000461A B203 <1> mov dl,3 560 0000461C 3D4F52 <1> cmp ax,'OR' 561 0000461F 7401 <1> je @@cd_2 562 00004621 C3 <1> ret 563 <1> @@cd_2: 564 00004622 AC <1> lodsb 565 00004623 3C44 <1> cmp al,'D' 566 00004625 7437 <1> je @@check_ptr 567 <1> ..@check_byte: 568 00004627 B201 <1> mov dl,1 569 00004629 80FC2F <1> cmp ah,'/' 570 0000462C 7413 <1> je @@ptr_1 571 0000462E 80FC59 <1> cmp ah,'Y' 572 00004631 741B <1> je @@check_byte_1 573 00004633 C3 <1> ret 574 <1> ..@check_word: 575 00004634 B202 <1> mov dl,2 576 00004636 80FC2F <1> cmp ah,'/' 577 00004639 7406 <1> je @@ptr_1 578 0000463B 80FC4F <1> cmp ah,'O' 579 0000463E 7416 <1> je @@check_word_1 580 00004640 C3 <1> ret 581 <1> @@ptr_1: 582 00004641 885508 <1> mov [di+AP_WORD_FLAG],dl 583 00004644 46 <1> inc si 584 00004645 46 <1> inc si 585 <1> ..@get_xptr_quit: 586 00004646 E8CF00 <1> call skip_spaces 587 00004649 7418 <1> jz jump_to_wrong_param_2 588 0000464B 39C0 <1> cmp ax,ax 589 0000464D C3 <1> ret 590 <1> @@check_byte_1: 591 0000464E AD <1> lodsw 592 0000464F AD <1> lodsw 593 00004650 3D5445 <1> cmp ax,'TE' 594 00004653 7409 <1> je @@check_ptr 595 00004655 C3 <1> ret 596 <1> @@check_word_1: 597 00004656 AD <1> lodsw 598 00004657 AD <1> lodsw 599 00004658 3D5244 <1> cmp ax,'RD' 600 0000465B 7401 <1> je @@check_ptr 601 0000465D C3 <1> ret 602 <1> @@check_ptr: 603 0000465E E8B700 <1> call skip_spaces 604 00004661 7503 <1> jnz ..@not_spc 605 <1> jump_to_wrong_param_2: 606 00004663 E9FFFC <1> jmp wrong_param 607 <1> ..@not_spc: 608 00004666 3C5B <1> cmp al,'[' 609 00004668 7415 <1> je @@ok 610 0000466A 3C24 <1> cmp al,'$' 611 0000466C 7411 <1> je @@ok 612 0000466E E86500 <1> call test_hex 613 00004671 730C <1> jnc @@ok 614 00004673 AD <1> lodsw 615 00004674 3D5054 <1> cmp ax,'PT' 616 00004677 7505 <1> jne @@quit_2 617 00004679 AC <1> lodsb 618 0000467A 3C52 <1> cmp al,'R' 619 0000467C 7401 <1> je @@ok 620 <1> @@quit_2: 621 0000467E C3 <1> ret 622 <1> @@ok: 623 0000467F 885508 <1> mov [di+AP_WORD_FLAG],dl 624 00004682 EBC2 <1> jmp ..@get_xptr_quit 625 <1> ;============================================================================= 626 <1> ; find_seg_reg 627 <1> ;----------------------------------------------------------------------------- 628 <1> find_seg_reg: 629 00004684 57 <1> push di 630 00004685 BF[9946] <1> mov di,asm_seg_regs 631 00004688 B90400 <1> mov cx,4 632 0000468B F2AF <1> repne scasw 633 0000468D 7508 <1> jne @@quit 634 0000468F 8D8565B8 <1> lea ax,[di-(asm_seg_regs-offset_0100h+102h)] 635 00004693 D1E8 <1> shr ax,1 636 00004695 39C0 <1> cmp ax,ax 637 <1> @@quit: 638 00004697 5F <1> pop di 639 00004698 C3 <1> ret 640 <1> ;============================================================================= 641 <1> 642 00004699 4553435353534453 <1> asm_seg_regs db 'ESCSSSDS' 643 <1> 644 <1> ;============================================================================= 645 <1> ; find_reg 646 <1> ;----------------------------------------------------------------------------- 647 <1> find_reg: 648 000046A1 57 <1> push di 649 000046A2 BF[B646] <1> mov di,asm_regs 650 000046A5 B91000 <1> mov cx,16 651 000046A8 F2AF <1> repne scasw 652 000046AA 7508 <1> jne @@quit 653 000046AC 8D8548B8 <1> lea ax,[di-(asm_regs-offset_0100h+102h)] 654 000046B0 D1E8 <1> shr ax,1 655 000046B2 39C0 <1> cmp ax,ax 656 <1> @@quit: 657 000046B4 5F <1> pop di 658 000046B5 C3 <1> ret 659 <1> ;============================================================================= 660 <1> 661 000046B6 414C434C444C424C41- <1> asm_regs db 'ALCLDLBLAHCHDHBH' 661 000046BF 48434844484248 <1> 662 000046C6 415843584458425853- <1> db 'AXCXDXBXSPBPSIDI' 662 000046CF 50425053494449 <1> 663 <1> 664 <1> ;============================================================================= 665 <1> ; test_hex 666 <1> ;----------------------------------------------------------------------------- 667 <1> test_hex: 668 000046D6 3C30 <1> cmp al,'0' 669 000046D8 720E <1> jb @@not 670 000046DA 3C39 <1> cmp al,'9' 671 000046DC 7608 <1> jbe @@hex 672 000046DE 3C41 <1> cmp al,'A' 673 000046E0 7206 <1> jb @@not 674 000046E2 3C46 <1> cmp al,'F' 675 000046E4 7702 <1> ja @@not 676 <1> @@hex: 677 000046E6 F8 <1> clc 678 000046E7 C3 <1> ret 679 <1> @@not: 680 000046E8 F9 <1> stc 681 000046E9 C3 <1> ret 682 <1> ;============================================================================= 683 <1> ; get_value 684 <1> ;----------------------------------------------------------------------------- 685 <1> get_value: 686 000046EA 31D2 <1> xor dx,dx 687 <1> @@next: 688 000046EC AC <1> lodsb 689 000046ED 2C30 <1> sub al,'0' 690 000046EF 721F <1> jb @@end 691 000046F1 3C09 <1> cmp al,9 692 000046F3 760A <1> jbe @@digit 693 000046F5 3C11 <1> cmp al,'A'-'0' 694 000046F7 7217 <1> jb @@end 695 000046F9 3C16 <1> cmp al,'F'-'0' 696 000046FB 7713 <1> ja @@end 697 000046FD 2C07 <1> sub al,7 698 <1> @@digit: 699 000046FF F6C6F0 <1> test dh,0f0h 700 00004702 750E <1> jnz big_num_error 701 00004704 D1E2 <1> shl dx,1 702 00004706 D1E2 <1> shl dx,1 703 00004708 D1E2 <1> shl dx,1 704 0000470A D1E2 <1> shl dx,1 705 0000470C 08C2 <1> or dl,al 706 0000470E EBDC <1> jmp @@next 707 <1> @@end: 708 00004710 4E <1> dec si 709 00004711 C3 <1> ret 710 <1> big_num_error: 711 00004712 B80600 <1> mov ax,ER_BIG_NUMBER 712 00004715 E955FC <1> jmp asm_error 713 <1> ;============================================================================= 714 <1> ; skip_spaces 715 <1> ;----------------------------------------------------------------------------- 716 <1> skip_spaces: 717 <1> @@next: 718 00004718 AC <1> lodsb 719 00004719 3C20 <1> cmp al,' ' 720 0000471B 74FB <1> je @@next 721 0000471D 3C09 <1> cmp al,9 722 0000471F 74F7 <1> je @@next 723 00004721 4E <1> dec si 724 00004722 3C00 <1> cmp al,0 725 00004724 7402 <1> je @@ok 726 00004726 3C3B <1> cmp al,';' 727 <1> @@ok: 728 00004728 C3 <1> ret 729 <1> ;============================================================================= 730 <1> ; test_space 731 <1> ;----------------------------------------------------------------------------- 732 <1> test_space: 733 00004729 3C20 <1> cmp al,' ' 734 0000472B 740A <1> je @@ok 735 0000472D 3C09 <1> cmp al,9 736 0000472F 7406 <1> je @@ok 737 00004731 3C00 <1> cmp al,0 738 00004733 7402 <1> je @@ok 739 00004735 3C3B <1> cmp al,';' 740 <1> @@ok: 741 00004737 C3 <1> ret 742 <1> ;============================================================================= 743 <1> 744 <1> 745 <1> ;~ifndef __ACT__ 746 <1> ;~;------------------------------------------------------------------------------ 747 <1> ;~UpCase: ;~proc 748 <1> ;~ cmp al,'a' 749 <1> ;~ jb @@1 750 <1> ;~ cmp al,'z' 751 <1> ;~ ja @@1 752 <1> ;~ sub al,20h 753 <1> ;~@@1: 754 <1> ;~ ret 755 <1> ;~ ;~endp 756 <1> ;~endif 757 <1> 758 <1> ;============================================================================= 759 <1> asm_table: 760 00004738 03 <1> db 3 761 00004739 [4A3A] <1> dw cadd 762 0000473B [4D4B] <1> dw _r_rm 763 0000473D 0000 <1> db 0, 0 764 0000473F [E54B] <1> dw _a_im 765 00004741 0400 <1> db 4, 0 766 00004743 [444C] <1> dw _rm_im 767 00004745 8000 <1> db 80h, 0 768 <1> 769 00004747 03 <1> db 3 770 00004748 [4E3A] <1> dw cor 771 0000474A [4D4B] <1> dw _r_rm 772 0000474C 0800 <1> db 8, 0 773 0000474E [E54B] <1> dw _a_im 774 00004750 0C00 <1> db 0Ch, 0 775 00004752 [444C] <1> dw _rm_im 776 00004754 8001 <1> db 80h, 1 777 <1> 778 00004756 03 <1> db 3 779 00004757 [513A] <1> dw cadc 780 00004759 [4D4B] <1> dw _r_rm 781 0000475B 1000 <1> db 10h, 0 782 0000475D [E54B] <1> dw _a_im 783 0000475F 1400 <1> db 14h, 0 784 00004761 [444C] <1> dw _rm_im 785 00004763 8002 <1> db 80h, 2 786 <1> 787 00004765 03 <1> db 3 788 00004766 [553A] <1> dw csbb 789 00004768 [4D4B] <1> dw _r_rm 790 0000476A 1800 <1> db 18h, 0 791 0000476C [E54B] <1> dw _a_im 792 0000476E 1C00 <1> db 1Ch, 0 793 00004770 [444C] <1> dw _rm_im 794 00004772 8003 <1> db 80h, 3 795 <1> 796 00004774 03 <1> db 3 797 00004775 [593A] <1> dw cand 798 00004777 [4D4B] <1> dw _r_rm 799 00004779 2000 <1> db 20h, 0 800 0000477B [E54B] <1> dw _a_im 801 0000477D 2400 <1> db 24h, 0 802 0000477F [444C] <1> dw _rm_im 803 00004781 8004 <1> db 80h, 4 804 <1> 805 00004783 03 <1> db 3 806 00004784 [5D3A] <1> dw csub 807 00004786 [4D4B] <1> dw _r_rm 808 00004788 2800 <1> db 28h, 0 809 0000478A [E54B] <1> dw _a_im 810 0000478C 2C00 <1> db 2Ch, 0 811 0000478E [444C] <1> dw _rm_im 812 00004790 8005 <1> db 80h, 5 813 <1> 814 00004792 03 <1> db 3 815 00004793 [613A] <1> dw cxor 816 00004795 [4D4B] <1> dw _r_rm 817 00004797 3000 <1> db 30h, 0 818 00004799 [E54B] <1> dw _a_im 819 0000479B 3400 <1> db 34h, 0 820 0000479D [444C] <1> dw _rm_im 821 0000479F 8006 <1> db 80h, 6 822 <1> 823 000047A1 03 <1> db 3 824 000047A2 [653A] <1> dw ccmp 825 000047A4 [4D4B] <1> dw _r_rm 826 000047A6 3800 <1> db 38h, 0 827 000047A8 [E54B] <1> dw _a_im 828 000047AA 3C00 <1> db 3Ch, 0 829 000047AC [444C] <1> dw _rm_im 830 000047AE 8007 <1> db 80h, 7 831 <1> 832 000047B0 03 <1> db 3 833 000047B1 [9F3A] <1> dw ctest 834 000047B3 [4D4B] <1> dw _r_rm 835 000047B5 8400 <1> db 84h, 0 836 000047B7 [E54B] <1> dw _a_im 837 000047B9 A800 <1> db 0A8h, 0 838 000047BB [444C] <1> dw _rm_im 839 000047BD F600 <1> db 0F6h, 0 840 <1> 841 000047BF 05 <1> db 5 842 000047C0 [7A3A] <1> dw cmov 843 000047C2 [B04D] <1> dw _sr_rm 844 000047C4 8C00 <1> db 8Ch, 0 845 000047C6 [734D] <1> dw _r_im 846 000047C8 B000 <1> db 0B0h, 0 847 000047CA [194D] <1> dw _a_mem 848 000047CC A000 <1> db 0A0h, 0 849 000047CE [4D4B] <1> dw _r_rm 850 000047D0 8800 <1> db 88h, 0 851 000047D2 [204C] <1> dw _rm_im1 852 000047D4 C600 <1> db 0C6h, 0 853 <1> 854 000047D6 03 <1> db 3 855 000047D7 [713A] <1> dw cpush 856 000047D9 [B84E] <1> dw _sreg 857 000047DB 0600 <1> db 6, 0 858 000047DD [964E] <1> dw _reg16 859 000047DF 5000 <1> db 50h,0 860 000047E1 [274E] <1> dw _rm 861 000047E3 FF06 <1> db 0FFh, 6 862 <1> 863 000047E5 03 <1> db 3 864 000047E6 [763A] <1> dw cpop 865 000047E8 [B84E] <1> dw _sreg 866 000047EA 0700 <1> db 7, 0 867 000047EC [964E] <1> dw _reg16 868 000047EE 5800 <1> db 58h,0 869 000047F0 [274E] <1> dw _rm 870 000047F2 8F06 <1> db 08Fh, 6 871 <1> 872 000047F4 01 <1> db 1 873 000047F5 [8F3B] <1> dw clea 874 000047F7 [334B] <1> dw _r_m16 875 000047F9 8D00 <1> db 8Dh, 0 876 <1> 877 000047FB 01 <1> db 1 878 000047FC [933B] <1> dw cles 879 000047FE [334B] <1> dw _r_m16 880 00004800 C400 <1> db 0C4h, 0 881 <1> 882 00004802 01 <1> db 1 883 00004803 [973B] <1> dw clds 884 00004805 [334B] <1> dw _r_m16 885 00004807 C500 <1> db 0C5h, 0 886 <1> 887 00004809 02 <1> db 2 888 0000480A [693A] <1> dw cinc 889 0000480C [964E] <1> dw _reg16 890 0000480E 4000 <1> db 40h,0 891 00004810 [274E] <1> dw _rm 892 00004812 FE00 <1> db 0FEh, 0 893 <1> 894 00004814 02 <1> db 2 895 00004815 [6D3A] <1> dw cdec 896 00004817 [964E] <1> dw _reg16 897 00004819 4800 <1> db 48h,0 898 0000481B [274E] <1> dw _rm 899 0000481D FE01 <1> db 0FEh, 1 900 <1> 901 0000481F 01 <1> db 1 902 00004820 [AC3A] <1> dw cmul 903 00004822 [274E] <1> dw _rm 904 00004824 F604 <1> db 0F6h, 100b 905 <1> 906 00004826 01 <1> db 1 907 00004827 [B03A] <1> dw cimul 908 00004829 [274E] <1> dw _rm 909 0000482B F605 <1> db 0F6h, 101b 910 <1> 911 0000482D 01 <1> db 1 912 0000482E [B53A] <1> dw cdiv 913 00004830 [274E] <1> dw _rm 914 00004832 F606 <1> db 0F6h, 110b 915 <1> 916 00004834 01 <1> db 1 917 00004835 [B93A] <1> dw cidiv 918 00004837 [274E] <1> dw _rm 919 00004839 F607 <1> db 0F6h, 111b 920 <1> 921 0000483B 01 <1> db 1 922 0000483C [A83A] <1> dw cneg 923 0000483E [274E] <1> dw _rm 924 00004840 F603 <1> db 0F6h, 011b 925 <1> 926 00004842 01 <1> db 1 927 00004843 [A43A] <1> dw cnot 928 00004845 [274E] <1> dw _rm 929 00004847 F602 <1> db 0F6h, 010b 930 <1> 931 00004849 02 <1> db 2 932 0000484A [7E3A] <1> dw cxchg 933 0000484C [5F4E] <1> dw _a_reg 934 0000484E 9000 <1> db 90h, 0 935 00004850 [4D4B] <1> dw _r_rm 936 00004852 8600 <1> db 86h, 0 937 <1> 938 00004854 01 <1> db 1 939 00004855 [AC3B] <1> dw cesc 940 00004857 [CB4C] <1> dw _esc 941 00004859 D800 <1> db 0D8h, 0 942 <1> 943 <1> ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 944 <1> 945 <1> asm_table_db: 946 0000485B 01 <1> db 1 947 0000485C [9D3D] <1> dw cdb 948 0000485E [274C] <1> dw _db 949 00004860 0000 <1> db 0, 0 950 <1> 951 <1> asm_table_dw: 952 00004862 01 <1> db 1 953 00004863 [0552] <1> dw cdw 954 00004865 [B750] <1> dw _dw 955 00004867 0000 <1> db 0, 0 956 <1> 957 00004869 01 <1> db 1 958 0000486A [DE3A] <1> dw csalc 959 0000486C [D050] <1> dw _noparam 960 0000486E D600 <1> db 0d6h,0 961 <1> 962 00004870 02 <1> db 2 963 00004871 [CE3A] <1> dw caam 964 00004873 [3B4F] <1> dw _im8 965 00004875 D400 <1> db 0D4h, 0 966 00004877 [7E4F] <1> dw _imn 967 00004879 D40A <1> db 0D4h, 0Ah 968 <1> 969 0000487B 02 <1> db 2 970 0000487C [CA3A] <1> dw caad 971 0000487E [3B4F] <1> dw _im8 972 00004880 D500 <1> db 0D5h, 0 973 00004882 [7E4F] <1> dw _imn 974 00004884 D50A <1> db 0D5h, 0Ah 975 <1> 976 00004886 01 <1> db 1 977 00004887 [D63A] <1> dw cdaa 978 00004889 [D050] <1> dw _noparam 979 0000488B 2700 <1> db 27h,0 980 <1> 981 0000488D 01 <1> db 1 982 0000488E [DA3A] <1> dw cdas 983 00004890 [D050] <1> dw _noparam 984 00004892 2F00 <1> db 2Fh,0 985 <1> 986 00004894 01 <1> db 1 987 00004895 [C63A] <1> dw caaa 988 00004897 [D050] <1> dw _noparam 989 00004899 3700 <1> db 37h,0 990 <1> 991 0000489B 01 <1> db 1 992 0000489C [D23A] <1> dw caas 993 0000489E [D050] <1> dw _noparam 994 000048A0 3F00 <1> db 3Fh,0 995 <1> 996 000048A2 01 <1> db 1 997 000048A3 [8B3B] <1> dw cnop 998 000048A5 [D050] <1> dw _noparam 999 000048A7 9000 <1> db 90h,0 1000 <1> 1001 000048A9 01 <1> db 1 1002 000048AA [BE3A] <1> dw ccbw 1003 000048AC [D050] <1> dw _noparam 1004 000048AE 9800 <1> db 98h,0 1005 <1> 1006 000048B0 01 <1> db 1 1007 000048B1 [C23A] <1> dw ccwd 1008 000048B3 [D050] <1> dw _noparam 1009 000048B5 9900 <1> db 99h,0 1010 <1> 1011 000048B7 01 <1> db 1 1012 000048B8 [B03B] <1> dw cwait 1013 000048BA [D050] <1> dw _noparam 1014 000048BC 9B00 <1> db 9Bh,0 1015 <1> 1016 000048BE 01 <1> db 1 1017 000048BF [563B] <1> dw cpushf 1018 000048C1 [D050] <1> dw _noparam 1019 000048C3 9C00 <1> db 9Ch,0 1020 <1> 1021 000048C5 01 <1> db 1 1022 000048C6 [5C3B] <1> dw cpopf 1023 000048C8 [D050] <1> dw _noparam 1024 000048CA 9D00 <1> db 9Dh,0 1025 <1> 1026 000048CC 01 <1> db 1 1027 000048CD [613B] <1> dw csahf 1028 000048CF [D050] <1> dw _noparam 1029 000048D1 9E00 <1> db 9Eh,0 1030 <1> 1031 000048D3 01 <1> db 1 1032 000048D4 [663B] <1> dw clahf 1033 000048D6 [D050] <1> dw _noparam 1034 000048D8 9F00 <1> db 9Fh,0 1035 <1> 1036 000048DA 01 <1> db 1 1037 000048DB [E33A] <1> dw cmovsb 1038 000048DD [D050] <1> dw _noparam 1039 000048DF A4FF <1> db 0A4h,-1 1040 <1> 1041 000048E1 01 <1> db 1 1042 000048E2 [E93A] <1> dw cmovsw 1043 000048E4 [D050] <1> dw _noparam 1044 000048E6 A5FF <1> db 0A5h,-1 1045 <1> 1046 000048E8 01 <1> db 1 1047 000048E9 [073B] <1> dw ccmpsb 1048 000048EB [D050] <1> dw _noparam 1049 000048ED A6FF <1> db 0A6h,-1 1050 <1> 1051 000048EF 01 <1> db 1 1052 000048F0 [0D3B] <1> dw ccmpsw 1053 000048F2 [D050] <1> dw _noparam 1054 000048F4 A7FF <1> db 0A7h,-1 1055 <1> 1056 000048F6 01 <1> db 1 1057 000048F7 [EF3A] <1> dw cstosb 1058 000048F9 [D050] <1> dw _noparam 1059 000048FB AAFF <1> db 0AAh,-1 1060 <1> 1061 000048FD 01 <1> db 1 1062 000048FE [F53A] <1> dw cstosw 1063 00004900 [D050] <1> dw _noparam 1064 00004902 ABFF <1> db 0ABh,-1 1065 <1> 1066 00004904 01 <1> db 1 1067 00004905 [FB3A] <1> dw clodsb 1068 00004907 [D050] <1> dw _noparam 1069 00004909 ACFF <1> db 0ACh,-1 1070 <1> 1071 0000490B 01 <1> db 1 1072 0000490C [013B] <1> dw clodsw 1073 0000490E [D050] <1> dw _noparam 1074 00004910 ADFF <1> db 0ADh,-1 1075 <1> 1076 00004912 01 <1> db 1 1077 00004913 [133B] <1> dw cscasb 1078 00004915 [D050] <1> dw _noparam 1079 00004917 AEFF <1> db 0AEh,-1 1080 <1> 1081 00004919 01 <1> db 1 1082 0000491A [193B] <1> dw cscasw 1083 0000491C [D050] <1> dw _noparam 1084 0000491E AFFF <1> db 0AFh,-1 1085 <1> 1086 00004920 02 <1> db 2 1087 00004921 [283B] <1> dw cret 1088 00004923 [5F4F] <1> dw _im16 1089 00004925 C200 <1> db 0C2h, 0 1090 00004927 [D050] <1> dw _noparam 1091 00004929 C300 <1> db 0C3h,0 1092 <1> 1093 0000492B 02 <1> db 2 1094 0000492C [9B51] <1> dw cretn 1095 0000492E [5F4F] <1> dw _im16 1096 00004930 C200 <1> db 0C2h, 0 1097 00004932 [D050] <1> dw _noparam 1098 00004934 C300 <1> db 0C3h,0 1099 <1> 1100 00004936 02 <1> db 2 1101 00004937 [2C3B] <1> dw cretf 1102 00004939 [5F4F] <1> dw _im16 1103 0000493B CA00 <1> db 0CAh, 0 1104 0000493D [D050] <1> dw _noparam 1105 0000493F CB00 <1> db 0CBh,0 1106 <1> 1107 00004941 01 <1> db 1 1108 00004942 [4C3B] <1> dw cint3 1109 00004944 [D050] <1> dw _noparam 1110 00004946 CC00 <1> db 0CCh,0 1111 <1> 1112 00004948 01 <1> db 1 1113 00004949 [433B] <1> dw cint 1114 0000494B [294F] <1> dw _im8ch3 1115 0000494D CD00 <1> db 0CDh, 0 1116 <1> 1117 0000494F 01 <1> db 1 1118 00004950 [473B] <1> dw cinto 1119 00004952 [D050] <1> dw _noparam 1120 00004954 CE00 <1> db 0CEh,0 1121 <1> 1122 00004956 01 <1> db 1 1123 00004957 [513B] <1> dw ciret 1124 00004959 [D050] <1> dw _noparam 1125 0000495B CF00 <1> db 0CFh,0 1126 <1> 1127 0000495D 01 <1> db 1 1128 0000495E [9B3B] <1> dw cxlat 1129 00004960 [D050] <1> dw _noparam 1130 00004962 D700 <1> db 0D7h,0 1131 <1> 1132 00004964 01 <1> db 1 1133 00004965 [A43D] <1> dw plock 1134 00004967 [D050] <1> dw _noparam 1135 00004969 F000 <1> db 0F0h,0 1136 <1> 1137 0000496B 01 <1> db 1 1138 0000496C [873B] <1> dw chlt 1139 0000496E [D050] <1> dw _noparam 1140 00004970 F400 <1> db 0F4h,0 1141 <1> 1142 00004972 01 <1> db 1 1143 00004973 [6F3B] <1> dw ccmc 1144 00004975 [D050] <1> dw _noparam 1145 00004977 F500 <1> db 0F5h,0 1146 <1> 1147 00004979 01 <1> db 1 1148 0000497A [6B3B] <1> dw cclc 1149 0000497C [D050] <1> dw _noparam 1150 0000497E F800 <1> db 0F8h,0 1151 <1> 1152 00004980 01 <1> db 1 1153 00004981 [733B] <1> dw cstc 1154 00004983 [D050] <1> dw _noparam 1155 00004985 F900 <1> db 0F9h,0 1156 <1> 1157 00004987 01 <1> db 1 1158 00004988 [7F3B] <1> dw ccli 1159 0000498A [D050] <1> dw _noparam 1160 0000498C FA00 <1> db 0FAh,0 1161 <1> 1162 0000498E 01 <1> db 1 1163 0000498F [833B] <1> dw csti 1164 00004991 [D050] <1> dw _noparam 1165 00004993 FB00 <1> db 0FBh,0 1166 <1> 1167 00004995 01 <1> db 1 1168 00004996 [773B] <1> dw ccld 1169 00004998 [D050] <1> dw _noparam 1170 0000499A FC00 <1> db 0FCh,0 1171 <1> 1172 0000499C 01 <1> db 1 1173 0000499D [7B3B] <1> dw cstd 1174 0000499F [D050] <1> dw _noparam 1175 000049A1 FD00 <1> db 0FDh,0 1176 <1> 1177 <1> diff_types: 1178 000049A3 01 <1> db 1 1179 000049A4 [833A] <1> dw cshl 1180 000049A6 [E04E] <1> dw _rm_cl_1 1181 000049A8 D004 <1> db 0D0h, 100b 1182 <1> 1183 000049AA 01 <1> db 1 1184 000049AB [A051] <1> dw csal 1185 000049AD [E04E] <1> dw _rm_cl_1 1186 000049AF D004 <1> db 0D0h, 100b 1187 <1> 1188 000049B1 01 <1> db 1 1189 000049B2 [873A] <1> dw cshr 1190 000049B4 [E04E] <1> dw _rm_cl_1 1191 000049B6 D005 <1> db 0D0h, 101b 1192 <1> 1193 000049B8 01 <1> db 1 1194 000049B9 [933A] <1> dw csar 1195 000049BB [E04E] <1> dw _rm_cl_1 1196 000049BD D007 <1> db 0D0h, 111b 1197 <1> 1198 000049BF 01 <1> db 1 1199 000049C0 [973A] <1> dw crol 1200 000049C2 [E04E] <1> dw _rm_cl_1 1201 000049C4 D000 <1> db 0D0h, 000b 1202 <1> 1203 000049C6 01 <1> db 1 1204 000049C7 [9B3A] <1> dw cror 1205 000049C9 [E04E] <1> dw _rm_cl_1 1206 000049CB D001 <1> db 0D0h, 001b 1207 <1> 1208 000049CD 01 <1> db 1 1209 000049CE [8B3A] <1> dw crcl 1210 000049D0 [E04E] <1> dw _rm_cl_1 1211 000049D2 D002 <1> db 0D0h, 010b 1212 <1> 1213 000049D4 01 <1> db 1 1214 000049D5 [8F3A] <1> dw crcr 1215 000049D7 [E04E] <1> dw _rm_cl_1 1216 000049D9 D003 <1> db 0D0h, 011b 1217 <1> 1218 <1> 1219 000049DB 02 <1> db 2 1220 000049DC [A53B] <1> dw cin 1221 000049DE [8C4F] <1> dw _a_dx 1222 000049E0 EC00 <1> db 0ECh, 0 1223 000049E2 [C74F] <1> dw _a_im8 1224 000049E4 E400 <1> db 0E4h, 0 1225 <1> 1226 000049E6 02 <1> db 2 1227 000049E7 [A83B] <1> dw cout 1228 000049E9 [AA4F] <1> dw _dx_a 1229 000049EB EE00 <1> db 0EEh, 0 1230 000049ED [F84F] <1> dw _im8_a 1231 000049EF E600 <1> db 0E6h, 0 1232 <1> 1233 <1> jumps_and_calls: 1234 000049F1 04 <1> db 4 1235 000049F2 [243B] <1> dw cjmp 1236 000049F4 [2950] <1> dw _short 1237 000049F6 EB00 <1> db 0EBh, 0 1238 000049F8 [5A50] <1> dw _near 1239 000049FA E900 <1> db 0E9h, 0 1240 000049FC [8850] <1> dw _far 1241 000049FE EA00 <1> db 0EAh, 0 1242 00004A00 [AB50] <1> dw _rmj 1243 00004A02 FF04 <1> db 0FFh, 100b 1244 <1> 1245 00004A04 03 <1> db 3 1246 00004A05 [1F3B] <1> dw ccall 1247 00004A07 [5A50] <1> dw _near 1248 00004A09 E800 <1> db 0E8h, 0 1249 00004A0B [8850] <1> dw _far 1250 00004A0D 9A00 <1> db 9Ah, 0 1251 00004A0F [AB50] <1> dw _rmj 1252 00004A11 FF02 <1> db 0FFh, 010b 1253 <1> 1254 00004A13 01 <1> db 1 1255 00004A14 [B53B] <1> dw cjo 1256 00004A16 [2950] <1> dw _short 1257 00004A18 7000 <1> db 070h, 0 1258 <1> 1259 00004A1A 01 <1> db 1 1260 00004A1B [B83B] <1> dw cjno 1261 00004A1D [2950] <1> dw _short 1262 00004A1F 7100 <1> db 071h, 0 1263 <1> 1264 00004A21 01 <1> db 1 1265 00004A22 [BC3B] <1> dw cjb 1266 00004A24 [2950] <1> dw _short 1267 00004A26 7200 <1> db 072h, 0 1268 <1> 1269 00004A28 01 <1> db 1 1270 00004A29 [A951] <1> dw cjc 1271 00004A2B [2950] <1> dw _short 1272 00004A2D 7200 <1> db 072h, 0 1273 <1> 1274 00004A2F 01 <1> db 1 1275 00004A30 [A451] <1> dw cjnae 1276 00004A32 [2950] <1> dw _short 1277 00004A34 7200 <1> db 072h, 0 1278 <1> 1279 00004A36 01 <1> db 1 1280 00004A37 [BF3B] <1> dw cjnb 1281 00004A39 [2950] <1> dw _short 1282 00004A3B 7300 <1> db 073h, 0 1283 <1> 1284 00004A3D 01 <1> db 1 1285 00004A3E [AC51] <1> dw cjnc 1286 00004A40 [2950] <1> dw _short 1287 00004A42 7300 <1> db 073h, 0 1288 <1> 1289 00004A44 01 <1> db 1 1290 00004A45 [B051] <1> dw cjae 1291 00004A47 [2950] <1> dw _short 1292 00004A49 7300 <1> db 073h, 0 1293 <1> 1294 00004A4B 01 <1> db 1 1295 00004A4C [B451] <1> dw cje 1296 00004A4E [2950] <1> dw _short 1297 00004A50 7400 <1> db 074h, 0 1298 <1> 1299 00004A52 01 <1> db 1 1300 00004A53 [C33B] <1> dw cjz 1301 00004A55 [2950] <1> dw _short 1302 00004A57 7400 <1> db 074h, 0 1303 <1> 1304 <1> 1305 00004A59 01 <1> db 1 1306 00004A5A [B751] <1> dw cjne 1307 00004A5C [2950] <1> dw _short 1308 00004A5E 7500 <1> db 075h, 0 1309 <1> 1310 00004A60 01 <1> db 1 1311 00004A61 [C63B] <1> dw cjnz 1312 00004A63 [2950] <1> dw _short 1313 00004A65 7500 <1> db 075h, 0 1314 <1> 1315 00004A67 01 <1> db 1 1316 00004A68 [CA3B] <1> dw cjbe 1317 00004A6A [2950] <1> dw _short 1318 00004A6C 7600 <1> db 076h, 0 1319 <1> 1320 00004A6E 01 <1> db 1 1321 00004A6F [BB51] <1> dw cjna 1322 00004A71 [2950] <1> dw _short 1323 00004A73 7600 <1> db 076h, 0 1324 <1> 1325 00004A75 01 <1> db 1 1326 00004A76 [BF51] <1> dw cjnbe 1327 00004A78 [2950] <1> dw _short 1328 00004A7A 7700 <1> db 077h, 0 1329 <1> 1330 00004A7C 01 <1> db 1 1331 00004A7D [CE3B] <1> dw cja 1332 00004A7F [2950] <1> dw _short 1333 00004A81 7700 <1> db 077h, 0 1334 <1> 1335 <1> 1336 00004A83 01 <1> db 1 1337 00004A84 [D13B] <1> dw cjs 1338 00004A86 [2950] <1> dw _short 1339 00004A88 7800 <1> db 078h, 0 1340 <1> 1341 00004A8A 01 <1> db 1 1342 00004A8B [D43B] <1> dw cjns 1343 00004A8D [2950] <1> dw _short 1344 00004A8F 7900 <1> db 079h, 0 1345 <1> 1346 00004A91 01 <1> db 1 1347 00004A92 [D83B] <1> dw cjp 1348 00004A94 [2950] <1> dw _short 1349 00004A96 7A00 <1> db 07Ah, 0 1350 <1> 1351 00004A98 01 <1> db 1 1352 00004A99 [C451] <1> dw cjpe 1353 00004A9B [2950] <1> dw _short 1354 00004A9D 7A00 <1> db 07Ah, 0 1355 <1> 1356 00004A9F 01 <1> db 1 1357 00004AA0 [DB3B] <1> dw cjnp 1358 00004AA2 [2950] <1> dw _short 1359 00004AA4 7B00 <1> db 07Bh, 0 1360 <1> 1361 00004AA6 01 <1> db 1 1362 00004AA7 [C851] <1> dw cjpo 1363 00004AA9 [2950] <1> dw _short 1364 00004AAB 7B00 <1> db 07Bh, 0 1365 <1> 1366 00004AAD 01 <1> db 1 1367 00004AAE [DF3B] <1> dw cjl 1368 00004AB0 [2950] <1> dw _short 1369 00004AB2 7C00 <1> db 07Ch, 0 1370 <1> 1371 00004AB4 01 <1> db 1 1372 00004AB5 [CC51] <1> dw cjnge 1373 00004AB7 [2950] <1> dw _short 1374 00004AB9 7C00 <1> db 07Ch, 0 1375 <1> 1376 00004ABB 01 <1> db 1 1377 00004ABC [D151] <1> dw cjnl 1378 00004ABE [2950] <1> dw _short 1379 00004AC0 7D00 <1> db 07Dh, 0 1380 <1> 1381 00004AC2 01 <1> db 1 1382 00004AC3 [E23B] <1> dw cjge 1383 00004AC5 [2950] <1> dw _short 1384 00004AC7 7D00 <1> db 07Dh, 0 1385 <1> 1386 00004AC9 01 <1> db 1 1387 00004ACA [E63B] <1> dw cjle 1388 00004ACC [2950] <1> dw _short 1389 00004ACE 7E00 <1> db 07Eh, 0 1390 <1> 1391 00004AD0 01 <1> db 1 1392 00004AD1 [D551] <1> dw cjng 1393 00004AD3 [2950] <1> dw _short 1394 00004AD5 7E00 <1> db 07Eh, 0 1395 <1> 1396 00004AD7 01 <1> db 1 1397 00004AD8 [D951] <1> dw cjnle 1398 00004ADA [2950] <1> dw _short 1399 00004ADC 7F00 <1> db 07Fh, 0 1400 <1> 1401 00004ADE 01 <1> db 1 1402 00004ADF [EA3B] <1> dw cjg 1403 00004AE1 [2950] <1> dw _short 1404 00004AE3 7F00 <1> db 07Fh, 0 1405 <1> 1406 00004AE5 01 <1> db 1 1407 00004AE6 [313B] <1> dw cloop 1408 00004AE8 [2950] <1> dw _short 1409 00004AEA E200 <1> db 0E2h, 0 1410 <1> 1411 00004AEC 01 <1> db 1 1412 00004AED [3C3B] <1> dw cloopne 1413 00004AEF [2950] <1> dw _short 1414 00004AF1 E000 <1> db 0E0h, 0 1415 <1> 1416 00004AF3 01 <1> db 1 1417 00004AF4 [E451] <1> dw cloopnz 1418 00004AF6 [2950] <1> dw _short 1419 00004AF8 E000 <1> db 0E0h, 0 1420 <1> 1421 00004AFA 01 <1> db 1 1422 00004AFB [363B] <1> dw cloope 1423 00004AFD [2950] <1> dw _short 1424 00004AFF E100 <1> db 0E1h, 0 1425 <1> 1426 00004B01 01 <1> db 1 1427 00004B02 [DE51] <1> dw cloopz 1428 00004B04 [2950] <1> dw _short 1429 00004B06 E100 <1> db 0E1h, 0 1430 <1> 1431 00004B08 01 <1> db 1 1432 00004B09 [A03B] <1> dw cjcxz 1433 00004B0B [2950] <1> dw _short 1434 00004B0D E300 <1> db 0E3h, 0 1435 <1> 1436 <1> rep_prefixes: 1437 00004B0F 01 <1> db 1 1438 00004B10 [0152] <1> dw crep 1439 00004B12 0000 <1> dw 0 1440 00004B14 F300 <1> db 0F3h, 0 1441 <1> 1442 00004B16 01 <1> db 1 1443 00004B17 [F651] <1> dw crepe 1444 00004B19 0000 <1> dw 0 1445 00004B1B F300 <1> db 0F3h, 0 1446 <1> 1447 00004B1D 01 <1> db 1 1448 00004B1E [EB51] <1> dw crepz 1449 00004B20 0000 <1> dw 0 1450 00004B22 F300 <1> db 0F3h, 0 1451 <1> 1452 00004B24 01 <1> db 1 1453 00004B25 [FB51] <1> dw crepne 1454 00004B27 0000 <1> dw 0 1455 00004B29 F200 <1> db 0F2h, 0 1456 <1> 1457 00004B2B 01 <1> db 1 1458 00004B2C [F051] <1> dw crepnz 1459 00004B2E 0000 <1> dw 0 1460 00004B30 F200 <1> db 0F2h, 0 1461 <1> 1462 <1> ;~comment # 1463 <1> ;~Asm286table ;~label byte 1464 <1> ;~ db 1 1465 <1> ;~ dw cpusha 1466 <1> ;~ dw _noparam 1467 <1> ;~ db 60h, 0 1468 <1> ;~ 1469 <1> ;~ db 1 1470 <1> ;~ dw cpopa 1471 <1> ;~ dw _noparam 1472 <1> ;~ db 61h, 0 1473 <1> ;~ 1474 <1> ;~ db 1 1475 <1> ;~ dw cbound 1476 <1> ;~ dw _r_m16 1477 <1> ;~ db 62h, 0 1478 <1> ;~ 1479 <1> ;~ db 1 1480 <1> ;~ dw carpl 1481 <1> ;~ dw _rm_r16 1482 <1> ;~# 1483 00004B32 00 <1> db 0 ; End of table 1484 <1> 1485 <1> 1486 <1> ;============================================================================= 1487 <1> ; _r_m16 1488 <1> ;----------------------------------------------------------------------------- 1489 <1> _r_m16: 1490 00004B33 81FB0001 <1> cmp bx,0100h 1491 00004B37 7511 <1> jne @@quit 1492 00004B39 80F9FF <1> cmp cl,-1 1493 00004B3C 740C <1> je @@quit 1494 00004B3E F6C108 <1> test cl,1000b 1495 00004B41 7407 <1> jz @@quit 1496 00004B43 C606[C68B]01 <1> mov byte [lxx_flag],1 1497 00004B48 EB08 <1> jmp _r_rm2 1498 <1> @@quit: 1499 00004B4A 09E4 <1> or sp,sp 1500 00004B4C C3 <1> ret 1501 <1> ;============================================================================= 1502 <1> ; _r_rm 1503 <1> ;----------------------------------------------------------------------------- 1504 <1> _r_rm: 1505 00004B4D C606[C68B]00 <1> mov byte [lxx_flag],0 1506 <1> _r_rm2: 1507 00004B52 803E[C88B]02 <1> cmp byte [param_count],2 1508 00004B57 753C <1> jne ..@_r_rm_q ;jump out of range 1509 00004B59 83FB01 <1> cmp bx,0001h 1510 00004B5C 743D <1> je ..@_r_rm_m_r 1511 00004B5E 81FB0001 <1> cmp bx,0100h 1512 00004B62 746C <1> je ..@_r_rm_r_m 1513 00004B64 09DB <1> or bx,bx 1514 00004B66 752D <1> jne ..@_r_rm_q 1515 <1> @@r_r: 1516 00004B68 80F9FF <1> cmp cl,-1 1517 00004B6B 7428 <1> je ..@_r_rm_q 1518 00004B6D 80FDFF <1> cmp ch,-1 1519 00004B70 7423 <1> je ..@_r_rm_q 1520 00004B72 C60502 <1> mov byte [di],2 1521 00004B75 803E[C68B]01 <1> cmp byte [lxx_flag],1 1522 00004B7A 7403 <1> je @@l1 1523 00004B7C E85F05 <1> call add_word_flag 1524 <1> @@l1: 1525 00004B7F 884501 <1> mov [di+1],al 1526 00004B82 E89A05 <1> call make_modrm 1527 <1> ;; mov al,cl 1528 <1> ; and al,0111b 1529 <1> ; or al,11000000b 1530 00004B85 80E507 <1> and ch,0111b 1531 00004B88 D0E5 <1> shl ch,1 1532 00004B8A D0E5 <1> shl ch,1 1533 00004B8C D0E5 <1> shl ch,1 1534 00004B8E 08E8 <1> or al,ch 1535 00004B90 884502 <1> mov [di+2],al 1536 00004B93 EB03 <1> jmp ..@_r_rm_ok 1537 <1> 1538 <1> ..@_r_rm_q: 1539 <1> exit_zf_clear: 1540 00004B95 09E4 <1> or sp,sp 1541 00004B97 C3 <1> ret 1542 <1> ..@_r_rm_ok: 1543 00004B98 39C0 <1> cmp ax,ax 1544 00004B9A C3 <1> ret 1545 <1> 1546 <1> ..@_r_rm_m_r: 1547 00004B9B 80FDFF <1> cmp ch,-1 1548 00004B9E 74F5 <1> je ..@_r_rm_q 1549 <1> @@make_modrm: 1550 00004BA0 803E[C68B]01 <1> cmp byte [lxx_flag],1 1551 00004BA5 7403 <1> je @@l2 1552 00004BA7 E83405 <1> call add_word_flag 1553 <1> @@l2: 1554 00004BAA 884501 <1> mov [di+1],al 1555 <1> 1556 00004BAD E86F05 <1> call make_modrm 1557 <1> 1558 00004BB0 8B16[0A52] <1> mov dx,[parameter_1+AP_VALUE] 1559 00004BB4 80C402 <1> add ah,2 1560 00004BB7 8825 <1> mov [di],ah 1561 <1> @@set_reg: 1562 00004BB9 895503 <1> mov [di+3],dx 1563 00004BBC 8A26[1252] <1> mov ah,[parameter_2+AP_REG_NUMBER] 1564 00004BC0 80E407 <1> and ah,0111b 1565 00004BC3 D0E4 <1> shl ah,1 1566 00004BC5 D0E4 <1> shl ah,1 1567 00004BC7 D0E4 <1> shl ah,1 1568 00004BC9 08E0 <1> or al,ah 1569 00004BCB 884502 <1> mov [di+2],al 1570 00004BCE EBC8 <1> jmp ..@_r_rm_ok 1571 <1> 1572 <1> ..@_r_rm_r_m: 1573 00004BD0 80F9FF <1> cmp cl,-1 1574 00004BD3 74C0 <1> je ..@_r_rm_q 1575 00004BD5 803E[C68B]01 <1> cmp byte [lxx_flag],1 1576 00004BDA 7402 <1> je @@7 1577 00004BDC 0C02 <1> or al,2 1578 <1> @@7: 1579 00004BDE E81A05 <1> call swap_parameters 1580 00004BE1 86CD <1> xchg cl,ch 1581 00004BE3 EBBB <1> jmp @@make_modrm 1582 <1> ;============================================================================= 1583 <1> ; _a_im 1584 <1> ;----------------------------------------------------------------------------- 1585 <1> _a_im: 1586 00004BE5 803E[C88B]02 <1> cmp byte [param_count],2 1587 00004BEA 7533 <1> jne @@quit 1588 00004BEC 80F9FF <1> cmp cl,0ffh 1589 00004BEF 74A4 <1> je exit_zf_clear 1590 00004BF1 80E107 <1> and cl,0111b 1591 00004BF4 80F900 <1> cmp cl,regAL 1592 00004BF7 7526 <1> jne @@quit 1593 00004BF9 80FF00 <1> cmp bh,0 1594 00004BFC 7521 <1> jne @@quit 1595 00004BFE E8DD04 <1> call add_word_flag 1596 00004C01 8B16[1352] <1> mov dx,[parameter_2+AP_VALUE] 1597 00004C05 08E4 <1> or ah,ah 1598 00004C07 7509 <1> jnz @@1 1599 00004C09 E80B05 <1> call check_byte 1600 00004C0C 7404 <1> jz @@1 1601 00004C0E 08F6 <1> or dh,dh 1602 00004C10 7572 <1> jnz jump_to_big_num_error ;jump out of range 1603 <1> @@1: 1604 00004C12 80C402 <1> add ah,2 1605 00004C15 8825 <1> mov [di],ah 1606 00004C17 884501 <1> mov [di+1],al 1607 00004C1A 895502 <1> mov [di+2],dx 1608 00004C1D 39C0 <1> cmp ax,ax 1609 <1> @@quit: 1610 00004C1F C3 <1> ret 1611 <1> ;============================================================================= 1612 <1> ; _rm_im1 1613 <1> ;----------------------------------------------------------------------------- 1614 <1> _rm_im1: 1615 00004C20 C606[C58B]01 <1> mov byte [mov_flag],1 1616 00004C25 EB22 <1> jmp _rm_im2 1617 <1> ;============================================================================= 1618 <1> ; _db 1619 <1> ;----------------------------------------------------------------------------- 1620 <1> _db: 1621 00004C27 720A <1> jc .checkonly 1622 00004C29 E80700 <1> call .checkonly 1623 00004C2C C60501 <1> mov byte [di],1 1624 00004C2F 884501 <1> mov [di+1],al 1625 00004C32 C3 <1> retn 1626 <1> 1627 <1> .checkonly: 1628 00004C33 08DB <1> or bl,bl 1629 00004C35 750C <1> jnz @@quit 1630 00004C37 80F9FF <1> cmp cl,-1 1631 00004C3A 7507 <1> jne @@quit 1632 00004C3C A1[0A52] <1> mov ax,[parameter_1+AP_VALUE] 1633 00004C3F 08E4 <1> or ah,ah 1634 00004C41 7541 <1> jnz jump_to_big_num_error ;jump out of range 1635 <1> @@quit: 1636 00004C43 C3 <1> ret 1637 <1> 1638 <1> ;============================================================================= 1639 <1> ; _rm_im 1640 <1> ;----------------------------------------------------------------------------- 1641 <1> _rm_im: 1642 00004C44 C606[C58B]00 <1> mov byte [mov_flag],0 1643 <1> _rm_im2: 1644 00004C49 803E[C88B]02 <1> cmp byte [param_count],2 1645 00004C4E 7517 <1> jne @@quit 1646 00004C50 80FDFF <1> cmp ch,0ffh 1647 00004C53 7512 <1> jne @@quit 1648 00004C55 83FB01 <1> cmp bx,0001h 1649 00004C58 740E <1> je @@m_i 1650 00004C5A 09DB <1> or bx,bx 1651 00004C5C 7509 <1> jnz @@quit 1652 <1> @@r_i: 1653 00004C5E 88E5 <1> mov ch,ah 1654 00004C60 E87B04 <1> call add_word_flag 1655 00004C63 EB05 <1> jmp @@make 1656 <1> ..@_rm_im_ok: 1657 00004C65 39C0 <1> cmp ax,ax 1658 <1> @@quit: 1659 00004C67 C3 <1> ret 1660 <1> @@m_i: 1661 00004C68 88E5 <1> mov ch,ah 1662 <1> ; or al,1 ;; WordFlag:=1 1663 <1> @@make: 1664 00004C6A 8B16[1352] <1> mov dx,[parameter_2+AP_VALUE] 1665 00004C6E 8A1E[1152] <1> mov bl,[parameter_1+AP_WORD_FLAG] 1666 00004C72 B104 <1> mov cl,4 1667 00004C74 E8A004 <1> call check_byte 1668 00004C77 741B <1> jz ..@byte_imm 1669 00004C79 08F6 <1> or dh,dh 1670 00004C7B 740A <1> jz ..@byte_imm_2 1671 00004C7D 0C01 <1> or al,1 1672 00004C7F 80FB01 <1> cmp bl,1 1673 00004C82 7522 <1> jne ..@word_imm 1674 <1> jump_to_big_num_error: 1675 00004C84 E98BFA <1> jmp big_num_error 1676 <1> ..@byte_imm_2: 1677 00004C87 FEC9 <1> dec cl 1678 00004C89 80FB02 <1> cmp bl,2 1679 00004C8C 7218 <1> jb @@byte 1680 00004C8E FEC1 <1> inc cl 1681 00004C90 0C01 <1> or al,1 1682 00004C92 EB12 <1> jmp ..@word_imm 1683 <1> ..@byte_imm: 1684 00004C94 FEC9 <1> dec cl 1685 00004C96 80FB02 <1> cmp bl,2 1686 00004C99 720B <1> jb @@byte 1687 00004C9B 0C03 <1> or al,3 1688 00004C9D 803E[C58B]00 <1> cmp byte [mov_flag],0 1689 00004CA2 7402 <1> je @@byte 1690 00004CA4 FEC1 <1> inc cl 1691 <1> @@byte: 1692 <1> ..@word_imm: 1693 00004CA6 884501 <1> mov [di+1],al 1694 00004CA9 E87304 <1> call make_modrm ; al=md000r/m, ah=size of offset(0,1,2) 1695 00004CAC D0E5 <1> shl ch,1 1696 00004CAE D0E5 <1> shl ch,1 1697 00004CB0 D0E5 <1> shl ch,1 1698 00004CB2 08E8 <1> or al,ch 1699 00004CB4 00E1 <1> add cl,ah 1700 00004CB6 880D <1> mov [di],cl 1701 00004CB8 884502 <1> mov [di+2],al 1702 00004CBB 88E3 <1> mov bl,ah 1703 00004CBD B700 <1> mov bh,0 1704 00004CBF 8B0E[0A52] <1> mov cx,[parameter_1+AP_VALUE] 1705 00004CC3 894D03 <1> mov [di+3],cx 1706 00004CC6 895103 <1> mov [di+bx+3],dx 1707 00004CC9 EB9A <1> jmp ..@_rm_im_ok 1708 <1> ;============================================================================= 1709 <1> ; _esc 1710 <1> ;----------------------------------------------------------------------------- 1711 <1> _esc: 1712 00004CCB 803E[C88B]02 <1> cmp byte [param_count],2 1713 00004CD0 7544 <1> jne @@quit 1714 00004CD2 08DB <1> or bl,bl 1715 00004CD4 7540 <1> jnz @@quit 1716 00004CD6 80F9FF <1> cmp cl,-1 1717 00004CD9 753B <1> jne @@quit 1718 00004CDB 88EB <1> mov bl,ch 1719 00004CDD 81FBFF00 <1> cmp bx,00ffh 1720 00004CE1 7433 <1> je @@quit 1721 00004CE3 86CD <1> xchg cl,ch 1722 00004CE5 E81304 <1> call swap_parameters 1723 00004CE8 E83404 <1> call make_modrm 1724 00004CEB 80C402 <1> add ah,2 1725 00004CEE 8825 <1> mov [di],ah 1726 00004CF0 8B16[1352] <1> mov dx,[parameter_2+AP_VALUE] 1727 00004CF4 83FA40 <1> cmp dx,64 1728 00004CF7 738B <1> jae jump_to_big_num_error ;jump out of range 1729 00004CF9 88D6 <1> mov dh,dl 1730 00004CFB 80E638 <1> and dh,00111000b 1731 00004CFE 08F0 <1> or al,dh 1732 00004D00 884502 <1> mov [di+2],al 1733 00004D03 88D0 <1> mov al,dl 1734 00004D05 2407 <1> and al,0111b 1735 00004D07 0CD8 <1> or al,0D8h 1736 00004D09 884501 <1> mov [di+1],al 1737 00004D0C 8B16[0A52] <1> mov dx,[parameter_1+AP_VALUE] 1738 00004D10 895503 <1> mov [di+3],dx 1739 00004D13 39C0 <1> cmp ax,ax 1740 00004D15 C3 <1> ret 1741 <1> @@quit: 1742 00004D16 09E4 <1> or sp,sp 1743 00004D18 C3 <1> ret 1744 <1> ;============================================================================= 1745 <1> ; _a_mem 1746 <1> ;----------------------------------------------------------------------------- 1747 <1> _a_mem: 1748 00004D19 803E[C88B]02 <1> cmp byte [param_count],2 1749 00004D1E 7552 <1> jne @@quit 1750 00004D20 83FB01 <1> cmp bx,0001h 1751 00004D23 742F <1> je @@m_a 1752 00004D25 81FB0001 <1> cmp bx,0100h 1753 00004D29 7547 <1> jne @@quit 1754 00004D2B 80E107 <1> and cl,0111b 1755 00004D2E 80F900 <1> cmp cl,regAL 1756 00004D31 753F <1> jne @@quit 1757 00004D33 833E[1652]00 <1> cmp word [parameter_2+AP_BX_FLAG],0 1758 00004D38 7538 <1> jne @@quit 1759 00004D3A 833E[1852]00 <1> cmp word [parameter_2+AP_SI_FLAG],0 1760 00004D3F 7531 <1> jne @@quit 1761 00004D41 8B16[1352] <1> mov dx,[parameter_2+AP_VALUE] 1762 <1> @@make: 1763 00004D45 E89603 <1> call add_word_flag 1764 00004D48 884501 <1> mov [di+1],al 1765 00004D4B C60503 <1> mov byte [di],3 1766 00004D4E 895502 <1> mov [di+2],dx 1767 00004D51 39C0 <1> cmp ax,ax 1768 00004D53 C3 <1> ret 1769 <1> @@m_a: 1770 00004D54 80E507 <1> and ch,0111b 1771 00004D57 80FD00 <1> cmp ch,regAL 1772 00004D5A 7516 <1> jne @@quit 1773 00004D5C 833E[0D52]00 <1> cmp word [parameter_1+AP_BX_FLAG],0 1774 00004D61 750F <1> jne @@quit 1775 00004D63 833E[0F52]00 <1> cmp word [parameter_1+AP_SI_FLAG],0 1776 00004D68 7508 <1> jne @@quit 1777 00004D6A 0C02 <1> or al,0010b 1778 00004D6C 8B16[0A52] <1> mov dx,[parameter_1+AP_VALUE] 1779 00004D70 EBD3 <1> jmp @@make 1780 <1> @@quit: 1781 00004D72 C3 <1> ret 1782 <1> ;============================================================================= 1783 <1> ; _r_im 1784 <1> ;----------------------------------------------------------------------------- 1785 <1> _r_im: 1786 00004D73 803E[C88B]02 <1> cmp byte [param_count],2 1787 00004D78 7535 <1> jne @@quit 1788 00004D7A 09DB <1> or bx,bx 1789 00004D7C 752F <1> jnz @@not 1790 00004D7E 80F9FF <1> cmp cl,-1 1791 00004D81 742A <1> jz @@not 1792 00004D83 80FDFF <1> cmp ch,-1 1793 00004D86 7525 <1> jnz @@not 1794 00004D88 08C8 <1> or al,cl 1795 00004D8A B403 <1> mov ah,3 1796 00004D8C 8B16[1352] <1> mov dx,[parameter_2+AP_VALUE] 1797 00004D90 A808 <1> test al,1000b 1798 00004D92 750E <1> jnz @@word 1799 00004D94 FECC <1> dec ah 1800 00004D96 E87E03 <1> call check_byte 1801 00004D99 7407 <1> jz @@word 1802 00004D9B 08F6 <1> or dh,dh 1803 00004D9D 7403 <1> jz @@word 1804 00004D9F E970F9 <1> jmp big_num_error 1805 <1> @@word: 1806 00004DA2 8825 <1> mov [di],ah 1807 00004DA4 884501 <1> mov [di+1],al 1808 00004DA7 895502 <1> mov [di+2],dx 1809 00004DAA 39C0 <1> cmp ax,ax 1810 00004DAC C3 <1> ret 1811 <1> @@not: 1812 00004DAD 09E4 <1> or sp,sp 1813 <1> @@quit: 1814 00004DAF C3 <1> ret 1815 <1> ;============================================================================= 1816 <1> ; _sr_rm 1817 <1> ;----------------------------------------------------------------------------- 1818 <1> _sr_rm: 1819 00004DB0 803E[C88B]02 <1> cmp byte [param_count],2 1820 00004DB5 756D <1> jne @@quit 1821 00004DB7 83FB01 <1> cmp bx,0001h 1822 00004DBA 7428 <1> je @@m_r 1823 00004DBC 81FB0001 <1> cmp bx,0100h 1824 00004DC0 744F <1> je @@r_m 1825 00004DC2 09DB <1> or bx,bx 1826 00004DC4 755E <1> jnz @@quit 1827 <1> @@r_r: 1828 00004DC6 80F9FF <1> cmp cl,-1 1829 00004DC9 7459 <1> je @@quit 1830 00004DCB 80FDFF <1> cmp ch,-1 1831 00004DCE 7454 <1> je @@quit 1832 00004DD0 80F910 <1> cmp cl,10h 1833 00004DD3 7307 <1> jae @@5 1834 00004DD5 80FD10 <1> cmp ch,10h 1835 00004DD8 7314 <1> jae @@m_s 1836 00004DDA EB48 <1> jmp @@quit 1837 <1> @@5: 1838 00004DDC 80FD10 <1> cmp ch,10h 1839 00004DDF 723A <1> jb @@s_m 1840 00004DE1 E981F5 <1> jmp wrong_param 1841 <1> @@m_r: 1842 00004DE4 80FDFF <1> cmp ch,-1 1843 00004DE7 743B <1> je @@quit 1844 00004DE9 80FD10 <1> cmp ch,10h 1845 00004DEC 7236 <1> jb @@quit 1846 <1> @@m_s: 1847 00004DEE 884501 <1> mov [di+1],al 1848 00004DF1 E82B03 <1> call make_modrm 1849 00004DF4 80C402 <1> add ah,2 1850 00004DF7 8825 <1> mov [di],ah 1851 00004DF9 80E507 <1> and ch,0111b 1852 00004DFC D0E5 <1> shl ch,1 1853 00004DFE D0E5 <1> shl ch,1 1854 00004E00 D0E5 <1> shl ch,1 1855 00004E02 08E8 <1> or al,ch 1856 00004E04 884502 <1> mov [di+2],al 1857 00004E07 8B16[0A52] <1> mov dx,[parameter_1+AP_VALUE] 1858 00004E0B 895503 <1> mov [di+3],dx 1859 <1> 1860 00004E0E 39C0 <1> cmp ax,ax 1861 00004E10 C3 <1> ret 1862 <1> 1863 <1> @@r_m: 1864 00004E11 80F9FF <1> cmp cl,-1 1865 00004E14 740E <1> je @@quit 1866 00004E16 80F910 <1> cmp cl,10h 1867 00004E19 7209 <1> jb @@quit 1868 <1> @@s_m: 1869 00004E1B 0C02 <1> or al,2 1870 00004E1D 86CD <1> xchg cl,ch 1871 00004E1F E8D902 <1> call swap_parameters 1872 00004E22 EBCA <1> jmp @@m_s 1873 <1> @@quit: 1874 00004E24 09E4 <1> or sp,sp 1875 00004E26 C3 <1> ret 1876 <1> ;============================================================================= 1877 <1> ; _rm 1878 <1> ;----------------------------------------------------------------------------- 1879 <1> _rm: 1880 00004E27 803E[C88B]01 <1> cmp byte [param_count],1 1881 00004E2C 752E <1> jne @@quit 1882 00004E2E 80FB01 <1> cmp bl,1 1883 00004E31 7405 <1> je @@m 1884 00004E33 80F9FF <1> cmp cl,-1 1885 00004E36 7424 <1> je @@quit 1886 <1> @@m: 1887 00004E38 88E5 <1> mov ch,ah 1888 00004E3A E8A102 <1> call add_word_flag 1889 00004E3D 884501 <1> mov [di+1],al 1890 00004E40 E8DC02 <1> call make_modrm 1891 00004E43 D0E5 <1> shl ch,1 1892 00004E45 D0E5 <1> shl ch,1 1893 00004E47 D0E5 <1> shl ch,1 1894 00004E49 08E8 <1> or al,ch 1895 00004E4B 884502 <1> mov [di+2],al 1896 00004E4E 80C402 <1> add ah,2 1897 00004E51 8825 <1> mov [di],ah 1898 00004E53 A1[0A52] <1> mov ax,[parameter_1+AP_VALUE] 1899 00004E56 894503 <1> mov [di+3],ax 1900 00004E59 39C0 <1> cmp ax,ax 1901 00004E5B C3 <1> ret 1902 <1> @@quit: 1903 00004E5C 09E4 <1> or sp,sp 1904 00004E5E C3 <1> ret 1905 <1> ;============================================================================= 1906 <1> ; _a_reg 1907 <1> ;----------------------------------------------------------------------------- 1908 <1> _a_reg: 1909 00004E5F 803E[C88B]02 <1> cmp byte [param_count],2 1910 00004E64 750E <1> jne @@quit 1911 00004E66 09DB <1> or bx,bx 1912 00004E68 750A <1> jnz @@quit 1913 00004E6A 80F908 <1> cmp cl,regAX 1914 00004E6D 740B <1> je @@a_r 1915 00004E6F 80FD08 <1> cmp ch,regAX 1916 00004E72 740D <1> je @@r_a 1917 <1> @@quit: 1918 00004E74 E88402 <1> call swap_parameters ;; Only for XCHG 1919 00004E77 09E4 <1> or sp,sp 1920 00004E79 C3 <1> ret 1921 <1> @@a_r: 1922 00004E7A 80FDFF <1> cmp ch,-1 1923 00004E7D 74F5 <1> je @@quit 1924 00004E7F EB07 <1> jmp @@ax_r 1925 <1> @@r_a: 1926 00004E81 80F9FF <1> cmp cl,-1 1927 00004E84 74EE <1> je @@quit 1928 00004E86 86CD <1> xchg cl,ch 1929 <1> @@ax_r: 1930 00004E88 80E507 <1> and ch,0111b 1931 00004E8B 08E8 <1> or al,ch 1932 00004E8D C60501 <1> mov byte [di],1 1933 00004E90 884501 <1> mov [di+1],al 1934 00004E93 39C0 <1> cmp ax,ax 1935 00004E95 C3 <1> ret 1936 <1> ;============================================================================= 1937 <1> ; _reg16 1938 <1> ;----------------------------------------------------------------------------- 1939 <1> _reg16: 1940 00004E96 803E[C88B]01 <1> cmp byte [param_count],1 1941 00004E9B 7518 <1> jne @@quit 1942 00004E9D 80F9FF <1> cmp cl,-1 1943 00004EA0 7413 <1> je @@quit 1944 00004EA2 F6C108 <1> test cl,1000b 1945 00004EA5 740E <1> jz @@quit 1946 00004EA7 80E107 <1> and cl,0111b 1947 00004EAA 08C8 <1> or al,cl 1948 00004EAC C60501 <1> mov byte [di],1 1949 00004EAF 884501 <1> mov [di+1],al 1950 00004EB2 39E4 <1> cmp sp,sp 1951 00004EB4 C3 <1> ret 1952 <1> @@quit: 1953 00004EB5 09E4 <1> or sp,sp 1954 00004EB7 C3 <1> ret 1955 <1> ;============================================================================= 1956 <1> ; _sreg 1957 <1> ;----------------------------------------------------------------------------- 1958 <1> _sreg: 1959 00004EB8 803E[C88B]01 <1> cmp byte [param_count],1 1960 00004EBD 751E <1> jne @@quit 1961 00004EBF 80F9FF <1> cmp cl,-1 1962 00004EC2 7419 <1> je @@quit 1963 00004EC4 80F910 <1> cmp cl,10h 1964 00004EC7 7214 <1> jb @@quit 1965 00004EC9 80E107 <1> and cl,0111b 1966 00004ECC D0E1 <1> shl cl,1 1967 00004ECE D0E1 <1> shl cl,1 1968 00004ED0 D0E1 <1> shl cl,1 1969 00004ED2 08C8 <1> or al,cl 1970 00004ED4 C60501 <1> mov byte [di],1 1971 00004ED7 884501 <1> mov [di+1],al 1972 00004EDA 39C0 <1> cmp ax,ax 1973 00004EDC C3 <1> ret 1974 <1> @@quit: 1975 00004EDD 09E4 <1> or sp,sp 1976 00004EDF C3 <1> ret 1977 <1> ;============================================================================= 1978 <1> ; _rm_cl_1 1979 <1> ;----------------------------------------------------------------------------- 1980 <1> _rm_cl_1: 1981 00004EE0 80FF01 <1> cmp bh,1 1982 00004EE3 7441 <1> je @@quit 1983 00004EE5 80FDFF <1> cmp ch,-1 1984 00004EE8 7409 <1> je @@check_1 1985 00004EEA 80FD01 <1> cmp ch,regCL 1986 00004EED 7537 <1> jne @@quit 1987 00004EEF B102 <1> mov cl,10b 1988 00004EF1 EB09 <1> jmp @@make 1989 <1> @@check_1: 1990 00004EF3 833E[1352]01 <1> cmp word [parameter_2+AP_VALUE],1 1991 00004EF8 752C <1> jne @@quit 1992 00004EFA B100 <1> mov cl,0 1993 <1> @@make: 1994 00004EFC 88E5 <1> mov ch,ah 1995 00004EFE E8DD01 <1> call add_word_flag 1996 00004F01 08C8 <1> or al,cl 1997 00004F03 884501 <1> mov [di+1],al 1998 00004F06 E81602 <1> call make_modrm 1999 00004F09 80C402 <1> add ah,2 2000 00004F0C 8825 <1> mov [di],ah 2001 00004F0E 80E507 <1> and ch,0111b 2002 00004F11 D0E5 <1> shl ch,1 2003 00004F13 D0E5 <1> shl ch,1 2004 00004F15 D0E5 <1> shl ch,1 2005 00004F17 08E8 <1> or al,ch 2006 00004F19 884502 <1> mov [di+2],al 2007 00004F1C 8B16[0A52] <1> mov dx,[parameter_1+AP_VALUE] 2008 00004F20 895503 <1> mov [di+3],dx 2009 00004F23 39C0 <1> cmp ax,ax 2010 00004F25 C3 <1> ret 2011 <1> @@quit: 2012 00004F26 09E4 <1> or sp,sp 2013 00004F28 C3 <1> ret 2014 <1> ;============================================================================= 2015 <1> ; _im8ch3 2016 <1> ;----------------------------------------------------------------------------- 2017 <1> _im8ch3: 2018 00004F29 E80F00 <1> call _im8 2019 00004F2C 750C <1> jnz @@quit 2020 00004F2E 807D0203 <1> cmp byte [di+2],3 2021 00004F32 7504 <1> jne @@quit_1 2022 00004F34 C70501CC <1> mov word [di],0cc01h 2023 <1> @@quit_1: 2024 00004F38 39C0 <1> cmp ax,ax 2025 <1> @@quit: 2026 00004F3A C3 <1> ret 2027 <1> ;============================================================================= 2028 <1> ; _im8 2029 <1> ;----------------------------------------------------------------------------- 2030 <1> _im8: 2031 00004F3B 803E[C88B]01 <1> cmp byte [param_count],1 2032 00004F40 751C <1> jne @@quit 2033 00004F42 80FB00 <1> cmp bl,0 2034 00004F45 7517 <1> jne @@quit 2035 00004F47 80F9FF <1> cmp cl,-1 2036 00004F4A 7512 <1> jne @@quit 2037 00004F4C 8B16[0A52] <1> mov dx,[parameter_1+AP_VALUE] 2038 00004F50 80FE00 <1> cmp dh,0 2039 00004F53 7509 <1> jnz @@quit 2040 00004F55 C60502 <1> mov byte [di],2 2041 00004F58 884501 <1> mov [di+1],al 2042 00004F5B 885502 <1> mov [di+2],dl 2043 <1> @@quit: 2044 00004F5E C3 <1> ret 2045 <1> ;============================================================================= 2046 <1> ; _im16 2047 <1> ;----------------------------------------------------------------------------- 2048 <1> _im16: 2049 00004F5F 803E[C88B]01 <1> cmp byte [param_count],1 2050 00004F64 7517 <1> jne @@quit 2051 00004F66 80FB00 <1> cmp bl,0 2052 00004F69 7512 <1> jne @@quit 2053 00004F6B 80F9FF <1> cmp cl,-1 2054 00004F6E 750D <1> jne @@quit 2055 00004F70 8B16[0A52] <1> mov dx,[parameter_1+AP_VALUE] 2056 00004F74 C60503 <1> mov byte [di],3 2057 00004F77 884501 <1> mov [di+1],al 2058 00004F7A 895502 <1> mov [di+2],dx 2059 <1> @@quit: 2060 00004F7D C3 <1> ret 2061 <1> ;============================================================================= 2062 <1> ; _imn 2063 <1> ;----------------------------------------------------------------------------- 2064 <1> _imn: 2065 00004F7E 803E[C88B]00 <1> cmp byte [param_count],0 2066 00004F83 7506 <1> jne @@quit 2067 00004F85 C60502 <1> mov byte [di],2 2068 00004F88 894501 <1> mov [di+1],ax 2069 <1> @@quit: 2070 00004F8B C3 <1> ret 2071 <1> ;============================================================================= 2072 <1> ; _a_dx 2073 <1> ;----------------------------------------------------------------------------- 2074 <1> _a_dx: 2075 00004F8C 803E[C88B]02 <1> cmp byte [param_count],2 2076 00004F91 7516 <1> jne @@quit 2077 00004F93 F6C108 <1> test cl,1000b 2078 00004F96 7402 <1> jz @@1 2079 00004F98 0C01 <1> or al,1 2080 <1> @@1: 2081 00004F9A 80E107 <1> and cl,0111b 2082 00004F9D 81F9000A <1> cmp cx,regAL + (regDX << 8) 2083 00004FA1 7506 <1> jne @@quit 2084 00004FA3 C60501 <1> mov byte [di],1 2085 00004FA6 884501 <1> mov [di+1],al 2086 <1> @@quit: 2087 00004FA9 C3 <1> ret 2088 <1> ;============================================================================= 2089 <1> ; _dx_a 2090 <1> ;----------------------------------------------------------------------------- 2091 <1> _dx_a: 2092 00004FAA 803E[C88B]02 <1> cmp byte [param_count],2 2093 00004FAF 7515 <1> jne @@quit 2094 00004FB1 F6C508 <1> test ch,1000b 2095 00004FB4 7402 <1> jz @@1 2096 00004FB6 0C01 <1> or al,1 2097 <1> @@1: 2098 00004FB8 80E507 <1> and ch,0111b 2099 00004FBB 83F90A <1> cmp cx,regDX + (regAL << 8) 2100 00004FBE 7506 <1> jne @@quit 2101 00004FC0 C60501 <1> mov byte [di],1 2102 00004FC3 884501 <1> mov [di+1],al 2103 <1> @@quit: 2104 00004FC6 C3 <1> ret 2105 <1> ;============================================================================= 2106 <1> ; _a_im8 2107 <1> ;----------------------------------------------------------------------------- 2108 <1> _a_im8: 2109 00004FC7 803E[C88B]02 <1> cmp byte [param_count],2 2110 00004FCC 7529 <1> jne @@quit 2111 00004FCE 09DB <1> or bx,bx 2112 00004FD0 7525 <1> jnz @@quit 2113 00004FD2 80FDFF <1> cmp ch,-1 2114 00004FD5 7520 <1> jne @@quit 2115 00004FD7 F6C108 <1> test cl,1000b 2116 00004FDA 7402 <1> jz @@1 2117 00004FDC 0C01 <1> or al,1 2118 <1> @@1: 2119 00004FDE 80E107 <1> and cl,0111b 2120 00004FE1 80F900 <1> cmp cl,regAL 2121 00004FE4 7511 <1> jne @@quit 2122 00004FE6 8B16[1352] <1> mov dx,[parameter_2+AP_VALUE] 2123 00004FEA 08F6 <1> or dh,dh 2124 00004FEC 7509 <1> jnz @@quit 2125 00004FEE C60502 <1> mov byte [di],2 2126 00004FF1 884501 <1> mov [di+1],al 2127 00004FF4 885502 <1> mov [di+2],dl 2128 <1> @@quit: 2129 00004FF7 C3 <1> ret 2130 <1> ;============================================================================= 2131 <1> ; _im8_a 2132 <1> ;----------------------------------------------------------------------------- 2133 <1> _im8_a: 2134 00004FF8 803E[C88B]02 <1> cmp byte [param_count],2 2135 00004FFD 7529 <1> jne @@quit 2136 00004FFF 09DB <1> or bx,bx 2137 00005001 7525 <1> jnz @@quit 2138 00005003 80F9FF <1> cmp cl,-1 2139 00005006 7520 <1> jne @@quit 2140 00005008 F6C508 <1> test ch,1000b 2141 0000500B 7402 <1> jz @@1 2142 0000500D 0C01 <1> or al,1 2143 <1> @@1: 2144 0000500F 80E507 <1> and ch,0111b 2145 00005012 80FD00 <1> cmp ch,regAL 2146 00005015 7511 <1> jne @@quit 2147 00005017 8B16[0A52] <1> mov dx,[parameter_1+AP_VALUE] 2148 0000501B 08F6 <1> or dh,dh 2149 0000501D 7509 <1> jnz @@quit 2150 0000501F C60502 <1> mov byte [di],2 2151 00005022 884501 <1> mov [di+1],al 2152 00005025 885502 <1> mov [di+2],dl 2153 <1> @@quit: 2154 00005028 C3 <1> ret 2155 <1> ;============================================================================= 2156 <1> ; _short 2157 <1> ;----------------------------------------------------------------------------- 2158 <1> _short: 2159 00005029 803E[C78B]01 <1> cmp byte [jump_flag],1 2160 0000502E 7529 <1> jne @@quit 2161 00005030 803E[C88B]01 <1> cmp byte [param_count],1 2162 00005035 7522 <1> jne @@quit 2163 00005037 08DB <1> or bl,bl 2164 00005039 751E <1> jnz @@quit 2165 0000503B 80F9FF <1> cmp cl,-1 2166 0000503E 7519 <1> jnz @@quit 2167 00005040 8B16[0A52] <1> mov dx,[parameter_1+AP_VALUE] 2168 <1> 2169 <1> ; sub dx,asm_offs 2170 00005044 2B16[7943] <1> sub dx,[jump_origin_offs] 2171 <1> 2172 00005048 83EA02 <1> sub dx,2 2173 0000504B E8C900 <1> call check_byte 2174 0000504E 7509 <1> jnz @@quit 2175 00005050 C60502 <1> mov byte [di],2 2176 00005053 884501 <1> mov [di+1],al 2177 00005056 885502 <1> mov [di+2],dl 2178 <1> @@quit: 2179 00005059 C3 <1> ret 2180 <1> ;============================================================================= 2181 <1> ; _near 2182 <1> ;----------------------------------------------------------------------------- 2183 <1> _near: 2184 0000505A 803E[C78B]01 <1> cmp byte [jump_flag],1 2185 0000505F 7526 <1> jne @@quit 2186 00005061 803E[C88B]01 <1> cmp byte [param_count],1 2187 00005066 751F <1> jne @@quit 2188 00005068 08DB <1> or bl,bl 2189 0000506A 751B <1> jnz @@quit 2190 0000506C 80F9FF <1> cmp cl,-1 2191 0000506F 7516 <1> jnz @@quit 2192 00005071 8B16[0A52] <1> mov dx,[parameter_1+AP_VALUE] 2193 <1> 2194 <1> ; sub dx,asm_offs 2195 00005075 2B16[7943] <1> sub dx,[jump_origin_offs] 2196 <1> 2197 00005079 83EA03 <1> sub dx,3 2198 0000507C C60503 <1> mov byte [di],3 2199 0000507F 884501 <1> mov [di+1],al 2200 00005082 895502 <1> mov [di+2],dx 2201 00005085 39C0 <1> cmp ax,ax 2202 <1> @@quit: 2203 00005087 C3 <1> ret 2204 <1> ;============================================================================= 2205 <1> ; _far 2206 <1> ;----------------------------------------------------------------------------- 2207 <1> _far: 2208 00005088 803E[C88B]01 <1> cmp byte [param_count],1 2209 0000508D 751B <1> jne @@quit 2210 0000508F 803E[C78B]02 <1> cmp byte [jump_flag],2 2211 00005094 7514 <1> jne @@quit 2212 00005096 8B16[0A52] <1> mov dx,[parameter_1+AP_VALUE] 2213 0000509A 8B0E[CA8B] <1> mov cx,[far_value] 2214 0000509E C60505 <1> mov byte [di],5 2215 000050A1 884501 <1> mov [di+1],al 2216 000050A4 894D02 <1> mov [di+2],cx 2217 000050A7 895504 <1> mov [di+4],dx 2218 <1> @@quit: 2219 000050AA C3 <1> ret 2220 <1> ;============================================================================= 2221 <1> ; _rmj 2222 <1> ;----------------------------------------------------------------------------- 2223 <1> _rmj: 2224 000050AB 803E[1152]03 <1> cmp byte [parameter_1+AP_WORD_FLAG],3 2225 000050B0 7502 <1> jne loc_rm 2226 000050B2 FEC4 <1> inc ah 2227 <1> loc_rm: 2228 000050B4 E970FD <1> jmp _rm 2229 <1> ;============================================================================= 2230 <1> ; _dw 2231 <1> ;----------------------------------------------------------------------------- 2232 <1> _dw: 2233 000050B7 720A <1> jc .checkonly 2234 000050B9 E80700 <1> call .checkonly 2235 000050BC C60502 <1> mov byte [di],2 2236 000050BF 894501 <1> mov [di+1],ax 2237 000050C2 C3 <1> retn 2238 <1> 2239 <1> .checkonly: 2240 000050C3 08DB <1> or bl,bl 2241 000050C5 7508 <1> jnz @@quit 2242 000050C7 80F9FF <1> cmp cl,-1 2243 000050CA 7503 <1> jne @@quit 2244 000050CC A1[0A52] <1> mov ax,[parameter_1+AP_VALUE] 2245 <1> @@quit: 2246 000050CF C3 <1> ret 2247 <1> ;============================================================================= 2248 <1> ; _noparam 2249 <1> ;----------------------------------------------------------------------------- 2250 <1> _noparam: 2251 000050D0 803E[C88B]00 <1> cmp byte [param_count],0 2252 000050D5 7506 <1> jne @@quit 2253 000050D7 C60501 <1> mov byte [di],1 2254 000050DA 884501 <1> mov [di+1],al 2255 <1> @@quit: 2256 000050DD C3 <1> ret 2257 <1> ;============================================================================= 2258 <1> ; add_word_flag 2259 <1> ;----------------------------------------------------------------------------- 2260 <1> add_word_flag: 2261 000050DE 8A26[1152] <1> mov ah,[parameter_1+AP_WORD_FLAG] 2262 000050E2 08E4 <1> or ah,ah 2263 000050E4 7405 <1> jz @@2 2264 <1> @@1: 2265 000050E6 FECC <1> dec ah 2266 000050E8 08E0 <1> or al,ah 2267 000050EA C3 <1> ret 2268 <1> @@2: 2269 000050EB 803E[C88B]01 <1> cmp byte [param_count],1 2270 000050F0 7608 <1> jbe @@3 2271 000050F2 8A26[1A52] <1> mov ah,[parameter_2+AP_WORD_FLAG] 2272 000050F6 08E4 <1> or ah,ah 2273 000050F8 75EC <1> jnz @@1 2274 <1> @@3: 2275 000050FA C3 <1> ret 2276 <1> ;============================================================================= 2277 <1> ; swap_parameters 2278 <1> ;----------------------------------------------------------------------------- 2279 <1> swap_parameters: 2280 000050FB 50 <1> push ax 2281 000050FC 51 <1> push cx 2282 000050FD 56 <1> push si 2283 000050FE 57 <1> push di 2284 000050FF BE[0952] <1> mov si,parameter_1 2285 00005102 BF[1252] <1> mov di,parameter_2 2286 00005105 B90900 <1> mov cx,SIZEOF_ASM_PARAM 2287 <1> @@next: 2288 00005108 AC <1> lodsb 2289 00005109 268605 <1> xchg al,[es:di] 2290 0000510C 8844FF <1> mov [si-1],al 2291 0000510F 47 <1> inc di 2292 00005110 E2F6 <1> loop @@next 2293 00005112 5F <1> pop di 2294 00005113 5E <1> pop si 2295 00005114 59 <1> pop cx 2296 00005115 58 <1> pop ax 2297 00005116 C3 <1> ret 2298 <1> ;============================================================================= 2299 <1> ; check_byte 2300 <1> ;----------------------------------------------------------------------------- 2301 <1> check_byte: 2302 00005117 50 <1> push ax 2303 00005118 88D0 <1> mov al,dl 2304 0000511A 98 <1> cbw 2305 0000511B 39D0 <1> cmp ax,dx 2306 0000511D 58 <1> pop ax 2307 0000511E C3 <1> ret 2308 <1> ;============================================================================= 2309 <1> ; 2310 <1> ;----------------------------------------------------------------------------- 2311 <1> ; Makes MODRM byte for 1st parameter 2312 <1> ; Returns: al=md000r/m, ah=offset size (0, 1 or 2) 2313 <1> make_modrm: 2314 0000511F 53 <1> push bx 2315 00005120 51 <1> push cx 2316 00005121 52 <1> push dx 2317 00005122 A0[0952] <1> mov al,[parameter_1+AP_REG_NUMBER] 2318 00005125 3CFF <1> cmp al,-1 2319 00005127 7408 <1> je @@mem 2320 00005129 2407 <1> and al,0111b 2321 0000512B 0CC0 <1> or al,11000000b 2322 <1> ;; and ch,0111b 2323 <1> ; shl ch,1 2324 <1> ; shl ch,1 2325 <1> ; shl ch,1 2326 <1> ; or al,ch 2327 0000512D B400 <1> mov ah,0 2328 0000512F EB5E <1> jmp @@ok 2329 <1> @@mem: 2330 00005131 803E[0C52]00 <1> cmp byte [parameter_1+AP_MEM_FLAG],0 2331 00005136 745C <1> je @@error 2332 <1> @@make_modrm: 2333 00005138 8B1E[0D52] <1> mov bx,[parameter_1+AP_BX_FLAG] 2334 0000513C 8B0E[0F52] <1> mov cx,[parameter_1+AP_SI_FLAG] 2335 00005140 8B16[0A52] <1> mov dx,[parameter_1+AP_VALUE] 2336 00005144 53 <1> push bx 2337 00005145 09CB <1> or bx,cx 2338 00005147 5B <1> pop bx 2339 00005148 7423 <1> jz @@no_base_index 2340 0000514A 09DB <1> or bx,bx 2341 0000514C 740C <1> jz @@no_base 2342 0000514E 09C9 <1> or cx,cx 2343 00005150 740E <1> jz @@no_index 2344 00005152 88F8 <1> mov al,bh 2345 00005154 00F8 <1> add al,bh 2346 00005156 00E8 <1> add al,ch 2347 00005158 EB19 <1> jmp @@make_mod 2348 <1> @@no_base: 2349 0000515A B004 <1> mov al,4 2350 0000515C 00E8 <1> add al,ch 2351 0000515E EB13 <1> jmp @@make_mod 2352 <1> @@no_index: 2353 00005160 B006 <1> mov al,6 2354 00005162 00D8 <1> add al,bl 2355 00005164 80FF01 <1> cmp bh,1 2356 00005167 750A <1> jne @@make_mod 2357 00005169 B302 <1> mov bl,2 2358 0000516B EB0C <1> jmp @@ch_byte 2359 <1> @@no_base_index: 2360 0000516D B006 <1> mov al,0110b 2361 0000516F B402 <1> mov ah,2 2362 00005171 EB1C <1> jmp @@ok 2363 <1> @@make_mod: 2364 00005173 B302 <1> mov bl,2 2365 00005175 09D2 <1> or dx,dx 2366 00005177 7409 <1> jz @@no_offs 2367 <1> @@ch_byte: 2368 00005179 E89BFF <1> call check_byte 2369 0000517C 7402 <1> jz @@byte_offs 2370 <1> @@word_offs: 2371 0000517E FEC3 <1> inc bl 2372 <1> @@byte_offs: 2373 00005180 FEC3 <1> inc bl 2374 <1> @@no_offs: 2375 00005182 881D <1> mov [di],bl 2376 00005184 80EB02 <1> sub bl,2 2377 00005187 88DC <1> mov ah,bl 2378 00005189 D0CB <1> ror bl,1 2379 0000518B D0CB <1> ror bl,1 2380 0000518D 08D8 <1> or al,bl 2381 <1> @@ok: 2382 0000518F F8 <1> clc 2383 <1> @@quit: 2384 00005190 5A <1> pop dx 2385 00005191 59 <1> pop cx 2386 00005192 5B <1> pop bx 2387 00005193 C3 <1> ret 2388 <1> @@error: 2389 00005194 F9 <1> stc 2390 00005195 EBF9 <1> jmp @@quit 2391 <1> ;============================================================================= 2392 <1> 2393 00005197 262E363E <1> pref_codes db 26h, 2Eh, 36h, 3Eh 2394 <1> 2395 0000519B 7265746E00 <1> cretn db 'retn',0 2396 000051A0 73616C00 <1> csal db 'sal',0 2397 000051A4 6A6E616500 <1> cjnae db 'jnae',0 2398 000051A9 6A6300 <1> cjc db 'jc',0 2399 000051AC 6A6E6300 <1> cjnc db 'jnc',0 2400 000051B0 6A616500 <1> cjae db 'jae',0 2401 000051B4 6A6500 <1> cje db 'je',0 2402 000051B7 6A6E6500 <1> cjne db 'jne',0 2403 000051BB 6A6E6100 <1> cjna db 'jna',0 2404 000051BF 6A6E626500 <1> cjnbe db 'jnbe',0 2405 000051C4 6A706500 <1> cjpe db 'jpe',0 2406 000051C8 6A706F00 <1> cjpo db 'jpo',0 2407 000051CC 6A6E676500 <1> cjnge db 'jnge',0 2408 000051D1 6A6E6C00 <1> cjnl db 'jnl',0 2409 000051D5 6A6E6700 <1> cjng db 'jng',0 2410 000051D9 6A6E6C6500 <1> cjnle db 'jnle',0 2411 000051DE 6C6F6F707A00 <1> cloopz db 'loopz',0 2412 000051E4 6C6F6F706E7A00 <1> cloopnz db 'loopnz',0 2413 000051EB 7265707A00 <1> crepz db 'repz',0 2414 000051F0 7265706E7A00 <1> crepnz db 'repnz',0 2415 000051F6 7265706500 <1> crepe db 'repe',0 2416 000051FB 7265706E6500 <1> crepne db 'repne',0 2417 00005201 72657000 <1> crep db 'rep',0 2418 00005205 647700 <1> cdw db 'dw',0 2419 <1> 2420 00005208 FF <1> curr_prefix db -1 2421 <1> 2422 <1> ;~Parameter1 AsmParam <> 2423 <1> ;~Parameter2 AsmParam <> 2424 00005209 FF0000000000000000 <1> parameter_1 db -1, 0, 0, 0, 0, 0, 0, 0, 0 2425 00005212 FF0000000000000000 <1> parameter_2 db -1, 0, 0, 0, 0, 0, 0, 0, 0 2426 <1> 2427 <1> ;============================================================================= 2428 <1> ; E0F 2429 <1> ;============================================================================= 2430 <1> 2431 <1> 64 %include "trace.inc" ; 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; trace.inc 7 <1> ; Trace-related procedures. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> ;============================================================================= 26 <1> ; Changelog 27 <1> ;----------------------------------------------------------------------------- 28 <1> ; 2007-02-06 0leg animate added 29 <1> ; 2007-03-01 0leg user_push, user_pop optimized 30 <1> ; 2008-02-15 0leg skip_instruction added 31 <1> ;============================================================================= 32 <1> 33 <1> 34 <1> %macro save_act_regs 0 35 <1> mov [save_sp],sp 36 <1> %endmacro 37 <1> 38 <1> 39 <1> %macro restore_act_regs 0 40 <1> mov ax,cs 41 <1> mov ds,ax 42 <1> mov es,ax 43 <1> mov ss,ax 44 <1> mov sp,[save_sp] 45 <1> %endmacro 46 <1> 47 <1> 48 <1> %macro save_user_regs 0 49 <1> cmp byte [cs:system_cpu],3 50 <1> jb @@skip_esp 51 <1> db 66h 52 <1> @@skip_esp: 53 <1> mov [cs:cpu_regs+REG_SP],sp 54 <1> call _save_user_regs 55 <1> %endmacro 56 <1> 57 <1> 58 <1> %macro restore_user_regs 0 59 <1> call _restore_user_regs 60 <1> %endmacro 61 <1> 62 <1> 63 <1> ;============================================================================= 64 <1> ; _save_user_regs 65 <1> ;----------------------------------------------------------------------------- 66 <1> _save_user_regs: 67 <1> first_prefix: 68 <1> prefix_01: 69 0000521B 90 <1> nop 70 0000521C 2EA3[C88A] <1> mov [cs:cpu_regs+REG_AX],ax 71 <1> 72 00005220 2E8C1E[EC8A] <1> mov [cs:cpu_regs+REG_DS],ds 73 00005225 8CC8 <1> mov ax,cs 74 00005227 8ED8 <1> mov ds,ax 75 00005229 8F06[EC8C] <1> pop word [keep_ip] 76 <1> 77 <1> prefix_02: 78 0000522D 90 <1> nop 79 0000522E 891E[CC8A] <1> mov [cpu_regs+REG_BX],bx 80 <1> 81 <1> prefix_03: 82 00005232 90 <1> nop 83 00005233 890E[D08A] <1> mov [cpu_regs+REG_CX],cx 84 <1> 85 <1> prefix_04: 86 00005237 90 <1> nop 87 00005238 8916[D48A] <1> mov [cpu_regs+REG_DX],dx 88 <1> 89 <1> prefix_05: 90 0000523C 90 <1> nop 91 0000523D 8936[D88A] <1> mov [cpu_regs+REG_SI],si 92 <1> 93 <1> prefix_06: 94 00005241 90 <1> nop 95 00005242 893E[DC8A] <1> mov [cpu_regs+REG_DI],di 96 <1> 97 <1> prefix_07: 98 00005246 90 <1> nop 99 00005247 892E[E08A] <1> mov [cpu_regs+REG_BP],bp 100 <1> 101 0000524B 803E[6E8B]03 <1> cmp byte [system_cpu],3 102 00005250 7208 <1> jb @@skip 103 <1> cpu 386 104 00005252 8C2E[FC8A] <1> mov [cpu_regs+REG_GS],gs 105 00005256 8C26[F88A] <1> mov [cpu_regs+REG_FS],fs 106 <1> cpu 8086 107 <1> @@skip: 108 0000525A 8C06[F08A] <1> mov [cpu_regs+REG_ES],es 109 0000525E 8C16[F48A] <1> mov [cpu_regs+REG_SS],ss 110 00005262 8EC0 <1> mov es,ax 111 00005264 8ED0 <1> mov ss,ax 112 <1> 113 <1> prefix_16: 114 00005266 90 <1> nop 115 00005267 A1[008B] <1> mov ax,[cpu_regs+REG_IP] 116 <1> 117 <1> prefix_17: 118 0000526A 90 <1> nop 119 0000526B A3[C08A] <1> mov [save_cpu_regs+REG_IP],ax 120 <1> 121 <1> prefix_18: 122 0000526E 90 <1> nop 123 0000526F A1[E88A] <1> mov ax,[cpu_regs+REG_CS] 124 <1> 125 <1> prefix_19: 126 00005272 90 <1> nop 127 00005273 A3[A88A] <1> mov [save_cpu_regs+REG_CS],ax 128 <1> 129 00005276 C606[4A78]00 <1> mov byte [regs_saved],0 130 0000527B 8B26[6C8B] <1> mov sp,[save_sp] 131 0000527F FF26[EC8C] <1> jmp word [keep_ip] 132 <1> ;============================================================================= 133 <1> ; _restore_user_regs 134 <1> ;----------------------------------------------------------------------------- 135 <1> _restore_user_regs: 136 00005283 8F06[EC8C] <1> pop word [keep_ip] 137 00005287 E84700 <1> call save_regs 138 <1> 139 <1> prefix_08: 140 0000528A 90 <1> nop 141 0000528B A1[C88A] <1> mov ax,[cpu_regs+REG_AX] 142 <1> 143 <1> prefix_09: 144 0000528E 90 <1> nop 145 0000528F 8B1E[CC8A] <1> mov bx,[cpu_regs+REG_BX] 146 <1> 147 <1> prefix_10: 148 00005293 90 <1> nop 149 00005294 8B0E[D08A] <1> mov cx,[cpu_regs+REG_CX] 150 <1> 151 <1> prefix_11: 152 00005298 90 <1> nop 153 00005299 8B16[D48A] <1> mov dx,[cpu_regs+REG_DX] 154 <1> 155 <1> prefix_12: 156 0000529D 90 <1> nop 157 0000529E 8B36[D88A] <1> mov si,[cpu_regs+REG_SI] 158 <1> 159 <1> prefix_13: 160 000052A2 90 <1> nop 161 000052A3 8B3E[DC8A] <1> mov di,[cpu_regs+REG_DI] 162 <1> 163 <1> prefix_14: 164 000052A7 90 <1> nop 165 000052A8 8B26[E48A] <1> mov sp,[cpu_regs+REG_SP] 166 <1> 167 <1> prefix_15: 168 000052AC 90 <1> nop 169 000052AD 8B2E[E08A] <1> mov bp,[cpu_regs+REG_BP] 170 000052B1 803E[6E8B]03 <1> cmp byte [system_cpu],3 171 000052B6 7208 <1> jb @@skip 172 <1> cpu 386 173 000052B8 8E2E[FC8A] <1> mov gs,[cpu_regs+REG_GS] 174 000052BC 8E26[F88A] <1> mov fs,[cpu_regs+REG_FS] 175 <1> cpu 8086 176 <1> @@skip: 177 000052C0 8E06[F08A] <1> mov es,[cpu_regs+REG_ES] 178 000052C4 8E16[F48A] <1> mov ss,[cpu_regs+REG_SS] 179 000052C8 8E1E[EC8A] <1> mov ds,[cpu_regs+REG_DS] 180 000052CC 2EFF26[EC8C] <1> jmp word [cs:keep_ip] 181 <1> ;============================================================================= 182 <1> ; save_regs 183 <1> ;----------------------------------------------------------------------------- 184 <1> save_regs: 185 000052D1 1E <1> push ds 186 000052D2 07 <1> pop es 187 000052D3 BE[C88A] <1> mov si,cpu_regs 188 000052D6 BF[888A] <1> mov di,save_cpu_regs 189 000052D9 B94000 <1> mov cx,SIZEOF_REGISTERS_32 190 000052DC FC <1> cld 191 000052DD F3A4 <1> rep movsb 192 000052DF C3 <1> ret 193 <1> ;============================================================================= 194 <1> ; restore_regs 195 <1> ;----------------------------------------------------------------------------- 196 <1> restore_regs: 197 000052E0 1E <1> push ds 198 000052E1 07 <1> pop es 199 000052E2 FF36[048B] <1> push word [cpu_regs+REG_FL] 200 000052E6 FF36[E88A] <1> push word [cpu_regs+REG_CS] 201 000052EA FF36[008B] <1> push word [cpu_regs+REG_IP] 202 000052EE BF[C88A] <1> mov di,cpu_regs 203 000052F1 BE[888A] <1> mov si,save_cpu_regs 204 000052F4 B94000 <1> mov cx,SIZEOF_REGISTERS_32 205 000052F7 FC <1> cld 206 000052F8 F3A4 <1> rep movsb 207 000052FA 8F06[008B] <1> pop word [cpu_regs+REG_IP] 208 000052FE 8F06[E88A] <1> pop word [cpu_regs+REG_CS] 209 00005302 8F06[048B] <1> pop word [cpu_regs+REG_FL] 210 00005306 C3 <1> ret 211 <1> ;============================================================================= 212 <1> ; skip_instruction 213 <1> ;----------------------------------------------------------------------------- 214 <1> skip_instruction: 215 00005307 8E06[9B8B] <1> mov es,[unasm_seg] 216 0000530B 8B36[008B] <1> mov si,[cpu_regs+REG_IP] 217 0000530F E8B3DB <1> call unassemble 218 00005312 8936[008B] <1> mov [cpu_regs+REG_IP],si 219 00005316 8936[C08A] <1> mov [save_cpu_regs+REG_IP],si 220 0000531A E98700 <1> jmp trace_update 221 <1> ;============================================================================= 222 <1> ; single_step 223 <1> ;----------------------------------------------------------------------------- 224 <1> single_step: 225 0000531D B200 <1> mov dl,0 226 0000531F E86D04 <1> call emulate 227 00005322 7305 <1> jnc @@1 228 00005324 E8AAFF <1> call save_regs 229 00005327 EB7B <1> jmp trace_update 230 00005329 E808DA <1> @@1: call check_swap 231 0000532C 803E[812D]00 <1> cmp byte [swap_flag],0 232 00005331 7403 <1> je @@n1 233 00005333 E8FED8 <1> call restore_screen 234 <1> @@n1: 235 00005336 FA <1> cli 236 <1> ; call set_09_vector 237 00005337 BA[6753] <1> mov dx,@@int_01_entry 238 0000533A E8EF01 <1> call set_01_vector 239 0000533D A0[838B] <1> mov al,[user_port_21] 240 00005340 0C03 <1> or al,3 241 00005342 E621 <1> out 21h,al 242 00005344 C606[028C]FF <1> mov byte [user_port_21_mask_3_only], -1 243 <1> save_act_regs 35 00005349 8926[6C8B] <2> mov [save_sp],sp 244 <1> restore_user_regs 59 0000534D E833FF <2> call _restore_user_regs 245 00005350 2E810E[048B]0001 <1> or word [cs:cpu_regs+REG_FL],100h 246 00005357 2EFF36[048B] <1> push word [cs:cpu_regs+REG_FL] 247 0000535C 2EFF36[E88A] <1> push word [cs:cpu_regs+REG_CS] 248 00005361 2EFF36[008B] <1> push word [cs:cpu_regs+REG_IP] 249 00005366 CF <1> iret 250 <1> @@int_01_entry: 251 00005367 2E8F06[008B] <1> pop word [cs:cpu_regs+REG_IP] 252 0000536C 2E8F06[E88A] <1> pop word [cs:cpu_regs+REG_CS] 253 00005371 2E8F06[048B] <1> pop word [cs:cpu_regs+REG_FL] 254 <1> save_user_regs 49 00005376 2E803E[6E8B]03 <2> cmp byte [cs:system_cpu],3 50 0000537C 7201 <2> jb @@skip_esp 51 0000537E 66 <2> db 66h 52 <2> @@skip_esp: 53 0000537F 2E8926[E48A] <2> mov [cs:cpu_regs+REG_SP],sp 54 00005384 E894FE <2> call _save_user_regs 255 00005387 E80D01 <1> call save_user_port_21_and_reset_to_mine 256 0000538A 8126[048B]FFFE <1> and word [cpu_regs+REG_FL],~100h 257 00005390 E8A801 <1> call restore_01_vector 258 00005393 E8BC03 <1> call clear_breakpoints 259 00005396 FB <1> sti 260 00005397 803E[2C78]00 <1> cmp byte [user_screen_mode],0 261 0000539C 7406 <1> je trace_update 262 0000539E E81CD8 <1> call save_screen 263 000053A1 E84DB4 <1> call draw_cpu_window 264 <1> 265 <1> trace_update: 266 000053A4 E8E3C3 <1> call update_screen 267 000053A7 833E[2A78]FF <1> cmp word [cur_ip_line],-1 268 000053AC 7503 <1> jne @@2 269 000053AE E98DAE <1> jmp go_to_origin 270 <1> @@2: 271 000053B1 A1[2A78] <1> mov ax,[cur_ip_line] 272 000053B4 83F80D <1> cmp ax,CPU_HEIGHT-4 273 000053B7 7706 <1> ja @@adjust 274 <1> @@ok: 275 000053B9 A3[748B] <1> mov [cur_line],ax 276 000053BC E963B6 <1> jmp update_commands 277 <1> @@adjust: 278 000053BF 8B36[2878] <1> mov si,[cur_ip] 279 000053C3 83E806 <1> sub ax,6 280 000053C6 89C1 <1> mov cx,ax 281 <1> @@next: 282 000053C8 E8FADA <1> call unassemble 283 000053CB E2FB <1> loop @@next 284 000053CD 8936[2878] <1> mov [cur_ip],si 285 000053D1 B80600 <1> mov ax,6 286 000053D4 EBE3 <1> jmp @@ok 287 <1> ;============================================================================= 288 <1> ; proc_trace 289 <1> ;----------------------------------------------------------------------------- 290 <1> proc_trace: 291 000053D6 E8A9D9 <1> call check_jump 292 000053D9 7303 <1> jnc @@3 293 000053DB E93FFF <1> jmp single_step 294 <1> @@3: 295 000053DE 31ED <1> xor bp,bp 296 000053E0 A1[E88A] <1> mov ax,[cpu_regs+REG_CS] 297 000053E3 A3[9B8B] <1> mov [unasm_seg],ax 298 000053E6 8B36[008B] <1> mov si,[cpu_regs+REG_IP] 299 000053EA E897C2 <1> call check_break 300 000053ED 7202 <1> jc @@a 301 000053EF 89DD <1> mov bp,bx 302 <1> @@a: 303 000053F1 FA <1> cli 304 000053F2 8EC0 <1> mov es,ax 305 000053F4 E8CEDA <1> call unassemble 306 000053F7 E88AC2 <1> call check_break 307 000053FA 7313 <1> jnc @@ok 308 000053FC BB[088B] <1> mov bx,bp0 309 000053FF E81903 <1> call set_breakpoint 310 00005402 730B <1> jnc @@ok 311 00005404 BE[ED76] <1> mov si,code_not_in_ram 312 00005407 E89BCC <1> call error_message 313 0000540A E82903 <1> call clear_breakpoint 314 0000540D EB95 <1> jmp trace_update 315 <1> @@ok: 316 0000540F B201 <1> mov dl,1 317 00005411 E820D9 <1> call check_swap 318 00005414 803E[812D]00 <1> cmp byte [swap_flag],0 319 00005419 7403 <1> je @@1 320 0000541B E816D8 <1> call restore_screen 321 <1> @@1: 322 0000541E E85501 <1> call set_09_vector 323 00005421 BA[5654] <1> mov dx,@@int_03_entry 324 00005424 E82A01 <1> call set_03_vector 325 00005427 E83D03 <1> call set_breakpoints 326 0000542A 09ED <1> or bp,bp 327 0000542C 7405 <1> jz @@b 328 0000542E 89EB <1> mov bx,bp 329 00005430 E80303 <1> call clear_breakpoint 330 <1> @@b: 331 00005433 A0[838B] <1> mov al,[user_port_21] 332 00005436 24FE <1> and al,11111110b 333 00005438 E621 <1> out 21h,al 334 0000543A C606[028C]00 <1> mov byte [user_port_21_mask_3_only], 0 335 <1> save_act_regs 35 0000543F 8926[6C8B] <2> mov [save_sp],sp 336 <1> restore_user_regs 59 00005443 E83DFE <2> call _restore_user_regs 337 00005446 2EFF36[048B] <1> push word [cs:cpu_regs+REG_FL] 338 0000544B 2EFF36[E88A] <1> push word [cs:cpu_regs+REG_CS] 339 00005450 2EFF36[008B] <1> push word [cs:cpu_regs+REG_IP] 340 00005455 CF <1> iret 341 <1> 342 <1> @@int_03_entry: 343 00005456 2E8F06[008B] <1> pop word [cs:cpu_regs+REG_IP] 344 0000545B 2E8F06[E88A] <1> pop word [cs:cpu_regs+REG_CS] 345 00005460 2E8F06[048B] <1> pop word [cs:cpu_regs+REG_FL] 346 <1> save_user_regs 49 00005465 2E803E[6E8B]03 <2> cmp byte [cs:system_cpu],3 50 0000546B 7201 <2> jb @@skip_esp 51 0000546D 66 <2> db 66h 52 <2> @@skip_esp: 53 0000546E 2E8926[E48A] <2> mov [cs:cpu_regs+REG_SP],sp 54 00005473 E8A5FD <2> call _save_user_regs 347 00005476 A1[008B] <1> mov ax,[cpu_regs+REG_IP] 348 00005479 48 <1> dec ax 349 0000547A A3[008B] <1> mov [cpu_regs+REG_IP],ax 350 0000547D A3[C08A] <1> mov [save_cpu_regs+REG_IP],ax 351 00005480 E8CF02 <1> call clear_breakpoints 352 00005483 E81100 <1> call save_user_port_21_and_reset_to_mine 353 00005486 FB <1> sti 354 <1> @@skip: 355 00005487 803E[2C78]00 <1> cmp byte [user_screen_mode],0 356 0000548C 7406 <1> je @@2 357 0000548E E82CD7 <1> call save_screen 358 00005491 E85DB3 <1> call draw_cpu_window 359 <1> @@2: 360 00005494 E90DFF <1> jmp trace_update 361 <1> 362 <1> save_user_port_21_and_reset_to_mine: 363 00005497 D006[028C] <1> rol byte [user_port_21_mask_3_only], 1 ; from trace ? 364 0000549B 720B <1> jc .trace ; yes --> 365 <1> .proceed: 366 0000549D E421 <1> in al,21h 367 0000549F A2[838B] <1> mov [user_port_21],al ; do int3 reset 368 000054A2 F616[028C] <1> not byte [user_port_21_mask_3_only] ; reset 369 000054A6 EB0D <1> jmp .common 370 <1> .trace: 371 000054A8 E421 <1> in al,21h 372 000054AA 24FC <1> and al,~3 373 000054AC 8026[838B]03 <1> and byte [user_port_21],3 374 000054B1 0806[838B] <1> or [user_port_21],al ; do int1 reset 375 <1> .common: 376 000054B5 A0[828B] <1> mov al,[my_port_21] 377 000054B8 E621 <1> out 21h,al ; set up ours 378 000054BA C3 <1> retn 379 <1> ;============================================================================= 380 <1> ; animate 381 <1> ;----------------------------------------------------------------------------- 382 <1> animate: 383 000054BB E8E0C4 <1> call pushr 384 000054BE BE[F264] <1> mov si,animate_dialog 385 000054C1 E827CE <1> call init_dialog 386 <1> 387 000054C4 C606[F964]00 <1> mov byte [anim_dlg_item],0 388 <1> @@again: 389 000054C9 E880CE <1> call exec_dialog_ 390 000054CC 7457 <1> jz @@exit 391 <1> 392 000054CE E83CAF <1> call get_delay 393 000054D1 C606[F964]00 <1> mov byte [anim_dlg_item],0 394 000054D6 72F1 <1> jc @@again 395 <1> 396 000054D8 E8A6C2 <1> call draw_screen 397 <1> 398 000054DB 833E[207E]00 <1> cmp word [delay_value],0 399 000054E0 7504 <1> jne @@ok 400 000054E2 FF06[207E] <1> inc word [delay_value] 401 <1> @@ok: 402 <1> 403 000054E6 E815BA <1> call display_focus 404 <1> @@loop: 405 000054E9 E831FE <1> call single_step 406 000054EC 1E <1> push ds 407 000054ED 31C0 <1> xor ax,ax 408 000054EF 8ED8 <1> mov ds,ax 409 000054F1 8B1E6C04 <1> mov bx,[46ch] 410 000054F5 8B0E6E04 <1> mov cx,[46eh] 411 000054F9 1F <1> pop ds 412 000054FA 031E[207E] <1> add bx,[delay_value] 413 000054FE 83D100 <1> adc cx,0 414 <1> @@wait: 415 00005501 B401 <1> mov ah,1 416 00005503 CD16 <1> int 16h 417 00005505 7517 <1> jnz @@quit 418 00005507 1E <1> push ds 419 00005508 31C0 <1> xor ax,ax 420 0000550A 8ED8 <1> mov ds,ax 421 0000550C 390E6E04 <1> cmp [46eh],cx 422 00005510 7709 <1> ja @@end 423 00005512 391E6C04 <1> cmp [46ch],bx 424 00005516 7303 <1> jae @@end 425 00005518 1F <1> pop ds 426 00005519 EBE6 <1> jmp @@wait 427 <1> @@end: 428 0000551B 1F <1> pop ds 429 0000551C EBCB <1> jmp @@loop 430 <1> @@quit: 431 0000551E B400 <1> mov ah,0 432 00005520 CD16 <1> int 16h 433 00005522 E8E0B9 <1> call hide_focus 434 <1> @@exit: 435 00005525 E859C2 <1> call draw_screen 436 00005528 E886C4 <1> call popr 437 0000552B C3 <1> ret 438 <1> ;============================================================================= 439 <1> ; set_01_vector 440 <1> ;----------------------------------------------------------------------------- 441 <1> set_01_vector: 442 0000552C BE0400 <1> mov si,1*4 443 0000552F BF[558B] <1> mov di,save_int_01 444 00005532 E8CC0B <1> call set_vector 445 00005535 C606[598B]01 <1> mov byte [int_01_set],1 446 0000553A C3 <1> ret 447 <1> ;============================================================================= 448 <1> ; restore_01_vector 449 <1> ;----------------------------------------------------------------------------- 450 <1> restore_01_vector: 451 0000553B 803E[598B]00 <1> cmp byte [int_01_set],0 452 00005540 740E <1> je @@quit 453 00005542 BE[558B] <1> mov si,save_int_01 454 00005545 BF0400 <1> mov di,1*4 455 00005548 E8C80B <1> call restore_vector 456 0000554B C606[598B]00 <1> mov byte [int_01_set],0 457 <1> @@quit: 458 00005550 C3 <1> ret 459 <1> ;============================================================================= 460 <1> ; set_03_vector 461 <1> ;----------------------------------------------------------------------------- 462 <1> set_03_vector: 463 00005551 BE0C00 <1> mov si,3*4 464 00005554 BF[5A8B] <1> mov di,save_int_03 465 00005557 E8A70B <1> call set_vector 466 0000555A C606[5E8B]01 <1> mov byte [int_03_set],1 467 0000555F C3 <1> ret 468 <1> ;============================================================================= 469 <1> ; restore_03_vector 470 <1> ;----------------------------------------------------------------------------- 471 <1> restore_03_vector: 472 00005560 803E[5E8B]00 <1> cmp byte [int_03_set],0 473 00005565 740E <1> je @@quit 474 00005567 BE[5A8B] <1> mov si,save_int_03 475 0000556A BF0C00 <1> mov di,3*4 476 0000556D E8A30B <1> call restore_vector 477 00005570 C606[5E8B]00 <1> mov byte [int_03_set],0 478 <1> @@quit: 479 00005575 C3 <1> ret 480 <1> ;============================================================================= 481 <1> ; set_09_vector 482 <1> ;----------------------------------------------------------------------------- 483 <1> set_09_vector: 484 00005576 BE2400 <1> mov si,9*4 485 00005579 BF[5F8B] <1> mov di,save_int_09 486 0000557C BA[CE56] <1> mov dx,int_09_handler 487 0000557F E87F0B <1> call set_vector 488 00005582 C606[638B]01 <1> mov byte [int_09_set],1 489 00005587 C3 <1> ret 490 <1> ;============================================================================= 491 <1> ; restore_09_vector 492 <1> ;----------------------------------------------------------------------------- 493 <1> restore_09_vector: 494 00005588 803E[638B]00 <1> cmp byte [int_09_set],0 495 0000558D 740E <1> je @@quit 496 0000558F BE[5F8B] <1> mov si,save_int_09 497 00005592 BF2400 <1> mov di,9*4 498 00005595 E87B0B <1> call restore_vector 499 00005598 C606[638B]00 <1> mov byte [int_09_set],0 500 <1> @@quit: 501 0000559D C3 <1> ret 502 <1> ;============================================================================= 503 <1> ; run_program 504 <1> ;----------------------------------------------------------------------------- 505 <1> run_program: 506 0000559E A1[E88A] <1> mov ax,[cpu_regs+REG_CS] 507 000055A1 A3[9B8B] <1> mov [unasm_seg],ax 508 000055A4 8B36[008B] <1> mov si,[cpu_regs+REG_IP] 509 000055A8 E8D9C0 <1> call check_break 510 000055AB 7203 <1> jc @@a 511 000055AD E86DFD <1> call single_step 512 <1> @@a: 513 000055B0 803E[946C]00 <1> cmp byte [swap_mode],0 514 000055B5 7403 <1> je @@n 515 000055B7 E87AD6 <1> call restore_screen 516 <1> @@n: 517 000055BA FA <1> cli 518 <1> ; call RestoreUserInts 519 000055BB E8A901 <1> call set_breakpoints 520 000055BE E8B5FF <1> call set_09_vector 521 000055C1 BA[7456] <1> mov dx,bp_entry 522 000055C4 E88AFF <1> call set_03_vector 523 000055C7 A0[838B] <1> mov al,[user_port_21] 524 000055CA 24FE <1> and al,11111110b 525 000055CC E621 <1> out 21h,al 526 <1> save_act_regs 35 000055CE 8926[6C8B] <2> mov [save_sp],sp 527 <1> restore_user_regs 59 000055D2 E8AEFC <2> call _restore_user_regs 528 000055D5 2EFF36[048B] <1> push word [cs:cpu_regs+REG_FL] 529 000055DA 2EFF36[E88A] <1> push word [cs:cpu_regs+REG_CS] 530 000055DF 2EFF36[008B] <1> push word [cs:cpu_regs+REG_IP] 531 000055E4 CF <1> iret 532 <1> ;============================================================================= 533 <1> ; go_to_cursor 534 <1> ;----------------------------------------------------------------------------- 535 <1> go_to_cursor: 536 000055E5 BB[088B] <1> mov bx,bp0 537 000055E8 A1[9B8B] <1> mov ax,[unasm_seg] 538 000055EB 8907 <1> mov [bx+BP_SEG],ax 539 000055ED A1[768B] <1> mov ax,[cur_line_ip] 540 000055F0 894702 <1> mov [bx+BP_OFFS],ax 541 000055F3 E873C0 <1> call test_break 542 000055F6 7306 <1> jnc @@ok 543 000055F8 BE[ED76] <1> mov si,code_not_in_ram 544 000055FB E9A7CA <1> jmp error_message 545 <1> @@ok: 546 000055FE FF36[9B8B] <1> push word [unasm_seg] 547 00005602 FF36[768B] <1> push word [cur_line_ip] 548 00005606 A1[E88A] <1> mov ax,[cpu_regs+REG_CS] 549 00005609 3B06[9B8B] <1> cmp ax,[unasm_seg] 550 0000560D 750E <1> jne @@a 551 0000560F A1[768B] <1> mov ax,[cur_line_ip] 552 00005612 3B06[008B] <1> cmp ax,[cpu_regs+REG_IP] 553 00005616 7505 <1> jne @@a 554 00005618 E802FD <1> call single_step 555 0000561B EB12 <1> jmp @@b 556 <1> @@a: 557 0000561D A1[E88A] <1> mov ax,[cpu_regs+REG_CS] 558 00005620 A3[9B8B] <1> mov [unasm_seg],ax 559 00005623 8B36[008B] <1> mov si,[cpu_regs+REG_IP] 560 00005627 E85AC0 <1> call check_break 561 0000562A 7203 <1> jc @@b 562 0000562C E8EEFC <1> call single_step 563 <1> @@b: 564 0000562F 803E[946C]00 <1> cmp byte [swap_mode],0 565 00005634 7403 <1> je @@n1 566 00005636 E8FBD5 <1> call restore_screen 567 <1> @@n1: 568 00005639 FA <1> cli 569 <1> ; call RestoreUserInts 570 0000563A E839FF <1> call set_09_vector 571 0000563D BA[7456] <1> mov dx,@@int_03_entry 572 00005640 E80EFF <1> call set_03_vector 573 00005643 5E <1> pop si 574 00005644 07 <1> pop es 575 00005645 E81F01 <1> call set_breakpoints 576 00005648 8E06[088B] <1> mov es,[bp0+BP_SEG] 577 0000564C 8B36[0A8B] <1> mov si,[bp0+BP_OFFS] 578 00005650 BB[088B] <1> mov bx,bp0 579 00005653 E8C500 <1> call set_breakpoint 580 00005656 A0[838B] <1> mov al,[user_port_21] 581 00005659 24FE <1> and al,11111110b 582 0000565B E621 <1> out 21h,al 583 <1> save_act_regs 35 0000565D 8926[6C8B] <2> mov [save_sp],sp 584 <1> restore_user_regs 59 00005661 E81FFC <2> call _restore_user_regs 585 00005664 2EFF36[048B] <1> push word [cs:cpu_regs+REG_FL] 586 00005669 2EFF36[E88A] <1> push word [cs:cpu_regs+REG_CS] 587 0000566E 2EFF36[008B] <1> push word [cs:cpu_regs+REG_IP] 588 00005673 CF <1> iret 589 <1> @@int_03_entry: 590 <1> bp_entry: 591 00005674 2E8F06[008B] <1> pop word [cs:cpu_regs+REG_IP] 592 00005679 2E8F06[E88A] <1> pop word [cs:cpu_regs+REG_CS] 593 0000567E 2E8F06[048B] <1> pop word [cs:cpu_regs+REG_FL] 594 <1> save_user_regs 49 00005683 2E803E[6E8B]03 <2> cmp byte [cs:system_cpu],3 50 00005689 7201 <2> jb @@skip_esp 51 0000568B 66 <2> db 66h 52 <2> @@skip_esp: 53 0000568C 2E8926[E48A] <2> mov [cs:cpu_regs+REG_SP],sp 54 00005691 E887FB <2> call _save_user_regs 595 <1> ; restore_act_regs 596 00005694 FF0E[008B] <1> dec word [cpu_regs+REG_IP] 597 <1> act_popup: 598 00005698 E8B700 <1> call clear_breakpoints 599 0000569B E421 <1> in al,21h 600 0000569D A2[838B] <1> mov [user_port_21],al 601 000056A0 A0[828B] <1> mov al,[my_port_21] 602 000056A3 E621 <1> out 21h,al 603 000056A5 FB <1> sti 604 000056A6 803E[2C78]00 <1> cmp byte [user_screen_mode],0 605 000056AB 7406 <1> je @@n2 606 000056AD E80DD5 <1> call save_screen 607 000056B0 E83EB1 <1> call draw_cpu_window 608 <1> @@n2: 609 000056B3 E8D4C0 <1> call update_screen 610 000056B6 A1[2A78] <1> mov ax,[cur_ip_line] 611 000056B9 83F8FF <1> cmp ax,-1 612 000056BC 7503 <1> jne @@1 613 000056BE E97DAB <1> jmp go_to_origin 614 <1> @@1: 615 000056C1 3B06[748B] <1> cmp ax,[cur_line] 616 000056C5 7406 <1> je @@quit 617 000056C7 A3[748B] <1> mov [cur_line],ax 618 000056CA E855B3 <1> call update_commands 619 <1> @@quit: 620 000056CD C3 <1> ret 621 <1> ;============================================================================= 622 <1> ; int_09_handler 623 <1> ;----------------------------------------------------------------------------- 624 <1> int_09_handler: 625 000056CE 50 <1> push ax 626 000056CF E460 <1> in al,60h 627 000056D1 3C01 <1> cmp al,SCAN_CODE 628 000056D3 750D <1> jne @@quit 629 000056D5 1E <1> push ds 630 000056D6 31C0 <1> xor ax,ax 631 000056D8 8ED8 <1> mov ds,ax 632 000056DA A01704 <1> mov al,[417h] 633 000056DD A804 <1> test al,SHIFT_CODE 634 000056DF 7507 <1> jnz int_09_execute 635 000056E1 1F <1> pop ds 636 <1> @@quit: 637 000056E2 58 <1> pop ax 638 000056E3 2EFF2E[5F8B] <1> jmp far [cs:save_int_09] 639 <1> int_09_execute: 640 000056E8 E461 <1> in al,61h 641 000056EA 0C80 <1> or al,80h 642 000056EC E661 <1> out 61h,al 643 000056EE 247F <1> and al,7Fh 644 000056F0 E661 <1> out 61h,al 645 000056F2 B020 <1> mov al,20h 646 000056F4 E620 <1> out 20h,al 647 000056F6 1F <1> pop ds 648 000056F7 58 <1> pop ax 649 000056F8 2E8F06[008B] <1> pop word [cs:cpu_regs+REG_IP] 650 000056FD 2E8F06[E88A] <1> pop word [cs:cpu_regs+REG_CS] 651 00005702 2E8F06[048B] <1> pop word [cs:cpu_regs+REG_FL] 652 <1> save_user_regs 49 00005707 2E803E[6E8B]03 <2> cmp byte [cs:system_cpu],3 50 0000570D 7201 <2> jb @@skip_esp 51 0000570F 66 <2> db 66h 52 <2> @@skip_esp: 53 00005710 2E8926[E48A] <2> mov [cs:cpu_regs+REG_SP],sp 54 00005715 E803FB <2> call _save_user_regs 653 <1> ; restore_act_regs 654 00005718 E97DFF <1> jmp act_popup 655 <1> ;============================================================================= 656 <1> ; set_breakpoint 657 <1> ;----------------------------------------------------------------------------- 658 <1> set_breakpoint: 659 0000571B 8C07 <1> mov [bx+BP_SEG],es 660 0000571D 897702 <1> mov [bx+BP_OFFS],si 661 00005720 C6470501 <1> mov byte [bx+BP_SET],1 662 00005724 268A04 <1> mov al,[es:si] 663 00005727 884704 <1> mov [bx+BP_BYTE],al 664 0000572A 26C604CC <1> mov byte [es:si],0cch 665 0000572E 26803CCC <1> cmp byte [es:si],0cch 666 00005732 7401 <1> je @@quit 667 00005734 F9 <1> stc 668 <1> @@quit: 669 00005735 C3 <1> ret 670 <1> ;============================================================================= 671 <1> ; clear_breakpoint 672 <1> ;----------------------------------------------------------------------------- 673 <1> clear_breakpoint: 674 00005736 807F0500 <1> cmp byte [bx+BP_SET],0 675 0000573A 7415 <1> je @@quit 676 0000573C 50 <1> push ax 677 0000573D 56 <1> push si 678 0000573E 06 <1> push es 679 0000573F 8E07 <1> mov es,[bx+BP_SEG] 680 00005741 8B7702 <1> mov si,[bx+BP_OFFS] 681 00005744 8A4704 <1> mov al,[bx+BP_BYTE] 682 00005747 268804 <1> mov [es:si],al 683 0000574A C6470500 <1> mov byte [bx+BP_SET],0 684 0000574E 07 <1> pop es 685 0000574F 5E <1> pop si 686 00005750 58 <1> pop ax 687 <1> @@quit: 688 00005751 C3 <1> ret 689 <1> ;============================================================================= 690 <1> ; clear_breakpoints 691 <1> ;----------------------------------------------------------------------------- 692 <1> clear_breakpoints: 693 00005752 E80BFE <1> call restore_03_vector 694 00005755 E830FE <1> call restore_09_vector 695 00005758 BB[088B] <1> mov bx,bp0 696 0000575B B90B00 <1> mov cx,MAX_BREAKPOINTS+1 697 <1> 698 <1> @@next_bp: 699 0000575E E8D5FF <1> call clear_breakpoint 700 00005761 83C307 <1> add bx,SIZEOF_BREAKPOINT 701 00005764 E2F8 <1> loop @@next_bp 702 00005766 C3 <1> ret 703 <1> ;============================================================================= 704 <1> ; set_breakpoints 705 <1> ;----------------------------------------------------------------------------- 706 <1> set_breakpoints: 707 00005767 53 <1> push bx 708 00005768 51 <1> push cx 709 00005769 56 <1> push si 710 0000576A 06 <1> push es 711 0000576B BB[0F8B] <1> mov bx,bp1 712 0000576E B90A00 <1> mov cx,MAX_BREAKPOINTS 713 <1> @@next_bp: 714 00005771 807F0600 <1> cmp byte [bx+BP_ACTIVE],BP_UNUSED 715 00005775 740E <1> je @@skip 716 00005777 807F0602 <1> cmp byte [bx+BP_ACTIVE],BP_DISABLED 717 0000577B 7408 <1> je @@skip 718 0000577D 8E07 <1> mov es,[bx+BP_SEG] 719 0000577F 8B7702 <1> mov si,[bx+BP_OFFS] 720 00005782 E896FF <1> call set_breakpoint 721 <1> @@skip: 722 00005785 83C307 <1> add bx,SIZEOF_BREAKPOINT 723 00005788 E2E7 <1> loop @@next_bp 724 0000578A 07 <1> pop es 725 0000578B 5E <1> pop si 726 0000578C 59 <1> pop cx 727 0000578D 5B <1> pop bx 728 0000578E C3 <1> ret 729 <1> ;============================================================================= 730 <1> ; emulate 731 <1> ;----------------------------------------------------------------------------- 732 <1> emulate: 733 0000578F FC <1> cld 734 00005790 1E <1> push ds 735 00005791 06 <1> push es 736 00005792 8B36[008B] <1> mov si,[cpu_regs+REG_IP] 737 00005796 8E06[E88A] <1> mov es,[cpu_regs+REG_CS] 738 0000579A BB[BC2D] <1> mov bx,inst_desc 739 <1> @@next_byte: 740 0000579D 26AC <1> es lodsb 741 0000579F D7 <1> xlat 742 000057A0 A840 <1> test al,S_PREFIX 743 000057A2 75F9 <1> jnz @@next_byte 744 000057A4 A810 <1> test al,S_EM 745 000057A6 7503 <1> jnz @@emulate 746 <1> @@quit: 747 000057A8 07 <1> pop es 748 000057A9 1F <1> pop ds 749 000057AA C3 <1> ret 750 <1> @@emulate: 751 000057AB 268A44FF <1> mov al,[es:si-1] 752 000057AF 3CCD <1> cmp al,0cdh 753 000057B1 7449 <1> je @@int 754 000057B3 3CCE <1> cmp al,0ceh 755 000057B5 743A <1> je @@into 756 000057B7 3C9C <1> cmp al,9ch 757 000057B9 740B <1> je @@pushf 758 000057BB 3C9D <1> cmp al,9dh 759 000057BD 7412 <1> je @@popf 760 000057BF 3CCF <1> cmp al,0cfh 761 000057C1 7419 <1> je @@iret 762 000057C3 F8 <1> clc 763 000057C4 EBE2 <1> jmp @@quit 764 <1> @@pushf: 765 000057C6 A1[048B] <1> mov ax,[cpu_regs+REG_FL] 766 000057C9 25FFFE <1> and ax,~100h 767 000057CC E86C00 <1> call user_push 768 000057CF EB62 <1> jmp @@skip 769 <1> @@popf: 770 000057D1 E87B00 <1> call user_pop 771 000057D4 25FFFE <1> and ax,~100h 772 000057D7 A3[048B] <1> mov [cpu_regs+REG_FL],ax 773 000057DA EB57 <1> jmp @@skip 774 <1> @@iret: 775 000057DC E87000 <1> call user_pop 776 000057DF A3[008B] <1> mov [cpu_regs+REG_IP],ax 777 000057E2 E86A00 <1> call user_pop 778 000057E5 A3[E88A] <1> mov [cpu_regs+REG_CS],ax 779 000057E8 E86400 <1> call user_pop 780 000057EB A3[048B] <1> mov [cpu_regs+REG_FL],ax 781 000057EE F9 <1> stc 782 000057EF EBB7 <1> jmp @@quit 783 <1> @@into: 784 000057F1 F606[058B]08 <1> test byte [cpu_regs+REG_FL+1],00001000b 785 000057F6 743B <1> jz @@skip 786 000057F8 B004 <1> mov al,4 787 000057FA EB02 <1> jmp @@int_n 788 <1> @@int: 789 000057FC 26AC <1> es lodsb 790 <1> @@int_n: 791 000057FE 50 <1> push ax 792 000057FF A1[048B] <1> mov ax,[cpu_regs+REG_FL] 793 00005802 25FFFE <1> and ax,~100h 794 00005805 E83300 <1> call user_push 795 00005808 25FFFD <1> and ax,~200h 796 0000580B A3[048B] <1> mov [cpu_regs+REG_FL],ax 797 0000580E 8CC0 <1> mov ax,es 798 00005810 E82800 <1> call user_push 799 00005813 89F0 <1> mov ax,si 800 00005815 E82300 <1> call user_push 801 00005818 58 <1> pop ax 802 00005819 B400 <1> mov ah,0 803 0000581B D1E0 <1> shl ax,1 804 0000581D D1E0 <1> shl ax,1 805 0000581F 89C6 <1> mov si,ax 806 00005821 31C0 <1> xor ax,ax 807 00005823 8ED8 <1> mov ds,ax 808 00005825 AD <1> lodsw 809 00005826 2EA3[008B] <1> mov [cs:cpu_regs+REG_IP],ax 810 0000582A AD <1> lodsw 811 0000582B 2EA3[E88A] <1> mov [cs:cpu_regs+REG_CS],ax 812 0000582F F9 <1> stc 813 00005830 E975FF <1> jmp @@quit 814 <1> @@skip: 815 00005833 8936[008B] <1> mov [cpu_regs+REG_IP],si 816 00005837 F9 <1> stc 817 00005838 E96DFF <1> jmp @@quit 818 <1> ;============================================================================= 819 <1> ; user_push 820 <1> ;----------------------------------------------------------------------------- 821 <1> user_push: 822 0000583B 53 <1> push bx 823 0000583C 1E <1> push ds 824 0000583D 832E[E48A]02 <1> sub word [cpu_regs+REG_SP],2 825 00005842 8B1E[E48A] <1> mov bx,[cpu_regs+REG_SP] 826 00005846 8E1E[F48A] <1> mov ds,[cpu_regs+REG_SS] 827 0000584A 8907 <1> mov [bx],ax 828 0000584C 1F <1> pop ds 829 0000584D 5B <1> pop bx 830 0000584E C3 <1> ret 831 <1> ;============================================================================= 832 <1> ; user_pop 833 <1> ;----------------------------------------------------------------------------- 834 <1> user_pop: 835 0000584F 53 <1> push bx 836 00005850 1E <1> push ds 837 00005851 8B1E[E48A] <1> mov bx,[cpu_regs+REG_SP] 838 00005855 8306[E48A]02 <1> add word [cpu_regs+REG_SP],2 839 0000585A 8E1E[F48A] <1> mov ds,[cpu_regs+REG_SS] 840 0000585E 8B07 <1> mov ax,[bx] 841 00005860 1F <1> pop ds 842 00005861 5B <1> pop bx 843 00005862 C3 <1> ret 844 <1> ;------------------------------------------------------------------------------ 845 <1> 846 <1> 847 <1> ;============================================================================= 848 <1> ; E0F 849 <1> ;============================================================================= 850 <1> 851 <1> 65 66 %include "follow.inc" ; 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; follow.inc 7 <1> ; ... 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; dump_reference 28 <1> ;----------------------------------------------------------------------------- 29 <1> dump_reference: 30 00005863 E85D02 <1> call unasm_cur_line 31 00005866 803E[7A8B]00 <1> cmp byte [memory_flag],0 32 0000586B 7408 <1> je @@exit 33 0000586D E8A7B3 <1> call calc_mem_address 34 00005870 56 <1> push si 35 00005871 52 <1> push dx 36 00005872 E87800 <1> call update_dump_window 37 <1> @@exit: 38 00005875 F8 <1> clc 39 00005876 C3 <1> ret 40 <1> ;============================================================================= 41 <1> ; dump_cur_line 42 <1> ;----------------------------------------------------------------------------- 43 <1> dump_cur_line: 44 00005877 FF36[768B] <1> push word [cur_line_ip] 45 0000587B FF36[9B8B] <1> push word [unasm_seg] 46 0000587F E86B00 <1> call update_dump_window 47 <1> ;============================================================================= 48 <1> ; dump_user_screen 49 <1> ;----------------------------------------------------------------------------- 50 <1> dump_user_screen: 51 00005882 B8[F395] <1> mov ax,old_screen 52 00005885 50 <1> push ax 53 00005886 0E <1> push cs 54 00005887 E86300 <1> call update_dump_window 55 <1> ;============================================================================= 56 <1> ; dump_esdi 57 <1> ;----------------------------------------------------------------------------- 58 <1> dump_esdi: 59 0000588A FF36[DC8A] <1> push word [cpu_regs+REG_DI] 60 0000588E FF36[F08A] <1> push word [cpu_regs+REG_ES] 61 00005892 E85800 <1> call update_dump_window 62 <1> ;============================================================================= 63 <1> ; dump_dssi 64 <1> ;----------------------------------------------------------------------------- 65 <1> dump_dssi: 66 00005895 FF36[D88A] <1> push word [cpu_regs+REG_SI] 67 00005899 FF36[EC8A] <1> push word [cpu_regs+REG_DS] 68 0000589D E84D00 <1> call update_dump_window 69 <1> ;============================================================================= 70 <1> ; dump_esbx 71 <1> ;----------------------------------------------------------------------------- 72 <1> dump_esbx: 73 000058A0 FF36[CC8A] <1> push word [cpu_regs+REG_BX] 74 000058A4 FF36[F08A] <1> push word [cpu_regs+REG_ES] 75 000058A8 E84200 <1> call update_dump_window 76 <1> ;============================================================================= 77 <1> ; dump_ssbp 78 <1> ;----------------------------------------------------------------------------- 79 <1> dump_ssbp: 80 000058AB FF36[E08A] <1> push word [cpu_regs+REG_BP] 81 000058AF FF36[F48A] <1> push word [cpu_regs+REG_SS] 82 000058B3 E83700 <1> call update_dump_window 83 <1> ;============================================================================= 84 <1> ; dump_dxax 85 <1> ;----------------------------------------------------------------------------- 86 <1> dump_dxax: 87 000058B6 FF36[C88A] <1> push word [cpu_regs+REG_AX] 88 000058BA FF36[D48A] <1> push word [cpu_regs+REG_DX] 89 000058BE E82C00 <1> call update_dump_window 90 <1> ;============================================================================= 91 <1> ; dump_dsdx 92 <1> ;----------------------------------------------------------------------------- 93 <1> dump_dsdx: 94 000058C1 FF36[D48A] <1> push word [cpu_regs+REG_DX] 95 000058C5 FF36[EC8A] <1> push word [cpu_regs+REG_DS] 96 000058C9 E82100 <1> call update_dump_window 97 <1> ;============================================================================= 98 <1> ; dump_essi 99 <1> ;----------------------------------------------------------------------------- 100 <1> dump_essi: 101 000058CC FF36[D88A] <1> push word [cpu_regs+REG_SI] 102 000058D0 FF36[F08A] <1> push word [cpu_regs+REG_ES] 103 000058D4 E81600 <1> call update_dump_window 104 <1> ;============================================================================= 105 <1> ; dump_dsdi 106 <1> ;----------------------------------------------------------------------------- 107 <1> dump_dsdi: 108 000058D7 FF36[DC8A] <1> push word [cpu_regs+REG_DI] 109 000058DB FF36[EC8A] <1> push word [cpu_regs+REG_DS] 110 000058DF E80B00 <1> call update_dump_window 111 <1> ;============================================================================= 112 <1> ; dump_csip 113 <1> ;----------------------------------------------------------------------------- 114 <1> dump_csip: 115 000058E2 FF36[008B] <1> push word [cpu_regs+REG_IP] 116 000058E6 FF36[E88A] <1> push word [cpu_regs+REG_CS] 117 000058EA E80000 <1> call update_dump_window 118 <1> ;============================================================================= 119 <1> ; update_dump_window 120 <1> ;----------------------------------------------------------------------------- 121 <1> update_dump_window: 122 000058ED 8F06[C28B] <1> pop word [dump_proc] 123 000058F1 8F06[BE8B] <1> pop word [new_dump_seg] 124 000058F5 8F06[C08B] <1> pop word [new_dump_offs] 125 <1> 126 000058F9 E8A2C0 <1> call pushr 127 <1> 128 000058FC A1[C28B] <1> mov ax,[dump_proc] 129 000058FF BB0B00 <1> mov bx,update_dump_window-dump_csip 130 00005902 29D8 <1> sub ax,bx 131 00005904 3D[8A58] <1> cmp ax,dump_esdi 132 00005907 7212 <1> jb @@set_dump 133 00005909 A3[AC8B] <1> mov [data_watch_temp],ax 134 0000590C 2D[8A58] <1> sub ax,dump_esdi 135 0000590F F6F3 <1> div bl 136 00005911 B304 <1> mov bl,4 137 00005913 F6E3 <1> mul bl 138 00005915 05[AC77] <1> add ax,data_watch_labels 139 00005918 A3[AE8B] <1> mov [data_watch_label],ax 140 <1> 141 <1> @@set_dump: 142 0000591B A1[C08B] <1> mov ax,[new_dump_offs] 143 0000591E 8B16[BE8B] <1> mov dx,[new_dump_seg] 144 <1> 145 <1> ; cmp dump_offs,ax 146 <1> ; jne @@UpdateDump 147 <1> ; cmp dump_seg,dx 148 <1> ; je @@Exit 149 <1> 150 <1> @@update_dump: 151 00005922 A3[BC8B] <1> mov [dump_offs],ax 152 00005925 8916[BA8B] <1> mov [dump_seg],dx 153 00005929 E80CB4 <1> call update_dump 154 <1> 155 <1> @@exit: 156 0000592C E882C0 <1> call popr 157 0000592F F8 <1> clc 158 00005930 C3 <1> ret 159 <1> ;============================================================================= 160 <1> ; set_code_mark_[0-9] 161 <1> ;----------------------------------------------------------------------------- 162 <1> set_code_mark_0: 163 00005931 E81B00 <1> call set_code_mark 164 <1> 165 <1> set_code_mark_1: 166 00005934 E81800 <1> call set_code_mark 167 <1> 168 <1> set_code_mark_2: 169 00005937 E81500 <1> call set_code_mark 170 <1> 171 <1> set_code_mark_3: 172 0000593A E81200 <1> call set_code_mark 173 <1> 174 <1> set_code_mark_4: 175 0000593D E80F00 <1> call set_code_mark 176 <1> 177 <1> set_code_mark_5: 178 00005940 E80C00 <1> call set_code_mark 179 <1> 180 <1> set_code_mark_6: 181 00005943 E80900 <1> call set_code_mark 182 <1> 183 <1> set_code_mark_7: 184 00005946 E80600 <1> call set_code_mark 185 <1> 186 <1> set_code_mark_8: 187 00005949 E80300 <1> call set_code_mark 188 <1> 189 <1> set_code_mark_9: 190 0000594C E80000 <1> call set_code_mark 191 <1> ;============================================================================= 192 <1> ; set_code_mark 193 <1> ;----------------------------------------------------------------------------- 194 <1> set_code_mark: 195 0000594F 5F <1> pop di 196 00005950 BB[3459] <1> mov bx,set_code_mark_1 197 00005953 E8A800 <1> call find_code_mark 198 00005956 0906[888B] <1> or [code_mark_exist],ax 199 0000595A E80AC2 <1> call check_shift 200 0000595D 7513 <1> jnz @@set_data_mark 201 <1> 202 0000595F A1[748B] <1> mov ax,[cur_line] 203 00005962 AB <1> stosw 204 00005963 A1[2878] <1> mov ax,[cur_ip] 205 00005966 AB <1> stosw 206 00005967 A1[9B8B] <1> mov ax,[unasm_seg] 207 0000596A AB <1> stosw 208 0000596B A1[768B] <1> mov ax,[cur_line_ip] 209 0000596E AB <1> stosw 210 0000596F E9B0B0 <1> jmp update_commands 211 <1> 212 <1> @@set_data_mark: 213 00005972 B8FFFF <1> mov ax,-1 214 00005975 AB <1> stosw 215 00005976 A1[BC8B] <1> mov ax,[dump_offs] 216 00005979 AB <1> stosw 217 0000597A A1[BA8B] <1> mov ax,[dump_seg] 218 0000597D AB <1> stosw 219 0000597E E9A1B0 <1> jmp update_commands 220 <1> ;============================================================================= 221 <1> ; clear_code_mark_[0-9] 222 <1> ;----------------------------------------------------------------------------- 223 <1> clear_code_mark_0: 224 00005981 E81B00 <1> call clear_code_mark 225 <1> 226 <1> clear_code_mark_1: 227 00005984 E81800 <1> call clear_code_mark 228 <1> 229 <1> clear_code_mark_2: 230 00005987 E81500 <1> call clear_code_mark 231 <1> 232 <1> clear_code_mark_3: 233 0000598A E81200 <1> call clear_code_mark 234 <1> 235 <1> clear_code_mark_4: 236 0000598D E80F00 <1> call clear_code_mark 237 <1> 238 <1> clear_code_mark_5: 239 00005990 E80C00 <1> call clear_code_mark 240 <1> 241 <1> clear_code_mark_6: 242 00005993 E80900 <1> call clear_code_mark 243 <1> 244 <1> clear_code_mark_7: 245 00005996 E80600 <1> call clear_code_mark 246 <1> 247 <1> clear_code_mark_8: 248 00005999 E80300 <1> call clear_code_mark 249 <1> 250 <1> clear_code_mark_9: 251 0000599C E80000 <1> call clear_code_mark 252 <1> ;============================================================================= 253 <1> ; clear_code_mark 254 <1> ;----------------------------------------------------------------------------- 255 <1> clear_code_mark: 256 0000599F 5F <1> pop di 257 000059A0 BB[8459] <1> mov bx,clear_code_mark_1 258 000059A3 E85800 <1> call find_code_mark 259 000059A6 89FE <1> mov si,di 260 000059A8 7430 <1> jz jump_beep_return 261 000059AA F7D0 <1> not ax 262 000059AC 2106[888B] <1> and [code_mark_exist],ax 263 000059B0 E96FB0 <1> jmp update_commands 264 <1> ;============================================================================= 265 <1> ; code_mark_[0-9] 266 <1> ;----------------------------------------------------------------------------- 267 <1> code_mark_0: 268 000059B3 E81B00 <1> call code_mark 269 <1> 270 <1> code_mark_1: 271 000059B6 E81800 <1> call code_mark 272 <1> 273 <1> code_mark_2: 274 000059B9 E81500 <1> call code_mark 275 <1> 276 <1> code_mark_3: 277 000059BC E81200 <1> call code_mark 278 <1> 279 <1> code_mark_4: 280 000059BF E80F00 <1> call code_mark 281 <1> 282 <1> code_mark_5: 283 000059C2 E80C00 <1> call code_mark 284 <1> 285 <1> code_mark_6: 286 000059C5 E80900 <1> call code_mark 287 <1> 288 <1> code_mark_7: 289 000059C8 E80600 <1> call code_mark 290 <1> 291 <1> code_mark_8: 292 000059CB E80300 <1> call code_mark 293 <1> 294 <1> code_mark_9: 295 000059CE E80000 <1> call code_mark 296 <1> ;============================================================================= 297 <1> ; code_mark 298 <1> ;----------------------------------------------------------------------------- 299 <1> code_mark: 300 000059D1 5F <1> pop di 301 000059D2 BB[B659] <1> mov bx,code_mark_1 302 000059D5 E82600 <1> call find_code_mark 303 000059D8 89FE <1> mov si,di 304 <1> 305 <1> jump_beep_return: 306 000059DA 747E <1> jz beep_return 307 <1> 308 000059DC AD <1> lodsw 309 000059DD 83F8FF <1> cmp ax,0ffffh 310 000059E0 7411 <1> je @@set_dump_pos 311 <1> 312 000059E2 E87800 <1> call push_unasm_pos 313 <1> 314 000059E5 A3[748B] <1> mov [cur_line],ax 315 000059E8 AD <1> lodsw 316 000059E9 A3[2878] <1> mov [cur_ip],ax 317 000059EC AD <1> lodsw 318 000059ED A3[9B8B] <1> mov [unasm_seg],ax 319 000059F0 E92FB0 <1> jmp update_commands 320 <1> 321 <1> @@set_dump_pos: 322 000059F3 AD <1> lodsw 323 000059F4 A3[BC8B] <1> mov [dump_offs],ax 324 000059F7 AD <1> lodsw 325 000059F8 A3[BA8B] <1> mov [dump_seg],ax 326 000059FB E93AB3 <1> jmp update_dump 327 <1> ;============================================================================= 328 <1> ; find_code_mark 329 <1> ;----------------------------------------------------------------------------- 330 <1> find_code_mark: 331 000059FE 29DF <1> sub di,bx 332 00005A00 97 <1> xchg ax,di 333 00005A01 B303 <1> mov bl,3 334 00005A03 F6F3 <1> div bl 335 00005A05 89C7 <1> mov di,ax 336 00005A07 D1E7 <1> shl di,1 337 00005A09 D1E7 <1> shl di,1 338 00005A0B D1E7 <1> shl di,1 339 00005A0D 81C7[368A] <1> add di,code_mark_buff 340 00005A11 91 <1> xchg ax,cx 341 00005A12 B80100 <1> mov ax,1 342 00005A15 D3E0 <1> shl ax,cl 343 00005A17 8506[888B] <1> test [code_mark_exist],ax 344 00005A1B FC <1> cld 345 00005A1C C3 <1> ret 346 <1> ;============================================================================= 347 <1> ; follow 348 <1> ;----------------------------------------------------------------------------- 349 <1> follow: 350 00005A1D F606[4878]01 <1> test byte [ref_flags],RF_FOLLOW 351 00005A22 7436 <1> jz beep_return 352 <1> 353 00005A24 E83600 <1> call push_unasm_pos 354 <1> 355 00005A27 A1[A88B] <1> mov ax,[follow_seg] 356 00005A2A A3[9B8B] <1> mov [unasm_seg],ax 357 00005A2D A1[A68B] <1> mov ax,[follow_offs] 358 00005A30 A3[2878] <1> mov [cur_ip],ax 359 00005A33 C706[748B]0000 <1> mov word [cur_line],0 360 00005A39 E9E6AF <1> jmp update_commands 361 <1> ;============================================================================= 362 <1> ; previous 363 <1> ;----------------------------------------------------------------------------- 364 <1> previous: 365 00005A3C FC <1> cld 366 00005A3D 8B36[2278] <1> mov si,[follow_stack_ptr] 367 00005A41 81FE[3687] <1> cmp si,follow_stack ;??? offset 368 00005A45 7313 <1> jae beep_return 369 00005A47 AD <1> lodsw 370 00005A48 A3[748B] <1> mov [cur_line],ax 371 00005A4B AD <1> lodsw 372 00005A4C A3[2878] <1> mov [cur_ip],ax 373 00005A4F AD <1> lodsw 374 00005A50 A3[9B8B] <1> mov [unasm_seg],ax 375 00005A53 8936[2278] <1> mov [follow_stack_ptr],si 376 00005A57 E9C8AF <1> jmp update_commands 377 <1> 378 <1> beep_return: 379 00005A5A E917C0 <1> jmp beep 380 <1> ;============================================================================= 381 <1> ; push_unasm_pos 382 <1> ;----------------------------------------------------------------------------- 383 <1> push_unasm_pos: 384 00005A5D 50 <1> push ax 385 00005A5E 56 <1> push si 386 00005A5F 8B36[2278] <1> mov si,[follow_stack_ptr] 387 00005A63 81FE[467F] <1> cmp si,follow_stack_btm 388 00005A67 761F <1> jbe @@stack_full 389 00005A69 83EE02 <1> sub si,2 390 00005A6C A1[9B8B] <1> mov ax,[unasm_seg] 391 00005A6F 8904 <1> mov [si],ax 392 00005A71 83EE02 <1> sub si,2 393 00005A74 A1[2878] <1> mov ax,[cur_ip] 394 00005A77 8904 <1> mov [si],ax 395 00005A79 83EE02 <1> sub si,2 396 00005A7C A1[748B] <1> mov ax,[cur_line] 397 00005A7F 8904 <1> mov [si],ax 398 00005A81 8936[2278] <1> mov [follow_stack_ptr],si 399 <1> @@exit: 400 00005A85 5E <1> pop si 401 00005A86 58 <1> pop ax 402 00005A87 C3 <1> ret 403 <1> 404 <1> @@stack_full: 405 00005A88 E8E9BF <1> call beep 406 00005A8B EBF8 <1> jmp @@exit 407 <1> ;============================================================================= 408 <1> ; check_shared_area 409 <1> ;----------------------------------------------------------------------------- 410 <1> check_shared_area: 411 00005A8D 56 <1> push si 412 00005A8E 8B36[E67E] <1> mov si,[buf_pos_mark] 413 00005A92 C706[E67E][467F] <1> mov word [buf_pos_mark],window_buffer 414 00005A98 EB01 <1> jmp ..@check_code_mark 415 <1> 416 <1> _check_shared_area: 417 00005A9A 56 <1> push si 418 <1> 419 <1> ..@check_code_mark: 420 00005A9B 81FE[368A] <1> cmp si,code_mark_buff 421 00005A9F 760E <1> jbe @@check_stack 422 00005AA1 C706[888B]0000 <1> mov word [code_mark_exist],0 423 00005AA7 BE[1B77] <1> mov si,code_mark_msg 424 00005AAA E8F8C5 <1> call error_message 425 00005AAD EB0C <1> jmp @@exit_2 426 <1> 427 <1> @@check_stack: 428 00005AAF 3B36[2278] <1> cmp si,[follow_stack_ptr] 429 00005AB3 760C <1> jbe @@exit_1 430 00005AB5 BE[2A77] <1> mov si,follow_stack_msg 431 00005AB8 E8FCC5 <1> call message_box 432 <1> 433 <1> @@exit_2: 434 00005ABB C706[2278][3687] <1> mov word [follow_stack_ptr],follow_stack 435 <1> 436 <1> @@exit_1: 437 00005AC1 5E <1> pop si 438 00005AC2 C3 <1> ret 439 <1> ;============================================================================= 440 <1> ; unasm_cur_line 441 <1> ;----------------------------------------------------------------------------- 442 <1> unasm_cur_line: 443 00005AC3 56 <1> push si 444 00005AC4 55 <1> push bp 445 00005AC5 8B36[2878] <1> mov si,[cur_ip] 446 00005AC9 31ED <1> xor bp,bp 447 <1> @@next_cpu_line: 448 00005ACB E8F7D3 <1> call unassemble 449 00005ACE 45 <1> inc bp 450 00005ACF 3B2E[748B] <1> cmp bp,[cur_line] 451 00005AD3 76F6 <1> jbe @@next_cpu_line 452 00005AD5 5D <1> pop bp 453 00005AD6 5E <1> pop si 454 00005AD7 C3 <1> ret 455 <1> ;============================================================================= 456 <1> ; find_first_byte 457 <1> ;----------------------------------------------------------------------------- 458 <1> find_first_byte: 459 <1> 460 00005AD8 31C9 <1> xor cx,cx 461 <1> @@next_byte: 462 00005ADA 26AC <1> es lodsb 463 <1> 464 00005ADC B220 <1> mov dl,RF_PREFIX 465 00005ADE 3C26 <1> cmp al,26h 466 00005AE0 7429 <1> je @@next 467 00005AE2 3C36 <1> cmp al,36h 468 00005AE4 7425 <1> je @@next 469 00005AE6 3C2E <1> cmp al,2Eh 470 00005AE8 7421 <1> je @@next 471 00005AEA 3C3E <1> cmp al,3Eh 472 00005AEC 741D <1> je @@next 473 <1> 474 00005AEE 3C64 <1> cmp al,64h 475 00005AF0 740E <1> je @@check_cpu 476 00005AF2 3C65 <1> cmp al,65h 477 00005AF4 740A <1> je @@check_cpu 478 00005AF6 3C67 <1> cmp al,67h 479 00005AF8 7406 <1> je @@check_cpu 480 00005AFA 3C66 <1> cmp al,66h 481 00005AFC 7511 <1> jne @@normal_exit 482 00005AFE B240 <1> mov dl,RF_ADDRESS_32 483 <1> 484 <1> @@check_cpu: 485 00005B00 803E[C42E]72 <1> cmp byte [cpu_type],a386 486 00005B05 7209 <1> jb @@exit 487 00005B07 0816[4878] <1> or [ref_flags],dl 488 <1> 489 <1> @@next: 490 00005B0B E2CD <1> loop @@next_byte 491 00005B0D F9 <1> stc 492 00005B0E C3 <1> ret 493 <1> 494 <1> @@normal_exit: 495 00005B0F F8 <1> clc 496 <1> @@exit: 497 00005B10 C3 <1> ret 498 <1> ;============================================================================= 499 <1> ; get_ref_addresses 500 <1> ;----------------------------------------------------------------------------- 501 <1> get_ref_addresses: 502 00005B11 E88ABE <1> call pushr 503 <1> 504 00005B14 8026[4878]01 <1> and byte [ref_flags],RF_FOLLOW 505 00005B19 89DE <1> mov si,bx 506 00005B1B 89DD <1> mov bp,bx 507 00005B1D 8E06[9B8B] <1> mov es,[unasm_seg] 508 00005B21 BF[DE5C] <1> mov di,@@follow_table - 2 509 <1> 510 00005B24 FC <1> cld 511 <1> 512 <1> @@command: 513 00005B25 E8B0FF <1> call find_first_byte 514 00005B28 723D <1> jc @@jump_to_error_exit 515 <1> 516 00005B2A 3CFF <1> cmp al,0ffh ;call/jmp mem/reg 517 00005B2C 7424 <1> je @@ref_jump 518 <1> 519 00005B2E F606[4878]20 <1> test byte [ref_flags],RF_PREFIX 520 00005B33 7574 <1> jnz @@error_exit 521 <1> 522 00005B35 3C70 <1> cmp al,70h 523 00005B37 7204 <1> jb @@next 524 00005B39 3C7F <1> cmp al,7fh 525 00005B3B 767B <1> jbe @@short_condit_jump 526 <1> 527 <1> @@next: 528 00005B3D AF <1> scasw ;add di,2 529 00005B3E 803D00 <1> cmp byte [di],0 530 00005B41 7466 <1> je @@error_exit 531 00005B43 3805 <1> cmp byte [di],al 532 00005B45 75F6 <1> jne @@next 533 00005B47 8A5D01 <1> mov bl,[di+1] 534 00005B4A B700 <1> mov bh,0 535 00005B4C 8D9F[525B] <1> lea bx,[@@first_jump+bx] 536 00005B50 FFE3 <1> jmp bx 537 <1> 538 <1> @@first_jump: 539 <1> 540 <1> @@ref_jump: 541 00005B52 F606[4878]C0 <1> test byte [ref_flags],RF_32 542 00005B57 7550 <1> jnz @@error_exit 543 00005B59 26AC <1> es lodsb 544 00005B5B 88C3 <1> mov bl,al 545 00005B5D B103 <1> mov cl,3 546 00005B5F D2E8 <1> shr al,cl 547 00005B61 88C4 <1> mov ah,al 548 00005B63 2407 <1> and al,111b 549 00005B65 3C02 <1> cmp al,010b 550 <1> 551 <1> @@jump_to_error_exit: 552 00005B67 7240 <1> jb @@error_exit 553 00005B69 3C05 <1> cmp al,101b 554 00005B6B 773C <1> ja @@error_exit 555 00005B6D 3C03 <1> cmp al,011b 556 00005B6F 7703 <1> ja @@ref_call 557 00005B71 BF[F05C] <1> mov di,@@last_jump 558 <1> 559 <1> @@ref_call: 560 00005B74 D2EC <1> shr ah,cl 561 00005B76 80FC03 <1> cmp ah,11b 562 00005B79 7410 <1> je @@reg_ref 563 00005B7B E899B0 <1> call calc_mem_address 564 00005B7E 8EC2 <1> mov es,dx 565 00005B80 803E[7A8B]03 <1> cmp byte [memory_flag],3 566 00005B85 7475 <1> je @@far_jump 567 00005B87 26AD <1> es lodsw 568 00005B89 EB6B <1> jmp @@set_cur_seg 569 <1> 570 <1> @@reg_ref: 571 00005B8B 83E307 <1> and bx,111b 572 00005B8E D1E3 <1> shl bx,1 573 00005B90 8B9F[195D] <1> mov bx,[reg_offs_table+bx] 574 00005B94 8B07 <1> mov ax,[bx] 575 00005B96 EB5E <1> jmp @@set_cur_seg 576 <1> 577 <1> @@condit_jump: 578 00005B98 803E[C42E]72 <1> cmp byte [cpu_type],a386 579 00005B9D 720A <1> jb @@error_exit 580 00005B9F 26AC <1> es lodsb 581 00005BA1 3C80 <1> cmp al,80h 582 00005BA3 7204 <1> jb @@error_exit 583 00005BA5 3C8F <1> cmp al,8Fh 584 00005BA7 7646 <1> jbe @@near_condit_jump 585 <1> 586 <1> @@error_exit: 587 00005BA9 3B2E[768B] <1> cmp bp,[cur_line_ip] 588 00005BAD 7505 <1> jne @@exit 589 00005BAF 8026[4878]FE <1> and byte [ref_flags],~RF_FOLLOW 590 <1> 591 <1> @@exit: 592 00005BB4 E8FABD <1> call popr 593 00005BB7 C3 <1> ret 594 <1> 595 <1> @@short_condit_jump: 596 00005BB8 E88F00 <1> call @@set_condition 597 <1> 598 <1> @@short_jump: 599 00005BBB 31C0 <1> xor ax,ax 600 00005BBD 26AC <1> es lodsb 601 00005BBF 98 <1> cbw 602 00005BC0 EB32 <1> jmp @@near_jump_ 603 <1> 604 <1> @@near_return: 605 00005BC2 8B36[E48A] <1> mov si,[cpu_regs+REG_SP] 606 00005BC6 8E06[F48A] <1> mov es,[cpu_regs+REG_SS] 607 00005BCA EB26 <1> jmp @@near_jump 608 <1> 609 <1> @@far_return: 610 00005BCC 8B36[E48A] <1> mov si,[cpu_regs+REG_SP] 611 00005BD0 8E06[F48A] <1> mov es,[cpu_regs+REG_SS] 612 00005BD4 EB26 <1> jmp @@far_jump 613 <1> 614 <1> @@int3: 615 00005BD6 B80C00 <1> mov ax,3*4 616 00005BD9 EB0D <1> jmp @@get_vector 617 <1> 618 <1> @@into: 619 00005BDB B81000 <1> mov ax,4*4 620 00005BDE EB08 <1> jmp @@get_vector 621 <1> 622 <1> @@int: 623 00005BE0 31C0 <1> xor ax,ax 624 00005BE2 26AC <1> es lodsb 625 00005BE4 D1E0 <1> shl ax,1 626 00005BE6 D1E0 <1> shl ax,1 627 <1> 628 <1> @@get_vector: 629 00005BE8 96 <1> xchg ax,si 630 00005BE9 31C0 <1> xor ax,ax 631 00005BEB 8EC0 <1> mov es,ax 632 00005BED EB0D <1> jmp @@far_jump 633 <1> 634 <1> @@near_condit_jump: 635 00005BEF E85800 <1> call @@set_condition 636 <1> 637 <1> @@near_jump: 638 00005BF2 26AD <1> es lodsw 639 <1> 640 <1> @@near_jump_: 641 00005BF4 01F0 <1> add ax,si 642 <1> 643 <1> @@set_cur_seg: 644 00005BF6 8B16[9B8B] <1> mov dx,[unasm_seg] 645 00005BFA EB06 <1> jmp @@normal_exit 646 <1> 647 <1> @@far_jump: 648 00005BFC 26AD <1> es lodsw 649 00005BFE 92 <1> xchg ax,dx 650 00005BFF 26AD <1> es lodsw 651 00005C01 92 <1> xchg ax,dx 652 <1> 653 <1> @@normal_exit: 654 00005C02 3B2E[768B] <1> cmp bp,[cur_line_ip] 655 00005C06 750C <1> jne @@skip 656 00005C08 8916[A88B] <1> mov [follow_seg],dx 657 00005C0C A3[A68B] <1> mov [follow_offs],ax 658 00005C0F 800E[4878]01 <1> or byte [ref_flags],RF_FOLLOW 659 <1> @@skip: 660 00005C14 81FF[F05C] <1> cmp di,@@last_jump 661 00005C18 739A <1> jae @@exit 662 00005C1A 800E[4878]02 <1> or byte [ref_flags],RF_JUMP 663 00005C1F E80701 <1> call adjust_address 664 00005C22 93 <1> xchg ax,bx 665 00005C23 87D1 <1> xchg dx,cx 666 00005C25 8B16[9B8B] <1> mov dx,[unasm_seg] 667 00005C29 89E8 <1> mov ax,bp 668 00005C2B E8FB00 <1> call adjust_address 669 00005C2E 39CA <1> cmp dx,cx 670 00005C30 7282 <1> jb @@exit 671 00005C32 7704 <1> ja @@set_dir 672 00005C34 39D8 <1> cmp ax,bx 673 00005C36 7205 <1> jb @@jump_to_exit 674 <1> 675 <1> @@set_dir: 676 00005C38 800E[4878]04 <1> or byte [ref_flags],RF_BACKWARD 677 <1> 678 <1> @@jump_to_exit: 679 00005C3D E974FF <1> jmp @@exit 680 <1> 681 <1> @@loop_jump: 682 00005C40 2CD0 <1> sub al,0e0h-16 683 00005C42 B400 <1> mov ah,0 684 00005C44 E80600 <1> call @@set_condition_ 685 00005C47 E971FF <1> jmp @@short_jump 686 <1> 687 <1> @@set_condition: 688 00005C4A 83E00F <1> and ax,0fh 689 <1> @@set_condition_: 690 00005C4D 800E[4878]08 <1> or byte [ref_flags],RF_CONDITION 691 00005C52 89C2 <1> mov dx,ax 692 00005C54 93 <1> xchg ax,bx 693 00005C55 8A9F[055D] <1> mov bl,[@@condition_table+bx] 694 00005C59 B700 <1> mov bh,0 695 00005C5B 81C3[745C] <1> add bx,@@jx 696 <1> 697 <1> @@check_flag: 698 00005C5F 8B0E[048B] <1> mov cx,[cpu_regs+REG_FL] 699 00005C63 81E1D508 <1> and cx,0000100011010101b 700 00005C67 51 <1> push cx 701 00005C68 9D <1> popf 702 00005C69 FFD3 <1> call bx 703 00005C6B 89D0 <1> mov ax,dx 704 00005C6D C3 <1> ret 705 <1> 706 <1> @@set_result: 707 00005C6E 800E[4878]10 <1> or byte [ref_flags],RF_TRUE 708 <1> 709 <1> @@return: 710 00005C73 C3 <1> ret 711 <1> 712 <1> @@jx: 713 <1> @@loopne: 714 00005C74 BB[BF5C] <1> mov bx,@@jnz 715 00005C77 EB08 <1> jmp @@check_cx 716 <1> 717 <1> @@loope: 718 00005C79 BB[BC5C] <1> mov bx,@@jz 719 00005C7C EB03 <1> jmp @@check_cx 720 <1> 721 <1> @@loop: 722 00005C7E BB[6E5C] <1> mov bx,@@set_result 723 <1> 724 <1> @@check_cx: 725 00005C81 F606[4878]80 <1> test byte [ref_flags],RF_OPERAND_32 726 00005C86 7507 <1> jnz @@2 727 00005C88 833E[D08A]01 <1> cmp word [cpu_regs+REG_CX],1 728 00005C8D EB06 <1> jmp @@1 729 <1> 730 <1> @@2: 731 <1> cpu 386 732 00005C8F 66833E[D08A]01 <1> cmp dword [cpu_regs+REG_CX],1 733 <1> cpu 8086 734 <1> @@1: 735 00005C95 74DC <1> je @@return 736 00005C97 EBC6 <1> jmp @@check_flag 737 <1> 738 <1> 739 <1> 740 <1> @@jcxz: 741 00005C99 F606[4878]80 <1> test byte [ref_flags],RF_OPERAND_32 742 00005C9E 7507 <1> jnz @@4 743 00005CA0 833E[D08A]00 <1> cmp word [cpu_regs+REG_CX],0 744 00005CA5 EB06 <1> jmp @@3 745 <1> 746 <1> @@4: 747 <1> cpu 386 748 00005CA7 66833E[D08A]00 <1> cmp dword [cpu_regs+REG_CX],0 749 <1> cpu 8086 750 <1> @@3: 751 00005CAD 74BF <1> je @@set_result 752 00005CAF C3 <1> ret 753 <1> 754 <1> @@jo: 755 00005CB0 70BC <1> jo @@set_result 756 00005CB2 C3 <1> ret 757 <1> 758 <1> @@jno: 759 00005CB3 71B9 <1> jno @@set_result 760 00005CB5 C3 <1> ret 761 <1> 762 <1> @@jb: 763 00005CB6 72B6 <1> jb @@set_result 764 00005CB8 C3 <1> ret 765 <1> 766 <1> @@jnb: 767 00005CB9 73B3 <1> jnb @@set_result 768 00005CBB C3 <1> ret 769 <1> 770 <1> @@jz: 771 00005CBC 74B0 <1> jz @@set_result 772 00005CBE C3 <1> ret 773 <1> 774 <1> @@jnz: 775 00005CBF 75AD <1> jnz @@set_result 776 00005CC1 C3 <1> ret 777 <1> 778 <1> @@jna: 779 00005CC2 76AA <1> jna @@set_result 780 00005CC4 C3 <1> ret 781 <1> 782 <1> @@ja: 783 00005CC5 77A7 <1> ja @@set_result 784 00005CC7 C3 <1> ret 785 <1> 786 <1> @@js: 787 00005CC8 78A4 <1> js @@set_result 788 00005CCA C3 <1> ret 789 <1> 790 <1> @@jns: 791 00005CCB 79A1 <1> jns @@set_result 792 00005CCD C3 <1> ret 793 <1> 794 <1> @@jp: 795 00005CCE 7A9E <1> jp @@set_result 796 00005CD0 C3 <1> ret 797 <1> 798 <1> @@jnp: 799 00005CD1 7B9B <1> jnp @@set_result 800 00005CD3 C3 <1> ret 801 <1> 802 <1> @@jl: 803 00005CD4 7C98 <1> jl @@set_result 804 00005CD6 C3 <1> ret 805 <1> 806 <1> @@jnl: 807 00005CD7 7D95 <1> jnl @@set_result 808 00005CD9 C3 <1> ret 809 <1> 810 <1> @@jng: 811 00005CDA 7E92 <1> jng @@set_result 812 00005CDC C3 <1> ret 813 <1> 814 <1> @@jg: 815 00005CDD 7F8F <1> jg @@set_result 816 00005CDF C3 <1> ret 817 <1> 818 <1> 819 <1> @@follow_table: 820 00005CE0 0F <1> db 0fh ;286+ 821 00005CE1 46 <1> db @@condit_jump - @@first_jump 822 <1> 823 00005CE2 E0 <1> db 0e0h ;loopne/loopnz 824 00005CE3 EE <1> db @@loop_jump - @@first_jump 825 <1> 826 00005CE4 E1 <1> db 0e1h ;loope/loopz 827 00005CE5 EE <1> db @@loop_jump - @@first_jump 828 <1> 829 00005CE6 E2 <1> db 0e2h ;loop 830 00005CE7 EE <1> db @@loop_jump - @@first_jump 831 <1> 832 00005CE8 E3 <1> db 0e3h ;jcxz 833 00005CE9 EE <1> db @@loop_jump - @@first_jump 834 <1> 835 00005CEA E9 <1> db 0e9h ;jmp near 836 00005CEB A0 <1> db @@near_jump - @@first_jump 837 <1> 838 00005CEC EA <1> db 0eah ;jmp far 839 00005CED AA <1> db @@far_jump - @@first_jump 840 <1> 841 00005CEE EB <1> db 0ebh ;jmp short 842 00005CEF 69 <1> db @@short_jump - @@first_jump 843 <1> 844 <1> @@last_jump: 845 00005CF0 9A <1> db 9ah ;call far 846 00005CF1 AA <1> db @@far_jump - @@first_jump 847 <1> 848 00005CF2 E8 <1> db 0e8h ;call near 849 00005CF3 A0 <1> db @@near_jump - @@first_jump 850 <1> 851 00005CF4 C2 <1> db 0c2h ;ret near 852 00005CF5 70 <1> db @@near_return - @@first_jump 853 <1> 854 00005CF6 C3 <1> db 0c3h ;ret near 855 00005CF7 70 <1> db @@near_return - @@first_jump 856 <1> 857 00005CF8 CA <1> db 0cah ;ret far 858 00005CF9 7A <1> db @@far_return - @@first_jump 859 <1> 860 00005CFA CB <1> db 0cbh ;ret far 861 00005CFB 7A <1> db @@far_return - @@first_jump 862 <1> 863 00005CFC CC <1> db 0cch ;int 3 864 00005CFD 84 <1> db @@int3 - @@first_jump 865 <1> 866 00005CFE CD <1> db 0cdh ;int 867 00005CFF 8E <1> db @@int - @@first_jump 868 <1> 869 00005D00 CE <1> db 0ceh ;into 870 00005D01 89 <1> db @@into - @@first_jump 871 <1> 872 00005D02 CF <1> db 0cfh ;iret 873 00005D03 7A <1> db @@far_return - @@first_jump 874 <1> 875 00005D04 00 <1> db 0 876 <1> 877 <1> @@condition_table: 878 00005D05 3C <1> db @@jo - @@jx ;jo 879 00005D06 3F <1> db @@jno - @@jx ;jno 880 00005D07 42 <1> db @@jb - @@jx ;jb/jnae 881 00005D08 45 <1> db @@jnb - @@jx ;jae/jnb 882 00005D09 48 <1> db @@jz - @@jx ;je/jz 883 00005D0A 4B <1> db @@jnz - @@jx ;jne/jnz 884 00005D0B 4E <1> db @@jna - @@jx ;jbe/jna 885 00005D0C 51 <1> db @@ja - @@jx ;ja/jnbe 886 00005D0D 54 <1> db @@js - @@jx ;js 887 00005D0E 57 <1> db @@jns - @@jx ;jns 888 00005D0F 5A <1> db @@jp - @@jx ;jp/jpe 889 00005D10 5D <1> db @@jnp - @@jx ;jnp/jpo 890 00005D11 60 <1> db @@jl - @@jx ;jl/jnge 891 00005D12 63 <1> db @@jnl - @@jx ;jge/jnl 892 00005D13 66 <1> db @@jng - @@jx ;jle/jng 893 00005D14 69 <1> db @@jg - @@jx ;jg/jnle 894 00005D15 00 <1> db @@loopne- @@jx ;loopne 895 00005D16 05 <1> db @@loope - @@jx ;loope 896 00005D17 0A <1> db @@loop - @@jx ;loop 897 00005D18 25 <1> db @@jcxz - @@jx ;jcxz 898 <1> 899 <1> reg_offs_table: 900 00005D19 [C88A] <1> dw cpu_regs+REG_AX 901 00005D1B [D08A] <1> dw cpu_regs+REG_CX 902 00005D1D [D48A] <1> dw cpu_regs+REG_DX 903 00005D1F [CC8A] <1> dw cpu_regs+REG_BX 904 00005D21 [E48A] <1> dw cpu_regs+REG_SP 905 00005D23 [E08A] <1> dw cpu_regs+REG_BP 906 00005D25 [D88A] <1> dw cpu_regs+REG_SI 907 00005D27 [DC8A] <1> dw cpu_regs+REG_DI 908 <1> ;============================================================================= 909 <1> ; adjust_address 910 <1> ;----------------------------------------------------------------------------- 911 <1> adjust_address: 912 00005D29 50 <1> push ax 913 00005D2A D1E8 <1> shr ax,1 914 00005D2C D1E8 <1> shr ax,1 915 00005D2E D1E8 <1> shr ax,1 916 00005D30 D1E8 <1> shr ax,1 917 00005D32 01C2 <1> add dx,ax 918 00005D34 58 <1> pop ax 919 00005D35 83E00F <1> and ax,000fh 920 00005D38 C3 <1> ret 921 <1> ;============================================================================= 922 <1> ; set_direction 923 <1> ;----------------------------------------------------------------------------- 924 <1> set_direction: 925 00005D39 E862BC <1> call pushr 926 00005D3C F606[4878]02 <1> test byte [ref_flags],RF_JUMP 927 00005D41 7437 <1> jz @@exit 928 <1> 929 00005D43 FC <1> cld 930 00005D44 BE[FA8D] <1> mov si,buffer + BUF_SIZE ;-offset 931 <1> 932 <1> @@next_char: 933 00005D47 4E <1> dec si 934 00005D48 803C20 <1> cmp byte [si],' ' 935 00005D4B 74FA <1> je @@next_char 936 00005D4D 89F7 <1> mov di,si 937 00005D4F 1E <1> push ds 938 00005D50 07 <1> pop es 939 00005D51 AF <1> scasw 940 <1> drawchoice 18h, '^' 941 00005D52 A0[EC8B] <1> mov al, byte [DRAWADDRESS] 942 00005D55 F606[4878]04 <1> test byte [ref_flags],RF_BACKWARD 943 00005D5A 7503 <1> jnz @@check_condition 944 <1> drawchoice 19h, 'v' 945 00005D5C A0[ED8B] <1> mov al, byte [DRAWADDRESS] 946 <1> 947 <1> @@check_condition: 948 00005D5F F606[4878]08 <1> test byte [ref_flags],RF_CONDITION 949 00005D64 7413 <1> jz @@set_direction 950 00005D66 F606[4878]10 <1> test byte [ref_flags],RF_TRUE 951 00005D6B 750C <1> jnz @@set_direction 952 00005D6D 3A06[ED8B] <1> cmp al, byte [DRAWADDRESS] 953 <1> drawchoice 1Eh, 'A' 954 00005D71 A0[EE8B] <1> mov al, byte [DRAWADDRESS] 955 00005D74 7503 <1> jne @F 956 <1> drawchoice 1Fh, 'V' 957 00005D76 A0[EF8B] <1> mov al, byte [DRAWADDRESS] 958 <1> @@: 959 <1> 960 <1> @@set_direction: 961 00005D79 AA <1> stosb 962 <1> 963 <1> @@exit: 964 00005D7A E834BC <1> call popr 965 00005D7D C3 <1> ret 966 <1> ;============================================================================= 967 <1> ; display_code_marks 968 <1> ;----------------------------------------------------------------------------- 969 <1> display_code_marks: 970 00005D7E E81DBC <1> call pushr 971 <1> 972 00005D81 95 <1> xchg ax,bp 973 00005D82 88C4 <1> mov ah,al 974 00005D84 B035 <1> mov al,CPU_WIDTH-1 975 00005D86 E81FC5 <1> call get_addr 976 00005D89 50 <1> push ax 977 <1> 978 00005D8A B90A00 <1> mov cx,10 979 00005D8D BD[368A] <1> mov bp,code_mark_buff 980 00005D90 BF0100 <1> mov di,1 981 <1> 982 <1> @@next_mark: 983 00005D93 853E[888B] <1> test [code_mark_exist],di 984 00005D97 7428 <1> jz @@next 985 00005D99 837E00FF <1> cmp word [bp],0ffffh 986 00005D9D 7422 <1> je @@next 987 00005D9F 8B4606 <1> mov ax,[bp+6] 988 00005DA2 8B5604 <1> mov dx,[bp+4] 989 00005DA5 E881FF <1> call adjust_address 990 00005DA8 53 <1> push bx 991 00005DA9 93 <1> xchg ax,bx 992 00005DAA 8B36[9B8B] <1> mov si,[unasm_seg] 993 00005DAE 87D6 <1> xchg dx,si 994 00005DB0 E876FF <1> call adjust_address 995 00005DB3 39D8 <1> cmp ax,bx 996 00005DB5 5B <1> pop bx 997 00005DB6 7509 <1> jne @@next 998 00005DB8 B83A0C <1> mov ax,atCodeMark*256+'0'+10 999 00005DBB 28C8 <1> sub al,cl 1000 00005DBD 39F2 <1> cmp dx,si 1001 00005DBF 740A <1> je @@write 1002 <1> 1003 <1> @@next: 1004 00005DC1 D1E7 <1> shl di,1 1005 00005DC3 83C508 <1> add bp,4*2 1006 00005DC6 E2CB <1> loop @@next_mark 1007 00005DC8 B8200C <1> mov ax,atCodeMark*256+' ' 1008 <1> 1009 <1> @@write: 1010 00005DCB 5F <1> pop di 1011 00005DCC AB <1> stosw 1012 00005DCD E8E1BB <1> call popr 1013 00005DD0 C3 <1> ret 1014 <1> ;============================================================================= 1015 <1> ; E0F 1016 <1> ;============================================================================= 1017 <1> 67 %include "search.inc" ; 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; search.inc 7 <1> ; Procedures for searching. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; search_bytes 28 <1> ;----------------------------------------------------------------------------- 29 <1> search_bytes: 30 00005DD1 1E <1> push ds 31 00005DD2 07 <1> pop es 32 <1> 33 00005DD3 A1[B68B] <1> mov ax,[search_options] 34 00005DD6 A3[D862] <1> mov [search_bits],ax 35 00005DD9 BE[BC62] <1> mov si,search_dialog 36 00005DDC E80CC5 <1> call init_dialog 37 <1> 38 <1> @@again_: 39 00005DDF C606[C362]00 <1> mov byte [search_dlg_item],0 40 <1> 41 <1> @@again: 42 00005DE4 E865C5 <1> call exec_dialog_ 43 00005DE7 09C0 <1> or ax,ax 44 00005DE9 7463 <1> jz @@error_exit 45 <1> 46 00005DEB BE[548F] <1> mov si,search_string 47 00005DEE BF[878F] <1> mov di,search_bin 48 00005DF1 E8F101 <1> call create_bin 49 00005DF4 725C <1> jc @@string_error 50 <1> 51 00005DF6 81EF[878F] <1> sub di,search_bin 52 00005DFA 7452 <1> jz @@error_exit 53 <1> 54 <1> @@check_address: 55 00005DFC 57 <1> push di 56 00005DFD BE[A890] <1> mov si,search_addr_str 57 00005E00 E818A5 <1> call get_address 58 00005E03 5B <1> pop bx 59 00005E04 C606[C362]02 <1> mov byte [search_dlg_item],2 60 00005E09 72D9 <1> jc @@again 61 <1> 62 00005E0B 891E[B48B] <1> mov [search_len],bx 63 <1> 64 00005E0F 8B1E[BA8B] <1> mov bx,[dump_seg] 65 00005E13 F706[B68B]0800 <1> test word [search_options],SRCH_RES_CODE 66 00005E19 7404 <1> jz @@def_seg 67 00005E1B 8B1E[9B8B] <1> mov bx,[unasm_seg] 68 <1> 69 <1> @@def_seg: 70 00005E1F 80FD00 <1> cmp ch,0 71 00005E22 7409 <1> je @@search 72 00005E24 80FD01 <1> cmp ch,1 73 00005E27 7402 <1> je @@set_seg 74 00005E29 31C0 <1> xor ax,ax 75 <1> 76 <1> @@set_seg: 77 00005E2B 89D3 <1> mov bx,dx 78 <1> 79 <1> @@search: 80 00005E2D 89DA <1> mov dx,bx 81 00005E2F E88001 <1> call linear_address 82 00005E32 F706[B68B]0400 <1> test word [search_options],SRCH_EXCL_HMA 83 00005E38 7403 <1> jz @@set_search_pos 84 00005E3A 80E20F <1> and dl,0fh 85 <1> 86 <1> @@set_search_pos: 87 00005E3D A3[B08B] <1> mov [search_offs],ax 88 00005E40 8916[B28B] <1> mov [search_seg],dx 89 <1> 90 00005E44 A1[D862] <1> mov ax,[search_bits] 91 00005E47 A3[B68B] <1> mov [search_options],ax 92 <1> 93 00005E4A B8[5D5E] <1> mov ax,search_next 94 00005E4D 50 <1> push ax 95 <1> 96 <1> @@error_exit: 97 00005E4E E830B9 <1> call draw_screen 98 <1> 99 <1> @@exit: 100 00005E51 C3 <1> ret 101 <1> 102 <1> @@string_error: 103 00005E52 BE[4077] <1> mov si,string_error_msg 104 00005E55 E80CB9 <1> call _error_message 105 00005E58 EB85 <1> jmp @@again_ 106 <1> 107 <1> jmp_@@not_found_msg: 108 00005E5A E98800 <1> jmp search_next@@not_found_msg 109 <1> ;============================================================================= 110 <1> ; search_next 111 <1> ;----------------------------------------------------------------------------- 112 <1> search_next: 113 00005E5D 8B0E[B48B] <1> mov cx,[search_len] 114 00005E61 E3F7 <1> jcxz jmp_@@not_found_msg 115 <1> 116 00005E63 C606[777E]01 <1> mov byte [exec_msg_type],1 117 00005E68 BE[6177] <1> mov si,search_msg 118 00005E6B E849C2 <1> call message_box 119 <1> 120 00005E6E 31C0 <1> xor ax,ax 121 00005E70 99 <1> cwd 122 00005E71 C706[088C][AE5F] <1> mov word [load_search_next_template], .reverse_lodsb 123 00005E77 F706[B68B]0200 <1> test word [search_options],SRCH_BACKWARD 124 00005E7D 7514 <1> jnz @@start_search 125 00005E7F C706[088C][AC5F] <1> mov word [load_search_next_template], .lodsb 126 00005E85 4A <1> dec dx 127 00005E86 29C8 <1> sub ax,cx 128 00005E88 F706[B68B]0400 <1> test word [search_options],SRCH_EXCL_HMA 129 00005E8E 7403 <1> jz @@start_search 130 00005E90 BA00F0 <1> mov dx,0f000h 131 <1> 132 <1> @@start_search: 133 00005E93 E81C01 <1> call linear_address 134 00005E96 8706[B08B] <1> xchg [search_offs],ax 135 00005E9A 8716[B28B] <1> xchg [search_seg],dx 136 00005E9E 97 <1> xchg ax,di 137 00005E9F FC <1> cld 138 <1> 139 <1> @@search_byte: 140 00005EA0 BE[878F] <1> mov si,search_bin 141 00005EA3 F706[B68B]0200 <1> test word [search_options], SRCH_BACKWARD 142 00005EA9 7403 <1> jz @F 143 00005EAB 01CE <1> add si, cx 144 00005EAD 4E <1> dec si 145 <1> @@: 146 00005EAE FF16[088C] <1> call near [load_search_next_template] 147 <1> 148 00005EB2 E89200 <1> call @@compare 149 00005EB5 7520 <1> jne @@next 150 00005EB7 E8A700 <1> call @@compare_bytes 151 00005EBA 751B <1> jne @@next 152 <1> 153 00005EBC 52 <1> push dx 154 00005EBD 89F8 <1> mov ax,di 155 00005EBF E80501 <1> call phisical_address 156 00005EC2 89C3 <1> mov bx,ax 157 00005EC4 89D6 <1> mov si,dx 158 00005EC6 B8[878F] <1> mov ax,search_bin 159 00005EC9 8CCA <1> mov dx,cs 160 00005ECB E85BFE <1> call adjust_address 161 00005ECE 39F2 <1> cmp dx,si 162 00005ED0 5A <1> pop dx 163 00005ED1 7526 <1> jne @@found 164 00005ED3 39D8 <1> cmp ax,bx 165 00005ED5 7522 <1> jne @@found 166 <1> 167 <1> @@next: 168 00005ED7 E8B000 <1> call @@next_byte 169 00005EDA 73C4 <1> jnc @@search_byte 170 <1> 171 <1> @@not_found: 172 00005EDC E80C00 <1> call @@close_window 173 00005EDF C706[B48B]0000 <1> mov word [search_len],0 174 <1> 175 <1> @@not_found_msg: 176 00005EE5 BE[5077] <1> mov si,not_found_msg 177 00005EE8 E97FB8 <1> jmp _msg_box 178 <1> 179 <1> @@close_window: 180 00005EEB C606[777E]02 <1> mov byte [exec_msg_type],2 181 00005EF0 E877B8 <1> call _msg_box 182 00005EF3 C606[777E]00 <1> mov byte [exec_msg_type],0 183 00005EF8 C3 <1> ret 184 <1> 185 <1> @@found: 186 00005EF9 E8EFFF <1> call @@close_window 187 00005EFC 57 <1> push di 188 00005EFD 52 <1> push dx 189 <1> 190 00005EFE E88900 <1> call @@next_byte 191 00005F01 7306 <1> jnc @@set_new_pos 192 00005F03 C706[B48B]0000 <1> mov word [search_len],0 193 <1> 194 <1> @@set_new_pos: 195 00005F09 893E[B08B] <1> mov [search_offs],di 196 00005F0D 8916[B28B] <1> mov [search_seg],dx 197 <1> 198 00005F11 5A <1> pop dx 199 00005F12 58 <1> pop ax 200 00005F13 F706[B68B]0200 <1> test word [search_options], SRCH_BACKWARD 201 00005F19 7407 <1> jz @F 202 00005F1B A1[048C] <1> mov ax, word [search_backwards_last_byte] 203 00005F1E 8B16[068C] <1> mov dx, word [search_backwards_last_byte + 2] 204 <1> @@: 205 <1> 206 00005F22 E8A200 <1> call phisical_address 207 <1> 208 00005F25 F706[B68B]0800 <1> test word [search_options],SRCH_RES_CODE 209 00005F2B 7410 <1> jz @@set_dump 210 00005F2D C706[748B]0000 <1> mov word [cur_line],0 211 00005F33 A3[2878] <1> mov [cur_ip],ax 212 00005F36 8916[9B8B] <1> mov [unasm_seg],dx 213 00005F3A E9E5AA <1> jmp update_commands 214 <1> 215 <1> @@set_dump: 216 00005F3D A3[BC8B] <1> mov [dump_offs],ax 217 00005F40 8916[BA8B] <1> mov [dump_seg],dx 218 00005F44 E9F1AD <1> jmp update_dump 219 <1> 220 <1> @@compare: 221 00005F47 E854BA <1> call pushr 222 00005F4A E83200 <1> call @@upcase 223 00005F4D 93 <1> xchg ax,bx 224 00005F4E 97 <1> xchg ax,di 225 00005F4F E87500 <1> call phisical_address 226 00005F52 97 <1> xchg ax,di 227 00005F53 8EC2 <1> mov es,dx 228 00005F55 268A05 <1> mov al,[es:di] 229 00005F58 E82400 <1> call @@upcase 230 00005F5B 38D8 <1> cmp al,bl 231 00005F5D E851BA <1> call popr 232 00005F60 C3 <1> ret 233 <1> 234 <1> @@compare_bytes: 235 00005F61 E83ABA <1> call pushr 236 00005F64 49 <1> dec cx 237 00005F65 740C <1> jz @@exit_1 238 <1> 239 <1> @@next_char: 240 00005F67 FF16[088C] <1> call near [load_search_next_template] 241 00005F6B E81C00 <1> call @@next_byte 242 00005F6E E8D6FF <1> call @@compare 243 00005F71 E1F4 <1> loope @@next_char 244 <1> @@exit_1: 245 00005F73 893E[048C] <1> mov word [search_backwards_last_byte], di 246 00005F77 8916[068C] <1> mov word [search_backwards_last_byte + 2], dx 247 00005F7B E833BA <1> call popr 248 00005F7E C3 <1> ret 249 <1> 250 <1> @@upcase: 251 00005F7F F706[B68B]0100 <1> test word [search_options],SRCH_IGN_CASE 252 00005F85 741D <1> jz @@exit 253 00005F87 E9C2BA <1> jmp upcase 254 <1> 255 <1> @@next_byte: 256 00005F8A F706[B68B]0200 <1> test word [search_options],SRCH_BACKWARD 257 00005F90 7513 <1> jnz @@backward 258 00005F92 83C701 <1> add di,1 259 00005F95 83D200 <1> adc dx,0 260 00005F98 8B1E[B08B] <1> mov bx,[search_offs] 261 00005F9C 8B2E[B28B] <1> mov bp,[search_seg] 262 00005FA0 29FB <1> sub bx,di 263 00005FA2 19D5 <1> sbb bp,dx 264 <1> 265 <1> @@exit: 266 00005FA4 C3 <1> ret 267 <1> 268 <1> @@backward: 269 00005FA5 83EF01 <1> sub di,1 270 00005FA8 83DA00 <1> sbb dx,0 271 00005FAB C3 <1> ret 272 <1> 273 <1> .lodsb: 274 00005FAC AC <1> lodsb 275 00005FAD C3 <1> retn 276 <1> 277 <1> .reverse_lodsb: 278 00005FAE 8A04 <1> mov al, byte [si] 279 00005FB0 4E <1> dec si 280 00005FB1 C3 <1> retn 281 <1> ;============================================================================= 282 <1> ; linear_address 283 <1> ;----------------------------------------------------------------------------- 284 <1> linear_address: 285 00005FB2 53 <1> push bx 286 00005FB3 51 <1> push cx 287 00005FB4 B104 <1> mov cl,4 288 00005FB6 89D3 <1> mov bx,dx 289 00005FB8 D3E3 <1> shl bx,cl 290 00005FBA D3C2 <1> rol dx,cl 291 00005FBC 83E20F <1> and dx,000fh 292 00005FBF 01D8 <1> add ax,bx 293 00005FC1 80D200 <1> adc dl,0 294 00005FC4 59 <1> pop cx 295 00005FC5 5B <1> pop bx 296 00005FC6 C3 <1> ret 297 <1> ;============================================================================= 298 <1> ; phisical_address 299 <1> ;----------------------------------------------------------------------------- 300 <1> phisical_address: 301 00005FC7 83FA10 <1> cmp dx,10h 302 00005FCA 7207 <1> jb @@skip_hma 303 00005FCC 83E8F0 <1> sub ax,0fff0h 304 00005FCF BAFFFF <1> mov dx,0ffffh 305 00005FD2 C3 <1> ret 306 <1> @@skip_hma: 307 00005FD3 53 <1> push bx 308 00005FD4 51 <1> push cx 309 00005FD5 B104 <1> mov cl,4 310 00005FD7 89C3 <1> mov bx,ax 311 00005FD9 D3EB <1> shr bx,cl 312 00005FDB D3CA <1> ror dx,cl 313 00005FDD 01DA <1> add dx,bx 314 00005FDF 83E00F <1> and ax,000fh 315 00005FE2 59 <1> pop cx 316 00005FE3 5B <1> pop bx 317 00005FE4 C3 <1> ret 318 <1> ;============================================================================= 319 <1> ; create_bin 320 <1> ;----------------------------------------------------------------------------- 321 <1> create_bin: 322 00005FE5 89FD <1> mov bp,di 323 00005FE7 FC <1> cld 324 <1> 325 <1> @@next_2: 326 00005FE8 AC <1> lodsb 327 <1> 328 00005FE9 3C20 <1> cmp al,' ' 329 00005FEB 74FB <1> je @@next_2 330 <1> 331 00005FED 3C3B <1> cmp al,';' 332 00005FEF 74F7 <1> je @@next_2 333 <1> 334 00005FF1 08C0 <1> or al,al 335 00005FF3 7502 <1> jnz @@convert 336 <1> 337 <1> @@eol: 338 00005FF5 F8 <1> clc 339 <1> 340 <1> @@exit: 341 00005FF6 C3 <1> ret 342 <1> 343 <1> @@convert: 344 00005FF7 E83300 <1> call convert_number 345 00005FFA 730A <1> jnc @@next_4 346 <1> 347 00005FFC E81600 <1> call convert_string 348 00005FFF 7305 <1> jnc @@next_4 349 <1> 350 00006001 E85C00 <1> call convert_command 351 00006004 72F0 <1> jc @@exit 352 <1> 353 <1> @@next_4: 354 00006006 AC <1> lodsb 355 00006007 3C3B <1> cmp al,';' 356 00006009 74DD <1> je @@next_2 357 0000600B 08C0 <1> or al,al 358 0000600D 74E6 <1> je @@eol 359 0000600F 3C20 <1> cmp al,' ' 360 00006011 74D5 <1> je @@next_2 361 00006013 F9 <1> stc 362 00006014 C3 <1> ret 363 <1> ;============================================================================= 364 <1> ; convert_string 365 <1> ;----------------------------------------------------------------------------- 366 <1> convert_string: 367 00006015 3C22 <1> cmp al,'"' 368 00006017 7404 <1> je @@convert 369 00006019 3C27 <1> cmp al,"'" 370 0000601B 750E <1> jne @@error_exit 371 <1> 372 <1> @@convert: 373 0000601D 88C2 <1> mov dl,al 374 <1> 375 <1> @@next: 376 0000601F AC <1> lodsb 377 00006020 08C0 <1> or al,al 378 00006022 7407 <1> jz @@error_exit 379 00006024 38D0 <1> cmp al,dl 380 00006026 7404 <1> je @@exit 381 00006028 AA <1> stosb 382 00006029 EBF4 <1> jmp @@next 383 <1> 384 <1> @@error_exit: 385 0000602B F9 <1> stc 386 <1> 387 <1> @@exit: 388 0000602C C3 <1> ret 389 <1> ;============================================================================= 390 <1> ; convert_number 391 <1> ;----------------------------------------------------------------------------- 392 <1> convert_number: 393 0000602D 89F3 <1> mov bx,si 394 0000602F 89F9 <1> mov cx,di 395 00006031 4B <1> dec bx 396 <1> ; call @@is_hex_number 397 00006032 E877BA <1> call ascii_to_bin 398 00006035 7222 <1> jc @@error_exit 399 00006037 92 <1> xchg ax,dx 400 00006038 AC <1> lodsb 401 <1> ; call @@is_hex_number 402 00006039 E870BA <1> call ascii_to_bin 403 0000603C 721B <1> jc @@error_exit 404 <1> ; jnc @@add 405 <1> ; xchg ax,dx 406 <1> ; jmp @@save 407 <1> 408 <1> @@add: 409 0000603E D1E2 <1> shl dx,1 410 00006040 D1E2 <1> shl dx,1 411 00006042 D1E2 <1> shl dx,1 412 00006044 D1E2 <1> shl dx,1 413 00006046 01D0 <1> add ax,dx 414 <1> 415 <1> @@save: 416 00006048 AA <1> stosb 417 00006049 8A04 <1> mov al,[si] 418 0000604B 3C20 <1> cmp al,' ' 419 0000604D 7408 <1> je @@ok 420 0000604F 3C3B <1> cmp al,';' 421 00006051 7404 <1> je @@ok 422 00006053 3C00 <1> cmp al,0 423 00006055 7502 <1> jne @@error_exit 424 <1> 425 <1> @@ok: 426 00006057 F8 <1> clc 427 00006058 C3 <1> ret 428 <1> 429 <1> ;@@is_hex_number: 430 <1> ; call upcase 431 <1> ; sub al,'0' 432 <1> ; jb @@error_exit 433 <1> ; cmp al,9 434 <1> ; jbe @@ok 435 <1> ; sub al,'A'-'0' 436 <1> ; jb @@error_exit 437 <1> ; cmp al,5 438 <1> ; ja @@error_exit 439 <1> ; add al,10 440 <1> ; clc 441 <1> ; ret 442 <1> 443 <1> @@error_exit: 444 00006059 89DE <1> mov si,bx 445 0000605B 89CF <1> mov di,cx 446 0000605D AC <1> lodsb 447 0000605E F9 <1> stc 448 0000605F C3 <1> ret 449 <1> ;============================================================================= 450 <1> ; convert_command 451 <1> ;----------------------------------------------------------------------------- 452 <1> convert_command: 453 00006060 4E <1> dec si 454 00006061 89F3 <1> mov bx,si 455 <1> 456 <1> @@next: 457 00006063 AC <1> lodsb 458 00006064 3C3B <1> cmp al,';' 459 00006066 7404 <1> je @@eoa 460 00006068 08C0 <1> or al,al 461 0000606A 75F7 <1> jne @@next 462 <1> 463 <1> @@eoa: 464 0000606C 4E <1> dec si 465 0000606D FF34 <1> push word [si] 466 0000606F 56 <1> push si 467 <1> 468 00006070 C60400 <1> mov byte [si],0 469 00006073 89DE <1> mov si,bx 470 00006075 89FB <1> mov bx,di 471 00006077 29EB <1> sub bx,bp 472 00006079 031E[008B] <1> add bx,[cpu_regs+REG_IP] 473 <1> 474 0000607D E8DBE1 <1> call assemble 475 <1> 476 00006080 5E <1> pop si 477 00006081 8F04 <1> pop word [si] 478 00006083 C3 <1> ret 479 <1> ;============================================================================= 480 <1> ; E0F 481 <1> ;============================================================================= 482 <1> 483 <1> 68 %include "resident.inc" ; 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; resident.inc 7 <1> ; ... 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; resident 28 <1> ;----------------------------------------------------------------------------- 29 <1> resident: 30 00006084 E8C700 <1> call is_resident 31 00006087 7506 <1> jne _resident 32 00006089 BE[BE75] <1> mov si,already_resident 33 0000608C E9D5B6 <1> jmp _error_message 34 <1> 35 <1> _resident: 36 0000608F E8BCA6 <1> call unload_program 37 00006092 E886A6 <1> call set_my_pid 38 00006095 E8A5A3 <1> call restore_int_table 39 00006098 E899CB <1> call restore_screen 40 <1> 41 0000609B A0[828B] <1> mov al,[my_port_21] 42 0000609E E621 <1> out 21h,al 43 000060A0 FA <1> cli 44 000060A1 E8C3F6 <1> call set_breakpoints 45 000060A4 BA[7456] <1> mov dx,bp_entry 46 000060A7 E8A7F4 <1> call set_03_vector 47 000060AA E8C9F4 <1> call set_09_vector 48 000060AD E82B00 <1> call set_16_vector 49 000060B0 C606[868B]01 <1> mov byte [resident_mode],1 50 000060B5 C706[FE69]0200 <1> mov word [resident_status],DISABLED 51 000060BB C706[026A]0200 <1> mov word [exit_status],DISABLED 52 000060C1 C606[946C]01 <1> mov byte [swap_mode],1 53 <1> save_act_regs 35 000060C6 8926[6C8B] <2> mov [save_sp],sp 54 000060CA FB <1> sti 55 000060CB BA[7775] <1> mov dx,resident_msg 56 000060CE E815C2 <1> call write_message 57 <1> 58 000060D1 31C9 <1> xor cx,cx 59 000060D3 E8EEB8 <1> call calc_prog_size 60 <1> 61 000060D6 B80031 <1> mov ax,3100h 62 000060D9 CD21 <1> int 21h 63 <1> ;============================================================================= 64 <1> ; set_16_vector 65 <1> ;----------------------------------------------------------------------------- 66 <1> set_16_vector: 67 000060DB BE5800 <1> mov si,16h*4 68 000060DE BF[648B] <1> mov di,save_int_16 69 000060E1 BA[2D61] <1> mov dx,keyboard_service 70 000060E4 EB1B <1> jmp set_vector 71 <1> ;============================================================================= 72 <1> ; restore_16_vector 73 <1> ;----------------------------------------------------------------------------- 74 <1> restore_16_vector: 75 000060E6 BE[648B] <1> mov si,save_int_16 76 000060E9 BF5800 <1> mov di,16h*4 77 000060EC EB25 <1> jmp restore_vector 78 <1> ;============================================================================= 79 <1> ; set_24_vector 80 <1> ;----------------------------------------------------------------------------- 81 <1> set_24_vector: 82 000060EE BE9000 <1> mov si,24h*4 83 000060F1 BF[688B] <1> mov di,save_int_24 84 000060F4 BA[4B61] <1> mov dx,critical_handler 85 000060F7 EB08 <1> jmp set_vector 86 <1> ;============================================================================= 87 <1> ; restore_24_vector 88 <1> ;----------------------------------------------------------------------------- 89 <1> restore_24_vector: 90 000060F9 BE[688B] <1> mov si,save_int_24 91 000060FC BF9000 <1> mov di,24h*4 92 000060FF EB12 <1> jmp restore_vector 93 <1> ;============================================================================= 94 <1> ; set_vector 95 <1> ;----------------------------------------------------------------------------- 96 <1> set_vector: 97 00006101 1E <1> push ds 98 00006102 0E <1> push cs 99 00006103 07 <1> pop es 100 00006104 31C0 <1> xor ax,ax 101 00006106 8ED8 <1> mov ds,ax 102 00006108 FC <1> cld 103 00006109 A5 <1> movsw 104 0000610A A5 <1> movsw 105 0000610B 8954FC <1> mov [si-4],dx 106 0000610E 8C4CFE <1> mov [si-2],cs 107 00006111 1F <1> pop ds 108 00006112 C3 <1> ret 109 <1> ;============================================================================= 110 <1> ; restore_vector 111 <1> ;----------------------------------------------------------------------------- 112 <1> restore_vector: 113 00006113 06 <1> push es 114 00006114 31C0 <1> xor ax,ax 115 00006116 8EC0 <1> mov es,ax 116 00006118 FC <1> cld 117 00006119 A5 <1> movsw 118 0000611A A5 <1> movsw 119 0000611B 07 <1> pop es 120 0000611C C3 <1> ret 121 <1> ;============================================================================= 122 <1> ; check_vector 123 <1> ;----------------------------------------------------------------------------- 124 <1> check_vector: 125 0000611D 1E <1> push ds 126 0000611E 31C0 <1> xor ax,ax 127 00006120 8ED8 <1> mov ds,ax 128 00006122 393C <1> cmp [si],di 129 00006124 7505 <1> jne @@exit 130 00006126 8CC0 <1> mov ax,es 131 00006128 394402 <1> cmp [si+2],ax 132 <1> @@exit: 133 0000612B 1F <1> pop ds 134 0000612C C3 <1> ret 135 <1> ;============================================================================= 136 <1> ; keyboard_service 137 <1> ;----------------------------------------------------------------------------- 138 <1> keyboard_service: 139 0000612D 3DDEC0 <1> cmp ax,MAGIC_REQUEST_CODE 140 00006130 7514 <1> jne @@int_exit 141 00006132 81FBCEFA <1> cmp bx,DEVELOPER_ID 142 00006136 750E <1> jne @@int_exit 143 00006138 83F901 <1> cmp cx,APPLICATION_ID 144 0000613B 7509 <1> jne @@int_exit 145 0000613D B8DEFA <1> mov ax,MAGIC_ANSWER_CODE 146 00006140 BB0301 <1> mov bx,DEBUGGER_VERSION 147 00006143 0E <1> push cs 148 00006144 07 <1> pop es 149 00006145 CF <1> iret 150 <1> @@int_exit: 151 00006146 2EFF2E[648B] <1> jmp far [cs:save_int_16] 152 <1> ;============================================================================= 153 <1> ; critical_handler 154 <1> ;----------------------------------------------------------------------------- 155 <1> critical_handler: 156 0000614B B003 <1> mov al,3 157 0000614D CF <1> iret 158 <1> ;============================================================================= 159 <1> ; is_resident 160 <1> ;----------------------------------------------------------------------------- 161 <1> is_resident: 162 0000614E B8DEC0 <1> mov ax,MAGIC_REQUEST_CODE 163 00006151 BBCEFA <1> mov bx,DEVELOPER_ID 164 00006154 B90100 <1> mov cx,APPLICATION_ID 165 00006157 CD16 <1> int 16h 166 00006159 BA[6985] <1> mov dx,not_installed_msg 167 0000615C 3DDEFA <1> cmp ax,MAGIC_ANSWER_CODE 168 0000615F 7507 <1> jne @@exit 169 00006161 BA[8685] <1> mov dx,version_msg 170 00006164 81FB0301 <1> cmp bx,DEBUGGER_VERSION 171 <1> @@exit: 172 00006168 C3 <1> ret 173 <1> ;============================================================================= 174 <1> ; E0F 175 <1> ;============================================================================= 176 <1> 177 <1> 69 70 %include "tools.inc" ; 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; tools.inc 7 <1> ; Various tools. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; Changelog 28 <1> ;----------------------------------------------------------------------------- 29 <1> ; 2007-02-06 0leg list_memory_blocks added 30 <1> ;============================================================================= 31 <1> 32 <1> 33 <1> ;============================================================================= 34 <1> ; list_memory_blocks 35 <1> ;----------------------------------------------------------------------------- 36 <1> ; Lists DOS memory blocks. User can dump or disassemble selected block. 37 <1> ; In: --- 38 <1> ; Out: --- 39 <1> ; Modf: --- 40 <1> ; Call: init_string_list, fill_word_str, add_string, init_dialog, 41 <1> ; exec_dialog, get_address_, get_string_addr, push_unasm_pos, 42 <1> ; draw_screen, pushr, popr 43 <1> ; Use: first_mcb, string, msg_free, msg_noname, msg_dos, msg_prog, 44 <1> ; msg_env, msg_data, umb_available, list_mem_blocks_dialog, 45 <1> ; list_choice, dump_seg, dump_offs, unasm_seg, cur_line, cur_ip 46 <1> ; 47 <1> list_memory_blocks: 48 00006169 E832B8 <1> call pushr 49 0000616C B82900 <1> mov ax,41 50 0000616F E832C6 <1> call init_string_list 51 <1> 52 00006172 8E1E[94B5] <1> mov ds,[first_mcb] 53 <1> @@next: 54 00006176 B020 <1> mov al,' ' 55 00006178 B92800 <1> mov cx,40 56 0000617B BF[96B5] <1> mov di,string 57 0000617E F3AA <1> rep stosb 58 00006180 26C60500 <1> mov byte [es:di],0 59 00006184 1E <1> push ds 60 <1> 61 00006185 8CD8 <1> mov ax,ds 62 00006187 40 <1> inc ax 63 00006188 BF[96B5] <1> mov di,string 64 0000618B E891B8 <1> call fill_word_str ;Segment 65 <1> 66 0000618E BE[247E] <1> mov si,msg_free ;Type: free 67 00006191 BD[387E] <1> mov bp,msg_noname ;Name: 68 00006194 8CCB <1> mov bx,cs ;Seg: our 69 00006196 833E010000 <1> cmp word [1],0 ;Free block? 70 0000619B 742E <1> je @@set_type ;Yes 71 <1> 72 0000619D BE[287E] <1> mov si,msg_dos ;Type: dos 73 000061A0 BD0800 <1> mov bp,8 ;Name: get name from MCB 74 000061A3 8CDB <1> mov bx,ds ;Seg: MCB 75 000061A5 833E010008 <1> cmp word [1],8 ;DOS code/data? 76 000061AA 741F <1> je @@set_type ;Yes 77 <1> 78 000061AC BE[2C7E] <1> mov si,msg_prog ;Type: program 79 000061AF 8CD8 <1> mov ax,ds 80 000061B1 40 <1> inc ax ;Seg of block 81 000061B2 39060100 <1> cmp [1],ax ;Seg of owner 82 000061B6 7413 <1> je @@set_type ;It is really seg of PSP 83 <1> 84 000061B8 8B1E0100 <1> mov bx,[1] ;PSP seg of owner 85 000061BC 8EDB <1> mov ds,bx 86 000061BE 4B <1> dec bx ;Seg of owner's MCB 87 000061BF BE[307E] <1> mov si,msg_env ;Type: env. seg 88 000061C2 39062C00 <1> cmp [2ch],ax ;Env. segment? 89 000061C6 7403 <1> je @@set_type ;Yes 90 000061C8 BE[347E] <1> mov si,msg_data ;Type: data segment 91 <1> @@set_type: 92 000061CB 0E <1> push cs 93 000061CC 1F <1> pop ds 94 000061CD BF[AEB5] <1> mov di,string+24 95 000061D0 B90400 <1> mov cx,4 96 000061D3 F3A4 <1> rep movsb ;Type of block 97 <1> 98 000061D5 8EDB <1> mov ds,bx 99 000061D7 89EE <1> mov si,bp 100 000061D9 BF[B6B5] <1> mov di,string+32 101 000061DC B90800 <1> mov cx,8 102 000061DF F3A4 <1> rep movsb ;Name of block 103 <1> 104 000061E1 1F <1> pop ds 105 000061E2 A10100 <1> mov ax,[1] ;Owner's seg 106 000061E5 BF[9EB5] <1> mov di,string+8 107 000061E8 E834B8 <1> call fill_word_str 108 <1> 109 000061EB A10300 <1> mov ax,[3] ;Size of block 110 000061EE BF[A6B5] <1> mov di,string+16 111 000061F1 E82BB8 <1> call fill_word_str 112 <1> 113 000061F4 1E <1> push ds 114 000061F5 06 <1> push es 115 000061F6 0E <1> push cs 116 000061F7 1F <1> pop ds 117 000061F8 BE[96B5] <1> mov si,string 118 000061FB E8B6C5 <1> call add_string ;Add string to list 119 000061FE 07 <1> pop es 120 000061FF 1F <1> pop ds 121 <1> 122 00006200 803E00005A <1> cmp byte [0],'Z' ;Last block? 123 00006205 750F <1> jne @@m_block ;No 124 00006207 2E803E[227E]00 <1> cmp byte [cs:umb_available],0 125 0000620D 7413 <1> je @@quit ;UMB not available, quit 126 0000620F 8CD8 <1> mov ax,ds 127 00006211 3D00A0 <1> cmp ax,0a000h ;Z-block in UMB? 128 00006214 730C <1> jae @@quit ;Yes, quit 129 <1> @@m_block: 130 00006216 8CD8 <1> mov ax,ds 131 00006218 03060300 <1> add ax,[3] 132 0000621C 40 <1> inc ax 133 0000621D 8ED8 <1> mov ds,ax 134 0000621F E954FF <1> jmp @@next ;Loop 135 <1> @@quit: 136 00006222 0E <1> push cs 137 00006223 1F <1> pop ds 138 <1> 139 00006224 BE[1865] <1> mov si,list_mem_blocks_dialog 140 00006227 E8C1C0 <1> call init_dialog 141 0000622A E818C1 <1> call exec_dialog 142 0000622D 7433 <1> jz @@exit 143 <1> 144 0000622F 50 <1> push ax 145 <1> 146 00006230 A1[268D] <1> mov ax,[list_choice] 147 00006233 E8F1C6 <1> call get_string_addr 148 00006236 89C6 <1> mov si,ax 149 00006238 C6440400 <1> mov byte [si+4],0 150 0000623C E8ECA0 <1> call get_address_ 151 <1> 152 0000623F 5B <1> pop bx 153 00006240 83FB01 <1> cmp bx,1 ;Dump 154 00006243 750B <1> jne @@go_to_code 155 00006245 C706[BC8B]0000 <1> mov word [dump_offs],0 156 0000624B A3[BA8B] <1> mov [dump_seg],ax 157 0000624E EB12 <1> jmp @@exit 158 <1> @@go_to_code: 159 00006250 E80AF8 <1> call push_unasm_pos 160 00006253 A3[9B8B] <1> mov [unasm_seg],ax 161 00006256 C706[2878]0000 <1> mov word [cur_ip],0 162 0000625C C706[748B]0000 <1> mov word [cur_line],0 163 <1> @@exit: 164 00006262 E81CB5 <1> call draw_screen 165 00006265 E849B7 <1> call popr 166 00006268 C3 <1> ret 167 <1> ;============================================================================= 168 <1> ; E0F 169 <1> ;============================================================================= 170 <1> 171 <1> 71 %include "config.inc" 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; config.inc 7 <1> ; Configuration dialog. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> open_config: 26 00006269 C606[1F63]00 <1> mov byte [config_dlg_item], 0 27 <1> .loop: 28 0000626E BE[1863] <1> mov si, config_dialog 29 00006271 E877C0 <1> call init_dialog 30 00006274 E8D5C0 <1> call exec_dialog_ 31 00006277 83F803 <1> cmp ax, 3 32 0000627A 7407 <1> je .redraw 33 0000627C E81AB5 <1> call initialise_draw_table 34 0000627F E8FFB4 <1> call draw_screen 35 00006282 C3 <1> retn 36 <1> 37 <1> .redraw: 38 00006283 E813B5 <1> call initialise_draw_table 39 00006286 E8F8B4 <1> call draw_screen 40 00006289 EBE3 <1> jmp .loop 41 <1> 42 <1> redraw_config_change: 43 0000628B B80300 <1> mov ax, 3 44 0000628E F9 <1> stc 45 0000628F C3 <1> retn 72 73 ;============================================================================= 74 ; Initialized data. 75 ;============================================================================= 76 %include "actdlgs.inc" ;Dialog windows 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; actdlgs.inc 7 <1> ; Data: dialog windows. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; Changelog 28 <1> ;----------------------------------------------------------------------------- 29 <1> ; 2007-02-06 0leg animate_dialog, animate_title, delay_label added 30 <1> ; 2007-02-08 0leg list_mem_blocks_dialog, mem_blks_label, 31 <1> ; mem_blks_title, dump_button added 32 <1> ;============================================================================= 33 <1> 34 <1> 35 <1> ;============================================================================= 36 <1> align 2, db 0 37 <1> about_dialog: 38 00006290 0F024115 <1> db 15, 2, 65, 21 39 00006294 [DA68] <1> dw about_title 40 00006296 02 <1> db 2 41 00006297 00 <1> db 0 42 <1> 43 00006298 0800 <1> dw STATIC_TEXT 44 0000629A [C864] <1> dw about_labels 45 <1> 46 0000629C 0000 <1> dw PUSH_BUTTON 47 0000629E 1411 <1> db 20, 17 48 000062A0 0A <1> db 10 49 000062A1 00 <1> db 0 50 000062A2 [5B68] <1> dw ok_button 51 000062A4 0100 <1> dw CM_OK 52 <1> ;============================================================================= 53 <1> align 2, db 0 54 <1> info_dialog: 55 000062A6 10043E14 <1> db 16, 4, 62, 20 56 000062AA [E368] <1> dw info_title 57 000062AC 02 <1> db 2 58 000062AD 00 <1> db 0 59 <1> 60 000062AE 0800 <1> dw STATIC_TEXT 61 000062B0 [B264] <1> dw info_labels 62 <1> 63 000062B2 0000 <1> dw PUSH_BUTTON 64 000062B4 120E <1> db 18, 14 65 000062B6 0A <1> db 10 66 000062B7 00 <1> db 0 67 000062B8 [5B68] <1> dw ok_button 68 000062BA 0100 <1> dw CM_OK 69 <1> ;============================================================================= 70 <1> align 2, db 0 71 <1> search_dialog: 72 000062BC 0E064111 <1> db 14, 6, 65, 17 73 000062C0 [FE68] <1> dw search_title 74 000062C2 05 <1> db 5 75 000062C3 00 <1> search_dlg_item db 0 76 <1> 77 000062C4 0400 <1> dw INPUT_LINE 78 000062C6 0303 <1> db 3, 3 79 000062C8 [0267] <1> dw search_for_label 80 000062CA 2C32 <1> db 44, SEARCH_FILL_LEN 81 000062CC [548F] <1> dw search_string 82 <1> 83 000062CE 0C00 <1> dw CHECK_BOXES 84 000062D0 0306 <1> db 3, 6 85 000062D2 [0F67] <1> dw options_label 86 000062D4 0400 <1> dw 4 87 000062D6 0F00 <1> dw 15 88 000062D8 0000 <1> search_bits dw 0 89 000062DA [8267][D862]0100- <1> dw ignore_case_check, search_bits, 1, emptyfunction 89 000062E0 [2629] <1> 90 000062E2 [9067][D862]0200- <1> dw backward_check, search_bits, 2, emptyfunction 90 000062E8 [2629] <1> 91 000062EA [9B67][D862]0400- <1> dw exclude_hma_check, search_bits, 4, emptyfunction 91 000062F0 [2629] <1> 92 000062F2 [A967][D862]0800- <1> dw result_code_check, search_bits, 8, emptyfunction 92 000062F8 [2629] <1> 93 <1> 94 000062FA 0400 <1> dw INPUT_LINE 95 000062FC 1906 <1> db 25, 6 96 000062FE [F866] <1> dw addr_name_label 97 00006300 1618 <1> db 22, ADDRESS_STRING_LENGTH 98 00006302 [A890] <1> dw search_addr_str 99 <1> 100 00006304 0000 <1> dw PUSH_BUTTON 101 00006306 1909 <1> db 25, 9 ; Button1 102 00006308 0A <1> db 10 103 00006309 00 <1> db 0 104 0000630A [8168] <1> dw search_button 105 0000630C 0100 <1> dw CM_OK 106 <1> 107 0000630E 0000 <1> dw PUSH_BUTTON 108 00006310 2609 <1> db 38, 9 ; Button2 109 00006312 0A <1> db 10 110 00006313 00 <1> db 0 111 00006314 [7368] <1> dw cancel_button 112 00006316 0000 <1> dw CM_CANCEL 113 <1> ;============================================================================= 114 <1> align 2, db 0 115 <1> config_dialog: 116 00006318 0E064511 <1> db 14, 6, 14+55, 6+11 117 0000631C [0869] <1> dw config_title 118 0000631E 02 <1> db 2 119 0000631F 00 <1> config_dlg_item:db 0 120 <1> 121 00006320 0C00 <1> dw CHECK_BOXES 122 00006322 0302 <1> db 3, 2 123 00006324 [1967] <1> dw options_no_accelerator_label 124 00006326 0500 <1> dw 5 125 00006328 2800 <1> dw 40 126 0000632A 0000 <1> config_bits: dw 0 127 0000632C [BA67][8B8B]4000- <1> dw config_check_ascii, cmd_line_options, CMD_ASCII, redraw_config_change 127 00006332 [8B62] <1> 128 00006334 [D367][8A7E]FF00- <1> dw config_check_cpdump, option_cpdump, 0FFh, redraw_config_change 128 0000633A [8B62] <1> 129 0000633C [F867][8B7E]FF00- <1> dw config_check_beep, option_beep, 0FFh, emptyfunction 129 00006342 [2629] <1> 130 00006344 [1168][8C7E]FF00- <1> dw config_check_1680, option_1680, 0FFh, emptyfunction 130 0000634A [2629] <1> 131 0000634C [3768][8D7E]FF00- <1> dw config_check_hlt, option_hlt, 0FFh, emptyfunction 131 00006352 [2629] <1> 132 <1> 133 00006354 0000 <1> dw PUSH_BUTTON 134 00006356 1909 <1> db 25, 9 ; coordinates 135 00006358 0A <1> db 10 ; width 136 00006359 00 <1> db 0 137 0000635A [5B68] <1> dw ok_button 138 0000635C 0100 <1> dw CM_OK 139 <1> ;============================================================================= 140 <1> align 2, db 0 141 <1> copy_data_dialog: 142 0000635E 17063911 <1> db 23, 6, 57, 17 143 00006362 [1969] <1> dw copy_title 144 00006364 05 <1> db 5 145 00006365 00 <1> copy_dlg_item db 0 146 <1> 147 00006366 0400 <1> dw INPUT_LINE 148 00006368 0303 <1> db 3, 3 149 0000636A [2167] <1> dw from_label 150 0000636C 0C18 <1> db ADDR_STR_SIZE/2, ADDRESS_STRING_LENGTH 151 0000636E [A890] <1> dw from_string 152 <1> 153 00006370 0400 <1> dw INPUT_LINE 154 00006372 0306 <1> db 3, 6 155 00006374 [2867] <1> dw to_label 156 00006376 0C18 <1> db ADDR_STR_SIZE/2, ADDRESS_STRING_LENGTH 157 00006378 [C190] <1> dw to_string 158 <1> 159 0000637A 0400 <1> dw INPUT_LINE 160 0000637C 0309 <1> db 3, 9 161 0000637E [2D67] <1> dw count_label 162 00006380 0C18 <1> db ADDR_STR_SIZE/2, ADDRESS_STRING_LENGTH 163 00006382 [DA90] <1> dw count_string 164 <1> 165 00006384 0000 <1> dw PUSH_BUTTON 166 00006386 1503 <1> db 21, 3 ; Button1 167 00006388 0A <1> db 10 168 00006389 00 <1> db 0 169 0000638A [5B68] <1> dw ok_button 170 0000638C 0100 <1> dw CM_OK 171 <1> 172 0000638E 0000 <1> dw PUSH_BUTTON 173 00006390 1505 <1> db 21, 5 ; Button2 174 00006392 0A <1> db 10 175 00006393 00 <1> db 0 176 00006394 [7368] <1> dw cancel_button 177 00006396 0000 <1> dw CM_CANCEL 178 <1> ;============================================================================= 179 <1> align 2, db 0 180 <1> fill_data_dialog: 181 00006398 16063A11 <1> db 22, 6, 58, 17 182 0000639C [2769] <1> dw fill_title 183 0000639E 05 <1> db 5 184 0000639F 00 <1> fill_dlg_item db 0 185 <1> 186 000063A0 0400 <1> dw INPUT_LINE 187 000063A2 0303 <1> db 3, 3 188 000063A4 [2167] <1> dw from_label 189 000063A6 0C18 <1> db ADDR_STR_SIZE/2, ADDRESS_STRING_LENGTH 190 000063A8 [C190] <1> dw to_string 191 <1> 192 000063AA 0400 <1> dw INPUT_LINE 193 000063AC 1403 <1> db 20, 3 194 000063AE [2D67] <1> dw count_label 195 000063B0 0C18 <1> db ADDR_STR_SIZE/2, ADDRESS_STRING_LENGTH 196 000063B2 [DA90] <1> dw count_string 197 <1> 198 000063B4 0400 <1> dw INPUT_LINE 199 000063B6 0306 <1> db 3, 6 200 000063B8 [3567] <1> dw fill_label 201 000063BA 1D32 <1> db 29, SEARCH_FILL_LEN 202 000063BC [0C91] <1> dw fill_string 203 <1> 204 000063BE 0000 <1> dw PUSH_BUTTON 205 000063C0 0B09 <1> db 11, 9 ; Button1 206 000063C2 0A <1> db 10 207 000063C3 00 <1> db 0 208 000063C4 [5B68] <1> dw ok_button 209 000063C6 0100 <1> dw CM_OK 210 <1> 211 000063C8 0000 <1> dw PUSH_BUTTON 212 000063CA 1709 <1> db 23, 9 ; Button2 213 000063CC 0A <1> db 10 214 000063CD 00 <1> db 0 215 000063CE [7368] <1> dw cancel_button 216 000063D0 0000 <1> dw CM_CANCEL 217 <1> ;============================================================================= 218 <1> align 2, db 0 219 <1> write_data_dialog: 220 <1> read_data_dialog: 221 000063D2 16063A11 <1> db 22, 6, 58, 17 222 000063D6 [2769] <1> block_dlg_title dw fill_title 223 000063D8 05 <1> db 5 224 000063D9 00 <1> block_dlg_item db 0 225 <1> 226 000063DA 0400 <1> dw INPUT_LINE 227 000063DC 0303 <1> db 3, 3 228 000063DE [D566] <1> dw filename_label 229 000063E0 1D50 <1> db 29, FILENAME_LEN 230 000063E2 [038F] <1> dw filename_string 231 <1> 232 000063E4 0400 <1> dw INPUT_LINE 233 000063E6 0306 <1> db 3, 6 234 000063E8 [2167] <1> block_dlg_label dw from_label 235 000063EA 0C18 <1> db ADDR_STR_SIZE/2, ADDRESS_STRING_LENGTH 236 000063EC [A890] <1> dw from_string 237 <1> 238 000063EE 0400 <1> dw INPUT_LINE 239 000063F0 1406 <1> db 20, 6 240 000063F2 [2D67] <1> dw count_label 241 000063F4 0C18 <1> db ADDR_STR_SIZE/2, ADDRESS_STRING_LENGTH 242 000063F6 [DA90] <1> dw count_string 243 <1> 244 000063F8 0000 <1> dw PUSH_BUTTON 245 000063FA 0B09 <1> db 11, 9 ; Button1 246 000063FC 0A <1> db 10 247 000063FD 00 <1> db 0 248 000063FE [5B68] <1> dw ok_button 249 00006400 0100 <1> dw CM_OK 250 <1> 251 00006402 0000 <1> dw PUSH_BUTTON 252 00006404 1709 <1> db 23, 9 ; Button2 253 00006406 0A <1> db 10 254 00006407 00 <1> db 0 255 00006408 [7368] <1> dw cancel_button 256 0000640A 0000 <1> dw CM_CANCEL 257 <1> ;============================================================================= 258 <1> align 2, db 0 259 <1> question_dialog: 260 0000640C 12083F0F <1> db 18, 8, 63, 15 261 00006410 [F268] <1> dw question_title 262 00006412 04 <1> db 4 263 00006413 00 <1> db 0 264 <1> 265 00006414 0800 <1> dw STATIC_TEXT 266 00006416 [C466] <1> dw question_labels 267 <1> 268 00006418 0000 <1> dw PUSH_BUTTON 269 0000641A 0405 <1> db 4, 5 ; Button1 270 0000641C 0A <1> db 10 271 0000641D 00 <1> db 0 272 0000641E [6068] <1> dw append_button 273 00006420 0100 <1> dw CM_OK 274 <1> 275 00006422 0000 <1> dw PUSH_BUTTON 276 00006424 1105 <1> db 17, 5 ; Button1 277 00006426 0B <1> db 11 278 00006427 00 <1> db 0 279 00006428 [6968] <1> dw rewrite_button 280 0000642A 0200 <1> dw CM_OK+1 281 <1> 282 0000642C 0000 <1> dw PUSH_BUTTON 283 0000642E 1F05 <1> db 31, 5 ; Button2 284 00006430 0A <1> db 10 285 00006431 00 <1> db 0 286 00006432 [7368] <1> dw cancel_button 287 00006434 0000 <1> dw CM_CANCEL 288 <1> ;============================================================================= 289 <1> align 2, db 0 290 <1> arg_dialog: 291 00006436 15083B0F <1> db 21, 8, 59, 15 292 0000643A [5269] <1> dw arg_title 293 0000643C 03 <1> db 3 294 0000643D 00 <1> db 0 295 <1> 296 0000643E 0400 <1> dw INPUT_LINE 297 00006440 0303 <1> db 3, 3 298 00006442 [E966] <1> dw arg_name_label 299 00006444 1F7E <1> db 31, 126 300 00006446 [838E] <1> dw cmd_line_string 301 <1> 302 00006448 0000 <1> dw PUSH_BUTTON 303 0000644A 0D05 <1> db 13, 5 ; Button1 304 0000644C 0A <1> db 10 305 0000644D 00 <1> db 0 306 0000644E [5B68] <1> dw ok_button 307 00006450 0100 <1> dw CM_OK 308 <1> 309 00006452 0000 <1> dw PUSH_BUTTON 310 00006454 1905 <1> db 25, 5 ; Button2 311 00006456 0A <1> db 10 312 00006457 00 <1> db 0 313 00006458 [7368] <1> dw cancel_button 314 0000645A 0000 <1> dw CM_CANCEL 315 <1> ;============================================================================= 316 <1> align 2, db 0 317 <1> addr_dialog: 318 0000645C 1406330D <1> db 20, 6, 51, 13 319 00006460 [5F69] <1> dw enter_addr_title 320 00006462 03 <1> db 3 321 00006463 00 <1> db 0 322 <1> 323 00006464 0400 <1> dw INPUT_LINE 324 00006466 0303 <1> db 3, 3 325 00006468 [F866] <1> dw addr_name_label 326 0000646A 1818 <1> db ADDR_STR_SIZE, ADDRESS_STRING_LENGTH 327 0000646C [8F90] <1> d_addr_str dw main_addr_string 328 <1> 329 0000646E 0000 <1> dw PUSH_BUTTON 330 00006470 0305 <1> db 3, 5 ; Button1 331 00006472 0A <1> db 10 332 00006473 00 <1> db 0 333 00006474 [7C68] <1> dw go_button 334 00006476 0100 <1> dw CM_OK 335 <1> 336 00006478 0000 <1> dw PUSH_BUTTON 337 0000647A 1205 <1> db 18, 5 ; Button2 338 0000647C 0A <1> db 10 339 0000647D 00 <1> db 0 340 0000647E [7368] <1> dw cancel_button 341 00006480 0000 <1> dw CM_CANCEL 342 <1> ;============================================================================= 343 <1> align 2, db 0 344 <1> load_dialog: 345 00006482 10043613 <1> db 16, 4, 54, 19 346 00006486 [6769] <1> dw load_title 347 00006488 04 <1> db 4 348 00006489 00 <1> db 0 349 <1> 350 0000648A 0400 <1> dw INPUT_LINE 351 0000648C 0503 <1> list_string db 5, 3 352 0000648E [CE66] <1> dw name_label 353 00006490 1B50 <1> db 27, FILENAME_LEN 354 00006492 [BA8F] <1> dw filename 355 <1> 356 00006494 1000 <1> dw STRING_LIST 357 00006496 0506 <1> db 5, 6 358 00006498 [E166] <1> dw files_label 359 0000649A 0800 <1> dw 8 360 0000649C [8C64] <1> dw list_string 361 <1> 362 0000649E 00 <1> db PUSH_BUTTON 363 0000649F 00 <1> db 0 364 000064A0 1805 <1> db 24, 5 ; Button1 365 000064A2 0A <1> db 10 366 000064A3 00 <1> db 0 367 000064A4 [5B68] <1> dw ok_button 368 000064A6 0100 <1> dw CM_OK 369 <1> 370 000064A8 0000 <1> dw PUSH_BUTTON 371 000064AA 1808 <1> db 24, 8 ; Button2 372 000064AC 0A <1> db 10 373 000064AD 00 <1> db 0 374 000064AE [7368] <1> dw cancel_button 375 000064B0 0000 <1> dw CM_CANCEL 376 <1> ;============================================================================= 377 <1> align 2, db 0 378 <1> info_labels: 379 000064B2 1104 <1> db 17, 4 380 000064B4 [6875] <1> dw main_title 381 000064B6 0607 <1> db 6, 7 382 000064B8 [4366] <1> dw info_str_1 383 000064BA 0608 <1> db 6, 8 384 000064BC [6766] <1> dw info_str_2 385 000064BE 0A0B <1> db 10, 11 386 000064C0 [8B66] <1> dw info_str_3 387 000064C2 0B0C <1> db 11, 12 388 000064C4 [A866] <1> dw info_str_4 389 000064C6 0000 <1> dw 0 390 <1> ;============================================================================= 391 <1> align 2, db 0 392 <1> about_labels: 393 000064C8 1304 <1> db 19, 4 394 000064CA [6875] <1> dw main_title 395 000064CC 0B06 <1> db 26-(about_str_2-about_str_1)/2, 6 396 000064CE [4865] <1> dw about_str_1 397 000064D0 1207 <1> db 26-(about_str_3-about_str_2)/2, 7 398 000064D2 [6765] <1> dw about_str_2 399 000064D4 0D08 <1> db 26-(about_str_4-about_str_3)/2, 8 400 000064D6 [7865] <1> dw about_str_3 401 000064D8 080A <1> db 26-(about_str_5-about_str_4)/2, 10 402 000064DA [9365] <1> dw about_str_4 403 000064DC 130B <1> db 26-(about_str_6-about_str_5)/2, 11 404 000064DE [B765] <1> dw about_str_5 405 000064E0 0F0C <1> db 26-(about_str_7-about_str_6)/2, 12 406 000064E2 [C665] <1> dw about_str_6 407 000064E4 120E <1> db 26-(about_str_8-about_str_7)/2, 14 408 000064E6 [DD65] <1> dw about_str_7 409 000064E8 050F <1> db 26-(about_str_9-about_str_8)/2, 15 410 000064EA [ED65] <1> dw about_str_8 411 000064EC 0510 <1> db 26-(about_str_last-about_str_9)/2, 16 412 000064EE [1866] <1> dw about_str_9 413 000064F0 0000 <1> dw 0 414 <1> ;============================================================================= 415 <1> align 2, db 0 416 <1> animate_dialog: 417 000064F2 1806370D <1> db 24, 6, 55, 13 418 000064F6 [7669] <1> dw animate_title 419 000064F8 03 <1> db 3 420 000064F9 00 <1> anim_dlg_item db 0 421 <1> 422 000064FA 0400 <1> dw INPUT_LINE 423 000064FC 0303 <1> db 3, 3 424 000064FE [4167] <1> dw delay_label 425 00006500 1818 <1> db ADDR_STR_SIZE, ADDRESS_STRING_LENGTH 426 00006502 [F390] <1> dw delay_string 427 <1> 428 00006504 0000 <1> dw PUSH_BUTTON 429 00006506 0305 <1> db 3, 5 ; Button1 430 00006508 0A <1> db 10 431 00006509 00 <1> db 0 432 0000650A [5B68] <1> dw ok_button 433 0000650C 0100 <1> dw CM_OK 434 <1> 435 0000650E 0000 <1> dw PUSH_BUTTON 436 00006510 1205 <1> db 18, 5 ; Button2 437 00006512 0A <1> db 10 438 00006513 00 <1> db 0 439 00006514 [7368] <1> dw cancel_button 440 00006516 0000 <1> dw CM_CANCEL 441 <1> ;============================================================================= 442 <1> align 2, db 0 443 <1> list_mem_blocks_dialog: 444 00006518 10043F13 <1> db 16, 4, 63, 19 445 0000651C [8169] <1> dw mem_blks_title 446 0000651E 04 <1> db 4 447 0000651F 00 <1> db 0 448 <1> 449 00006520 1000 <1> dw STRING_LIST 450 00006522 0302 <1> db 3, 2 451 00006524 [5C67] <1> dw mem_blks_label 452 00006526 0A00 <1> dw 10 453 00006528 0000 <1> dw 0 ;No linked string 454 <1> 455 0000652A 00 <1> db PUSH_BUTTON ;Dump 456 0000652B 00 <1> db 0 457 0000652C 040D <1> db 4, 13 458 0000652E 0A <1> db 10 459 0000652F 00 <1> db 0 460 00006530 [8A68] <1> dw dump_button 461 00006532 0100 <1> dw 1 462 <1> 463 00006534 00 <1> db PUSH_BUTTON ;Go 464 00006535 00 <1> db 0 465 00006536 120D <1> db 18, 13 466 00006538 0A <1> db 10 467 00006539 00 <1> db 0 468 0000653A [7C68] <1> dw go_button 469 0000653C 0200 <1> dw 2 470 <1> 471 0000653E 00 <1> db PUSH_BUTTON ;Cancel 472 0000653F 00 <1> db 0 473 00006540 200D <1> db 32, 13 474 00006542 0A <1> db 10 475 00006543 00 <1> db 0 476 00006544 [7368] <1> dw cancel_button 477 00006546 0000 <1> dw CM_CANCEL 478 <1> ;============================================================================= 479 00006548 4F726967696E616C20- <1> about_str_1 db "Original idea and programming:", 0 479 00006551 6964656120616E6420- <1> 479 0000655A 70726F6772616D6D69- <1> 479 00006563 6E673A00 <1> 480 00006567 566963746F72204761- <1> about_str_2 db "Victor Gamayunov", 0 480 00006570 6D6179756E6F7600 <1> 481 00006578 436F70797269676874- <1> about_str_3 db "Copyright (c) 1993, 96, 97", 0 481 00006581 202863292031393933- <1> 481 0000658A 2C2039362C20393700 <1> 482 00006593 4164646974696F6E61- <1> about_str_4 db "Additional ideas and modifications:", 0 482 0000659C 6C2069646561732061- <1> 482 000065A5 6E64206D6F64696669- <1> 482 000065AE 636174696F6E733A00 <1> 483 000065B7 536572676579205069- <1> about_str_5 db "Sergey Pimenov", 0 483 000065C0 6D656E6F7600 <1> 484 000065C6 436F70797269676874- <1> about_str_6 db "Copyright (c) 1996, 97", 0 484 000065CF 202863292031393936- <1> 484 000065D8 2C20393700 <1> 485 000065DD 416C736F207468616E- <1> about_str_7 db "Also thanks to:", 0 485 000065E6 6B7320746F3A00 <1> 486 000065ED 536572676579204479- <1> about_str_8 db "Sergey Dyakov, Igor Tryndin, Andrey Ivanov", 0 486 000065F6 616B6F762C2049676F- <1> 486 000065FF 72205472796E64696E- <1> 486 00006608 2C20416E6472657920- <1> 486 00006611 4976616E6F7600 <1> 487 00006618 49676F72204D65726B- <1> about_str_9 db "Igor Merkulov, Dmitriy Dudkin, Igor Chorny", 0 487 00006621 756C6F762C20446D69- <1> 487 0000662A 74726979204475646B- <1> 487 00006633 696E2C2049676F7220- <1> 487 0000663C 43686F726E7900 <1> 488 <1> about_str_last: 489 <1> ;============================================================================= 490 00006643 496E7465726E616C20- <1> info_str_1 db "Internal version number: V06.S06", 0 490 0000664C 76657273696F6E206E- <1> 490 00006655 756D6265723A202020- <1> 490 0000665E 205630362E53303600 <1> 491 00006667 436F6D70696C617469- <1> info_str_2 db "Compilation date: ", BUILD, 0 491 00006670 6F6E20646174653A20- <1> 491 00006679 202020202020203230- <1> 491 00006682 30392D30312D313100 <1> 492 0000668B 436869702026204461- <1> info_str_3 db "Chip & Dale, Rescue Rangers", 0 492 00006694 6C652C202052657363- <1> 492 0000669D 75652052616E676572- <1> 492 000066A6 7300 <1> 493 000066A8 436F70797269676874- <1> info_str_4 db "Copyright (C) 1993, 96, 97", 0 493 000066B1 202843292031393933- <1> 493 000066BA 2C2039362C20393700 <1> 494 <1> ;============================================================================= 495 000066C3 00 <1> align 2, db 0 496 <1> question_labels: 497 000066C4 0403 <1> db 4, 3 498 000066C6 [9168] <1> dw question_str_1 499 000066C8 0604 <1> db 6, 4 500 000066CA [B868] <1> dw question_str_2 501 000066CC 0000 <1> dw 0 502 <1> ;============================================================================= 503 000066CE 7E4E7E616D6500 <1> name_label db "~N~ame", 0 504 000066D5 46696C65207E6E7E61- <1> filename_label db "File ~n~ame", 0 504 000066DE 6D6500 <1> 505 000066E1 7E467E696C657300 <1> files_label db "~F~iles", 0 506 000066E9 7E437E6F6D6D616E64- <1> arg_name_label db "~C~ommand line", 0 506 000066F2 206C696E6500 <1> 507 000066F8 7E417E646472657373- <1> addr_name_label db "~A~ddress", 0 507 00006701 00 <1> 508 00006702 536561726368207E66- <1> search_for_label db "Search ~f~or", 0 508 0000670B 7E6F7200 <1> 509 0000670F 7E4F7E7074696F6E73- <1> options_label db "~O~ptions", 0 509 00006718 00 <1> 510 <1> options_no_accelerator_label: 511 00006719 4F7074696F6E7300 <1> asciz "Options" 512 00006721 7E467E726F6D00 <1> from_label db "~F~rom", 0 513 00006728 7E547E6F00 <1> to_label db "~T~o", 0 514 0000672D 7E437E6F756E7400 <1> count_label db "~C~ount", 0 515 00006735 467E697E6C6C207769- <1> fill_label db "F~i~ll with", 0 515 0000673E 746800 <1> 516 00006741 456E7465722064656C- <1> delay_label db "Enter delay (18ths of sec)", 0 516 0000674A 617920283138746873- <1> 516 00006753 206F66207365632900 <1> 517 0000675C 205365672020202020- <1> mem_blks_label db " Seg Owner Size Type Name", 0 517 00006765 4F776E657220202053- <1> 517 0000676E 697A65202020205479- <1> 517 00006777 7065202020204E616D- <1> 517 00006780 6500 <1> 518 <1> ; 0123456789012345678901234567890123456789 519 <1> ; 0 1 2 3 520 <1> ;============================================================================= 521 00006782 7E497E676E6F726520- <1> ignore_case_check db "~I~gnore case", 0 521 0000678B 6361736500 <1> 522 00006790 7E427E61636B776172- <1> backward_check db "~B~ackward", 0 522 00006799 6400 <1> 523 0000679B 7E457E78636C756465- <1> exclude_hma_check db "~E~xclude HMA", 0 523 000067A4 20484D4100 <1> 524 000067A9 7E527E6573756C7420- <1> result_code_check db "~R~esult in code", 0 524 000067B2 696E20636F646500 <1> 525 <1> ;============================================================================= 526 000067BA 557365207E417E5343- <1> config_check_ascii: db "Use ~A~SCII for drawings", 0 526 000067C3 494920666F72206472- <1> 526 000067CC 6177696E677300 <1> 527 000067D3 44756D70207E437E6F- <1> config_check_cpdump: db "Dump ~C~odepage dependent characters", 0 527 000067DC 646570616765206465- <1> 527 000067E5 70656E64656E742063- <1> 527 000067EE 686172616374657273- <1> 527 000067F7 00 <1> 528 000067F8 426565702062792061- <1> config_check_beep: db "Beep by accessing ~p~ort", 0 528 00006801 6363657373696E6720- <1> 528 0000680A 7E707E6F727400 <1> 529 00006811 54727920746F206964- <1> config_check_1680: db "Try to idle using ~I~nterrupt 2F.1680", 0 529 0000681A 6C65207573696E6720- <1> 529 00006823 7E497E6E7465727275- <1> 529 0000682C 70742032462E313638- <1> 529 00006835 3000 <1> 530 00006837 54727920746F206964- <1> config_check_hlt: db "Try to idle using ~H~LT instruction", 0 530 00006840 6C65207573696E6720- <1> 530 00006849 7E487E4C5420696E73- <1> 530 00006852 7472756374696F6E00 <1> 531 <1> ;============================================================================= 532 0000685B 7E4F7E6B00 <1> ok_button db "~O~k", 0 533 00006860 7E417E7070656E6400 <1> append_button db "~A~ppend", 0 534 00006869 7E527E657772697465- <1> rewrite_button db "~R~ewrite", 0 534 00006872 00 <1> 535 00006873 7E437E616E63656C00 <1> cancel_button db "~C~ancel", 0 536 0000687C 7E477E6F00 <1> go_button db "~G~o", 0 537 00006881 7E537E656172636800 <1> search_button db "~S~earch", 0 538 0000688A 7E447E756D7000 <1> dump_button db "~D~ump", 0 539 <1> ;============================================================================= 540 00006891 46696C652077697468- <1> question_str_1 db "File with the same name already exist.", 0 540 0000689A 207468652073616D65- <1> 540 000068A3 206E616D6520616C72- <1> 540 000068AC 656164792065786973- <1> 540 000068B5 742E00 <1> 541 000068B8 5768617420646F2079- <1> question_str_2 db "What do you want to do with file?", 0 541 000068C1 6F752077616E742074- <1> 541 000068CA 6F20646F2077697468- <1> 541 000068D3 2066696C653F00 <1> 542 <1> ;============================================================================= 543 000068DA 077F2041626F757420 <1> about_title db 7, atDialogWindowTitle, " About " 544 000068E3 0D7F20496E666F726D- <1> info_title db 13, atDialogWindowTitle, " Information " 544 000068EC 6174696F6E20 <1> 545 000068F2 0A7F20517565737469- <1> question_title db 10, atDialogWindowTitle, " Question " 545 000068FB 6F6E20 <1> 546 000068FE 087F20536561726368- <1> search_title db 8, atDialogWindowTitle, " Search " 546 00006907 20 <1> 547 00006908 0F7F <1> config_title db .length, atDialogWindowTitle 548 <1> .string: 549 0000690A 20436F6E6669677572- <1> db " Configuration " 549 00006913 6174696F6E20 <1> 550 <1> .length: equ $ - .string 551 00006919 0C7F20436F70792042- <1> copy_title db 12, atDialogWindowTitle, " Copy Block " 551 00006922 6C6F636B20 <1> 552 00006927 0C7F2046696C6C2042- <1> fill_title db 12, atDialogWindowTitle, " Fill Block " 552 00006930 6C6F636B20 <1> 553 00006935 0C7F20526561642042- <1> read_title db 12, atDialogWindowTitle, " Read Block " 553 0000693E 6C6F636B20 <1> 554 00006943 0D7F20577269746520- <1> write_title db 13, atDialogWindowTitle, " Write Block " 554 0000694C 426C6F636B20 <1> 555 00006952 0B7F20417267756D65- <1> arg_title db 11, atDialogWindowTitle, " Arguments " 555 0000695B 6E747320 <1> 556 0000695F 067F20476F746F20 <1> enter_addr_title db 6, atDialogWindowTitle, " Goto " 557 00006967 0D7F204C6F61642061- <1> load_title db 13, atDialogWindowTitle, " Load a File " 557 00006970 2046696C6520 <1> 558 00006976 097F20416E696D6174- <1> animate_title db 9, atDialogWindowTitle, " Animate " 558 0000697F 6520 <1> 559 00006981 0F7F204D656D6F7279- <1> mem_blks_title db 15, atDialogWindowTitle, " Memory Blocks " 559 0000698A 20426C6F636B7320 <1> 560 <1> ;============================================================================= 561 <1> ; E0F 562 <1> ;============================================================================= 563 <1> 564 <1> 77 %include "menus.inc" ;Menus 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; menus.inc 7 <1> ; Data: menu definitions. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; Changelog 28 <1> ;----------------------------------------------------------------------------- 29 <1> ; 2007-11-17 0leg Menu structures optimized 30 <1> ;============================================================================= 31 <1> 32 <1> 33 <1> ;============================================================================= 34 <1> align 2, db 0 35 <1> menu_structure: 36 00006992 0600[9869][CE69] <1> dw 6, hmenu, hsub 37 00006998 7E467E696C6500 <1> hmenu db "~F~ile",0 38 0000699F 7E457E64697400 <1> db "~E~dit",0 39 000069A6 7E527E756E00 <1> db "~R~un",0 40 000069AC 7E427E7265616B706F- <1> db "~B~reakpoints",0 40 000069B5 696E747300 <1> 41 000069BA 7E4F7E7074696F6E73- <1> db "~O~ptions",0 41 000069C3 00 <1> 42 <1> ; db "~T~ools",0 43 000069C4 7E577E696E646F7700 <1> db "~W~indow",0 44 000069CD 00 <1> align 2, db 0 45 000069CE 0100[E669] <1> hsub dw SUB_MENU, file_submenu 46 000069D2 0100[3E6A] <1> dw SUB_MENU, edit_submenu 47 000069D6 0100[B66A] <1> dw SUB_MENU, run_submenu 48 000069DA 0100[606B] <1> dw SUB_MENU, bp_submenu 49 000069DE 0100[E26B] <1> dw SUB_MENU, options_submenu 50 <1> ; dw SUB_MENU, tools_submenu 51 000069E2 0100[BE6C] <1> dw SUB_MENU, window_submenu 52 <1> ;============================================================================= 53 <1> align 2, db 0 54 <1> file_submenu: 55 000069E6 01011209 <1> db 1, 1, 1+17, 9 ; Coords 56 000069EA 0500 <1> dw 5 ; Number 57 000069EC 000F <1> db 0, 15 ; Selected, Width 58 000069EE [F269] <1> dw file_sub 59 000069F0 [066A] <1> dw file_str 60 <1> align 2, db 0 61 000069F2 0000[2D06] <1> file_sub dw 0, load_file 62 000069F6 0000[E206] <1> dw 0, new_program 63 000069FA 0000[0300] <1> dw 0, about 64 000069FE 0000[8460] <1> resident_status dw 0, resident 65 00006A02 0000[CF16] <1> exit_status dw 0, quit_proc 66 00006A06 7E4C7E6F61642E2E2E- <1> file_str db "~L~oad...`F3",0 66 00006A0F 60463300 <1> 67 00006A13 7E4E7E657700 <1> db "~N~ew",0 68 00006A19 00 <1> db SEPARATOR 69 00006A1A 7E417E626F75742E2E- <1> db "~A~bout...",0 69 00006A23 2E00 <1> 70 00006A25 00 <1> db SEPARATOR 71 00006A26 7E527E65736964656E- <1> db "~R~esident",0 71 00006A2F 7400 <1> 72 00006A31 457E787E697460416C- <1> db "E~x~it`Alt+X",0 72 00006A3A 742B5800 <1> 73 <1> ;============================================================================= 74 <1> align 2, db 0 75 <1> edit_submenu: 76 00006A3E 07011C07 <1> db 7, 1, 7+21, 7 ; Coords 77 00006A42 0500 <1> dw 5 ; Number 78 00006A44 0013 <1> db 0, 19 ; Selected, Width 79 00006A46 [4A6A] <1> dw edit_sub 80 00006A48 [5E6A] <1> dw edit_str 81 <1> align 2, db 0 82 00006A4A 0000[DF14] <1> edit_sub dw 0, edit_commands 83 00006A4E 0000[1C11] <1> dw 0, edit_dump 84 00006A52 0000[0C0F] <1> dw 0, edit_registers 85 00006A56 0000[8410] <1> dw 0, edit_flags 86 00006A5A 0000[B313] <1> dw 0, edit_stack 87 00006A5E 7E417E7373656D626C- <1> edit_str db "~A~ssembler`Shift+A",0 87 00006A67 65726053686966742B- <1> 87 00006A70 4100 <1> 88 00006A72 7E447E756D70605368- <1> db "~D~ump`Shift+D",0 88 00006A7B 6966742B4400 <1> 89 00006A81 7E527E656769737465- <1> db "~R~egisters`Shift+R",0 89 00006A8A 72736053686966742B- <1> 89 00006A93 5200 <1> 90 00006A95 7E467E6C6167736053- <1> db "~F~lags`Shift+F",0 90 00006A9E 686966742B4600 <1> 91 00006AA5 7E537E7461636B6053- <1> db "~S~tack`Shift+S",0 91 00006AAE 686966742B5300 <1> 92 <1> ;============================================================================= 93 00006AB5 00 <1> align 2, db 0 94 <1> run_submenu: 95 00006AB6 0D01260B <1> db 13, 1, 13+25, 11; Coords 96 00006ABA 0800 <1> dw 8 ; Number 97 00006ABC 0017 <1> db 0, 23 ; Selected, Width 98 00006ABE [C26A] <1> dw run_sub 99 00006AC0 [E26A] <1> dw run_str 100 <1> align 2, db 0 101 00006AC2 0000[9E55] <1> run_sub dw 0, run_program 102 00006AC6 0000[E555] <1> dw 0, go_to_cursor 103 00006ACA 0000[0753] <1> dw 0, skip_instruction 104 00006ACE 0000[1D53] <1> dw 0, single_step 105 00006AD2 0000[D653] <1> dw 0, proc_trace 106 00006AD6 0000[BB54] <1> dw 0, animate 107 00006ADA 0000[E705] <1> dw 0, read_cmd_line 108 00006ADE 0000[8F06] <1> dw 0, reset_program 109 00006AE2 7E527E756E60437472- <1> run_str db "~R~un`Ctrl+F9", 0 109 00006AEB 6C2B463900 <1> 110 00006AF0 7E477E6F20746F2063- <1> db "~G~o to cursor`F4", 0 110 00006AF9 7572736F7260463400 <1> 111 00006B02 537E6B7E6970604636- <1> db "S~k~ip`F6", 0 111 00006B0B 00 <1> 112 00006B0C 7E547E726163652069- <1> db "~T~race into`F7", 0 112 00006B15 6E746F60463700 <1> 113 00006B1C 7E537E746570206F76- <1> db "~S~tep over`F8", 0 113 00006B25 657260463800 <1> 114 00006B2B 417E6E7E696D617465- <1> db "A~n~imate...", 0 114 00006B34 2E2E2E00 <1> 115 00006B38 00 <1> db SEPARATOR 116 00006B39 7E417E7267756D656E- <1> db "~A~rguments...", 0 116 00006B42 74732E2E2E00 <1> 117 00006B48 7E507E726F6772616D- <1> db "~P~rogram reset`Ctrl+F2", 0 117 00006B51 207265736574604374- <1> 117 00006B5A 726C2B463200 <1> 118 <1> ;============================================================================= 119 <1> align 2, db 0 120 <1> bp_submenu: 121 00006B60 12012609 <1> db 18, 1, 18+20, 9 ; Coords 122 00006B64 0600 <1> dw 6 ; Number 123 00006B66 0012 <1> db 0, 18 ; Selected, Width 124 00006B68 [6C6B] <1> dw bp_sub 125 00006B6A [846B] <1> dw bp_str 126 <1> align 2, db 0 127 00006B6C 0000[ED15] <1> bp_sub dw 0, toggle_break 128 00006B70 0000[3316] <1> dw 0, toggle_activity 129 00006B74 0200[136D] <1> dw DISABLED, test_proc 130 00006B78 0000[5D16] <1> dw 0, clear_all_breaks 131 00006B7C 0000[6116] <1> dw 0, enable_all_breaks 132 00006B80 0000[6516] <1> dw 0, disable_all_breaks 133 00006B84 7E537E65742F436C65- <1> bp_str db "~S~et/Clear`F2",0 133 00006B8D 617260463200 <1> 134 00006B93 7E417E637469766974- <1> db "~A~ctivity`Alt+F2",0 134 00006B9C 7960416C742B463200 <1> 135 00006BA5 7E457E6469742E2E2E- <1> db "~E~dit... ",0 135 00006BAE 202020202020202020- <1> 135 00006BB7 2000 <1> 136 00006BB9 00 <1> db SEPARATOR 137 00006BBA 7E447E656C65746520- <1> db "~D~elete all",0 137 00006BC3 616C6C00 <1> 138 00006BC7 457E6E7E61626C6520- <1> db "E~n~able all",0 138 00006BD0 616C6C00 <1> 139 00006BD4 447E697E7361626C65- <1> db "D~i~sable all",0 139 00006BDD 20616C6C00 <1> 140 <1> ;============================================================================= 141 <1> align 2, db 0 142 <1> options_submenu: 143 00006BE2 1F013905 <1> db 31, 1, 31+26, 5 ; Coords 144 00006BE6 0300 <1> dw 3 ; Number 145 00006BE8 0018 <1> db 0, 24 ; Selected, Width 146 00006BEA [EE6B] <1> dw options_sub 147 00006BEC [FA6B] <1> dw options_str 148 <1> align 2, db 0 149 00006BEE 0100[3A6C] <1> options_sub dw SUB_MENU, options_cpu 150 00006BF2 0100[8E6C] <1> dw SUB_MENU, options_swap 151 <1> ; dw DISABLED, test_proc 152 <1> ; dw DISABLED, test_proc 153 00006BF6 0000[6962] <1> dw 0, open_config 154 <1> options_str: 155 00006BFA 7E437E505520666F72- <1> db "~C~PU for disassembler`>",0 155 00006C03 20646973617373656D- <1> 155 00006C0C 626C6572603E00 <1> 156 <1> drawarrowoffset -2 157 00006C13 7E537E637265656E20- <1> db "~S~creen swapping`>",0 157 00006C1C 7377617070696E6760- <1> 157 00006C25 3E00 <1> 158 <1> drawarrowoffset -2 159 <1> ; db "~E~mulation...",0 160 <1> ; db "C~o~lors...",0 161 00006C27 436F7E6E7E66696775- <1> db "Co~n~figuration...",0 161 00006C30 726174696F6E2E2E2E- <1> 161 00006C39 00 <1> 162 <1> ;============================================================================= 163 <1> align 2, db 0 164 <1> options_cpu: 165 00006C3A 2D033B0A <1> db 45, 3, 45+14, 10 ; Coords 166 00006C3E 0500 <1> dw 5 ; Number 167 00006C40 000C <1> opt_cpu db 0, 12 ; Selected, Width 168 00006C42 [466C] <1> dw options_cpu_sub 169 00006C44 [5A6C] <1> dw options_cpu_str 170 <1> align 2, db 0 171 00006C46 0000[D516] <1> options_cpu_sub dw 0, set_cpu_88 172 00006C4A 0000[DD16] <1> dw 0, set_cpu_286 173 00006C4E 0000[E516] <1> dw 0, set_cpu_386 174 00006C52 0000[ED16] <1> dw 0, set_cpu_486 175 00006C56 0000[F516] <1> dw 0, set_cpu_auto 176 00006C5A 387E307E38362F3830- <1> options_cpu_str db "8~0~86/8088",0 176 00006C63 383800 <1> 177 00006C66 38307E327E383600 <1> db "80~2~86",0 178 00006C6E 38307E337E383600 <1> db "80~3~86",0 179 00006C76 38307E347E383600 <1> db "80~4~86",0 180 00006C7E 00 <1> db SEPARATOR 181 00006C7F 7E417E75746F206465- <1> db "~A~uto detect",0 181 00006C88 7465637400 <1> 182 <1> ;============================================================================= 183 00006C8D 00 <1> align 2, db 0 184 <1> options_swap: 185 00006C8E 2F043A08 <1> db 47, 4, 47+11, 8 ; Coords 186 00006C92 0300 <1> dw 3 ; Number 187 00006C94 0109 <1> swap_mode db 1, 9 ; Selected, Width 188 00006C96 [9A6C] <1> dw options_swap_sub 189 00006C98 [A66C] <1> dw options_swap_str 190 <1> align 2, db 0 191 00006C9A 0000[0717] <1> options_swap_sub dw 0, set_swap_off 192 00006C9E 0000[0D17] <1> dw 0, set_swap_smart 193 00006CA2 0000[1317] <1> dw 0, set_swap_on 194 00006CA6 7E4E7E6F6E6500 <1> options_swap_str db "~N~one",0 195 00006CAD 7E537E6D61727400 <1> db "~S~mart",0 196 00006CB5 7E417E6C7761797300 <1> db "~A~lways",0 197 <1> ;============================================================================= 198 <1> ;ToolsSubMenu ;~label byte 199 <1> ; db 40, 1, 40+26, 8 ; Coords 200 <1> ; dw 6 ; Number 201 <1> ; db 0, 24 ; Selected, Width 202 <1> ; dw ToolsSub 203 <1> ; dw ToolsStr 204 <1> ;ToolsSub dw DISABLED, test_proc 205 <1> ; dw DISABLED, test_proc 206 <1> ; dw DISABLED, test_proc 207 <1> ; dw DISABLED, test_proc 208 <1> ; dw DISABLED, test_proc 209 <1> ; dw DISABLED, test_proc 210 <1> ;ToolsStr db "~M~emory blocks list...",0 211 <1> ; db "~T~SR programs...",0 212 <1> ; db "~D~evice drivers...",0 213 <1> ; db "~H~ooked vectors...",0 214 <1> ; db "~I~/O",0 215 <1> ; db "~C~alculator...",0 216 <1> ;============================================================================= 217 <1> align 2, db 0 218 <1> window_submenu: 219 00006CBE 28014305 <1> db 40, 1, 40+27, 5 ; Coords 220 00006CC2 0300 <1> dw 3 ; Number 221 00006CC4 0019 <1> db 0, 25 ; Selected, Width 222 00006CC6 [CA6C] <1> dw window_sub 223 00006CC8 [D66C] <1> dw window_str 224 <1> align 2, db 0 225 00006CCA 0000[8117] <1> window_sub dw 0, draw_screen 226 00006CCE 0000[7917] <1> dw 0, toggle_ascii 227 00006CD2 0000[7802] <1> dw 0, exec_user_screen 228 00006CD6 7E527E656672657368- <1> window_str db "~R~efresh display`F5",0 228 00006CDF 20646973706C617960- <1> 228 00006CE8 463500 <1> 229 00006CEB 7E547E6F67676C6520- <1> db "~T~oggle ASCII use",0 229 00006CF4 415343494920757365- <1> 229 00006CFD 00 <1> 230 00006CFE 7E557E736572207363- <1> db "~U~ser screen`Alt+F5",0 230 00006D07 7265656E60416C742B- <1> 230 00006D10 463500 <1> 231 <1> 232 00006D13 C3 <1> test_proc: ret 233 <1> ;============================================================================= 234 <1> align 2, db 0 235 <1> cpu_local_struc: 236 00006D14 23013C10 <1> db 35, 1, 35+25, 2+14 237 00006D18 0B00 <1> dw 11 238 00006D1A 00 <1> db 0 239 00006D1B 17 <1> db 23 240 00006D1C [0A6E] <1> dw cpu_loc_sub 241 00006D1E [206D] <1> dw cpu_loc_str 242 00006D20 7E417E7373656D626C- <1> cpu_loc_str db "~A~ssembler`Shift+A",0 242 00006D29 65726053686966742B- <1> 242 00006D32 4100 <1> 243 00006D34 7E4E7E65772043533A- <1> db "~N~ew CS:IP`Ctrl+N",0 243 00006D3D 4950604374726C2B4E- <1> 243 00006D46 00 <1> 244 00006D47 33322D7E627E697420- <1> regs_menu_1 db "32-~b~it regs`Ctrl+R",0 244 00006D50 72656773604374726C- <1> 244 00006D59 2B5200 <1> 245 00006D5C 44617461207E777E61- <1> db "Data ~w~atch`Ctrl+W",0 245 00006D65 746368604374726C2B- <1> 245 00006D6E 5700 <1> 246 00006D70 00 <1> db SEPARATOR 247 00006D71 7E447E756D7020706F- <1> db "~D~ump position`>",0 247 00006D7A 736974696F6E603E00 <1> 248 <1> drawarrowoffset -2 249 00006D83 7E437E6F646520706F- <1> db "~C~ode position`>",0 249 00006D8C 736974696F6E603E00 <1> 250 <1> drawarrowoffset -2 251 00006D95 00 <1> db SEPARATOR 252 00006D96 527E657E73746F7265- <1> db "R~e~store CS:IP`Ctrl+C",0 252 00006D9F 2043533A4950604374- <1> 252 00006DA8 726C2B4300 <1> 253 00006DAD 7E527E6573746F7265- <1> db "~R~estore regs`Ctrl+A",0 253 00006DB6 207265677360437472- <1> 253 00006DBF 6C2B4100 <1> 254 00006DC3 526573746F7265207E- <1> db "Restore ~f~lags`Ctrl+T",0 254 00006DCC 667E6C616773604374- <1> 254 00006DD5 726C2B5400 <1> 255 00006DDA 00 <1> db SEPARATOR 256 00006DDB 7E537E656172636820- <1> db "~S~earch bytes...`Ctrl+S",0 256 00006DE4 62797465732E2E2E60- <1> 256 00006DED 4374726C2B5300 <1> 257 00006DF4 53656172636820617E- <1> db "Search a~g~ain`Ctrl+L",0 257 00006DFD 677E61696E60437472- <1> 257 00006E06 6C2B4C00 <1> 258 <1> align 2, db 0 259 00006E0A 0000[DF14] <1> cpu_loc_sub dw 0, edit_commands 260 00006E0E 0000[5302] <1> dw 0, new_csip 261 00006E12 0200[1E01] <1> reg_mode_stat_1 dw DISABLED, switch_reg_mode 262 00006E16 0000[FF00] <1> dw 0, data_watch 263 00006E1A 0100[9A6E] <1> dw SUB_MENU, dump_pos 264 00006E1E 0100[366E] <1> dw SUB_MENU, code_pos 265 00006E22 0000[9302] <1> dw 0, restore_csip 266 00006E26 0000[8402] <1> dw 0, restore_all 267 00006E2A 0000[8A02] <1> dw 0, restore_flags 268 00006E2E 0000[D15D] <1> dw 0, search_bytes 269 00006E32 0000[5D5E] <1> dw 0, search_next 270 <1> ;============================================================================= 271 <1> align 2, db 0 272 <1> code_pos: 273 00006E36 28093D0F <1> db 40, 9, 40+21, 9+6 274 00006E3A 0400 <1> dw 4 275 00006E3C 00 <1> db 0 276 00006E3D 13 <1> db 19 277 00006E3E [8A6E] <1> dw code_pos_sub 278 00006E40 [426E] <1> dw code_pos_str 279 00006E42 7E417E646472657373- <1> code_pos_str db "~A~ddress...`Ctrl+G",0 279 00006E4B 2E2E2E604374726C2B- <1> 279 00006E54 4700 <1> 280 00006E56 00 <1> db SEPARATOR 281 00006E57 7E4F7E726967696E60- <1> db "~O~rigin`Ctrl+O",0 281 00006E60 4374726C2B4F00 <1> 282 00006E67 7E467E6F6C6C6F7760- <1> db "~F~ollow`Ctrl+F",0 282 00006E70 4374726C2B4600 <1> 283 00006E77 7E507E726576696F75- <1> db "~P~revious`Ctrl+P",0 283 00006E80 73604374726C2B5000 <1> 284 00006E89 00 <1> align 2, db 0 285 00006E8A 0000[A202] <1> code_pos_sub dw 0, unasm_go_to 286 00006E8E 0000[3E02] <1> dw 0, go_to_origin 287 00006E92 0000[1D5A] <1> dw 0, follow 288 00006E96 0000[3C5A] <1> dw 0, previous 289 <1> ;============================================================================= 290 <1> align 2, db 0 291 <1> dump_pos: 292 00006E9A 28083D17 <1> db 40, 8, 40+21, 8+15 293 00006E9E 0D00 <1> dw 13 294 00006EA0 00 <1> db 0 295 00006EA1 13 <1> db 19 296 00006EA2 [9E6F] <1> dw dump_pos_sub 297 00006EA4 [A66E] <1> dw dump_pos_str 298 00006EA6 7E417E646472657373- <1> dump_pos_str db "~A~ddress...`Ctrl+D",0 298 00006EAF 2E2E2E604374726C2B- <1> 298 00006EB8 4400 <1> 299 00006EBA 7E527E65666572656E- <1> db "~R~eference`Alt+=",0 299 00006EC3 636560416C742B3D00 <1> 300 00006ECC 7E557E736572207363- <1> db "~U~ser screen`Alt+U",0 300 00006ED5 7265656E60416C742B- <1> 300 00006EDE 5500 <1> 301 00006EE0 00 <1> db SEPARATOR 302 00006EE1 44756D70207E447E53- <1> db "Dump ~D~S:SI`Alt+D",0 302 00006EEA 3A534960416C742B44- <1> 302 00006EF3 00 <1> 303 00006EF4 44756D70207E457E53- <1> db "Dump ~E~S:DI`Alt+E",0 303 00006EFD 3A444960416C742B45- <1> 303 00006F06 00 <1> 304 00006F07 44756D70207E537E53- <1> db "Dump ~S~S:BP`Alt+S",0 304 00006F10 3A425060416C742B53- <1> 304 00006F19 00 <1> 305 00006F1A 44756D70207E437E53- <1> db "Dump ~C~S:IP`Alt+C",0 305 00006F23 3A495060416C742B43- <1> 305 00006F2C 00 <1> 306 00006F2D 44756D702045533A7E- <1> db "Dump ES:~B~X`Alt+B",0 306 00006F36 427E5860416C742B42- <1> 306 00006F3F 00 <1> 307 00006F40 44756D702045533A53- <1> db "Dump ES:S~I~`Alt+I",0 307 00006F49 7E497E60416C742B49- <1> 307 00006F52 00 <1> 308 00006F53 44756D702044533A44- <1> db "Dump DS:DX`Alt+~F~",0 308 00006F5C 5860416C742B7E467E- <1> 308 00006F65 00 <1> 309 00006F66 44756D702044533A44- <1> db "Dump DS:DI`Alt+~J~",0 309 00006F6F 4960416C742B7E4A7E- <1> 309 00006F78 00 <1> 310 00006F79 44756D7020447E587E- <1> db "Dump D~X~:AX`Alt+A",0 310 00006F82 3A415860416C742B41- <1> 310 00006F8B 00 <1> 311 00006F8C 44756D7020636F6465- <1> db "Dump code`Alt+~L~",0 311 00006F95 60416C742B7E4C7E00 <1> 312 <1> align 2, db 0 313 00006F9E 0000[BF14] <1> dump_pos_sub dw 0, dump_go_to 314 00006FA2 0000[6358] <1> dw 0, dump_reference 315 00006FA6 0000[8258] <1> dw 0, dump_user_screen 316 00006FAA 0000[9558] <1> dw 0, dump_dssi 317 00006FAE 0000[8A58] <1> dw 0, dump_esdi 318 00006FB2 0000[AB58] <1> dw 0, dump_ssbp 319 00006FB6 0000[E258] <1> dw 0, dump_csip 320 00006FBA 0000[A058] <1> dw 0, dump_esbx 321 00006FBE 0000[CC58] <1> dw 0, dump_essi 322 00006FC2 0000[C158] <1> dw 0, dump_dsdx 323 00006FC6 0000[D758] <1> dw 0, dump_dsdi 324 00006FCA 0000[B658] <1> dw 0, dump_dxax 325 00006FCE 0000[7758] <1> dw 0, dump_cur_line 326 <1> ;============================================================================= 327 <1> align 2, db 0 328 <1> dump_menu_struc: 329 00006FD2 230E3C15 <1> db 35, 14, 35+25, 14+7 330 00006FD6 0500 <1> dw 5 331 00006FD8 00 <1> db 0 332 00006FD9 17 <1> db 23 333 00006FDA [3A70] <1> dw dump_loc_sub 334 00006FDC [DE6F] <1> dw dump_loc_str 335 <1> dump_loc_str: 336 00006FDE 7E447E756D7020706F- <1> db "~D~ump position`>",0 336 00006FE7 736974696F6E603E00 <1> 337 <1> drawarrowoffset -2 338 00006FF0 44756D70207E667E6F- <1> db "Dump ~f~ollow`>",0 338 00006FF9 6C6C6F77603E00 <1> 339 <1> drawarrowoffset -2 340 00007000 7E427E6C6F636B603E- <1> db "~B~lock`>",0 340 00007009 00 <1> 341 <1> drawarrowoffset -2 342 0000700A 00 <1> db SEPARATOR 343 0000700B 7E537E656172636820- <1> db "~S~earch bytes...`Ctrl+S",0 343 00007014 62797465732E2E2E60- <1> 343 0000701D 4374726C2B5300 <1> 344 00007024 53656172636820617E- <1> db "Search a~g~ain`Ctrl+L",0 344 0000702D 677E61696E60437472- <1> 344 00007036 6C2B4C00 <1> 345 <1> align 2, db 0 346 0000703A 0100[9A6E] <1> dump_loc_sub dw SUB_MENU, dump_pos 347 0000703E 0100[4E70] <1> dw SUB_MENU, follow_menu_struc 348 00007042 0100[C070] <1> dw SUB_MENU, block_menu_struc 349 00007046 0000[D15D] <1> dw 0, search_bytes 350 0000704A 0000[5D5E] <1> dw 0, search_next 351 <1> ;============================================================================= 352 <1> align 2, db 0 353 <1> follow_menu_struc: 354 0000704E 2E0F3D17 <1> db 46, 15, 46+15, 15+8 355 00007052 0600 <1> dw 6 356 00007054 00 <1> db 0 357 00007055 0D <1> db 13 358 00007056 [A870] <1> dw follow_loc_sub 359 00007058 [5A70] <1> dw follow_loc_str 360 0000705A 7E4E7E656172206461- <1> follow_loc_str db "~N~ear data",0 360 00007063 746100 <1> 361 00007066 7E467E617220646174- <1> db "~F~ar data",0 361 0000706F 6100 <1> 362 00007071 7E447E617461207365- <1> db "~D~ata segment",0 362 0000707A 676D656E7400 <1> 363 00007080 00 <1> db SEPARATOR 364 00007081 4E7E657E617220636F- <1> db "N~e~ar code",0 364 0000708A 646500 <1> 365 0000708D 467E617E7220636F64- <1> db "F~a~r code",0 365 00007096 6500 <1> 366 00007098 7E437E6F6465207365- <1> db "~C~ode segment",0 366 000070A1 676D656E7400 <1> 367 000070A7 00 <1> align 2, db 0 368 000070A8 0000[DE12] <1> follow_loc_sub dw 0, follow_near_data 369 000070AC 0000[D712] <1> dw 0, follow_far_data 370 000070B0 0000[CD12] <1> dw 0, follow_data_seg 371 000070B4 0000[FA12] <1> dw 0, follow_near_code 372 000070B8 0000[F312] <1> dw 0, follow_far_code 373 000070BC 0000[E912] <1> dw 0, follow_code_seg 374 <1> ;============================================================================= 375 <1> align 2, db 0 376 <1> block_menu_struc: 377 000070C0 2E123D17 <1> db 46, 18, 46+15, 18+5 378 000070C4 0400 <1> dw 4 379 000070C6 00 <1> db 0 380 000070C7 0D <1> db 13 381 000070C8 [F670] <1> dw block_loc_sub 382 000070CA [CC70] <1> dw block_loc_str 383 000070CC 7E437E6F70792E2E2E- <1> block_loc_str db "~C~opy...",0 383 000070D5 00 <1> 384 000070D6 7E467E696C6C2E2E2E- <1> db "~F~ill...",0 384 000070DF 00 <1> 385 000070E0 7E577E726974652E2E- <1> db "~W~rite...",0 385 000070E9 2E00 <1> 386 000070EB 7E527E6561642E2E2E- <1> db "~R~ead...",0 386 000070F4 00 <1> 387 000070F5 00 <1> align 2, db 0 388 000070F6 0000[C617] <1> block_loc_sub dw 0, copy_mem_block 389 000070FA 0000[3118] <1> dw 0, fill_mem_block 390 000070FE 0000[9818] <1> dw 0, write_mem_block 391 00007102 0000[3919] <1> dw 0, read_mem_block 392 <1> ;============================================================================= 393 <1> align 2, db 0 394 <1> regs_local_struc: 395 00007106 2F0A4815 <1> db 47, 10, 47+25, 10+11 396 0000710A 0800 <1> dw 8 397 0000710C 00 <1> db 0 398 0000710D 17 <1> db 23 399 0000710E [B271] <1> dw regs_loc_sub 400 00007110 [1271] <1> dw regs_loc_str 401 00007112 7E497E6E6372656D65- <1> regs_loc_str db "~I~ncrement`Ctrl+I",0 401 0000711B 6E74604374726C2B49- <1> 401 00007124 00 <1> 402 00007125 7E447E656372656D65- <1> db "~D~ecrement`Ctrl+D",0 402 0000712E 6E74604374726C2B44- <1> 402 00007137 00 <1> 403 00007138 7E5A7E65726F604374- <1> db "~Z~ero`Ctrl+Z",0 403 00007141 726C2B5A00 <1> 404 00007146 00 <1> db SEPARATOR 405 00007147 526573747E6F7E7265- <1> db "Rest~o~re`Ctrl+O",0 405 00007150 604374726C2B4F00 <1> 406 00007158 7E527E6573746F7265- <1> db "~R~estore all`Ctrl+A",0 406 00007161 20616C6C604374726C- <1> 406 0000716A 2B4100 <1> 407 0000716D 527E657E73746F7265- <1> db "R~e~store CS:IP`Ctrl+C",0 407 00007176 2043533A4950604374- <1> 407 0000717F 726C2B4300 <1> 408 00007184 526573746F7265207E- <1> db "Restore ~f~lags`Ctrl+T",0 408 0000718D 667E6C616773604374- <1> 408 00007196 726C2B5400 <1> 409 0000719B 00 <1> db SEPARATOR 410 0000719C 33322D7E627E697420- <1> regs_menu_2 db "32-~b~it regs`Ctrl+R",0 410 000071A5 72656773604374726C- <1> 410 000071AE 2B5200 <1> 411 000071B1 00 <1> align 2, db 0 412 000071B2 0000[AD0F] <1> regs_loc_sub dw 0, inc_reg 413 000071B6 0000[C90F] <1> dw 0, dec_reg 414 000071BA 0000[E70F] <1> dw 0, zero_reg 415 000071BE 0000[F90F] <1> dw 0, restore_reg 416 000071C2 0000[9A0F] <1> dw 0, _restore_all 417 000071C6 0000[A70F] <1> dw 0, _restore_csip 418 000071CA 0000[A10F] <1> dw 0, _restore_flags 419 000071CE 0200[940F] <1> reg_mode_stat_2 dw DISABLED, _switch_reg_mode 420 <1> ;============================================================================= 421 <1> align 2, db 0 422 <1> flags_local_struc: 423 000071D2 2F0C480F <1> db 47, 12, 47+25, 12+3 424 000071D6 0200 <1> dw 2 425 000071D8 00 <1> db 0 426 000071D9 17 <1> db 23 427 000071DA [0472] <1> dw flags_loc_sub 428 000071DC [DE71] <1> dw flags_loc_str 429 000071DE 7E547E6F67676C6560- <1> flags_loc_str db "~T~oggle`Space",0 429 000071E7 537061636500 <1> 430 000071ED 7E527E6573746F7265- <1> db "~R~estore flags`Ctrl+T",0 430 000071F6 20666C616773604374- <1> 430 000071FF 726C2B5400 <1> 431 <1> align 2, db 0 432 00007204 0000[7210] <1> flags_loc_sub dw 0, toggle_flag 433 00007208 0000[8A02] <1> dw 0, restore_flags 434 <1> ;============================================================================= 435 <1> ; E0F 436 <1> ;============================================================================= 78 %include "actdata.inc" ;Initialized variables 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; actdata.inc 7 <1> ; Data: initialized variables. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; Changelog 28 <1> ;----------------------------------------------------------------------------- 29 <1> ; 2007-02-06 0leg Some variables added. 30 <1> ; 2007-02-08 0leg Added entry w/ kbCtrlM into `main_loop'. 31 <1> ; 2007-03-18 0leg Added items_table. Changed flags_str. 32 <1> ; 2007-04-01 0leg reg_names removed. 33 <1> ; 2007-12-09 0leg 'string' -> "string" 34 <1> ; 2008-01-02 0leg point_options, string_changed moved to actudata.inc 35 <1> ;============================================================================= 36 <1> 37 <1> 38 <1> ;============================================================================= 39 <1> align 4, db 0 40 0000720C 002D0000 <1> main_loop dw kbAltX, 0 41 00007210 0044[AD16] <1> dw kbF10, execute_menu 42 00007214 FEFF[AD16] <1> dw kbAltAlone, execute_menu 43 00007218 0071[1917] <1> dw kbAltF10, cpu_local_menu 44 0000721C 003B[0F00] <1> dw kbF1, show_help 45 <1> 46 00007220 0050[4E01] <1> dw kbDown, cur_down 47 00007224 0048[6901] <1> dw kbUp, cur_up 48 00007228 0051[B501] <1> dw kbPgDn, page_down 49 0000722C 0049[C801] <1> dw kbPgUp, page_up 50 00007230 0047[0E02] <1> dw kbHome, cur_home 51 00007234 004F[1702] <1> dw kbEnd, cur_end 52 00007238 004D[2002] <1> dw kbRight, cur_right 53 0000723C 004B[2F02] <1> dw kbLeft, cur_left 54 00007240 0073[6202] <1> dw kbCtrlLeft, byte_up 55 00007244 0074[7102] <1> dw kbCtrlRight, byte_down 56 00007248 1A2C[6202] <1> dw kbCtrlZ, byte_up 57 0000724C 1915[6202] <1> dw kbCtrlY, byte_up 58 00007250 1A15[6202] <1> dw kbCtrlZGerman, byte_up 59 00007254 192C[6202] <1> dw kbCtrlYGerman, byte_up 60 00007258 182D[7102] <1> dw kbCtrlX, byte_down 61 <1> 62 0000725C 0A1C[3E02] <1> dw kbCtrlEnter, go_to_origin 63 00007260 0F18[3E02] <1> dw kbCtrlO, go_to_origin 64 00007264 0E31[5302] <1> dw kbCtrlN, new_csip 65 00007268 0722[A202] <1> dw kbCtrlG, unasm_go_to 66 0000726C 0420[BF14] <1> dw kbCtrlD, dump_go_to 67 00007270 0230[B414] <1> dw kbCtrlB, block_menu 68 00007274 0621[1D5A] <1> dw kbCtrlF, follow 69 00007278 0D1C[1D5A] <1> dw kbEnter, follow 70 0000727C 1019[3C5A] <1> dw kbCtrlP, previous 71 00007280 080E[3C5A] <1> dw kbBackSpace, previous 72 <1> 73 00007284 011E[8402] <1> dw kbCtrlA, restore_all 74 00007288 1414[8A02] <1> dw kbCtrlT, restore_flags 75 0000728C 032E[9302] <1> dw kbCtrlC, restore_csip 76 00007290 1213[1E01] <1> dw kbCtrlR, switch_reg_mode 77 <1> 78 00007294 131F[D15D] <1> dw kbCtrlS, search_bytes 79 00007298 0C26[5D5E] <1> dw kbCtrlL, search_next 80 <1> 81 0000729C 006C[7802] <1> dw kbAltF5, exec_user_screen 82 000072A0 003F[8117] <1> dw kbF5, draw_screen 83 <1> 84 000072A4 0040[0753] <1> dw kbF6, skip_instruction 85 000072A8 0041[1D53] <1> dw kbF7, single_step 86 000072AC 0042[D653] <1> dw kbF8, proc_trace 87 000072B0 0066[9E55] <1> dw kbCtrlF9, run_program 88 000072B4 003E[E555] <1> dw kbF4, go_to_cursor 89 000072B8 003C[ED15] <1> dw kbF2, toggle_break 90 000072BC 0069[3316] <1> dw kbAltF2, toggle_activity 91 <1> 92 000072C0 005F[8F06] <1> dw kbCtrlF2, reset_program 93 000072C4 003D[2D06] <1> dw kbF3, load_file 94 <1> 95 000072C8 0D32[6961] <1> dw kbCtrlM, list_memory_blocks 96 000072CC 162F[6961] <1> dw kbCtrlV, list_memory_blocks 97 <1> 98 000072D0 1711[FF00] <1> dw kbCtrlW, data_watch 99 <1> 100 000072D4 0012[8A58] <1> dw kbAltE, dump_esdi 101 000072D8 0020[9558] <1> dw kbAltD, dump_dssi 102 000072DC 0030[A058] <1> dw kbAltB, dump_esbx 103 000072E0 001F[AB58] <1> dw kbAltS, dump_ssbp 104 000072E4 002E[E258] <1> dw kbAltC, dump_csip 105 000072E8 001E[B658] <1> dw kbAltA, dump_dxax 106 000072EC 0021[C158] <1> dw kbAltF, dump_dsdx 107 000072F0 0017[CC58] <1> dw kbAltI, dump_essi 108 000072F4 0024[D758] <1> dw kbAltJ, dump_dsdi 109 000072F8 0026[7758] <1> dw kbAltL, dump_cur_line 110 000072FC 0083[6358] <1> dw kbAltEqu, dump_reference 111 00007300 0016[8258] <1> dw kbAltU, dump_user_screen 112 <1> 113 00007304 0078[3459] <1> dw kbAlt1, set_code_mark_1 114 00007308 0079[3759] <1> dw kbAlt2, set_code_mark_2 115 0000730C 007A[3A59] <1> dw kbAlt3, set_code_mark_3 116 00007310 007B[3D59] <1> dw kbAlt4, set_code_mark_4 117 00007314 007C[4059] <1> dw kbAlt5, set_code_mark_5 118 00007318 007D[4359] <1> dw kbAlt6, set_code_mark_6 119 0000731C 007E[4659] <1> dw kbAlt7, set_code_mark_7 120 00007320 007F[4959] <1> dw kbAlt8, set_code_mark_8 121 00007324 0080[4C59] <1> dw kbAlt9, set_code_mark_9 122 00007328 0081[3159] <1> dw kbAlt0, set_code_mark_0 123 <1> 124 0000732C 3102[B659] <1> dw 0200h + '1', code_mark_1 125 00007330 3203[B959] <1> dw 0300h + '2', code_mark_2 126 00007334 3304[BC59] <1> dw 0400h + '3', code_mark_3 127 00007338 3405[BF59] <1> dw 0500h + '4', code_mark_4 128 0000733C 3506[C259] <1> dw 0600h + '5', code_mark_5 129 00007340 3607[C559] <1> dw 0700h + '6', code_mark_6 130 00007344 3708[C859] <1> dw 0800h + '7', code_mark_7 131 00007348 3809[CB59] <1> dw 0900h + '8', code_mark_8 132 0000734C 390A[CE59] <1> dw 0A00h + '9', code_mark_9 133 00007350 300B[B359] <1> dw 0B00h + '0', code_mark_0 134 <1> 135 00007354 2102[8459] <1> dw 0200h + '!', clear_code_mark_1 136 00007358 4003[8759] <1> dw 0300h + '@', clear_code_mark_2 137 0000735C 2304[8A59] <1> dw 0400h + '#', clear_code_mark_3 138 00007360 2405[8D59] <1> dw 0500h + '$', clear_code_mark_4 139 00007364 2506[9059] <1> dw 0600h + '%', clear_code_mark_5 140 00007368 5E07[9359] <1> dw 0700h + '^', clear_code_mark_6 141 0000736C 2608[9659] <1> dw 0800h + '&', clear_code_mark_7 142 00007370 2A09[9959] <1> dw 0900h + '*', clear_code_mark_8 143 00007374 280A[9C59] <1> dw 0A00h + '(', clear_code_mark_9 144 00007378 290B[8159] <1> dw 0B00h + ')', clear_code_mark_0 145 <1> 146 0000737C 0000[BB00] <1> dw 0, any_key 147 <1> 148 00007380 0C01011401 <1> magic_code db 'I'^45h, 'D'^45h, 'D'^45h, 'Q'^45h, 'D'^45h 149 <1> 150 00007385 00 <1> align 4, db 0 151 <1> ;----------------------------------------------------------------------------- 152 <1> ;ax bx cx dx si di bp sp cs ds es ss ip fl 153 <1> ; 0 1 2 3 4 5 6 7 8 9 10 11 12 13 154 <1> ; 155 <1> ; Distance between this reg. struc and linked struc --. 156 <1> ; Pointer to reg's content ----. ,----,---,----,---' 157 <1> ; Reg's position (X/Y) --.--. | L R U D 158 <1> ; | | | | | | | 159 <1> reg16_pos_table:; V V V V V V V 160 <1> reg_pos 3, 0, AX, 13, 4, 12, 1 ;FL, SI, IP, BX 417 00007388 3A <2> db REG_X+%1 418 00007389 00 <2> db REG_Y+%2 419 0000738A [C88A] <2> dw cpu_regs+REG_%3 420 0000738C 0D <2> db %4 421 0000738D 04 <2> db %5 422 0000738E 0C <2> db %6 423 0000738F 01 <2> db %7 161 <1> reg_pos 3, 1, BX, 7, 4, -1, 1 ;CS, DI, AX, CX 417 00007390 3A <2> db REG_X+%1 418 00007391 01 <2> db REG_Y+%2 419 00007392 [CC8A] <2> dw cpu_regs+REG_%3 420 00007394 07 <2> db %4 421 00007395 04 <2> db %5 422 00007396 FF <2> db %6 423 00007397 01 <2> db %7 162 <1> reg_pos 3, 2, CX, 7, 4, -1, 1 ;DS, BP, BX, DX 417 00007398 3A <2> db REG_X+%1 418 00007399 02 <2> db REG_Y+%2 419 0000739A [D08A] <2> dw cpu_regs+REG_%3 420 0000739C 07 <2> db %4 421 0000739D 04 <2> db %5 422 0000739E FF <2> db %6 423 0000739F 01 <2> db %7 163 <1> reg_pos 3, 3, DX, 7, 4, -1, 9 ;ES, SP, CX, IP 417 000073A0 3A <2> db REG_X+%1 418 000073A1 03 <2> db REG_Y+%2 419 000073A2 [D48A] <2> dw cpu_regs+REG_%3 420 000073A4 07 <2> db %4 421 000073A5 04 <2> db %5 422 000073A6 FF <2> db %6 423 000073A7 09 <2> db %7 164 <1> reg_pos 12, 0, SI, -4, 4, 3, 1 ;AX, CS, SP, DI 417 000073A8 43 <2> db REG_X+%1 418 000073A9 00 <2> db REG_Y+%2 419 000073AA [D88A] <2> dw cpu_regs+REG_%3 420 000073AC FC <2> db %4 421 000073AD 04 <2> db %5 422 000073AE 03 <2> db %6 423 000073AF 01 <2> db %7 165 <1> reg_pos 12, 1, DI, -4, 4, -1, 1 ;BX, DS, SI, BP 417 000073B0 43 <2> db REG_X+%1 418 000073B1 01 <2> db REG_Y+%2 419 000073B2 [DC8A] <2> dw cpu_regs+REG_%3 420 000073B4 FC <2> db %4 421 000073B5 04 <2> db %5 422 000073B6 FF <2> db %6 423 000073B7 01 <2> db %7 166 <1> reg_pos 12, 2, BP, -4, 4, -1, 1 ;CX, ES, DI, SP 417 000073B8 43 <2> db REG_X+%1 418 000073B9 02 <2> db REG_Y+%2 419 000073BA [E08A] <2> dw cpu_regs+REG_%3 420 000073BC FC <2> db %4 421 000073BD 04 <2> db %5 422 000073BE FF <2> db %6 423 000073BF 01 <2> db %7 167 <1> reg_pos 12, 3, SP, -4, 4, -1, 5 ;DX, SS, BP, IP 417 000073C0 43 <2> db REG_X+%1 418 000073C1 03 <2> db REG_Y+%2 419 000073C2 [E48A] <2> dw cpu_regs+REG_%3 420 000073C4 FC <2> db %4 421 000073C5 04 <2> db %5 422 000073C6 FF <2> db %6 423 000073C7 05 <2> db %7 168 <1> reg_pos 21, 0, CS, -4, -7, 5, 1 ;SI, BX, FL, DS 417 000073C8 4C <2> db REG_X+%1 418 000073C9 00 <2> db REG_Y+%2 419 000073CA [E88A] <2> dw cpu_regs+REG_%3 420 000073CC FC <2> db %4 421 000073CD F9 <2> db %5 422 000073CE 05 <2> db %6 423 000073CF 01 <2> db %7 169 <1> reg_pos 21, 1, DS, -4, -7, -1, 1 ;DI, CX, CS, ES 417 000073D0 4C <2> db REG_X+%1 418 000073D1 01 <2> db REG_Y+%2 419 000073D2 [EC8A] <2> dw cpu_regs+REG_%3 420 000073D4 FC <2> db %4 421 000073D5 F9 <2> db %5 422 000073D6 FF <2> db %6 423 000073D7 01 <2> db %7 170 <1> reg_pos 21, 2, ES, -4, -7, -1, 1 ;BP, DX, DS, SS 417 000073D8 4C <2> db REG_X+%1 418 000073D9 02 <2> db REG_Y+%2 419 000073DA [F08A] <2> dw cpu_regs+REG_%3 420 000073DC FC <2> db %4 421 000073DD F9 <2> db %5 422 000073DE FF <2> db %6 423 000073DF 01 <2> db %7 171 <1> reg_pos 21, 3, SS, -4, 1, -1, 2 ;SP, IP, ES, FL 417 000073E0 4C <2> db REG_X+%1 418 000073E1 03 <2> db REG_Y+%2 419 000073E2 [F48A] <2> dw cpu_regs+REG_%3 420 000073E4 FC <2> db %4 421 000073E5 01 <2> db %5 422 000073E6 FF <2> db %6 423 000073E7 02 <2> db %7 172 <1> reg_pos 3, 5, IP, -1, 1, -9, -12 ;SS, FL, DX, AX 417 000073E8 3A <2> db REG_X+%1 418 000073E9 05 <2> db REG_Y+%2 419 000073EA [008B] <2> dw cpu_regs+REG_%3 420 000073EC FF <2> db %4 421 000073ED 01 <2> db %5 422 000073EE F7 <2> db %6 423 000073EF F4 <2> db %7 173 <1> reg_pos 21, 5, FL, -1, -13, -2, -5 ;IP, AX, SS, CS 417 000073F0 4C <2> db REG_X+%1 418 000073F1 05 <2> db REG_Y+%2 419 000073F2 [048B] <2> dw cpu_regs+REG_%3 420 000073F4 FF <2> db %4 421 000073F5 F3 <2> db %5 422 000073F6 FE <2> db %6 423 000073F7 FB <2> db %7 174 <1> 175 <1> align 4, db 0 176 <1> ;----------------------------------------------------------------------------- 177 <1> ;eaxh eaxl ebxh ebxl ecxh ecxl edxh edxl esih esil edih edil 178 <1> ; 0 1 2 3 4 5 6 7 8 9 10 11 179 <1> ;ebph ebpl esph espl ecs eds ees ess efs egs eip efl 180 <1> ; 12 13 14 15 16 17 18 19 20 21 22 23 181 <1> reg32_pos_table: 182 <1> reg_pos 4, 0, AX+2, 23, 1, 14, 2 ;EFL, EAXL, ESPH, EBXH 417 000073F8 3B <2> db REG_X+%1 418 000073F9 00 <2> db REG_Y+%2 419 000073FA [CA8A] <2> dw cpu_regs+REG_%3 420 000073FC 17 <2> db %4 421 000073FD 01 <2> db %5 422 000073FE 0E <2> db %6 423 000073FF 02 <2> db %7 183 <1> reg_pos 9, 0, AX, -1, 15, 14, 2 ;EAXH, ECS, ESPL, EBXL 417 00007400 40 <2> db REG_X+%1 418 00007401 00 <2> db REG_Y+%2 419 00007402 [C88A] <2> dw cpu_regs+REG_%3 420 00007404 FF <2> db %4 421 00007405 0F <2> db %5 422 00007406 0E <2> db %6 423 00007407 02 <2> db %7 184 <1> reg_pos 4, 1, BX+2, 14, 1, -2, 2 ;ECS, EBXL, EAXH, ECXH 417 00007408 3B <2> db REG_X+%1 418 00007409 01 <2> db REG_Y+%2 419 0000740A [CE8A] <2> dw cpu_regs+REG_%3 420 0000740C 0E <2> db %4 421 0000740D 01 <2> db %5 422 0000740E FE <2> db %6 423 0000740F 02 <2> db %7 185 <1> reg_pos 9, 1, BX, -1, 14, -2, 2 ;EBXH, EDS, EAXL, ECXL 417 00007410 40 <2> db REG_X+%1 418 00007411 01 <2> db REG_Y+%2 419 00007412 [CC8A] <2> dw cpu_regs+REG_%3 420 00007414 FF <2> db %4 421 00007415 0E <2> db %5 422 00007416 FE <2> db %6 423 00007417 02 <2> db %7 186 <1> reg_pos 4, 2, CX+2, 13, 1, -2, 2 ;EDS, ECXL, EBXH, EDXH 417 00007418 3B <2> db REG_X+%1 418 00007419 02 <2> db REG_Y+%2 419 0000741A [D28A] <2> dw cpu_regs+REG_%3 420 0000741C 0D <2> db %4 421 0000741D 01 <2> db %5 422 0000741E FE <2> db %6 423 0000741F 02 <2> db %7 187 <1> reg_pos 9, 2, CX, -1, 13, -2, 2 ;ECXH, EES, EBXL, EDXL 417 00007420 40 <2> db REG_X+%1 418 00007421 02 <2> db REG_Y+%2 419 00007422 [D08A] <2> dw cpu_regs+REG_%3 420 00007424 FF <2> db %4 421 00007425 0D <2> db %5 422 00007426 FE <2> db %6 423 00007427 02 <2> db %7 188 <1> reg_pos 4, 3, DX+2, 12, 1, -2, 2 ;EES, EDXL, ECXH, ESIH 417 00007428 3B <2> db REG_X+%1 418 00007429 03 <2> db REG_Y+%2 419 0000742A [D68A] <2> dw cpu_regs+REG_%3 420 0000742C 0C <2> db %4 421 0000742D 01 <2> db %5 422 0000742E FE <2> db %6 423 0000742F 02 <2> db %7 189 <1> reg_pos 9, 3, DX, -1, 12, -2, 2 ;EDXH, ESS, ECXL, ESIL 417 00007430 40 <2> db REG_X+%1 418 00007431 03 <2> db REG_Y+%2 419 00007432 [D48A] <2> dw cpu_regs+REG_%3 420 00007434 FF <2> db %4 421 00007435 0C <2> db %5 422 00007436 FE <2> db %6 423 00007437 02 <2> db %7 190 <1> reg_pos 4, 4, SI+2, 11, 1, -2, 2 ;ESS, ESIL, EDXH, EDIH 417 00007438 3B <2> db REG_X+%1 418 00007439 04 <2> db REG_Y+%2 419 0000743A [DA8A] <2> dw cpu_regs+REG_%3 420 0000743C 0B <2> db %4 421 0000743D 01 <2> db %5 422 0000743E FE <2> db %6 423 0000743F 02 <2> db %7 191 <1> reg_pos 9, 4, SI, -1, 11, -2, 2 ;ESIH, EFS, EDXL, EDIL 417 00007440 40 <2> db REG_X+%1 418 00007441 04 <2> db REG_Y+%2 419 00007442 [D88A] <2> dw cpu_regs+REG_%3 420 00007444 FF <2> db %4 421 00007445 0B <2> db %5 422 00007446 FE <2> db %6 423 00007447 02 <2> db %7 192 <1> reg_pos 4, 5, DI+2, 10, 1, -2, 2 ;EFS, EDIL, ESIH, EBPH 417 00007448 3B <2> db REG_X+%1 418 00007449 05 <2> db REG_Y+%2 419 0000744A [DE8A] <2> dw cpu_regs+REG_%3 420 0000744C 0A <2> db %4 421 0000744D 01 <2> db %5 422 0000744E FE <2> db %6 423 0000744F 02 <2> db %7 193 <1> reg_pos 9, 5, DI, -1, 10, -2, 2 ;EDIH, EGS, ESIL, EBPL 417 00007450 40 <2> db REG_X+%1 418 00007451 05 <2> db REG_Y+%2 419 00007452 [DC8A] <2> dw cpu_regs+REG_%3 420 00007454 FF <2> db %4 421 00007455 0A <2> db %5 422 00007456 FE <2> db %6 423 00007457 02 <2> db %7 194 <1> reg_pos 4, 7, BP+2, 9, 1, -2, 2 ;EGS, EBPL, EDIH, ESPH 417 00007458 3B <2> db REG_X+%1 418 00007459 07 <2> db REG_Y+%2 419 0000745A [E28A] <2> dw cpu_regs+REG_%3 420 0000745C 09 <2> db %4 421 0000745D 01 <2> db %5 422 0000745E FE <2> db %6 423 0000745F 02 <2> db %7 195 <1> reg_pos 9, 7, BP, -1, 9, -2, 2 ;EBPH, EIP, EDIL, ESPL 417 00007460 40 <2> db REG_X+%1 418 00007461 07 <2> db REG_Y+%2 419 00007462 [E08A] <2> dw cpu_regs+REG_%3 420 00007464 FF <2> db %4 421 00007465 09 <2> db %5 422 00007466 FE <2> db %6 423 00007467 02 <2> db %7 196 <1> reg_pos 4, 8, SP+2, 8, 1, -2, -14 ;EIP, ESPL, EBPH, EAXH 417 00007468 3B <2> db REG_X+%1 418 00007469 08 <2> db REG_Y+%2 419 0000746A [E68A] <2> dw cpu_regs+REG_%3 420 0000746C 08 <2> db %4 421 0000746D 01 <2> db %5 422 0000746E FE <2> db %6 423 0000746F F2 <2> db %7 197 <1> reg_pos 9, 8, SP, -1, 8, -2, -14 ;ESPH, EFL, EBPL, EAXL 417 00007470 40 <2> db REG_X+%1 418 00007471 08 <2> db REG_Y+%2 419 00007472 [E48A] <2> dw cpu_regs+REG_%3 420 00007474 FF <2> db %4 421 00007475 08 <2> db %5 422 00007476 FE <2> db %6 423 00007477 F2 <2> db %7 198 <1> reg_pos 21, 0, CS, -15, -14, 7, 1 ;EAXL, EBXH, EFL, EDS 417 00007478 4C <2> db REG_X+%1 418 00007479 00 <2> db REG_Y+%2 419 0000747A [E88A] <2> dw cpu_regs+REG_%3 420 0000747C F1 <2> db %4 421 0000747D F2 <2> db %5 422 0000747E 07 <2> db %6 423 0000747F 01 <2> db %7 199 <1> reg_pos 21, 1, DS, -14, -13, -1, 1 ;EBXL, ECXH, ECS, EES 417 00007480 4C <2> db REG_X+%1 418 00007481 01 <2> db REG_Y+%2 419 00007482 [EC8A] <2> dw cpu_regs+REG_%3 420 00007484 F2 <2> db %4 421 00007485 F3 <2> db %5 422 00007486 FF <2> db %6 423 00007487 01 <2> db %7 200 <1> reg_pos 21, 2, ES, -13, -12, -1, 1 ;ECXL, EDXH, EDS, ESS 417 00007488 4C <2> db REG_X+%1 418 00007489 02 <2> db REG_Y+%2 419 0000748A [F08A] <2> dw cpu_regs+REG_%3 420 0000748C F3 <2> db %4 421 0000748D F4 <2> db %5 422 0000748E FF <2> db %6 423 0000748F 01 <2> db %7 201 <1> reg_pos 21, 3, SS, -12, -11, -1, 1 ;EDXL, ESIH, EES, EFS 417 00007490 4C <2> db REG_X+%1 418 00007491 03 <2> db REG_Y+%2 419 00007492 [F48A] <2> dw cpu_regs+REG_%3 420 00007494 F4 <2> db %4 421 00007495 F5 <2> db %5 422 00007496 FF <2> db %6 423 00007497 01 <2> db %7 202 <1> reg_pos 21, 4, FS, -11, -10, -1, 1 ;ESIL, EDIH, ESS, EGS 417 00007498 4C <2> db REG_X+%1 418 00007499 04 <2> db REG_Y+%2 419 0000749A [F88A] <2> dw cpu_regs+REG_%3 420 0000749C F5 <2> db %4 421 0000749D F6 <2> db %5 422 0000749E FF <2> db %6 423 0000749F 01 <2> db %7 203 <1> reg_pos 21, 5, GS, -10, -9, -1, 1 ;EDIL, EBPH, EFS, EIP 417 000074A0 4C <2> db REG_X+%1 418 000074A1 05 <2> db REG_Y+%2 419 000074A2 [FC8A] <2> dw cpu_regs+REG_%3 420 000074A4 F6 <2> db %4 421 000074A5 F7 <2> db %5 422 000074A6 FF <2> db %6 423 000074A7 01 <2> db %7 204 <1> reg_pos 21, 7, IP, -9, -8, -1, 1 ;EBPL, ESPH, EGS, EFL 417 000074A8 4C <2> db REG_X+%1 418 000074A9 07 <2> db REG_Y+%2 419 000074AA [008B] <2> dw cpu_regs+REG_%3 420 000074AC F7 <2> db %4 421 000074AD F8 <2> db %5 422 000074AE FF <2> db %6 423 000074AF 01 <2> db %7 205 <1> reg_pos 21, 8, FL, -8, -23, -1, -7 ;ESPL, EAXH, EIP, ECS 417 000074B0 4C <2> db REG_X+%1 418 000074B1 08 <2> db REG_Y+%2 419 000074B2 [048B] <2> dw cpu_regs+REG_%3 420 000074B4 F8 <2> db %4 421 000074B5 E9 <2> db %5 422 000074B6 FF <2> db %6 423 000074B7 F9 <2> db %7 206 <1> ;============================================================================= 207 <1> ; address/opcode/instruction/number/arrow/disabled 208 000074B8 07020A <1> cmd_normal db atNormAddr, atNormOpcode, atNormInstr 209 000074BB 030F07 <1> db atNormNumber, atNormArrow, atNormDisable 210 <1> 211 000074BE 707070 <1> cmd_selected db atSelAddr, atSelOpcode, atSelInstr 212 000074C1 707B78 <1> db atSelNumber, atSelArrow, atSelDisable 213 <1> 214 000074C4 4F4F4F <1> cmd_breakpoint db atBrkAddr, atBrkOpcode, atBrkInstr 215 000074C7 4F4F48 <1> db atBrkNumber, atBrkArrow, atBrkDisable 216 <1> 217 000074CA 484848 <1> cmd_brk_disabled db atBrkDisAddr, atBrkDisOpcode, atBrkDisInstr 218 000074CD 484F48 <1> db atBrkDisNumber, atBrkDisArrow, atBrkDisDisable 219 <1> 220 000074D0 5F5F5F <1> cmd_brk_selected db atBrkSelAddr, atBrkSelOpcode, atBrkSelInstr 221 000074D3 5F5F58 <1> db atBrkSelNumber, atBrkSelArrow, atBrkSelDisable 222 <1> 223 000074D6 585858 <1> cmd_brk_dis_sel db atBrkDSAddr, atBrkDSOpcode, atBrkDSInstr 224 000074D9 585F58 <1> db atBrkDSNumber, atBrkDSArrow, atBrkDSDisable 225 <1> 226 000074DC 0E0E0E <1> cmd_not_focus db atNFAddr, atNFOpcode, atNFInstr 227 000074DF 0E0F07 <1> db atNFNumber, atNFArrow, atNFDisable 228 <1> ;----------------------------------------------------------------------------- 229 <1> 230 <1> align 2, db 0 231 000074E2 0D1C1B010044005000- <1> asm_exit_keys dw kbEnter, kbEsc, kbF10, kbDown, kbUp, kbPgDn, kbPgUp, 0 231 000074EB 48005100490000 <1> 232 <1> 233 <1> asm_errors: 234 000074F2 [0275] <1> dw ms_mnemonic ; 2 235 000074F4 [1375] <1> dw ms_invalid_param ; 3 236 000074F6 [2875] <1> dw ms_mem_param ; 4 237 000074F8 [1375] <1> dw ms_extra ; 5 238 000074FA [4475] <1> dw ms_big_number ; 6 239 000074FC [1375] <1> dw ms_reg_bits ; 7 240 000074FE [1375] <1> dw ms_param_type ; 8 241 00007500 [5375] <1> dw ms_rep_error ; 9 242 <1> 243 00007502 556E6B6E6F776E206D- <1> ms_mnemonic db "Unknown mnemonic", 0 243 0000750B 6E656D6F6E696300 <1> 244 00007513 496E76616C69642070- <1> ms_invalid_param db "Invalid parameter(s)", 0 244 0000751C 6172616D6574657228- <1> 244 00007525 732900 <1> 245 00007528 496E76616C69642072- <1> ms_mem_param db "Invalid register addressing", 0 245 00007531 656769737465722061- <1> 245 0000753A 646472657373696E67- <1> 245 00007543 00 <1> 246 <1> ms_extra equ ms_invalid_param ;db 'Too many parameters',0 247 00007544 4E756D62657220746F- <1> ms_big_number db "Number too big", 0 247 0000754D 6F2062696700 <1> 248 <1> ms_reg_bits equ ms_invalid_param 249 <1> ms_param_type equ ms_invalid_param 250 00007553 496E636F7272656374- <1> ms_rep_error db "Incorrect prefix use", 0 250 0000755C 207072656669782075- <1> 250 00007565 736500 <1> 251 <1> 252 00007568 20496E736967687420- <1> main_title db " ", SERIAL_NUMBER, " ", 0 252 00007571 312E32342000 <1> 253 <1> TITLE_LEN equ $-main_title 254 <1> 255 00007577 446562756767657220- <1> resident_msg db "Debugger has been installed resident.", 13, 10 255 00007580 686173206265656E20- <1> 255 00007589 696E7374616C6C6564- <1> 255 00007592 207265736964656E74- <1> 255 0000759B 2E0D0A <1> 256 0000759E 202050726573732043- <1> db " Press Ctrl+Esc to activate.", 13, 10, '$' 256 000075A7 74726C2B4573632074- <1> 256 000075B0 6F2061637469766174- <1> 256 000075B9 652E0D0A24 <1> 257 000075BE 446562756767657220- <1> already_resident db "Debugger already resident", 0 257 000075C7 616C72656164792072- <1> 257 000075D0 65736964656E7400 <1> 258 000075D8 496E76616C69642061- <1> addr_error_msg db "Invalid address value", 0 258 000075E1 646472657373207661- <1> 258 000075EA 6C756500 <1> 259 000075EE 496E76616C69642063- <1> count_error_msg db "Invalid count value", 0 259 000075F7 6F756E742076616C75- <1> 259 00007600 6500 <1> 260 00007602 43616E277420777269- <1> write_error_msg db "Can't write block on disk", 0 260 0000760B 746520626C6F636B20- <1> 260 00007614 6F6E206469736B00 <1> 261 0000761C 43616E277420726561- <1> read_error_msg db "Can't read block from disk", 0 261 00007625 6420626C6F636B2066- <1> 261 0000762E 726F6D206469736B00 <1> 262 00007637 43616E2774206F7065- <1> open_error_msg db "Can't open file", 0 262 00007640 6E2066696C6500 <1> 263 00007647 43616E277420637265- <1> create_error_msg db "Can't create file", 0 263 00007650 6174652066696C6500 <1> 264 00007659 4E6F2070726F677261- <1> no_specif_msg db "No program loaded", 0 264 00007662 6D206C6F6164656400 <1> 265 0000766B 43616E2774206C6F61- <1> load_error_msg db "Can't load program", 0 265 00007674 642070726F6772616D- <1> 265 0000767D 00 <1> 266 0000767E 50726F6772616D2074- <1> terminate_msg db "Program terminated (" 266 00007687 65726D696E61746564- <1> 266 00007690 2028 <1> 267 00007692 2A292E205265747572- <1> term_method db "*). Return code: " 267 0000769B 6E20636F64653A20 <1> 268 000076A3 30303000 <1> return_code db "000", 0 269 000076A7 546869732061646472- <1> dump_not_in_ram db "This address is not in RAM", 0 269 000076B0 657373206973206E6F- <1> 269 000076B9 7420696E2052414D00 <1> 270 000076C2 546F6F206D616E7920- <1> many_bp_msg db "Too many breakpoints", 0 270 000076CB 627265616B706F696E- <1> 270 000076D4 747300 <1> 271 000076D7 427265616B706F696E- <1> bp_not_in_ram db "Breakpoint not in RAM", 0 271 000076E0 74206E6F7420696E20- <1> 271 000076E9 52414D00 <1> 272 000076ED 436F6465206E6F7420- <1> code_not_in_ram db "Code not in RAM", 0 272 000076F6 696E2052414D00 <1> 273 000076FD 496E76616C69642061- <1> asm_error_msg db "Invalid assembler instruction", 0 273 00007706 7373656D626C657220- <1> 273 0000770F 696E73747275637469- <1> 273 00007718 6F6E00 <1> 274 0000771B 436F6465206D61726B- <1> code_mark_msg db "Code marks and " 274 00007724 7320616E6420 <1> 275 0000772A 466F6C6C6F77207374- <1> follow_stack_msg db "Follow stack cleared.", 0 275 00007733 61636B20636C656172- <1> 275 0000773C 65642E00 <1> 276 00007740 496E76616C69642073- <1> string_error_msg db "Invalid string.", 0 276 00007749 7472696E672E00 <1> 277 00007750 4279746573206E6F74- <1> not_found_msg db "Bytes not found.", 0 277 00007759 20666F756E642E00 <1> 278 00007761 536561726368696E67- <1> search_msg db "Searching bytes...", 0 278 0000776A 2062797465732E2E2E- <1> 278 00007773 00 <1> 279 <1> 280 00007774 54454D502E434F4D00 <1> env_name db "TEMP.COM", 0 ;!!! 281 0000777D 415842584358445853- <1> rreg db "AXBXCXDXSIDIBPSP" ;!!! 281 00007786 49444942505350 <1> 282 0000778D 435344534553535346- <1> rreg_segs db "CSDSESSSFSGSIPFL" ;!!! 282 00007796 5347534950464C <1> 283 0000779D 466C6167733D00 <1> flags_msg db "Flags=", 0 ;!!! 284 000077A4 4F4449535A415043 <1> flags_str db "ODISZAPC" ;First letters of flags names 285 <1> 286 <1> align 2, db 0 287 <1> data_watch_labels: 288 000077AC 45534449 <1> db "ESDI" 289 000077B0 44535349 <1> db "DSSI" 290 000077B4 45534258 <1> db "ESBX" 291 000077B8 53534250 <1> db "SSBP" 292 000077BC 44584158 <1> db "DXAX" 293 000077C0 44534458 <1> db "DSDX" 294 000077C4 45535349 <1> db "ESSI" 295 000077C8 44534449 <1> db "DSDI" 296 000077CC 43534950 <1> db "CSIP" 297 <1> 298 000077D0 2A2E2A00 <1> file_mask db "*.*", 0 ;!!! 299 <1> 300 <1> align 2, db 0 301 000077D4 [E077] <1> cpu_name dw cpu_8086 ;!!! 302 <1> 303 <1> cpu_names: 304 000077D6 [E077] <1> dw cpu_8086 305 000077D8 [E777] <1> dw cpu_8088 306 000077DA [EE77] <1> dw cpu_80286 307 000077DC [F677] <1> dw cpu_80386 308 000077DE [FE77] <1> dw cpu_80486 309 <1> 310 000077E0 20383038362000 <1> cpu_8086 db " 8086 ", 0 311 000077E7 20383038382000 <1> cpu_8088 db " 8088 ", 0 312 000077EE 2038303238362000 <1> cpu_80286 db " 80286 ", 0 313 000077F6 2038303338362000 <1> cpu_80386 db " 80386 ", 0 314 000077FE 2038303438362000 <1> cpu_80486 db " 80486 ", 0 315 00007806 20 <1> cpu_advanced db " " 316 00007807 3F3F3F3F3F3F3F3F3F- <1> cpu_advanced_name db "???????????? " 316 00007810 3F3F3F20 <1> 317 00007814 3038362000 <1> cpu_advanced_id db "086 ", 0 318 <1> 319 00007819 0B0A090706040200 <1> reg_shift db 11, 10, 9, 7, 6, 4, 2, 0 ;!!! 320 <1> 321 00007821 00 <1> align 2, db 0 322 00007822 [3687] <1> follow_stack_ptr dw follow_stack ;!!! 323 <1> 324 00007824 [C3B5] <1> code_end dw program_end ;!!! 325 <1> 326 00007826 8000 <1> save_dta_offs dw 80h ;!!! 327 <1> 328 00007828 0001 <1> cur_ip dw 100h ;IP of _first_ instruction in Code Wnd 329 0000782A FFFF <1> cur_ip_line dw -1 ;Number of line w/ <> sign, -1 if hidden 330 0000782C 01 <1> user_screen_mode db 1 ;1 if user screen is displayed 331 <1> 332 0000782D 00 <1> align 2, db 0 333 0000782E 1800 <1> screen_height dw SCR_ROWS-1 ;(Height of screen) - 1 334 00007830 0500 <1> dump_height dw DUMP_HEIGHT ;Actual height of the Dump window 335 00007832 0500 <1> e_dump_height dw DUMP_HEIGHT ;Height of normal (shrinked) Dump window 336 <1> 337 00007834 08 <1> stack_height db STK16_LEN ;Height of the Stack window 338 00007835 0000 <1> stack_wnd_xy dw 0 ;Saved X and Y (relative) of cursor 339 <1> 340 <1> ED_SSSP equ $-offset_0100h 341 <1> ED_SSBP equ ED_SSSP+5 342 <1> edit_sssp_params: 343 00007837 3F <1> db STK16_X+8 ;Init. X position of cursor in SS:SP 344 00007838 FEFF <1> initial_sp_val dw 0fffeh ;Init. SP value (bottom of SS:SP wnd) 345 0000783A 0000 <1> current_sp dw 0 ;Current offset in SP part of Stack wnd 346 <1> 347 <1> edit_ssbp_params: 348 0000783C 4B <1> db STK16_X+20 ;Init. X position of cursor in SS:BP 349 0000783D FCFF <1> initial_bp_disp dw -4 ;Init. BP displ-t (bottom of SS:BP wnd) 350 0000783F 0000 <1> current_bp dw 0 ;Current offset in BP part of Stack wnd 351 <1> 352 00007841 00 <1> align 2, db 0 353 00007842 [3778] <1> stack_mode dw edit_sssp_params 354 <1> 355 00007844 00 <1> large_dump db 0 ;1 if the Dump window is expanded 356 00007845 14 <1> dump_y db DUMP_Y ;First row of the Dump window 357 00007846 800C <1> dump_start dw DUMP_START ;Initial offset of Dump in video mem. 358 <1> 359 <1> loaded: 360 00007848 01 <1> ref_flags db 1 ;!!! 361 00007849 01 <1> focus db 1 ;!!! 362 0000784A 00 <1> regs_saved db 0 ;!!! 363 <1> 364 <1> ;============================================================================= 365 <1> 366 <1> edit_procs: 367 0000784B 13 <1> db kbAltR / 256 368 0000784C [0C0F] <1> dw edit_registers 369 0000784E 1E <1> db kbAltA / 256 370 0000784F [DF14] <1> dw edit_commands 371 00007851 21 <1> db kbAltF / 256 372 00007852 [8410] <1> dw edit_flags 373 00007854 20 <1> db kbAltD / 256 374 00007855 [1C11] <1> dw edit_dump 375 00007857 1F <1> db kbAltS / 256 376 00007858 [B313] <1> dw edit_stack 377 <1> edit_procs_end: 378 <1> 379 <1> EDIT_PROCS_NUM equ (edit_procs_end - edit_procs) / 3 380 <1> 381 <1> ;============================================================================= 382 <1> help_page1: 383 0000785A <1> incbin "data/page1.xlp" ;Compressed help screen 384 <1> help_page2: 385 00007CC4 <1> incbin "data/page2.xlp" ;Compressed help screen 386 <1> 387 <1> ;============================================================================= 388 <1> ; 2007-02-06 389 <1> ;----------------------------------------------------------------------------- 390 00007E1F 00 <1> align 2, db 0 391 00007E20 0000 <1> delay_value dw 0 ;Delay for `animate' 392 00007E22 00 <1> umb_available db 0 ;0 if UMB is not available 393 <1> 394 00007E23 00 <1> align 2, db 0 395 00007E24 66726565 <1> msg_free db "free" ;Strings for List Memory Blocks 396 00007E28 646F7320 <1> msg_dos db "dos " ;Exactly 4 chars! 397 00007E2C 70726F67 <1> msg_prog db "prog" ;... 398 00007E30 656E7620 <1> msg_env db "env " 399 00007E34 64617461 <1> msg_data db "data" 400 00007E38 3C6E6F6E616D653E <1> msg_noname db "" ;Exactly 8 chars! 401 <1> 402 <1> ;============================================================================= 403 <1> ; keyboard.inc 404 <1> ;----------------------------------------------------------------------------- 405 <1> align 2, db 0 406 00007E40 [1B1B] <1> test_key dw def_test_key ;Ptr to default key testing procedure 407 <1> 408 <1> ;============================================================================= 409 <1> ; dialogs.inc 410 <1> ;----------------------------------------------------------------------------- 411 <1> align 2, db 0 412 <1> inp_line_exit_keys: 413 00007E42 0D1C1B01090F000F00- <1> dw kbEnter, kbEsc, kbTab, kbShiftTab, 0 413 00007E4B 00 <1> 414 <1> 415 00007E4C [2D24][0925] <1> items_table dw init_push_button, run_push_button 416 00007E50 [5825][8E25] <1> dw init_input_line, run_input_line 417 00007E54 [EC27][0928] <1> dw init_static_text, run_static_text 418 00007E58 [0D28][A628] <1> dw init_check_boxes, run_check_boxes 419 00007E5C [E625][8226] <1> dw init_list, run_list 420 <1> 421 <1> ;============================================================================= 422 <1> ; windows.inc 423 <1> ;----------------------------------------------------------------------------- 424 00007E60 091B204D6573736167- <1> message_title db 9, atMessageBoxTitle, " Message " ;Msg box title 424 00007E69 6520 <1> 425 00007E6B 074E204572726F7220 <1> error_title db 7, atErrorBoxTitle, " Error " ;Error box title 426 00007E74 000000 <1> empty_title db 0, 0, 0 ;Empty title 427 00007E77 00 <1> exec_msg_type db 0 ;!!! 428 <1> 429 <1> drawchoice '╔','#' 430 <1> double_border equ DRAWADDRESS 431 <1> drawchoice '═','=' 432 <1> drawchoice '╗','#' 433 <1> drawchoice '║','|' 434 <1> drawchoice '║','|' 435 <1> drawchoice '╚','#' 436 <1> drawchoice '═','=' 437 <1> drawchoice '╝','#' 438 <1> 439 <1> drawchoice '┌','+' 440 <1> single_border equ DRAWADDRESS 441 <1> drawchoice '─','-' 442 <1> drawchoice '┐','+' 443 <1> drawchoice '│','|' 444 <1> drawchoice '│','|' 445 <1> drawchoice '└','+' 446 <1> drawchoice '─','-' 447 <1> drawchoice '┘','+' 448 <1> 449 <1> align 2, db 0 450 00007E78 01000000 <1> fake_table dw SUB_MENU, 0 ;!!! 451 00007E7C 0000 <1> h_pos dw 0 ;!!! 452 <1> 453 00007E7E [0C1F] <1> test_char dw default_test_char ;!!! 454 <1> 455 00007E80 [827E] <1> read_exit_keys dw default_exit_keys ;!!! 456 00007E82 1B010D1C0000 <1> default_exit_keys dw kbEsc, kbEnter, 0 ;!!! 457 <1> dialog_accelerators_behind_last: 458 00007E88 [148C] <1> dw dialog_accelerators 459 00007E8A FF <1> option_cpdump: db -1 460 00007E8B FF <1> option_beep: db -1 461 00007E8C FF <1> option_1680: db -1 462 00007E8D FF <1> option_hlt: db -1 463 <1> 464 <1> accelerator_letter_to_scancode: 465 00007E8E 1E <1> db kbAltA >> 8 466 00007E8F 30 <1> db kbAltB >> 8 467 00007E90 2E <1> db kbAltC >> 8 468 00007E91 20 <1> db kbAltD >> 8 469 00007E92 12 <1> db kbAltE >> 8 470 00007E93 21 <1> db kbAltF >> 8 471 00007E94 22 <1> db kbAltG >> 8 472 00007E95 23 <1> db kbAltH >> 8 473 00007E96 17 <1> db kbAltI >> 8 474 00007E97 24 <1> db kbAltJ >> 8 475 00007E98 25 <1> db kbAltK >> 8 476 00007E99 26 <1> db kbAltL >> 8 477 00007E9A 32 <1> db kbAltM >> 8 478 00007E9B 31 <1> db kbAltN >> 8 479 00007E9C 18 <1> db kbAltO >> 8 480 00007E9D 19 <1> db kbAltP >> 8 481 00007E9E 10 <1> db kbAltQ >> 8 482 00007E9F 13 <1> db kbAltR >> 8 483 00007EA0 1F <1> db kbAltS >> 8 484 00007EA1 14 <1> db kbAltT >> 8 485 00007EA2 16 <1> db kbAltU >> 8 486 00007EA3 2F <1> db kbAltV >> 8 487 00007EA4 11 <1> db kbAltW >> 8 488 00007EA5 2D <1> db kbAltX >> 8 489 00007EA6 15 <1> db kbAltY >> 8 490 00007EA7 2C <1> db kbAltZ >> 8 491 00007EA8 81 <1> db kbAlt0 >> 8 492 00007EA9 78 <1> db kbAlt1 >> 8 493 00007EAA 79 <1> db kbAlt2 >> 8 494 00007EAB 7A <1> db kbAlt3 >> 8 495 00007EAC 7B <1> db kbAlt4 >> 8 496 00007EAD 7C <1> db kbAlt5 >> 8 497 00007EAE 7D <1> db kbAlt6 >> 8 498 00007EAF 7E <1> db kbAlt7 >> 8 499 00007EB0 7F <1> db kbAlt8 >> 8 500 00007EB1 80 <1> db kbAlt9 >> 8 501 <1> 502 <1> align 2, db 0 503 00007EB2 1B010000 <1> menu_keys dw kbEsc, 0 504 00007EB6 0D1C0000 <1> dw kbEnter, 0 505 00007EBA 004B0000 <1> dw kbLeft, 0 506 00007EBE 004D0000 <1> dw kbRight, 0 507 00007EC2 00440000 <1> dw kbF10, 0 508 00007EC6 0048[A61F] <1> dw kbUp, vert_menu_up 509 00007ECA 0050[9C1F] <1> dw kbDown, vert_menu_down 510 00007ECE 0047[A21F] <1> dw kbHome, vert_menu_home 511 00007ED2 004F[AD1F] <1> dw kbEnd, vert_menu_end 512 00007ED6 0049[A21F] <1> dw kbPgUp, vert_menu_home 513 00007EDA 0051[AD1F] <1> dw kbPgDn, vert_menu_end 514 00007EDE 00000000 <1> dw 0, 0 515 <1> 516 00007EE2 00B8 <1> video_seg dw COLOR_SEG ;Segment of video buffer 517 00007EE4 [467F] <1> buf_pos dw window_buffer ;Ptr to windows buffer 518 00007EE6 [467F] <1> buf_pos_mark dw window_buffer ;2nd ptr to windows buffer 519 <1> 520 <1> ; The following tables must be written after all 521 <1> ; uses of the drawchoice macro. So undefine that 522 <1> ; macro here, making it an error to use it. 523 <1> %unmacro drawchoice 2.nolist 524 <1> 525 <1> drawing_list_table: 526 <1> .: 527 00007EE8 CDB8B3C4C1C3C4C3C4- <1> db DRAWING_LIST 527 00007EF1 C41110C41010C3C4B4- <1> 527 00007EFA DCDF18191E1FC9CDBB- <1> 527 00007F03 BABAC8CDBCDAC4BFB3- <1> 527 00007F0C B3C0C4D9 <1> 528 <1> .size equ $ - . 529 <1> ascii_list_table: 530 <1> .: 531 00007F10 3D237C2D2B2B2D2B2D- <1> db ASCII_LIST 531 00007F19 2D3C3E2D3E3E2B2D2B- <1> 531 00007F22 5F3D5E764156233D23- <1> 531 00007F2B 7C7C233D232B2D2B7C- <1> 531 00007F34 7C2B2D2B <1> 532 <1> .size equ $ - . 533 <1> %if .size != drawing_list_table.size 534 <1> %error Draw tables length mismatch 535 <1> %endif 536 <1> 537 <1> ; The following table must be written after all 538 <1> ; uses of the drawarrowoffset macro. So undefine 539 <1> ; that macro here, making it an error to use it. 540 <1> %unmacro drawarrowoffset 1.nolist 541 <1> 542 <1> align 2, db 0 543 <1> arrow_offset_list_table: 544 <1> .: 545 00007F38 [116C][256C][816D]- <1> dw ARROW_OFFSET_LIST 545 00007F3E [936D][EE6F][FE6F]- <1> 545 00007F44 [0870] <1> 546 <1> .amount equ ($ - .) / 2 547 <1> %if arrow_offset_list_table.amount == 0 548 <1> %error Code assumes nonzero table size 549 <1> %endif 550 <1> 551 <1> ;============================================================================= 552 <1> ; E0F 553 <1> ;============================================================================= 79 80 ;============================================================================= 81 ; Code and initialized data. 82 ;============================================================================= 83 follow_stack_btm: 84 shared_data_area: 85 string_buffer: 86 window_buffer: 87 88 %include "cpu.inc" ;CPU detection code 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; cpu.inc 7 <1> ; Procedure for determining CPU type. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; get_cpu_type 28 <1> ;----------------------------------------------------------------------------- 29 <1> ; Determines CPU type. 30 <1> ; In: --- 31 <1> ; Out: AX -- CPU type: 32 <1> ; 0 = 8086 33 <1> ; 1 = 8088 34 <1> ; 2 = 80286 35 <1> ; 3 = 80386 36 <1> ; 4 = 80486 37 <1> ; 7f = Advanced (with CPUID) 38 <1> ; Modf: AX 39 <1> ; Call: --- 40 <1> ; Use: --- 41 <1> ; 42 <1> get_cpu_type: 43 <1> cpu 486 44 00007F46 9C <1> pushf 45 00007F47 53 <1> push bx 46 00007F48 51 <1> push cx 47 00007F49 9C <1> pushf 48 00007F4A 58 <1> pop ax 49 00007F4B 25FF0F <1> and ax,0fffh 50 00007F4E 50 <1> push ax 51 00007F4F 9D <1> popf 52 00007F50 9C <1> pushf 53 00007F51 58 <1> pop ax 54 00007F52 2500F0 <1> and ax,0f000h 55 00007F55 3D00F0 <1> cmp ax,0f000h 56 00007F58 7516 <1> jne @@cpu1 57 00007F5A 31C9 <1> xor cx,cx 58 00007F5C BF[677F] <1> mov di,@@inc_cx 59 00007F5F B090 <1> mov al,90h 60 00007F61 FA <1> cli 61 00007F62 8805 <1> mov [di],al 62 00007F64 90 <1> nop 63 00007F65 90 <1> nop 64 00007F66 90 <1> nop 65 <1> @@inc_cx: 66 00007F67 41 <1> inc cx 67 00007F68 FB <1> sti 68 00007F69 B80100 <1> mov ax,1 69 00007F6C 29C8 <1> sub ax,cx 70 00007F6E EB5A <1> jmp @@quit 71 <1> @@cpu1: 72 00007F70 0D00F0 <1> or ax,0f000h 73 00007F73 50 <1> push ax 74 00007F74 9D <1> popf 75 00007F75 9C <1> pushf 76 00007F76 58 <1> pop ax 77 00007F77 2500F0 <1> and ax,0f000h 78 00007F7A 7504 <1> jnz @@cpu2 79 00007F7C B002 <1> mov al,2 80 00007F7E EB4A <1> jmp @@quit 81 <1> @@cpu2: 82 00007F80 89E3 <1> mov bx,sp 83 00007F82 83E4FC <1> and sp,~3 84 00007F85 669C <1> pushfd 85 00007F87 6658 <1> pop eax 86 00007F89 6689C1 <1> mov ecx,eax 87 00007F8C 663500000400 <1> xor eax,40000h 88 00007F92 6650 <1> push eax 89 00007F94 669D <1> popfd 90 00007F96 669C <1> pushfd 91 00007F98 6658 <1> pop eax 92 00007F9A 89DC <1> mov sp,bx 93 00007F9C 6631C8 <1> xor eax,ecx 94 00007F9F B003 <1> mov al,3 95 00007FA1 7427 <1> jz @@quit 96 00007FA3 66BB00002000 <1> mov ebx,200000h 97 00007FA9 6689C8 <1> mov eax,ecx 98 00007FAC 6631D8 <1> xor eax,ebx 99 00007FAF 6650 <1> push eax 100 00007FB1 669D <1> popfd 101 00007FB3 669C <1> pushfd 102 00007FB5 6658 <1> pop eax 103 00007FB7 6651 <1> push ecx 104 00007FB9 669D <1> popfd 105 00007FBB 6621D8 <1> and eax,ebx 106 00007FBE 6621D9 <1> and ecx,ebx 107 00007FC1 6639C8 <1> cmp eax,ecx 108 00007FC4 B004 <1> mov al,4 109 00007FC6 7402 <1> jz @@quit 110 00007FC8 B07F <1> mov al,7fh 111 <1> @@quit: 112 00007FCA 98 <1> cbw 113 00007FCB 59 <1> pop cx 114 00007FCC 5B <1> pop bx 115 00007FCD 9D <1> popf 116 00007FCE C3 <1> ret 117 <1> cpu 8086 118 <1> ;============================================================================= 119 <1> ; E0F 120 <1> ;============================================================================= 121 <1> 122 <1> 89 %include "cmdline.inc" ;Command line parsing procedures 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; cmdline.inc 7 <1> ; Procedures for parsing command line. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; get_cmd_line 28 <1> ;----------------------------------------------------------------------------- 29 <1> get_cmd_line: 30 00007FCF BE8100 <1> mov si,81h 31 00007FD2 FC <1> cld 32 00007FD3 E80F00 <1> call process_options 33 <1> 34 00007FD6 B420 <1> mov ah,' ' 35 00007FD8 BF[BA8F] <1> mov di,filename 36 00007FDB E83100 <1> call process_param 37 <1> 38 00007FDE B40D <1> mov ah,13 39 00007FE0 BF[838E] <1> mov di,cmd_line_string 40 00007FE3 EB2A <1> jmp process_param 41 <1> ;============================================================================= 42 <1> ; process_options 43 <1> ;----------------------------------------------------------------------------- 44 <1> process_options: 45 <1> @@next_char: 46 00007FE5 AC <1> lodsb 47 00007FE6 3C20 <1> cmp al,' ' 48 00007FE8 74FB <1> je @@next_char 49 00007FEA 3C09 <1> cmp al,9 50 00007FEC 74F7 <1> je @@next_char 51 00007FEE 3C2F <1> cmp al,'/' 52 00007FF0 7402 <1> je @@option 53 00007FF2 4E <1> dec si 54 00007FF3 C3 <1> ret 55 <1> 56 <1> @@option: 57 00007FF4 AC <1> lodsb 58 00007FF5 E8549A <1> call upcase 59 00007FF8 BF[7A82] <1> mov di,available_options 60 <1> 61 <1> @@next_option: 62 00007FFB AE <1> scasb 63 00007FFC 8A6506 <1> mov ah,[di + (options_bits - available_options) - 1] 64 00007FFF 7408 <1> je @@set_option 65 00008001 807DFF00 <1> cmp byte [di-1],0 66 00008005 75F4 <1> jne @@next_option 67 00008007 B480 <1> mov ah,CMD_ERROR 68 <1> 69 <1> @@set_option: 70 00008009 0826[8B8B] <1> or [cmd_line_options],ah 71 0000800D EBD6 <1> jmp @@next_char 72 <1> ;============================================================================= 73 <1> ; process_param 74 <1> ;----------------------------------------------------------------------------- 75 <1> process_param: 76 <1> @@next_char: 77 0000800F AC <1> lodsb 78 00008010 3C20 <1> cmp al,' ' 79 00008012 74FB <1> je @@next_char 80 00008014 3C09 <1> cmp al,9 81 00008016 74F7 <1> je @@next_char 82 <1> 83 <1> @@save_char: 84 00008018 3C0D <1> cmp al,13 85 0000801A 7408 <1> je @@exit 86 0000801C 38E0 <1> cmp al,ah 87 0000801E 7404 <1> je @@exit 88 <1> ; call upcase 89 00008020 AA <1> stosb 90 00008021 AC <1> lodsb 91 00008022 EBF4 <1> jmp @@save_char 92 <1> 93 <1> @@exit: 94 00008024 B000 <1> mov al,0 95 00008026 AA <1> stosb 96 00008027 4E <1> dec si 97 00008028 C3 <1> ret 98 <1> ;============================================================================= 99 <1> ; E0F 100 <1> ;============================================================================= 101 <1> 102 <1> 90 %include "install.inc" ;Initialization code 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; install.inc 7 <1> ; Initialization procedures and messages. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; Changelog 28 <1> ;----------------------------------------------------------------------------- 29 <1> ; 2007-02-08 0leg Added code for UMB presence checking and for determining 30 <1> ; segment of 1st MCB. 31 <1> ; 2007-12-13 0leg Fixed incorrect displaying of CPU type on P-4. 32 <1> ;============================================================================= 33 <1> 34 <1> 35 <1> ;============================================================================= 36 <1> ; install 37 <1> ;----------------------------------------------------------------------------- 38 <1> install: 39 00008029 BA[8782] <1> mov dx,copyright 40 0000802C E8B7A2 <1> call write_message 41 <1> 42 0000802F 31C0 <1> xor ax,ax 43 00008031 B9A22F <1> mov cx,udata_end-udata_start 44 00008034 BF[2186] <1> mov di,udata_start 45 00008037 FC <1> cld 46 00008038 F3AA <1> rep stosb 47 <1> 48 0000803A 06 <1> push es ;Get segment of 1st MCB 49 0000803B B452 <1> mov ah,52h 50 0000803D CD21 <1> int 21h 51 0000803F 268B47FE <1> mov ax,[es:bx-2] 52 00008043 A3[94B5] <1> mov [first_mcb],ax 53 00008046 07 <1> pop es 54 <1> 55 00008047 B80258 <1> mov ax,5802h ;Get UMB link state 56 0000804A CD21 <1> int 21h 57 0000804C 98 <1> cbw 58 0000804D 50 <1> push ax 59 0000804E B80358 <1> mov ax,5803h 60 00008051 BB0100 <1> mov bx,1 ;Link UMB for allocations 61 00008054 CD21 <1> int 21h 62 00008056 7205 <1> jc @@no_umbs 63 00008058 C606[227E]01 <1> mov byte [umb_available],1 64 <1> @@no_umbs: 65 0000805D 5B <1> pop bx 66 0000805E B80358 <1> mov ax,5803h 67 00008061 CD21 <1> int 21h ;Restore UMB link state 68 <1> 69 00008063 E8A001 <1> call get_video_type 70 00008066 A2[8E8B] <1> mov [video_type],al ;1 == VGA, 0 == EGA 71 <1> 72 00008069 E8B901 <1> call is_hma_exist 73 0000806C 7305 <1> jnc @@command_line 74 0000806E 830E[B68B]04 <1> or word [search_options],SRCH_EXCL_HMA 75 <1> @@command_line: 76 <1> 77 00008073 C706[038E]000D <1> mov word [my_cmd_line],0d00h 78 00008079 C606[838E]00 <1> mov byte [cmd_line_string],0 79 0000807E C606[BA8F]00 <1> mov byte [filename],0 80 <1> 81 00008083 E849FF <1> call get_cmd_line 82 00008086 E8CC85 <1> call full_prog_name 83 <1> 84 00008089 BA[4A84] <1> mov dx,help_msg 85 0000808C F606[8B8B]01 <1> test byte [cmd_line_options],CMD_HELP 86 00008091 7540 <1> jnz @@display_error 87 <1> 88 00008093 BA[2784] <1> mov dx,error_help_msg 89 00008096 F606[8B8B]80 <1> test byte [cmd_line_options],CMD_ERROR 90 0000809B 753B <1> jnz display_error 91 <1> 92 0000809D F606[8B8B]20 <1> test byte [cmd_line_options],CMD_EGA 93 000080A2 7405 <1> jz @@not_ega 94 000080A4 C606[8E8B]00 <1> mov byte [video_type],0 ;1 == VGA, 0 == EGA 95 <1> @@not_ega: 96 <1> 97 000080A9 F606[8B8B]40 <1> test byte [cmd_line_options], CMD_ASCII 98 000080AE 7405 <1> jz @F 99 000080B0 C606[8A7E]00 <1> mov byte [option_cpdump], 0 100 <1> @@: 101 000080B5 E8E196 <1> call initialise_draw_table 102 <1> 103 000080B8 F606[8B8B]10 <1> test byte [cmd_line_options],CMD_UNLOAD 104 000080BD 7527 <1> jnz ..@unload 105 <1> 106 <1> @@check_memory: 107 000080BF 31C9 <1> xor cx,cx 108 000080C1 E80099 <1> call calc_prog_size 109 000080C4 89C4 <1> mov sp,ax 110 000080C6 89D3 <1> mov bx,dx 111 000080C8 B44A <1> mov ah,4ah 112 000080CA CD21 <1> int 21h 113 <1> 114 000080CC BA[3385] <1> mov dx,fatal_memory_msg 115 000080CF 7207 <1> jc display_error 116 000080D1 EB66 <1> jmp init 117 <1> 118 <1> @@display_error: 119 000080D3 C606[1F86]24 <1> mov byte [beep_char],'$' 120 <1> display_error: 121 000080D8 E80BA2 <1> call write_message 122 000080DB BA[1C86] <1> mov dx,eol 123 000080DE E805A2 <1> call write_message 124 <1> 125 <1> @@error_quit: 126 000080E1 B8014C <1> mov ax,4c01h 127 000080E4 CD21 <1> int 21h 128 <1> 129 <1> ..@unload: 130 000080E6 E865E0 <1> call is_resident 131 000080E9 75ED <1> jne display_error 132 <1> 133 000080EB BA[A185] <1> mov dx,unload_error_msg 134 <1> 135 000080EE BE0C00 <1> mov si,3*4 136 000080F1 BF[7456] <1> mov di,bp_entry 137 000080F4 E826E0 <1> call check_vector 138 000080F7 75DF <1> jne display_error 139 <1> 140 000080F9 BE2400 <1> mov si,9*4 141 000080FC BF[CE56] <1> mov di,int_09_handler 142 000080FF E81BE0 <1> call check_vector 143 00008102 75D4 <1> jne display_error 144 <1> 145 00008104 BE5800 <1> mov si,16h*4 146 00008107 BF[2D61] <1> mov di,keyboard_service 147 0000810A E810E0 <1> call check_vector 148 0000810D 75C9 <1> jne display_error 149 <1> 150 0000810F 06 <1> push es 151 00008110 1F <1> pop ds 152 00008111 E84CD4 <1> call restore_03_vector 153 00008114 E871D4 <1> call restore_09_vector 154 00008117 E8CCDF <1> call restore_16_vector 155 <1> 156 0000811A 8E062C00 <1> mov es,[2ch] 157 0000811E B449 <1> mov ah,49h 158 00008120 CD21 <1> int 21h 159 00008122 7206 <1> jc @@skip_free 160 00008124 1E <1> push ds 161 00008125 07 <1> pop es 162 00008126 B449 <1> mov ah,49h 163 00008128 CD21 <1> int 21h 164 <1> 165 <1> @@skip_free: 166 0000812A 0E <1> push cs 167 0000812B 1F <1> pop ds 168 0000812C BA[4B85] <1> mov dx,memory_free_msg 169 0000812F 72A7 <1> jc display_error 170 <1> 171 00008131 BA[B785] <1> mov dx,unloaded_msg 172 00008134 E8AFA1 <1> call write_message 173 00008137 EBA8 <1> jmp @@error_quit 174 <1> ;----------------------------------------------------------------------------- 175 <1> ; init 176 <1> ;----------------------------------------------------------------------------- 177 <1> init: 178 00008139 E8EB82 <1> call save_int_table 179 <1> 180 0000813C F606[8B8B]02 <1> test byte [cmd_line_options],CMD_RESIDENT 181 00008141 740A <1> jz @@check_prog_name 182 00008143 E808E0 <1> call is_resident 183 00008146 7519 <1> jne @@create_program 184 00008148 BA[D985] <1> mov dx,alredy_tsr_msg 185 0000814B EB8B <1> jmp display_error 186 <1> 187 <1> @@check_prog_name: 188 0000814D 803E[BA8F]00 <1> cmp byte [filename],0 189 00008152 740D <1> je @@create_program 190 00008154 E8BE84 <1> call set_command_line 191 00008157 E8C783 <1> call load_program 192 0000815A 7308 <1> jnc @@loaded 193 0000815C C606[4878]00 <1> mov byte [loaded],0 194 <1> 195 <1> @@create_program: 196 00008161 E8EF82 <1> call create_program 197 <1> 198 <1> @@loaded: 199 00008164 E8AB85 <1> call set_user_pid 200 00008167 E81586 <1> call set_term_handler 201 0000816A E81CAB <1> call save_font 202 0000816D E84DAA <1> call save_screen 203 00008170 E421 <1> in al,21h 204 00008172 24FC <1> and al,11111100b 205 00008174 A2[828B] <1> mov [my_port_21],al 206 00008177 A2[838B] <1> mov [user_port_21],al 207 <1> 208 0000817A E8C9FD <1> call get_cpu_type 209 0000817D 3C7F <1> cmp al,7fh 210 0000817F 7531 <1> jne @@set_cpu_type 211 <1> 212 <1> cpu 586 213 00008181 6631C0 <1> xor eax,eax 214 00008184 0FA2 <1> cpuid 215 00008186 66891E[0778] <1> mov [cpu_advanced_name+0],ebx 216 0000818B 668916[0B78] <1> mov [cpu_advanced_name+4],edx 217 00008190 66890E[0F78] <1> mov [cpu_advanced_name+8],ecx 218 00008195 6631C0 <1> xor eax,eax 219 00008198 40 <1> inc ax 220 00008199 0FA2 <1> cpuid 221 <1> cpu 8086 222 <1> 223 0000819B 80E40F <1> and ah,0fh 224 0000819E 80FC06 <1> cmp ah,6 ;ah == 0fh on Pentium-4 225 000081A1 7602 <1> jbe @@cpu_type_ok 226 000081A3 B406 <1> mov ah,6 227 <1> @@cpu_type_ok: 228 000081A5 0026[1478] <1> add [cpu_advanced_id],ah 229 000081A9 B80400 <1> mov ax,4 230 000081AC C706[DE77][0678] <1> mov word [cpu_names+8],cpu_advanced 231 <1> 232 <1> @@set_cpu_type: 233 000081B2 A2[6E8B] <1> mov [system_cpu],al 234 000081B5 3C03 <1> cmp al,3 235 000081B7 720C <1> jb @@skip_enable 236 000081B9 C706[126E]0000 <1> mov word [reg_mode_stat_1],0 237 000081BF C706[CE71]0000 <1> mov word [reg_mode_stat_2],0 238 <1> 239 <1> @@skip_enable: 240 000081C5 89C3 <1> mov bx,ax 241 000081C7 09C0 <1> or ax,ax 242 000081C9 7401 <1> jz @@1 243 000081CB 48 <1> dec ax 244 <1> @@1: 245 000081CC A2[406C] <1> mov [opt_cpu],al 246 000081CF 0470 <1> add al,a86 247 000081D1 A2[C42E] <1> mov [cpu_type],al 248 000081D4 D1E3 <1> shl bx,1 249 000081D6 8B87[D677] <1> mov ax,[cpu_names+bx] 250 000081DA A3[D477] <1> mov [cpu_name],ax 251 <1> 252 000081DD A1[E88A] <1> mov ax,[cpu_regs+REG_CS] 253 000081E0 A3[9B8B] <1> mov [unasm_seg],ax 254 000081E3 A1[008B] <1> mov ax,[cpu_regs+REG_IP] 255 000081E6 A3[2878] <1> mov [cur_ip],ax 256 000081E9 A1[EC8A] <1> mov ax,[cpu_regs+REG_DS] 257 000081EC A3[BA8B] <1> mov [dump_seg],ax 258 <1> 259 000081EF 31C0 <1> xor ax,ax 260 000081F1 A2[8F90] <1> mov [main_addr_string],al 261 000081F4 A2[7690] <1> mov [dump_addr_string],al 262 000081F7 A2[3A90] <1> mov [asm_line],al 263 000081FA A3[748B] <1> mov [cur_line],ax 264 000081FD A3[BC8B] <1> mov [dump_offs],ax 265 <1> 266 00008200 E84800 <1> call set_prefixes 267 00008203 E91E95 <1> jmp continue_init 268 <1> ;============================================================================= 269 <1> ; get_video_type 270 <1> ;----------------------------------------------------------------------------- 271 <1> get_video_type: 272 00008206 B412 <1> mov ah,12h 273 00008208 B310 <1> mov bl,10h 274 0000820A CD10 <1> int 10h 275 0000820C 80FB10 <1> cmp bl,10h 276 0000820F 7411 <1> je @@old_video 277 00008211 B8001A <1> mov ax,1a00h 278 00008214 CD10 <1> int 10h 279 00008216 3C1A <1> cmp al,1ah 280 00008218 7508 <1> jne @@old_video 281 0000821A 80FB07 <1> cmp bl,7 282 0000821D 7603 <1> jbe @@old_video 283 0000821F B001 <1> mov al,1 284 00008221 C3 <1> ret 285 <1> 286 <1> @@old_video: 287 00008222 31C0 <1> xor ax,ax 288 00008224 C3 <1> ret 289 <1> ;============================================================================= 290 <1> ; is_hma_exist 291 <1> ;----------------------------------------------------------------------------- 292 <1> is_hma_exist: 293 00008225 B80043 <1> mov ax,4300h 294 00008228 CD2F <1> int 2fh 295 0000822A 3C80 <1> cmp al,80h 296 0000822C 751B <1> jne @@error_exit 297 <1> 298 0000822E 06 <1> push es 299 0000822F B81043 <1> mov ax,4310h 300 00008232 CD2F <1> int 2fh 301 <1> 302 00008234 0E <1> push cs 303 00008235 B8[3E82] <1> mov ax,@@ret_point 304 00008238 50 <1> push ax 305 00008239 B400 <1> mov ah,0 306 0000823B 06 <1> push es 307 0000823C 53 <1> push bx 308 0000823D CB <1> retf 309 <1> 310 <1> @@ret_point: 311 0000823E 07 <1> pop es 312 0000823F 09C0 <1> or ax,ax 313 00008241 7406 <1> jz @@error_exit 314 00008243 09D2 <1> or dx,dx 315 00008245 7402 <1> jz @@error_exit 316 00008247 F8 <1> clc 317 00008248 C3 <1> ret 318 <1> 319 <1> @@error_exit: 320 00008249 F9 <1> stc 321 0000824A C3 <1> ret 322 <1> ;============================================================================= 323 <1> ; set_prefixes 324 <1> ;----------------------------------------------------------------------------- 325 <1> set_prefixes: 326 0000824B 803E[6E8B]03 <1> cmp byte [system_cpu],3 327 00008250 7214 <1> jb @@exit 328 00008252 B91300 <1> mov cx,@@prefix_table_end - @@prefix_table 329 00008255 BE[6782] <1> mov si,@@prefix_table 330 00008258 31DB <1> xor bx,bx 331 <1> @@next: 332 0000825A 8A1C <1> mov bl,[si] 333 0000825C 8DBF[1B52] <1> lea di,[first_prefix+bx] 334 00008260 C60566 <1> mov byte [di],066h 335 00008263 46 <1> inc si 336 00008264 E2F4 <1> loop @@next 337 <1> @@exit: 338 00008266 C3 <1> ret 339 <1> ;----------------------------------------------------------------------------- 340 <1> @@prefix_table: 341 00008267 00 <1> db prefix_01 - first_prefix 342 00008268 12 <1> db prefix_02 - first_prefix 343 00008269 17 <1> db prefix_03 - first_prefix 344 0000826A 1C <1> db prefix_04 - first_prefix 345 0000826B 21 <1> db prefix_05 - first_prefix 346 0000826C 26 <1> db prefix_06 - first_prefix 347 0000826D 2B <1> db prefix_07 - first_prefix 348 0000826E 6F <1> db prefix_08 - first_prefix 349 0000826F 73 <1> db prefix_09 - first_prefix 350 00008270 78 <1> db prefix_10 - first_prefix 351 00008271 7D <1> db prefix_11 - first_prefix 352 00008272 82 <1> db prefix_12 - first_prefix 353 00008273 87 <1> db prefix_13 - first_prefix 354 00008274 8C <1> db prefix_14 - first_prefix 355 00008275 91 <1> db prefix_15 - first_prefix 356 00008276 4B <1> db prefix_16 - first_prefix 357 00008277 4F <1> db prefix_17 - first_prefix 358 00008278 53 <1> db prefix_18 - first_prefix 359 00008279 57 <1> db prefix_19 - first_prefix 360 <1> @@prefix_table_end: 361 <1> ;============================================================================= 362 <1> 363 0000827A 41455255483F00 <1> available_options db "AERUH?",0 364 <1> 365 00008281 402002100101 <1> options_bits db CMD_ASCII, CMD_EGA, CMD_RESIDENT, CMD_UNLOAD, CMD_HELP, CMD_HELP 366 <1> 367 00008287 496E73696768742031- <1> copyright db SERIAL_NUMBER, ", real-mode debugger for MS/PC/FreeDOS. Build ", BUILD, ".", 13, 10 367 00008290 2E32342C207265616C- <1> 367 00008299 2D6D6F646520646562- <1> 367 000082A2 756767657220666F72- <1> 367 000082AB 204D532F50432F4672- <1> 367 000082B4 6565444F532E204275- <1> 367 000082BD 696C6420323030392D- <1> 367 000082C6 30312D31312E0D0A <1> 368 000082CE 436F70797269676874- <1> db "Copyright (C) 1993, 96, 97, 2002, Victor Gamayunov, Sergey Pimenov", 13, 10 368 000082D7 202843292031393933- <1> 368 000082E0 2C2039362C2039372C- <1> 368 000082E9 20323030322C205669- <1> 368 000082F2 63746F722047616D61- <1> 368 000082FB 79756E6F762C205365- <1> 368 00008304 726765792050696D65- <1> 368 0000830D 6E6F760D0A <1> 369 00008312 4D6F64696669636174- <1> db "Modifications by Oleg O. Chukaev, 2006 - 2009", 13, 10, 13, 10 369 0000831B 696F6E73206279204F- <1> 369 00008324 6C6567204F2E204368- <1> 369 0000832D 756B6165762C203230- <1> 369 00008336 3036202D2032303039- <1> 369 0000833F 0D0A0D0A <1> 370 00008343 496E73696768742063- <1> db "Insight comes with ABSOLUTELY NO WARRANTY. This is free software covered by", 13, 10 370 0000834C 6F6D65732077697468- <1> 370 00008355 204142534F4C555445- <1> 370 0000835E 4C59204E4F20574152- <1> 370 00008367 52414E54592E205468- <1> 370 00008370 697320697320667265- <1> 370 00008379 6520736F6674776172- <1> 370 00008382 6520636F7665726564- <1> 370 0000838B 2062790D0A <1> 371 00008390 474E552047454E4552- <1> db "GNU GENERAL PUBLIC LICENSE 2, and you are welcome to redistribute it under", 13, 10 371 00008399 414C205055424C4943- <1> 371 000083A2 204C4943454E534520- <1> 371 000083AB 322C20616E6420796F- <1> 371 000083B4 75206172652077656C- <1> 371 000083BD 636F6D6520746F2072- <1> 371 000083C6 656469737472696275- <1> 371 000083CF 746520697420756E64- <1> 371 000083D8 65720D0A <1> 372 000083DC 6365727461696E2063- <1> db "certain conditions. See http://www.gnu.org/ or COPYING file for details.", 13, 10, '$' 372 000083E5 6F6E646974696F6E73- <1> 372 000083EE 2E2053656520687474- <1> 372 000083F7 703A2F2F7777772E67- <1> 372 00008400 6E752E6F72672F206F- <1> 372 00008409 7220434F5059494E47- <1> 372 00008412 2066696C6520666F72- <1> 372 0000841B 2064657461696C732E- <1> 372 00008424 0D0A24 <1> 373 <1> 374 00008427 4572726F7220696E20- <1> error_help_msg db "Error in command line parameters.", 13, 10 374 00008430 636F6D6D616E64206C- <1> 374 00008439 696E6520706172616D- <1> 374 00008442 65746572732E0D0A <1> 375 0000844A 202055736167653A20- <1> help_msg db " Usage: INSIGHT [options] [filename [parameters]]", 13, 10 375 00008453 494E5349474854205B- <1> 375 0000845C 6F7074696F6E735D20- <1> 375 00008465 5B66696C656E616D65- <1> 375 0000846E 205B706172616D6574- <1> 375 00008477 6572735D5D0D0A <1> 376 0000847E 20204F7074696F6E73- <1> db " Options:", 13, 10 376 00008487 3A0D0A <1> 377 0000848A 092F682C202F3F0909- <1> db " /h, /? - display this help screen", 13, 10 377 00008493 2D20646973706C6179- <1> 377 0000849C 20746869732068656C- <1> 377 000084A5 702073637265656E0D- <1> 377 000084AE 0A <1> 378 000084AF 092F6509092D204547- <1> db " /e - EGA mode (do not save font and VGA registers)", 13, 10 378 000084B8 41206D6F6465202864- <1> 378 000084C1 6F206E6F7420736176- <1> 378 000084CA 6520666F6E7420616E- <1> 378 000084D3 642056474120726567- <1> 378 000084DC 697374657273290D0A <1> 379 000084E5 092F7209092D207465- <1> db " /r - terminate and stay resident in memory", 13, 10 379 000084EE 726D696E6174652061- <1> 379 000084F7 6E6420737461792072- <1> 379 00008500 65736964656E742069- <1> 379 00008509 6E206D656D6F72790D- <1> 379 00008512 0A <1> 380 00008513 092F7509092D20756E- <1> db " /u - unload resident debugger$" 380 0000851C 6C6F61642072657369- <1> 380 00008525 64656E742064656275- <1> 380 0000852E 6767657224 <1> 381 <1> 382 00008533 4D656D6F727920616C- <1> fatal_memory_msg db "Memory allocation error$" 382 0000853C 6C6F636174696F6E20- <1> 382 00008545 6572726F7224 <1> 383 <1> 384 0000854B 43616E27742072656C- <1> memory_free_msg db "Can't release debugger memory$" 384 00008554 656173652064656275- <1> 384 0000855D 67676572206D656D6F- <1> 384 00008566 727924 <1> 385 00008569 446562756767657220- <1> not_installed_msg db "Debugger not found in memory$" 385 00008572 6E6F7420666F756E64- <1> 385 0000857B 20696E206D656D6F72- <1> 385 00008584 7924 <1> 386 00008586 496E636F7272656374- <1> version_msg db "Incorrect debugger version$" 386 0000858F 206465627567676572- <1> 386 00008598 2076657273696F6E24 <1> 387 000085A1 43616E277420756E6C- <1> unload_error_msg db "Can't unload debugger$" 387 000085AA 6F6164206465627567- <1> 387 000085B3 67657224 <1> 388 000085B7 446562756767657220- <1> unloaded_msg db "Debugger unloaded successfully.", 13, 10, '$' 388 000085C0 756E6C6F6164656420- <1> 388 000085C9 737563636573736675- <1> 388 000085D2 6C6C792E0D0A24 <1> 389 000085D9 446562756767657220- <1> alredy_tsr_msg db "Debugger already installed resident.", 13, 10 389 000085E2 616C72656164792069- <1> 389 000085EB 6E7374616C6C656420- <1> 389 000085F4 7265736964656E742E- <1> 389 000085FD 0D0A <1> 390 000085FF 202050726573732043- <1> db " Press Ctrl+Esc to activate$" 390 00008608 74726C2B4573632074- <1> 390 00008611 6F2061637469766174- <1> 390 0000861A 6524 <1> 391 0000861C 2E0D0A <1> eol db ".", 13, 10 392 0000861F 0724 <1> beep_char db 7, '$' 393 <1> 394 <1> ;============================================================================= 395 <1> ; E0F 396 <1> ;============================================================================= 397 <1> 398 <1> 91 92 SHARED_DATA_SIZE equ $-shared_data_area 93 94 ;============================================================================= 95 ; Uninitialized data. 96 ;============================================================================= 97 udata_start: 98 99 absolute udata_start 100 101 00008621 resb WINDOW_BUF_SIZE - SHARED_DATA_SIZE 102 00008A36 code_mark_buff resw 10 * 4 103 104 %include "actudata.inc" ;Uninitialized data 1 <1> ;============================================================================= 2 <1> ; Insight, real-mode debugger for MS DOS / PC DOS / FreeDOS. 3 <1> ; Copyright (c) Victor M. Gamayunov, Sergey Pimenov, 1993, 96, 97, 2002. 4 <1> ; Modifications by Oleg O. Chukaev (2006 - 2009). 5 <1> ;----------------------------------------------------------------------------- 6 <1> ; actudata.inc 7 <1> ; Data: uninitialized variables. 8 <1> ;----------------------------------------------------------------------------- 9 <1> ; This program is free software; you can redistribute it and/or 10 <1> ; modify it under the terms of the GNU General Public License 11 <1> ; as published by the Free Software Foundation; either version 2 12 <1> ; of the License, or (at your option) any later version. 13 <1> ; 14 <1> ; This program is distributed in the hope that it will be useful, 15 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 <1> ; GNU General Public License for more details. 18 <1> ; 19 <1> ; You should have received a copy of the GNU General Public License 20 <1> ; along with this program; if not, write to the Free Software 21 <1> ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 <1> ; 02110-1301 USA 23 <1> ;============================================================================= 24 <1> 25 <1> 26 <1> ;============================================================================= 27 <1> ; Changelog 28 <1> ;----------------------------------------------------------------------------- 29 <1> ; 2007-02-08 0leg first_mcb, string added. 30 <1> ; 2007-02-10 0leg Some variables from windows.inc, keyboard.inc 31 <1> ; moved here. 32 <1> ; 2007-03-13 0leg Removed exec_message_bx, exec_message_dx. 33 <1> ; 2007-03-18 0leg Removed exec_dialog_cx, exec_dialog_dx 34 <1> ; zz_cpu -> system_cpu (was `CPU' in v1.10) 35 <1> ; 2007-11-11 0leg list_act added, cur_str moved from actdata.inc 36 <1> ; 2008-01-02 0leg ... 37 <1> ; 2008-03-23 0leg dump_address added 38 <1> ;============================================================================= 39 <1> 40 <1> 41 00008A86 ???? <1> alignb 4 42 <1> ;============================================================================= 43 00008A88 <1> save_cpu_regs resw 16*2 ;Saved CPU regs, 16 regs * 2 words 44 00008AC8 <1> cpu_regs resw 16*2 ;Current CPU regs 45 <1> 46 00008B08 ?????????????? <1> bp0 resb SIZEOF_BREAKPOINT ;Temporary breakpoint 47 00008B0F <1> bp1 resb MAX_BREAKPOINTS * SIZEOF_BREAKPOINT ;Breakpoints 48 <1> 49 00008B55 ???????? <1> save_int_01 resd 1 ; 50 00008B59 ?? <1> int_01_set resb 1 ; 51 00008B5A ???????? <1> save_int_03 resd 1 ; 52 00008B5E ?? <1> int_03_set resb 1 ; 53 00008B5F ???????? <1> save_int_09 resd 1 ; 54 00008B63 ?? <1> int_09_set resb 1 ; 55 00008B64 ???????? <1> save_int_16 resd 1 ; 56 00008B68 ???????? <1> save_int_24 resd 1 ; 57 <1> 58 <1> alignb 2 59 00008B6C ???? <1> save_sp resw 1 ;For saving SP in trace.inc 60 <1> 61 00008B6E ?? <1> system_cpu resb 1 ;Type of CPU: 0 -- 8086, ..., 4 -- 486+ 62 <1> 63 00008B6F ?? <1> alignb 2 64 00008B70 ???? <1> save_dta_seg resw 1 ; 65 <1> 66 00008B72 ???? <1> cur_x resw 1 ;*Initial column of text in the Code wnd 67 00008B74 ???? <1> cur_line resw 1 ;*Number of current line in the Code wnd 68 00008B76 ???? <1> cur_line_ip resw 1 ;IP of current (selected) instruction 69 00008B78 ???? <1> user_pid resw 1 ;Segment address of user program's PSP 70 00008B7A ?? <1> memory_flag resb 1 ; 71 00008B7B ?? <1> mem_disp_type resb 1 ; 72 <1> alignb 2 73 00008B7C ???? <1> mem_disp_offs resw 1 ; 74 00008B7E ???? <1> mem_prefix resw 1 ; 75 00008B80 ???? <1> cmd_text_size resw 1 ; 76 00008B82 ?? <1> my_port_21 resb 1 ; 77 00008B83 ?? <1> user_port_21 resb 1 ; 78 <1> 79 00008B84 ?? <1> edit_mode resb 1 ;2008-03-23 80 00008B85 ?? <1> quit_flag resb 1 ;*1 if exit from debugger requested 81 00008B86 ?? <1> resident_mode resb 1 ;*1 if debugger is in TSR mode 82 00008B87 ?? <1> alignb 2 83 00008B88 ???? <1> code_mark_exist resw 1 ; 84 00008B8A ?? <1> file_specified resb 1 ;*1 if program is loaded in the debugger 85 00008B8B ?? <1> cmd_line_options resb 1 ;Command line options (bit array) 86 00008B8C ?? <1> regs_mode resb 1 ;*1 if regs is in 32-bit mode 87 00008B8D ?? <1> cur_line_brk resb 1 ; 88 00008B8E ?? <1> video_type resb 1 ;Type of video card. 1: VGA, 0 otherwise 89 <1> 90 00008B8F ?? <1> alignb 2 91 00008B90 ???? <1> unasm_cur_ip resw 1 ; 92 00008B92 ?? <1> cur_cmd resb 1 ; 93 00008B93 ???? <1> cur_param resw 1 ; 94 00008B95 ?? <1> word_flag resb 1 ; 95 00008B96 ?? <1> dword_flag resb 1 ; 96 00008B97 ?? <1> print_flag resb 1 ; 97 00008B98 ???? <1> cur_prefix resw 1 ; 98 00008B9A ?? <1> ignore_prefix resb 1 ; 99 00008B9B ???? <1> unasm_seg resw 1 ;Segment of current instruction 100 00008B9D ?? <1> inst_286 resb 1 ; 101 00008B9E ?? <1> op_size_flag resb 1 ; 102 00008B9F ?? <1> addr_size_flag resb 1 ; 103 00008BA0 ?? <1> str_flag resb 1 ; 104 00008BA1 ???? <1> cur_rep resw 1 ; 105 00008BA3 ?? <1> jcnear resb 1 ; 106 00008BA4 ?? <1> db_flag resb 1 ; 107 <1> 108 00008BA5 ?? <1> alignb 2 109 00008BA6 ???? <1> follow_offs resw 1 ; 110 00008BA8 ???? <1> follow_seg resw 1 ; 111 <1> 112 00008BAA ???? <1> data_watch_proc resw 1 ; 113 00008BAC ???? <1> data_watch_temp resw 1 ; 114 00008BAE ???? <1> data_watch_label resw 1 ; 115 <1> 116 00008BB0 ???? <1> search_offs resw 1 ;Initial offset and 117 00008BB2 ???? <1> search_seg resw 1 ;segment for search 118 00008BB4 ???? <1> search_len resw 1 ;Length of searched byte sequence 119 00008BB6 ???? <1> search_options resw 1 ;Search options (bit array) 120 <1> 121 00008BB8 ???? <1> dump_address resw 1 ;Current offset in the Dump window 122 00008BBA ???? <1> dump_seg resw 1 ;Initial segment of the Dump window 123 00008BBC ???? <1> dump_offs resw 1 ;Initial offset of the Dump window 124 00008BBE ???? <1> new_dump_seg resw 1 ;Tmp var for update_dump_window 125 00008BC0 ???? <1> new_dump_offs resw 1 ;Tmp var for update_dump_window 126 00008BC2 ???? <1> dump_proc resw 1 ;Tmp var for update_dump_window 127 <1> 128 00008BC4 ?? <1> minus_flag resb 1 ; 129 00008BC5 ?? <1> mov_flag resb 1 ; 130 00008BC6 ?? <1> lxx_flag resb 1 ; 131 00008BC7 ?? <1> jump_flag resb 1 ; 132 00008BC8 ?? <1> param_count resb 1 ; 133 00008BC9 ?? <1> rep_pref resb 1 ; 134 00008BCA ???? <1> far_value resw 1 ; 135 <1> 136 <1> alignb 4 137 00008BCC ???????? <1> from_addr resd 1 ;Block: source address 138 00008BD0 ???????? <1> to_addr resd 1 ;Destination address 139 00008BD4 ???? <1> count_value resw 1 ;Number of bytes to copy/move/etc. 140 <1> 141 00008BD6 ???? <1> magic_offs resw 1 ;*Index of next char in DOOM cheat code 142 <1> 143 00008BD8 <1> draw_table: resb drawing_list_table.size 144 00008C00 ?? <1> in_init_dialog: resb 1 ; record accelerators while -1 145 00008C01 ?? <1> draw_text_found_accelerator: resb 1 ; accelerator found if -1 146 00008C02 ?? <1> user_port_21_mask_3_only: resb 1 147 00008C03 ?? <1> alignb 4 148 00008C04 ???????? <1> search_backwards_last_byte: resd 1 149 <1> alignb 2 150 00008C08 ???? <1> load_search_next_template: resw 1 151 00008C0A ???? <1> read_key_insert: resw 1 152 00008C0C ???? <1> toggle_checkbox_ax: resw 1 153 00008C0E ???? <1> accelerator_item_index: resw 1 154 00008C10 ???? <1> accelerator_checkbox_index: resw 1 155 00008C12 ???? <1> active_checkbox_index: resw 1 156 00008C14 <1> dialog_accelerators: resb 6 * 36 ; each item is one accelerator: 157 <1> ; keyboard code, 158 <1> ; item index (in dialog), 159 <1> ; checkbox index (in item) 160 <1> ; end given by word [dialog_accelerators_behind_last] 161 <1> 162 <1> ;============================================================================= 163 <1> ; system.inc 164 <1> ;----------------------------------------------------------------------------- 165 <1> alignb 2 166 00008CEC ???? <1> keep_ip resw 1 ;For pushr and popr 167 <1> 168 <1> ;============================================================================= 169 <1> ; windows.inc 170 <1> ;----------------------------------------------------------------------------- 171 <1> alignb 2 172 00008CEE ???? <1> sub_struc resw 1 ;exec_sub_menu: ptr to number of items 173 00008CF0 ???? <1> sub_coord resw 1 ;exec_sub_menu: coordinates of l/t corner 174 00008CF2 ???? <1> exec_message_cx resw 1 ;exec_message: cursor shape 175 00008CF4 ???? <1> vert_menu_result resw 1 ;vert_menu: return value 176 00008CF6 ???? <1> msg_title resw 1 ;exec_message: ptr to wnd title 177 00008CF8 ?? <1> msg_box_attr resb 1 ;exec_message: color of window 178 00008CF9 ?? <1> message_attr resb 1 ;exec_message: color of message 179 00008CFA ???? <1> owb_bp resw 1 ;open_window_bord: ??? 180 00008CFC ?? <1> read_line_attr resb 1 ;Normal color of input line 181 00008CFD ?? <1> read_line_sel_attr resb 1 ;Color of unchanged input line 182 00008CFE ???? <1> read_line_result resw 1 ;read_line: return value 183 00008D00 ???? <1> read_line_cur resw 1 ;read_line: cursor shape 184 00008D02 ???? <1> read_line_cur_c resw 1 ;read_line: cursor coord. 185 00008D04 ???? <1> str_buffer resw 1 ;read_line, update_string: ptr to string buffer 186 00008D06 ???? <1> str_start resw 1 ;read_line, update_string: coord. of input line 187 00008D08 ???? <1> point_options resw 1 ;Ptr to list of menu procedures/submenus 188 00008D0A ?? <1> string_changed resb 1 ;1 if input string is not changed yet 189 00008D0B ?? <1> alignb 2 190 00008D0C ???? <1> str_length resw 1 ;Length of input line `window' 191 00008D0E ???? <1> max_str_length resw 1 ;Max length of input line 192 <1> 193 <1> ;============================================================================= 194 <1> ; keyboard.inc 195 <1> ;----------------------------------------------------------------------------- 196 <1> alignb 2 197 00008D10 ???? <1> key_loop_sub resw 1 ;Ptr to proc. called by key_loop 198 00008D12 ???? <1> keys resw 1 ;Ptr to keys table for key_loop 199 00008D14 ???? <1> cur_test_code resw 1 ;Key code if it isn't found in a table 200 <1> 201 <1> ;============================================================================= 202 <1> ; dialogs.inc 203 <1> ;----------------------------------------------------------------------------- 204 <1> alignb 2 205 00008D16 ???? <1> exec_dialog_res resw 1 ;exec_dialog: return value 206 <1> cb_max: ;draw_check_boxes: width of labels 207 00008D18 ???? <1> cb_si resw 1 ;{init|draw}_check_boxes: tmp var 208 00008D1A ?? <1> cb_cur resb 1 ;-//-: number of current checkbox 209 00008D1B ?? <1> alignb 2 210 00008D1C ???? <1> string_count resw 1 ;Number of strings in string list 211 00008D1E ???? <1> string_ptr resw 1 ;Ptr to buffer for string list 212 00008D20 ???? <1> string_size resw 1 ;Length of string in string list 213 00008D22 ???? <1> list_height resw 1 ;Height of string list 214 00008D24 ???? <1> link_string resw 1 ;Ptr to input line struc. for string list 215 00008D26 ???? <1> list_choice resw 1 ;run_list: selected item 216 00008D28 ???? <1> list_first resw 1 ;draw_list: number of top string 217 00008D2A ???? <1> cur_str resw 1 ;draw_list: number of current string 218 00008D2C ?? <1> list_act resb 1 ;draw_list: flag: normal/active list 219 00008D2D ?? <1> alignb 2 220 00008D2E ???? <1> dlg_win_a resw 1 ;Coordinates ot top left corner of wnd 221 00008D30 ???? <1> dlg_win_b resw 1 ;Coordinates ot lower right corner of wnd 222 00008D32 ???? <1> dlg_items resw 1 ;Number of elements in a dialog window 223 00008D34 ???? <1> dlg_active_item resw 1 ;Ptr to number of active element 224 00008D36 <1> dlg_items_data resw MAX_ITEMS ;Array of pointers to data of items 225 <1> 226 <1> ;============================================================================= 227 <1> 228 00008D76 <1> instr_table resw CPU_HEIGHT-1 ; 229 00008D96 <1> asm_buffer resb 20 ; 230 00008DAA <1> buffer resb BUF_SIZE ; 231 00008DFA <1> name_buf resb MAX_LETTER+2 ; 232 00008E03 <1> my_cmd_line resb 80h ; 233 00008E83 <1> cmd_line_string resb 80h ; 234 00008F03 <1> filename_string resb FILENAME_LEN+1 ; 235 00008F54 <1> search_string resb SEARCH_FILL_LEN+1 ; 236 00008F87 <1> search_bin resb SEARCH_FILL_LEN+1 ; 237 00008FBA <1> filename resb 128 ; 238 0000903A <1> asm_line resb MAX_ASM_SIZE+1 ; 239 <1> 240 00009076 <1> dump_addr_string resb ADDRESS_STRING_LENGTH+1 ; 241 0000908F <1> main_addr_string resb ADDRESS_STRING_LENGTH+1 ; 242 <1> search_addr_str: 243 000090A8 <1> from_string resb ADDRESS_STRING_LENGTH+1 ; 244 000090C1 <1> to_string resb ADDRESS_STRING_LENGTH+1 ; 245 000090DA <1> count_string resb ADDRESS_STRING_LENGTH+1 ; 246 000090F3 <1> delay_string resb ADDRESS_STRING_LENGTH+1 ; 247 0000910C <1> fill_string resb SEARCH_FILL_LEN+1 ; 248 0000913F <1> fill_bin resb SEARCH_FILL_LEN+1 ; 249 <1> 250 00009172 ???? <1> alignb 4 251 00009174 <1> interrupt_table resb 1024 ;Saved interrupt vectors table 252 <1> 253 <1> ;============================================================================= 254 <1> ; video.inc 255 <1> ;----------------------------------------------------------------------------- 256 00009574 ?? <1> old_mode_num resb 1 ; 257 00009575 ???? <1> old_cursor resw 1 ; 258 00009577 ???? <1> old_cur_shape resw 1 ; 259 00009579 <1> old_video_regs resb 79h ; 260 000095F2 ?? <1> old_mode_num_2 resb 1 ; 261 000095F3 <1> old_screen resw SCR_COLS*SCR_ROWS ; 262 0000A593 ?? <1> alignb 4 263 0000A594 <1> font resb 4096 ;Saved font, but may be used for saving 264 <1> ;the screen when /e switch specified 265 <1> 266 <1> ;============================================================================= 267 <1> ; tools.inc 268 <1> ;----------------------------------------------------------------------------- 269 <1> alignb 2 270 0000B594 ???? <1> first_mcb resw 1 ;Segment of 1st MCB 271 0000B596 <1> string resb 45 ;String for list_memory_blocks 272 <1> 273 <1> ;============================================================================= 274 <1> ; E0F 275 <1> ;============================================================================= 276 <1> 105 106 udata_end: 107 program_end: 108 109 ;============================================================================= 110 ; E0F 111 ;============================================================================= 112