     1                                  
     2                                  %if 0
     3                                  
     4                                  lDebug D commands - Dump data
     5                                  
     6                                  Copyright (C) 1995-2003 Paul Vojta
     7                                  Copyright (C) 2008-2026 E. C. Masloch
     8                                  
     9                                  Usage of the works is permitted provided that this
    10                                  instrument is retained with the works, so that any entity
    11                                  that uses the works is notified of this instrument.
    12                                  
    13                                  DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    14                                  
    15                                  %endif
    16                                  
    17                                  %define SOURCEFILENAME "dd.asm"
    18                                  %ifidni __OUTPUT_FORMAT__, obj
    19                                   %include "debug.mac"
     1                              <1> [list -]
    14                              <3> [list -]
    14                              <2> [list -]
    86                              <1> [list -]
    86          ------------------  <1>  note: Disable usesection detection
    86          ------------------  <1>  note: usesection lDEBUG_DATA_ENTRY
    86          ------------------  <1>  note: usesection ASMTABLE1
    86          ------------------  <1>  note: usesection ASMTABLE2
    86          ------------------  <1>  note: usesection DATASTACKBASE
    86          ------------------  <1>  note: usesection MESSAGESEGMENT
    86          ------------------  <1>  note: usesection lDEBUG_CODE
    86          ------------------  <1>  note: usesection lDEBUG_CODE2
    86          ------------------  <1>  note: usesection INIT
    86          ------------------  <1>  note: usesection WLEMITALIGNINITEND
    86          ------------------  <1>  note: usesection DEVICESHIM
    86          ------------------  <1>  note: usesection WLEMITALIGNRELOCZERO
    68                              <2> %endif
    69                              <2> 
    70                              <2> 
    71                              <2> 	usesection lDEBUG_CODE
    71          ------------------  <2>  note: usesection lDEBUG_CODE
    72                              <2> section_of puts, trimputs, puts_ext_done, puts_ext_next
    73                              <2> section_of putsz_exthelp, code_retf
    74                              <2> section_of puts_getline_ext_done
    75                              <2> section_of puts_copyoutput_ext_done
    76                              <2> section_of guard_auxbuff, guard_re
    77                              <2> section_of handle_serial_flags_ctrl_c
    78                              <2> section_of hexword_high
    79                              <2> section_of call_int2D
    80                              <2> section_of copy_single_counted_string
    81                              <2> section_of intchk
    82                              <2> section_of IsIISPEntry?
    83                              <2> section_of dd_store
    84                              <2> section_of dohack, getsegmented, hexbyte, hexnyb, iseol?.notsemicolon
    85                              <2> section_of peekc, getc, prephack, readmem, setds2si, setds2bx, setes2dx
    86                              <2> section_of silence_get_start, silence_get_start.have_di, silence_count_zeroes
    87                              <2> section_of setrmlimit, skipcomm0, unhack
    88                              <2> section_of skipequals
    89                              <2> section_of to_errret_pop
    90                              <2> section_of cmd3.have_cx_convenience
    91                              <2> section_of verifysegm, verifysegm_or_error
    92                              <2> section_of pp16, resetmode, resetmode_and_test_d_b_bit
    93                              <2> section_of pp_fix32bitflags, proceedbreakpoint
    94                              <2> section_of putsz, hexword, skipcomma, cmd3, cmd3_not_ext, cmd3_preprocessed
    95                              <2> section_of hexdword
    96                              <2> section_of cmd3_not_inject, cmd3_injected
    97                              <2> section_of aa_not_inject, aa_injected, aa_before_getline, aa_after_getline
    98                              <2> section_of transfer_ext_cx_nearcall_from_code2
    99                              <2> section_of traceone, unexpectedinterrupt, dumpregs_no_disasm
   100                              <2> section_of aa_imm_entry, ia_restore_a_addr, ia_restore_u_addr, disasm
   101                              <2> section_of ia_restore_ds
   102                              <2> %ifn _SYMBOLIC
   103                              <2> section_of selector_to_segment
   104                              <2> %endif
   105                              <2> section_of disp_al, disp_al_hex, disp_al_nybble_hex, disp_ax_dec, disp_ax_hex
   106                              <2> section_of disp_dxax_times_cx_width_bx_size
   107                              <2> section_of disp_dxax_times_cx_width_bx_size.store
   108                              <2> section_of disp_message, disp_message_length_cx
   109                              <2> section_of ispm
   110                              <2> section_of setrc, error
   111                              <2> section_of _doscall, _doscall_return_es, _doscall_return_es_parameter_es_ds
   112                              <2> section_of intcall_ext_return_es, close_ext, doscall_extseg
   113                              <2> section_of yy_reset_buf
   114                              <2> section_of init_bootcmd
   115                              <2> 
   116                              <2> section_of InDOS, bootgetmemorysize
   117                              <2> section_of chkeol, decword, decdword
   118                              <2> section_of dec_dword_minwidth
   119                              <2> section_of getexpression.lit_isdigit?, getexpression.lit_ishexdigit?
   120                              <2> section_of getlinearaddr
   121                              <2> section_of getlinear_d_b
   122                              <2> section_of getlinear_high_limit
   123                              <2> section_of getlinear_32bit
   124                              <2> section_of getlinear_high_limit.do_not_use_test
   125                              <2> section_of getlinear_common
   126                              <2> section_of ifsep, iseol?, isseparator?, isstring?, movp
   127                              <2> section_of putc, putsline, putsline_crlf, putsz_error
   128                              <2> section_of setrmsegm
   129                              <2> section_of skipwh0, skipwhite
   130                              <2> section_of test_d_b_bit, test_high_limit, push_cxdx_or_edx
   131                              <2> section_of capitalise
   132                              <2> section_of setes2ax
   133                              <2> section_of zz_copy_strings_to_str_buffer
   134                              <2> section_of call_xms_move, zz_call_xms, zz_detect_xms
   135                              <2> section_of code2_to_code_ret_to_ext
   136                              <2> section_of yy_dos_parse_name, yy_open_file, yy_check_lfn
   137                              <2> section_of yy_common_parse_name
   138                              <2> section_of yy_common_parse_name_bx_buffer
   139                              <2> section_of retry_open_scriptspath
   140                              <2> section_of yy_boot_read.bx, yy_boot_seek_start.bx, yy_boot_seek_current.bx
   141                              <2> section_of yy_boot_parse_name, yy_boot_open_file
   142                              <2> section_of yy_boot_parse_name_bx_buffer
   143                              <2> section_of near_transfer_ext_return, scan_dir_aux, read_sector
   144                              <2> section_of yy_boot_init_dir, got_yyentry, scan_dir_entry
   145                              <2> section_of ..@yy_filename_empty, boot_parse_fn
   146                              <2> section_of count_store, count_store.maybe_0
   147                              <2> section_of loader_get_resident_address, loader_prepare_resident
   148                              <2> 
   149                              <2> 
   150                              <2>  %if _SYMBOLIC && _DUALCODE && _SYMBOLASMDUALCODE
   151                              <2> 	usesection lDEBUG_CODE2
   152                              <2>  %else
   153                              <2> 	usesection lDEBUG_CODE
   153          ------------------  <2>  note: usesection lDEBUG_CODE
   154                              <2>  %endif
   155                              <2> section_of bxcx_to_cx_paragraphs
   156                              <2> section_of zz_list_symbol.first, zz_list_symbol.subsequent
   157                              <2> section_of zz_xms_to_86mm, zz_xms_try_free, zz_xms_try_free_handle
   158                              <2> section_of zz_86mm_to_xms, zz_del_match.add_poison_entrypoint
   159                              <2> section_of zz_free_nonxms, zz_free_xms, zz_free_reset, zz_free_dos
   160                              <2> section_of zz_get_literal, zz_restore_strat, zz_save_strat
   161                              <2> section_of zz_switch_s, zz_transfer_buffer
   162                              <2> 
   163                              <2> 
   164                              <2> %if _SYMBOLIC
   165                              <2>  %if _DUALCODE && _SYMBOLICDUALCODE
   166                              <2> 	usesection lDEBUG_CODE2
   167                              <2>  %else
   168                              <2> 	usesection lDEBUG_CODE
   169                              <2>  %endif
   170                              <2> section_of shift_left_4_bxcx
   171                              <2> section_of selector_to_segment
   172                              <2> 
   173                              <2> section_of anti_normalise_pointer_with_displacement_bxcx, displaystring
   174                              <2> section_of getfarpointer.hash, getfarpointer.main, getfarpointer.str
   175                              <2> section_of move_delete_farpointer.hash, move_delete_farpointer.hash.sidi
   176                              <2> section_of move_delete_farpointer.main, move_delete_farpointer.str.sidi
   177                              <2> section_of move_insert_farpointer.hash, move_insert_farpointer.hash.sidi
   178                              <2> section_of move_insert_farpointer.main, move_insert_farpointer.main.sidi
   179                              <2> section_of move_insert_farpointer.str.sidi
   180                              <2> section_of normalise_pointer, normalise_pointer_with_displacement_bxcx
   181                              <2> section_of pointer_to_linear
   182                              <2> section_of save_slice_farpointer.hash, save_slice_farpointer.main
   183                              <2> section_of save_slice_farpointer.str
   184                              <2> section_of segment_to_selector
   185                              <2> section_of zz_insert, zz_match_symbol, zz_match_symbol.continue, zz_relocate
   186                              <2> 
   187                              <2> section_of binsearchhash, binsearchmain
   188                              <2> section_of check_second_slice
   189                              <2> section_of disp_size_hash, disp_size_main, disp_size_str
   190                              <2> section_of displayresult, getstring1, getstring2
   191                              <2> section_of increment_ss_ref_count
   192                              <2> section_of list_sym_storage_usage, str_index_to_pointer
   193                              <2> section_of zz_commit_insert, zz_compact, zz_compact_expand_check_nonxms
   194                              <2> section_of zz_compact_expand_check_xms
   195                              <2> section_of zz_delete_hash, zz_delete_main, zz_delete_main_and_its_hash
   196                              <2> section_of zz_delete_string, zz_expand, zz_expand_common
   197                              <2> section_of zz_get_symstr_length_bytes
   198                              <2> section_of zz_get_symstr_length_bytes.ssLength_in_cx
   199                              <2> section_of zz_get_symstr_length_indices
   200                              <2> section_of zz_get_symstr_length_indices.ssLength_in_cx
   201                              <2> section_of zz_hash, zz_hash.bx_init
   202                              <2> section_of zz_insert_main.linklist, zz_reloc_main, zz_reloc_str
   203                              <2> section_of zz_store_pre_str, zz_store_string, zz_store_string.hash_bx
   204                              <2> section_of zz_unlink_main_next
   205                              <2> %endif
   206                              <2> 
   207                              <2> %if _DUALCODE
   208                              <2> 	usesection lDEBUG_CODE2
   208          ------------------  <2>  note: usesection lDEBUG_CODE2
   209                              <2> %else
   210                              <2> 	usesection lDEBUG_CODE
   211                              <2> %endif
   212                              <2> section_of FloatToStr
   213                              <2> 
   214                              <2> 
   215                              <2>  %if _DUALCODE && _EXPRDUALCODE
   216                              <2> 	usesection lDEBUG_CODE2
   216          ------------------  <2>  note: usesection lDEBUG_CODE2
   217                              <2>  %else
   218                              <2> 	usesection lDEBUG_CODE
   219                              <2>  %endif
   220                              <2> 
   221                              <2> section_of getofsforbx, checkpointer, getrangeX
   222                              <2> section_of getrangeX_have_address_need_length
   223                              <2> section_of getrange, getaddr, getofsforbx_remember_bitness
   224                              <2> section_of remember_bitness, getaddr_taken
   225                              <2> section_of getstr, get_length, get_length_keyword
   226                              <2> section_of isbracketorunaryoperator?, isunaryoperator?, isoperator?
   227                              <2> section_of ..@call_operator_dispatchers
   228                              <2> section_of isseparator?, istype?, isunsignedtype?
   229                              <2> section_of handlesegment, handle3byte, handlebyte, handleword
   230                              <2> section_of handledword, handlepointer
   231                              <2> section_of uoh_abs, uoh_minus, calculate_minus_bxdx, uoh_plus
   232                              <2> section_of uoh_not_bitwise, uoh_not_boolean
   233                              <2> section_of od_minus, od_plus, od_multiply, od_divide, od_modulo, od_retn
   234                              <2> section_of od_above, od_below, od_equal, od_not, od_or, od_and, od_xor
   235                              <2> section_of od_cond, od_o, od_a, od_x, od_c, od_string_common
   236                              <2> section_of of_modulo, of_minus, of_plus, or_hhtype, of_multiply
   237                              <2> section_of set_hhtype, of_divide, of_power
   238                              <2> section_of of_compare_below_equal, of_compare_below, of_compare_not_equal
   239                              <2> section_of of_compare_equal, of_compare_above_equal, of_compare_above
   240                              <2> section_of toboolean, of_helper_compare_true, of_rightop, of_helper_compare
   241                              <2> section_of of_shift_right, of_shift_right_signed, of_shift_left
   242                              <2> section_of of_helper_getshiftdata, of_bit_mirror
   243                              <2> section_of of_or_bitwise, or_hhtype_1, of_or_boolean, of_clr_bitwise
   244                              <2> section_of of_and_bitwise, of_and_boolean, of_xor_bitwise, of_xor_boolean
   245                              <2> section_of of_helper_retbool, of_helper_getbool
   246                              <2> 
   247                              <2> section_of var_cip_setup, var_csp_setup, var_lfsr_setup, var_reverselfsr_setup
   248                              <2> section_of var_dpspsel_setup, var_seldbg_setup, var_mt_setup
   249                              <2> section_of var_ioi_setup, var_psps_setup, var_ppr_setup, var_ppi_setup
   250                              <2> section_of var_iok_setup, var_rhcount_setup
   251                              <2> section_of var_get_psp_segment, var_get_psp_selector
   252                              <2> section_of var_bootldpunit_setup, var_bootsdpunit_setup, var_bootydpunit_setup
   253                              <2> section_of var_bootldppart_setup, var_bootsdppart_setup, var_bootydppart_setup
   254                              <2> section_of var_bootunitflags_setup
   255                              <2> 
   256                              <2> section_of issymbol?, isvariable?, var_mm_setup, var_ri_setup, var_ysf_setup
   257                              <2> section_of default_variable_setup
   258                              <2> section_of var_ext_setup
   259                              <2> section_of var_ext_setup_done
   260                              <2> 
   261                              <2> section_of getstmmxdigit
   262                              <2> section_of getexpression.lit_ishexdigit?, getexpression.lit_isdigit?
   263                              <2> section_of of_cond, count_unary_operators, count_unary_operators_restrict
   264                              <2> section_of get3byte.checksignificantbits, getbyte, checksignificantbitscommon
   265                              <2> section_of getnyb, get_value_range
   266                              <2> 
   267                              <2> section_of getaddrX, getword, getdword, getexpression
   268                              <2> 
   269                              <2> section_of getrangeX.lines, getrangeX.ecx_and_0_valid
   270                              <2> section_of getrange.lines, getrange.ecx_and_0_valid, get_length.lines
   271                              <2> section_of getrangeX.lines_and_uu, getrange.lines_and_uu
   272                              <2> section_of isseparator?.except_L_or_dot, isvariable?.return_name
   273                              <2> section_of getword.checksignificantbits, getbyte.checksignificantbits
   274                              <2> 
   275                              <2> section_of seg_bx_to_sel
   276                              <2> section_of getexpression.countsignificantbits
   277                              <2> section_of ..@rr_checksignificantbits, ..@rr_operatordispatchers
   278                              <2> section_of ..@rr_operatorfunctions, ..@parsecm_getaddr
   279                              <2> section_of stack_check.internal
   280                              <2> 
   281                              <2> 
   282                              <2> 	usesection INIT
   282          ------------------  <2>  note: usesection INIT
   283                              <2> section_of init_capitalise
   284                              <2> section_of init_skipwhite, init_skipwh0
   285                              <2> section_of init_skipcomma, init_skipcomm0
   286                              <2> section_of init_skipequals
   287                              <2> 
   288                              <2> 
   289                              <2> 	usesection lDEBUG_DATA_ENTRY
   289          ------------------  <2>  note: usesection lDEBUG_DATA_ENTRY
   290                              <2> section_of entry_retn
   291                              <2> 
   292                              <2> 
   293                              <2> %if _LINK
   294                              <2>  %include "extern.mac"
     1                              <3> 
     2                              <3> ; expr.asm
     3                              <3>  extern PPLEN, PPLEN_ONLY_PREFIXES, a_addr, alloc_seg, alloc_size
     4                              <3>  extern amis_multiplex_number, asm_options, asm_startoptions
     5                              <3>  extern auxbuff_current_size, auxbuff_segorsel, behind_r_u_addr
     6                              <3>  extern bp_offset, code_seg, code_size, d_addr, dcount_addr
     7                              <3>  extern dcpm_addr, dd_default_length, dd_default_lines, dd_text_and
     8                              <3>  extern debuggerfunction, default_pp_count, default_tp_count
     9                              <3>  extern default_tt_count, device_header_address, device_mcb_paragraphs
    10                              <3>  extern dwcount_addr, dz_addr, e_addr, encodedmach87, entryseg_size
    11                              <3>  extern env_size, envseg, erc, errret
    12                              <3>  extern extdata, extdata_size, extdata_used, extseg, extseg_size
    13                              <3>  extern extseg_used, flagbits.amount, flagnames, flagvaron
    14                              <3>  extern getrange_is_uu, getrange_lines, has_mmx, hhresult
    15                              <3>  extern history.segorsel, historyseg_size, immseg, input_file_handles
    16                              <3>  extern input_file_handles.active, internalflags, internalflags2
    17                              <3>  extern internalflags3, intr8_limit, io_columns, io_columns_getline
    18                              <3>  extern io_end_buffer, io_flags, io_levels, io_rows, io_start_buffer
    19                              <3>  extern line_out, line_out_end, linkinfoaddress, load_data
    20                              <3>  extern load_input_file, load_input_file.active, load_unit_flags
    21                              <3>  extern loaddata_loadedfrom, machine, maxmachinetype, messageseg
    22                              <3>  extern messageseg_size, mmxbuff, msg.as, msg.end, msg.executing
    23                              <3>  extern msg.executing_value_range, msg.from, msg.in, msg.length
    24                              <3>  extern msg.linear, msg.lines, msg.lr, msg.nd, msg.nottaken
    25                              <3>  extern msg.nt, msg.or, msg.questionmark, msg.r, msg.stack_overflow
    26                              <3>  extern msg.stack_overflow.caller, msg.stack_overflow.cond
    27                              <3>  extern msg.stack_overflow.indirection, msg.stack_overflow.linear
    28                              <3>  extern msg.stack_overflow.parens, msg.stack_overflow.precedence
    29                              <3>  extern msg.stack_overflow.value_in, msg.t, msg.taken, msg.to
    30                              <3>  extern msg.value, msgtable_value_range, options, options2, parent
    31                              <3>  extern ppbytes, priorrc, psp22, pspdbe, pspdbg
    32                              <3>  extern qqtermcode, rc_count, rc_limit, re_count, re_limit
    33                              <3>  extern reading_access_variables, reg16names, reg8names, reg_cs
    34                              <3>  extern reg_ds, reg_efl, reg_eip, reg_esp, search_results
    35                              <3>  extern serial_columns, serial_fifo_size, serial_keep_timeout
    36                              <3>  extern serial_rows, serial_use_baseport, serial_use_dl
    37                              <3>  extern serial_use_fifo, serial_use_intnum, serial_use_irqmask
    38                              <3>  extern serial_use_params, serial_var_baseport, serial_var_dl
    39                              <3>  extern serial_var_fifo, serial_var_intnum, serial_var_irqmask
    40                              <3>  extern serial_var_params, sscounter, stack, startoptions
    41                              <3>  extern table_length_keywords, throwsp, transfer_ext_cx
    42                              <3>  extern try_amis_multiplex_number, try_debugger_amis_multiplex_number
    43                              <3>  extern types, types.addresses_minus_end, types.end, u_addr
    44                              <3>  extern usertermcode, uu_default_length, uu_default_lines, vregs
    45                              <3>  extern vregs.amount, writing_access_variables
    46                              <3>  extern flagbits, regs
    47                              <3> 
    48                              <3> ; run.asm
    49                              <3>  extern ..@aa_access_end, ..@aa_access_start, ..@dd_access_end
    50                              <3>  extern ..@dd_access_start, ..@ee_access_end, ..@ee_access_start
    51                              <3>  extern ..@ee_interactive_access_end, ..@ee_interactive_access_start
    52                              <3>  extern ..@hh_indirection_memory_access_end
    53                              <3>  extern ..@hh_indirection_memory_access_start
    54                              <3>  extern ..@readmem_fault_skip_4_near_call, ..@rr_access_end
    55                              <3>  extern ..@rr_access_start, ..@rr_variable_read_access_end
    56                              <3>  extern ..@rr_variable_read_access_start
    57                              <3>  extern ..@rr_variable_write_access_end
    58                              <3>  extern ..@rr_variable_write_access_start, ..@sss_access_end
    59                              <3>  extern ..@sss_access_start, ..@uu_access_end, ..@uu_access_start
    60                              <3>  extern ..@uu_referenced_memory_access_end
    61                              <3>  extern ..@uu_referenced_memory_access_start, ..@uu_simulate_cmps_end
    62                              <3>  extern ..@uu_simulate_cmps_start, ..@uu_simulate_scas_end
    63                              <3>  extern ..@uu_simulate_scas_start, InDOS_or_BIOS_IO, PPLEN_ONLY_STRING
    64                              <3>  extern auxbuff_behind_last_silent
    65                              <3>  extern auxbuff_start_silent, bInDbg, b_bplist.bp, b_bplist.counter
    66                              <3>  extern b_bplist.disabled_mask, b_bplist.idbuffer, b_bplist.used_mask
    67                              <3>  extern b_bplist.when, bb_deferred_message_in_lineout_behind
    68                              <3>  extern bp_display_offset, calcpointbit, cmd2_reset_re, cmd_goto
    69                              <3>  extern debug22.cleartraceflag, decbyte, dmycmd, dumpregs_extended
    70                              <3>  extern enable_rh, entry_to_code_seg, entry_to_code_segsel, eqflag
    71                              <3>  extern eqladdr, exccsip, exception_csip, exception_stack, excloc
    72                              <3>  extern g_bplist.bp, g_bplist.used_count, get_set_id_offset_length
    73                              <3>  extern getc_if_any, getcseipbyte, getint2324, getpsp
    74                              <3>  extern gg_deferred_message, gg_first_cseip_linear
    75                              <3>  extern gg_next_cseip_linear, guard_auxbuff.1_or_2, idle, in_getinput
    76                              <3>  extern int19msg, internalflags6, intr8_counter, lastcmd, msg.again
    77                              <3>  extern msg.alreadytsr, msg.area_aa_access, msg.area_dd_access
    78                              <3>  extern msg.area_ee_access, msg.area_ee_interactive_access
    79                              <3>  extern msg.area_hh_indirection_memory_access, msg.area_rr_access
    80                              <3>  extern msg.area_rr_variable_read_access
    81                              <3>  extern msg.area_rr_variable_write_access, msg.area_run_access
    82                              <3>  extern msg.area_sss_access, msg.area_uu_access
    83                              <3>  extern msg.area_uu_referenced_memory_access
    84                              <3>  extern msg.area_uu_simulate_cmps, msg.area_uu_simulate_scas
    85                              <3>  extern msg.bb_hit.1, msg.bb_hit.2.counter, msg.bb_hitpass_id.after
    86                              <3>  extern msg.bb_hitpass_id.long, msg.bb_hitpass_id.short, msg.bb_pass.1
    87                              <3>  extern msg.cant_bp_linear, msg.cant_bp_linear.address1
    88                              <3>  extern msg.cant_bp_reason, msg.cant_bp_reason0, msg.cant_bp_reason1
    89                              <3>  extern msg.cant_bp_reason2, msg.cant_bp_reason3
    90                              <3>  extern msg.cant_bp_reason3.value, msg.cant_bp_reasonu
    91                              <3>  extern msg.cant_bp_restore, msg.cant_bp_restore.value
    92                              <3>  extern msg.cant_bp_the, msg.cant_bp_type_gg
    93                              <3>  extern msg.cant_bp_type_permanent, msg.cant_bp_type_permanent.index
    94                              <3>  extern msg.cant_bp_type_proceed, msg.cant_bp_write, msg.ctrlc
    95                              <3>  extern msg.empty_message, msg.goto, msg.invalidpsp, msg.list
    96                              <3>  extern msg.list_bp.address1, msg.list_bp.first, msg.list_bp.second
    97                              <3>  extern msg.list_bp.third, msg.list_bp.value, msg.list_bp_csip_16
    98                              <3>  extern msg.list_bp_none, msg.list_bp_not_cseip, msg.notyettsr
    99                              <3>  extern msg.nowattached, msg.nowtsr1, msg.nowtsr2, msg.psphooked
   100                              <3>  extern msg.pspnotfound, msg.remember, msg.selfownedpsp, msg.silent
   101                              <3>  extern msg.warnprefix, msg.while, msg.while_not_true
   102                              <3>  extern msg.while_terminated_after, msg.while_terminated_before
   103                              <3>  extern oldcols, oldcrtp, oldcsrpos, oldmr, options3
   104                              <3>  extern options6, pp_instruction, pp_operand, progexit, progtrm
   105                              <3>  extern rc, reg_eax, reg_es, reg_gs, reg_ss
   106                              <3>  extern run_int, run_sp, run_sp_reserve, savesp, setcseipbyte
   107                              <3>  extern setint2324, setpsp, setpspdbg
   108                              <3>  extern showstring, silence_dump, spadjust, swapscreen
   109                              <3>  extern tmode0, tmode1, tmodes, tmodev, tpg_possible_breakpoint
   110                              <3>  extern tpg_proceed_bp, tt_silent_mode_number, vpage, vrows
   111                              <3>  extern while_buffer, while_buffer.length, writemem
   112                              <3> 
   113                              <3>  extern ..@getcseipbyte_fault_skip_2_near_call
   114                              <3>  extern ..@setcseipbyte_fault_skip_2_near_call
   115                              <3>  extern ..@writemem_fault_skip_4_near_call_a
   116                              <3>  extern ..@writemem_fault_skip_4_near_call_b, int0Cmsg, int0Dmsg
   117                              <3>  extern int0msg, int18msg, int1msg, int3msg, int6msg
   118                              <3>  extern int8_kbd_msg, int8msg, runint_ctrlc_msg, serial_flags
   119                              <3> 
   120                              <3> ; bb.asm
   121                              <3>  extern ..@bb_id_length, ..@bb_id_start, ..@bb_saved_linear
   122                              <3>  extern ..@bb_when_length, ..@bb_when_start, b_bplist.id
   123                              <3>  extern b_bplist.idbuffer.free
   124                              <3>  extern b_bplist.whenbuffer, b_bplist.whenbuffer.free
   125                              <3>  extern bootcmd, crlf, msg.all, msg.at
   126                              <3>  extern msg.bb_no_new, msg.bb_when, msg.boot, msg.bp, msg.bpaddress
   127                              <3>  extern msg.bpcontent, msg.bpcounter, msg.bpdisabled, msg.bpenabled
   128                              <3>  extern msg.bpnone, msg.bpnone_at, msg.bpunused, msg.counter
   129                              <3>  extern msg.existing, msg.id, msg.new, msg.notbu, msg.number
   130                              <3>  extern msg.offset, msg.when, prnquit
   131                              <3> 
   132                              <3> ; rr.asm
   133                              <3>  extern InDOS_or_BIOS_output, cmdline_buffer
   134                              <3>  extern cmdline_buffer.end, cmdline_buffer.position, disflags, ee0a
   135                              <3>  extern error_expr, flagbits_for_40, flagbits_for_80, flagsoff
   136                              <3>  extern flagsoff_style2, flagsoff_style3, flagson, flagson_style23
   137                              <3>  extern get_memref_index_bx, getline00, getline_reset_notatty
   138                              <3>  extern guard_rc, hexnyb.common, hhtype, hhvar, in_re
   139                              <3>  extern mask_4byte, masks, memrefs, memrefs.free, msg.3byte
   140                              <3>  extern msg.abort, msg.append, msg.byte, msg.count, msg.dword
   141                              <3>  extern msg.highlight, msg.internal_error_no_mmx, msg.readonly
   142                              <3>  extern msg.readonly_mem, msg.regs386, msg.regs386_off, msg.regs386_on
   143                              <3>  extern msg.replace, msg.rh, msg.rv_mode.before, msg.rv_mode_r86m
   144                              <3>  extern msg.rv_mode_v86m, msg.rvd, msg.rvd_deviceheader
   145                              <3>  extern msg.rvd_not_device, msg.rvd_size, msg.rvm, msg.rvp
   146                              <3>  extern msg.rvp_application, msg.rvp_boot, msg.rvp_device
   147                              <3>  extern msg.rvp_device_attached, msg.rvp_tsr, msg.rvv
   148                              <3>  extern msg.unexpected_auxbuff_guard, msg.unhighlight, msg.vm_auxseg
   149                              <3>  extern msg.vm_codeseg, msg.vm_dataseg, msg.vm_entryseg, msg.vm_hisseg
   150                              <3>  extern msg.vm_messageseg, msg.vp_dparent, msg.vp_dpra
   151                              <3>  extern msg.vp_dpspsegment, msg.vp_parent, msg.vp_pra
   152                              <3>  extern msg.vp_pspsegment, msg.word, operatorfunctions, psp_parent
   153                              <3>  extern psp_pra, puts_break_line_more, putsline_break_line, re_buffer
   154                              <3>  extern re_buffer.end, re_buffer.position, re_sp, regs_prior
   155                              <3>  extern regs_prior.size, retn_expr, rh_count_number
   156                              <3>  extern rh_display_with_count, shortflagbits, shortflagbits.amount
   157                              <3>  extern shortflagsoff, shortflagson, silence_dump.rh
   158                              <3>  extern silence_dump.rh.all, table_getline_prepare_ldebug
   159                              <3>  extern table_getline_prepare_ms_debug, terminate_silent_dump
   160                              <3>  extern terminate_silent_dump.if_nonnull
   161                              <3> 
   162                              <3> ; rr.asm
   163                              <3>  extern flagbits_for_shl, regs_prior.size_w
   164                              <3> 
   165                              <3> ; aa.asm
   166                              <3>  extern REP_LEN, SEGP_LEN, attach
   167                              <3>  extern ext_aa_after_getline_handler, ext_aa_before_getline_handler
   168                              <3>  extern ext_aa_inject_handler, immasm_length, immasm_rel1632_target
   169                              <3>  extern immasm_rel8_target, msg.aa_internal_error, msg.attach
   170                              <3>  extern prefixlist.after_segment, replist, segprfxtab, showmach
   171                              <3>  extern skipalpha, sm1
   172                              <3> 
   173                              <3> ; uu.asm
   174                              <3>  extern A32P_LEN, GROUP7, MN_DB, MN_LOCK, MN_LOOP
   175                              <3>  extern MN_LOOPNZ, MN_LOOPZ, MN_REP, MN_REPE, MN_REPNE
   176                              <3>  extern MN_SEG, MN_WAIT, N_LOCK, N_LTABA, N_LTABO
   177                              <3>  extern N_WTAB, O32P_AMOUNT, OPTYPES_BASE, REP_DIFF_LEN, REP_SAME_LEN
   178                              <3>  extern SFPGROUP3, SGROUP4, SPARSE_BASE, a32prfxtab, dismach
   179                              <3>  extern dmflags, has_87, immasm_far_target, immasm_imm16, locktab
   180                              <3>  extern ltaba1, ltabo1, mach_87, mnlist, mnlist_a_suffix_allowed
   181                              <3>  extern mnlist_o_suffix_allowed, mnlist_o_suffix_required
   182                              <3>  extern msg.condjump, msg.condnotjump, msg.memrefs_invalid_internal
   183                              <3>  extern msg.uninstall, msg.uu_internal_error, msg.uu_too_many_repeat
   184                              <3>  extern needsmath, needsmath_L, needsmsg, needsmsg.digit_6_ofs
   185                              <3>  extern needsmsg.digit_x_ofs, needsmsg_L, o32prfxtab, obsmach
   186                              <3>  extern obsolete, obsolete_L, opindex, opinfo, oplists
   187                              <3>  extern optypes, ppbytes.string, ppbytes.string_amount, reg_ebp
   188                              <3>  extern reg_ebx, reg_ecx, reg_edi, reg_esi, reg_fs
   189                              <3>  extern regmem, rgnam16, rgnam816, segrgnam, sibbyte
   190                              <3>  extern sqztab, tab_to, uninstall, unused, wtab1
   191                              <3> 
   192                              <3> ; uu.asm
   193                              <3>  extern reg_edx
   194                              <3> 
   195                              <3> ; uu.asm
   196                              <3>  extern MN_BSWAP, MN_O32
   197                              <3> 
   198                              <3> ; uu.asm
   199                              <3>  extern MN_A32
   200                              <3> 
   201                              <3> ; amis.asm
   202                              <3>  extern amisintr_offset, deviceshim_size, ext_amis_handler
   203                              <3> 
   204                              <3> ; boot.asm
   205                              <3>  extern boot_remember_seek_handle
   206                              <3>  extern boot_remember_seek_offset, chkeol_or_then, cmd_goto.yy_entry
   207                              <3>  extern display_y_or_ext, ext_cmdline, ext_finish.boot
   208                              <3>  extern if_exists_found_open, if_exists_not_found
   209                              <3>  extern if_exists_then_address, iseol?_or_then, loadoptiontable
   210                              <3>  extern loadoptiontable.incompatible, loadsettings
   211                              <3>  extern msdos7_message_table, msdos7_message_table.size
   212                              <3>  extern msg.boot_access_error, msg.boot_and, msg.boot_auxbuff_crossing
   213                              <3>  extern msg.boot_badchain, msg.boot_badclusters, msg.boot_badfat
   214                              <3>  extern msg.boot_bpb_load_overlap, msg.boot_bpb_too_low
   215                              <3>  extern msg.boot_cannot_set_both, msg.boot_dot_crlf
   216                              <3>  extern msg.boot_file_not_found, msg.boot_file_too_big_error
   217                              <3>  extern msg.boot_file_too_small_error, msg.boot_internal_error
   218                              <3>  extern msg.boot_invalid_filename, msg.boot_invalid_heads
   219                              <3>  extern msg.boot_invalid_sectors, msg.boot_out_of_memory_error
   220                              <3>  extern msg.boot_partition_cycle_error, msg.boot_partition_not_found
   221                              <3>  extern msg.boot_quit_fail, msg.boot_sector_not_power
   222                              <3>  extern msg.boot_sector_too_large, msg.boot_sector_too_small
   223                              <3>  extern msg.boot_segment_too_low, msg.boot_too_many_partitions_error
   224                              <3>  extern msg.bootfail, msg.bootfail_check_mismatch
   225                              <3>  extern msg.bootfail_check_mismatch.check_got
   226                              <3>  extern msg.bootfail_check_mismatch.check_offset
   227                              <3>  extern msg.bootfail_check_mismatch.check_value, msg.bootfail_code
   228                              <3>  extern msg.bootfail_read, msg.bootfail_read_errorcode
   229                              <3>  extern msg.bootfail_secsizediffer, msg.bootfail_sig
   230                              <3>  extern msg.bootfail_sig_parttable, msg.bootfail_stack_underflow
   231                              <3>  extern msg.bpb, msg.checkoffset, msg.checkvalue, msg.dir
   232                              <3>  extern msg.dirinsteadsize, msg.emptydirname, msg.entry
   233                              <3>  extern msg.guard_auxbuff_error, msg.hidden, msg.hiddenadd
   234                              <3>  extern msg.maxpara, msg.minpara, msg.protocol, msg.quit, msg.read
   235                              <3>  extern msg.sector, msg.sector_alt, msg.segment, msg.write
   236                              <3>  extern msg.yy_empty, msg.yy_filename_empty, msg.yy_no_file
   237                              <3>  extern msg.yy_requires_filename, msg.yy_too_large
   238                              <3>  extern msg.yy_too_many_handles, terminator_in_line_in.offset
   239                              <3>  extern terminator_in_line_in.value, throwret
   240                              <3>  extern yy_boot_attempt_open_pathname, yy_boot_attempt_open_stack
   241                              <3>  extern yy_is_script
   242                              <3> 
   243                              <3> ; cc.asm
   244                              <3>  extern count_var, hh.single, msg.clear, msg.clear_sequence
   245                              <3>  extern msg.range, parsecm
   246                              <3> 
   247                              <3> ; dd.asm
   248                              <3>  extern auxbuff_current_size_minus_24, charcounter
   249                              <3>  extern dstringaddr, dstringtype, firstmcb, firstumcb, intaddress
   250                              <3>  extern lastint, lastint_is_86m_and_mcb, msg.di_empty, msg.di_error
   251                              <3>  extern msg.di_freedos_reloc, msg.di_hidden, msg.di_hma, msg.di_iisp
   252                              <3>  extern msg.di_jmpfar, msg.di_jmpfarindirect, msg.di_multiplex.1
   253                              <3>  extern msg.di_multiplex.2, msg.di_multiplex.3, msg.di_nonstd_iisp
   254                              <3>  extern msg.di_system_low, msg.di_system_mcb, msg.di_system_upper
   255                              <3>  extern msg.di_testhook, msg.di_toomany, msg.di_uninst_iisp
   256                              <3>  extern msg.header, msg.header.length, msg.invmcbadr, msg.prefixes
   257                              <3>  extern msg.tableheader, msg.tableheadertop, msg.top, msg.trailer
   258                              <3>  extern msg.trailer.length, smcbmsg_unknown, smcbtypes
   259                              <3> 
   260                              <3> ; debug.asm
   261                              <3>  extern UnhookInterruptForce, UnhookInterruptForceSim, aa
   262                              <3>  extern adusetup, bb, boot_ebdaflag, boot_initcode
   263                              <3>  extern boot_new_memsizekib, boot_old_memsizekib, cc, code_start, ddd
   264                              <3>  extern device_initcode, driveno, dumpregs_extended.exit, ee
   265                              <3>  extern eld_linkcall.call_cmd3, end_of_ldebug_code, entry_int3_retf
   266                              <3>  extern errcarat, ff, get_86m_interrupt_handler_no_dos, get_columns
   267                              <3>  extern getline_close_file, getline_close_file.resetstuff, gg, hh
   268                              <3>  extern hh_depth, hh_depth_of_single_term, hhflag, ia_restore, ii
   269                              <3>  extern immasm, install_86m_interrupt_handler, int22, int2D, intr0
   270                              <3>  extern intr0C, intr0D, intr1, intr18, intr19
   271                              <3>  extern intr3, intr6, intr8, linkinfo, ll
   272                              <3>  extern ll3, ll_copy_cmdline_and_fcbs
   273                              <3>  extern ll_copy_cmdline_and_fcbs.have_cx
   274                              <3>  extern mm, msg.NULblank, msg.asmoptions_1, msg.boothelp
   275                              <3>  extern msg.build_array, msg.build_long_amount, msg.build_short_amount
   276                              <3>  extern msg.build_version_amount, msg.cannot_hook_2D.invalid
   277                              <3>  extern msg.cannot_hook_2D.nofree, msg.cannotbootquit_memsizes
   278                              <3>  extern msg.condhelp, msg.ensure_no_memory, msg.expressionhelp
   279                              <3>  extern msg.flaghelp, msg.flags_1, msg.guard_rc_error
   280                              <3>  extern msg.guard_re_error, msg.help_array, msg.help_array_amount
   281                              <3>  extern msg.help_re, msg.help_run, msg.help_source, msg.keep
   282                              <3>  extern msg.license, msg.line_out_overflow, msg.n_toolongname
   283                              <3>  extern msg.n_toolongtail, msg.nobootsupp, msg.options_array
   284                              <3>  extern msg.options_array_amount, msg.options_pages, msg.options_scan
   285                              <3>  extern msg.options_scan_amount, msg.qq_a_terminated
   286                              <3>  extern msg.qq_a_unterminated, msg.qq_device_no_c, msg.qq_device_no_d
   287                              <3>  extern msg.qq_device_none_selected, msg.qq_unterm
   288                              <3>  extern msg.rc_limit_reached, msg.re, msg.re_limit_reached
   289                              <3>  extern msg.reghelp, msg.rh_disabled, msg.rh_enabled, msg.run
   290                              <3>  extern msg.serial_cannot_hook, msg.serial_cannot_hook.new_int
   291                              <3>  extern msg.serial_cannot_hook.old_int, msg.serial_cannot_unhook
   292                              <3>  extern msg.serial_cannot_unhook.int, msg.serial_cannot_unhook.nowarn
   293                              <3>  extern msg.serial_late_unhook, msg.serial_late_unhook.int
   294                              <3>  extern msg.serial_no_keep_enter, msg.serial_no_keep_timer
   295                              <3>  extern msg.serial_request_keep, msg.source, msg.string_build
   296                              <3>  extern msg.string_options, msg.string_version
   297                              <3>  extern msg.tsr_cannot_terminate_attached, msg.varhelp, oo, ph_msg, pp
   298                              <3>  extern putrunint, putsz_exthelp, rr, run, section.DEVICESHIM.vstart
   299                              <3>  extern serial_clean_up, serial_clear_fifos, serial_eoi
   300                              <3>  extern serial_init_UART, serial_install_interrupt_handler
   301                              <3>  extern serial_interrupt_handler, serial_uninstall_interrupt_handler
   302                              <3>  extern set_irq, setscreen, sleep_delta_limit, sleep_highest_delta
   303                              <3>  extern sss, tpg_initialise_empty_auxbuff.reset
   304                              <3>  extern transfer_to_ext_puts_getline, tt, update_inttab_optional, uu
   305                              <3>  extern vv, vv_disable, vv_set, ww, yy
   306                              <3> 
   307                              <3> ; debug.asm
   308                              <3>  extern eld_linkcall
   309                              <3> 
   310                              <3> ; ee.asm
   311                              <3>  extern bufend, bufnext, fillbuf, fullbsout
   312                              <3>  extern getline_is_input_file?, line_in, linecounter, load_extension
   313                              <3>  extern msg.ext, notatty, prehak1, run2324
   314                              <3> 
   315                              <3> ; hh.asm
   316                              <3>  extern hh_div_active, hh_div_dividend, hh_div_divisor
   317                              <3>  extern msg.base, msg.group, msg.hh_div_remainder, msg.width
   318                              <3> 
   319                              <3> ; iioo.asm
   320                              <3>  extern if_exists_length, if_exists_si, if_exists_sp
   321                              <3>  extern install, msg.exists, msg.install, msg.not, msg.then
   322                              <3>  extern msg.y, resetrc, yy_or_ext_no_guard_re
   323                              <3> 
   324                              <3> ; immasm.asm
   325                              <3>  extern aa_ret, addrr, condmsg, error_mirror, index
   326                              <3>  extern msg.immasm_error_eip, presizeflags, reg32addr, segmnt
   327                              <3>  extern segrgaddr
   328                              <3> 
   329                              <3> ; msg.asm
   330                              <3>  extern ..@boot_scan_dir_return_fat16_root_entry
   331                              <3>  extern ..@boot_scan_dir_return_filenotfound
   332                              <3>  extern ..@boot_scan_dir_return_subdir_or_fat32_entry
   333                              <3>  extern alloc_size_not_reserved, asciitablenames, boot_init_foundname
   334                              <3>  extern configpath, configpath.dir_end, device_quittable_regs, dpmi32
   335                              <3>  extern execblk.cmdline, ext_command_handler, ext_finish.bp_is_set
   336                              <3>  extern ext_handle, ext_inject_handler, ext_preprocess_handler
   337                              <3>  extern ext_puts_copyoutput_handler, ext_puts_getline_handler
   338                              <3>  extern ext_puts_handler, ext_var, ext_var_amount, ext_var_format
   339                              <3>  extern ext_var_size, extcssel, extdssel, handle_scan_dir_entry
   340                              <3>  extern handle_scan_dir_not_found, history.first, history.last
   341                              <3>  extern indirect_array_errfix, init_executable_pathname
   342                              <3>  extern init_executable_pathname.end, internalflags4, internalflags5
   343                              <3>  extern internalflags7, isvariable_morebyte_nameheaders.ext
   344                              <3>  extern lastcmd_transfer_ext_address, lastcmd_transfer_ext_entry
   345                              <3>  extern line_in.end, linkcall_table, load_adr_dirbuf_segment
   346                              <3>  extern load_check_dir_attr, load_data_lowest, load_kernel_name
   347                              <3>  extern load_yy_direntry, load_yyname_input, load_yyname_next
   348                              <3>  extern near_transfer_ext_address, near_transfer_ext_entry
   349                              <3>  extern next_reserved_segment, options4, options5, options7
   350                              <3>  extern patcharea_intrtn, patcharea_intrtn.segment
   351                              <3>  extern patcharea_intrtn.size, patcharea_run, patcharea_run.segment
   352                              <3>  extern patcharea_run.size, pm_2_86m_0, promptlen, reserved_address
   353                              <3>  extern scriptspath, scriptspath.dir_end
   354                              <3>  extern sss_silent_count, sss_silent_count_used, stack_end, swch1
   355                              <3>  extern while_buffer.end
   356                              <3> 
   357                              <3> ; msg.asm
   358                              <3>  extern install_trying
   359                              <3> 
   360                              <3> ; init.asm
   361                              <3>  extern ..@init_behind, ..@init_first
   362                              <3>  extern ..@patch_no386_ds_6_DATA_ENTRY
   363                              <3>  extern ..@patch_no386_ds_code_or_entry
   364                              <3>  extern ..@patch_no386_iret_code_or_entry, behind_code_truncated
   365                              <3>  extern behind_init, behind_messagesegment_nobits
   366                              <3>  extern behind_messagesegment_nobits_truncated, debug22
   367                              <3>  extern device_header.next, devint23, devint24, entry_retf
   368                              <3>  extern execblk.fcb1, execblk.fcb2, ext_data_area, extcall_table.ret
   369                              <3>  extern extcall_table.segsel, fileext, hVdd, immasm_buffer, initcont
   370                              <3>  extern initcont.boot_entry, initcont.device, inttab, inttab.i06
   371                              <3>  extern inttab.i2D, inttab_number_variable, line_out_overflow
   372                              <3>  extern linkcall_table.code1, linkcall_table.entry
   373                              <3>  extern linkcall_table.init, oldmode, pInDOS, pSDA, regs.size
   374                              <3>  extern switchar, trim_overflow, var_addr_entries
   375                              <3>  extern var_addr_entries.amount
   376                              <3> 
   377                              <3> ; install.asm
   378                              <3>  extern installflags, msg.alreadydisabled
   379                              <3>  extern msg.alreadyenabled, msg.toggle, msg.trydisable, msg.tryenable
   380                              <3> 
   381                              <3> ; ints.asm
   382                              <3>  extern debuggeramissig, inttab_optional
   383                              <3> 
   384                              <3> ; lineio.asm
   385                              <3>  extern auxbuff_amount_silent, cmd3_set_options
   386                              <3>  extern determine_quiet_output, eldheader, getc_repeat_idle
   387                              <3>  extern getline_timer_func, handle_ctrl_c, if_exists_found_closed
   388                              <3>  extern if_exists_found_ext_open, indos_remember_seek_function
   389                              <3>  extern indos_remember_seek_handle, indos_remember_seek_offset
   390                              <3>  extern input_file_handles.to_close, msg.configkeyword
   391                              <3>  extern msg.eld_error_code, msg.eld_load_error, msg.emptykeyword
   392                              <3>  extern msg.eof, msg.executablekeyword, msg.ext_error_internal
   393                              <3>  extern msg.ext_error_invalid, msg.ext_error_io, msg.ext_error_oom
   394                              <3>  extern msg.freedos_ctrlc_workaround, msg.goto_empty
   395                              <3>  extern msg.goto_not_file, msg.goto_not_found.1, msg.goto_not_found.2
   396                              <3>  extern msg.history_internal_error, msg.more, msg.more_over
   397                              <3>  extern msg.more_over_size, msg.more_size, msg.rh_step.1
   398                              <3>  extern msg.rh_step.2, msg.scriptskeyword, msg.silent_error, msg.sof
   399                              <3>  extern msg.unexpected_noneol_rc, msg.unexpected_noneol_re
   400                              <3>  extern msg.yy_error_file_open, msg.yy_filename_missing_unquote
   401                              <3>  extern msg.yy_no_dos, qq, section.DATASTACK.vstart
   402                              <3>  extern serial_check_receive_char, serial_receive_char
   403                              <3>  extern serial_send_char, skip_rh, yy_boot
   404                              <3>  extern yy_boot_clear_remember_seek, yy_boot_close_file, yy_boot_read
   405                              <3>  extern yy_boot_remember_seek, yy_boot_seek_current
   406                              <3>  extern yy_boot_seek_start, yy_try_scriptspath
   407                              <3>  extern yy_try_scriptspath.didnotyettry
   408                              <3>  extern yy_try_scriptspath.nokeywordused
   409                              <3> 
   410                              <3> ; ll.asm
   411                              <3>  extern doserr8, ensuredebuggeeloaded, execblk, execblk.csip
   412                              <3>  extern execblk.sssp, msg.hexerror, msg.ll_unterm, msg.not_while_indos
   413                              <3>  extern msg.tsr_cannot_ll, parselw, reading
   414                              <3>  extern terminate_attached_process, ww1, ww15, zeroregs
   415                              <3> 
   416                              <3> ; mm.asm
   417                              <3>  extern has_287, has_copr, msg.c0, msg.cr, msg8088
   418                              <3>  extern msgx86, no_copr, parsecm_have_address
   419                              <3> 
   420                              <3> ; serialp.asm
   421                              <3>  extern baseport, msg.no_progress, rxfifo, rxhead
   422                              <3>  extern rxtail, serial_fcr_setting, serial_installed_intnum
   423                              <3>  extern serial_save_dl, serial_save_ier, serial_save_irq_mask
   424                              <3>  extern serial_save_irq_off, serial_save_lcr, serial_save_mcr, txfifo
   425                              <3>  extern txhead, txtail
   426                              <3> 
   427                              <3> ; ss.asm
   428                              <3>  extern msg.matches, msg.reverse, msg.seconds, msg.sleep
   429                              <3>  extern msg.ticks, sleep_repeat_idle
   430                              <3> 
   431                              <3> ; vv.asm
   432                              <3>  extern csrpos, msg.nokeep, msg.off, msg.on, msg.vv_disabled
   433                              <3>  extern msg.vv_enable_failure, xmsdrv, xmsmove
   434                              <3> 
   435                              <3> ; ww.asm
   436                              <3>  extern diskful, doserr11, doserr2, doserr3, doserr5
   437                              <3>  extern drive, drivenumber, dskerrs, not_while_indos, nowhexe
   438                              <3>  extern nownull, openerr, openerr1, writing, wwmsg1
   439                              <3>  extern wwmsg2
   440                              <3> 
   441                              <3> 
   442                              <3>  extern bCSAttr, lDEBUG_CODE_to_lDEBUG_CODE2_nearcall_helper
   443                              <3> 
   444                              <3>  extern hook2F.not_in_dos
   445                              <3> 
   446                              <3>  extern cmd4.int3, lDEBUG_CODE2_dualret_helper
   447                              <3>  extern lDEBUG_CODE2_to_lDEBUG_CODE_nearcall_helper
   448                              <3>  extern lDEBUG_CODE_to_lDEBUG_CODE2_dualcall_helper, msg.bu
   449                              <3>  extern msg.bu_relocated, msg.bu_relocated.sign
   450                              <3> 
   451                              <3>  extern nopmsupp
   452                              <3> 
   453                              <3>  extern bAddr32
   454                              <3> 
   455                              <3>  extern descriptor, descriptor.attrib, descriptor.base
   456                              <3>  extern descriptor.limit, gatewrong, msg.d.a_error, msg.d.a_error_code
   457                              <3>  extern msg.d.a_success, msg.d.a_success_sel, msg.d.b_error
   458                              <3>  extern msg.d.b_error_code, msg.d.b_success, msg.d.d_error
   459                              <3>  extern msg.d.d_error_code, msg.d.d_success, msg.d.l_error
   460                              <3>  extern msg.d.l_error_code, msg.d.l_success, msg.d.t_error
   461                              <3>  extern msg.d.t_error_code, msg.d.t_success, msg.deschelp, msg.ofs32
   462                              <3>  extern nodesc
   463                              <3> 
   464                              <3>  extern ..@patch_tsr_quit_run, areastruc_entry.qq_entry, cssel
   465                              <3>  extern ddebugareas.next, debug2F, dpmidisable, dpmientry, dpmihook
   466                              <3>  extern dpmihookamis, dpmihookcs, dpmiwatch, end_of_ldebug_code2
   467                              <3>  extern findinstalleddebugger, get_messagesegsel, handle_mode_changed
   468                              <3>  extern i23pm, msg.cannotpmquit, msg.desc, msg.dpmi_no_hook, msg.msdos
   469                              <3>  extern msg.qq_device_pm, msg.qq_still_pm, msg.qqlate_areas_error
   470                              <3>  extern msg.readonly_verifysegm, msg.readonly_verifysegm.selector
   471                              <3>  extern mydpmientry, nodosext, oldi2F, pm_reset_handlers, scratchsel
   472                              <3>  extern sr_state, switchmode, uninstall_areas.qq_entry
   473                              <3> 
   474                              <3>  extern i24pm
   475                              <3> 
   476                              <3>  extern auxbuff_switchbuffer_size, code2_seg, code2_sel, code2_size
   477                              <3>  extern code_sel, daresult, dssel, immsel
   478                              <3>  extern lDEBUG_CODE2_to_lDEBUG_CODE_dualcall_helper
   479                              <3>  extern lDEBUG_CODE_dualret_helper, messagesel, msg.desctype
   480                              <3>  extern msg.stack_overflow.desctype
   481                              <3> 
   482                              <3>  extern cmd3_mirror
   483                              <3> 
   484                              <3>  extern ..@patch_entry_seg, ..@patch_no386_ds_4, ..@patch_no386_ds_5
   485                              <3>  extern ..@patch_no386_ds_entry_pmint21_1
   486                              <3>  extern ..@patch_no386_ds_entry_pmint21_2, areas_fun, areas_sub
   487                              <3>  extern ddebugareas.prev, linkcall_table.code2
   488                              <3> 
   489                              <3>  extern areas_struc, msg.areasalreadyinstalled
   490                              <3>  extern msg.areasalreadyuninstalled, msg.areasinstalled
   491                              <3>  extern msg.areasnodebuggerfound, msg.areasnotinstalled
   492                              <3>  extern msg.areasnotinstalled.code, msg.areasnotsupported
   493                              <3>  extern msg.areasuninstalled, msg.areasuninstalled.code
   494                              <3> 
   495                              <3>  extern intcall_return_parameter_es_parameter_ds
   496                              <3>  extern lDEBUG_CODE_to_lDEBUG_CODE_dualcall_helper, pop_if, push_if
   497                              <3> 
   498                              <3>  extern isextenderavailable, msg.cannotpmload, nodosextinst
   499                              <3> 
   500                              <3>  extern install_areas, patcharea_pm_exc, patcharea_pm_exc.segment
   501                              <3>  extern patcharea_pm_exc.size
   502                              <3> 
   503                              <3>  extern pmint21
   504                              <3> 
   505                              <3>  extern debuggerexception, entry_to_code_sel, exc6msg, excCmsg
   506                              <3>  extern excDmsg, excEmsg, intrtn2_entry, pmintsave.int21
   507                              <3> 
   508                              <3>  extern convsegs, convsegs.amount_fixed, convsegs.end_fixed
   509                              <3>  extern dpmi_pm2rm, dpmi_pmsav, dpmi_rm2pm, dpmi_rmsav, endexctab
   510                              <3>  extern exc_first, exc_second, excsave, exctab, installdpmimsg
   511                              <3>  extern intrtn_entry.from_installdpmi, pmintsave, pminttab
   512                              <3>  extern pminttab.end, setrmaddr, silence_delete_one_string.internal
   513                              <3> 
   514                              <3>  extern msg.rv_mode_dpmi_16, msg.rv_mode_dpmi_32, msg.vm_code2seg
   515                              <3>  extern msg.vm_selector, msg.vp_dpspsel, msg.vp_pspsel, psp_selector
   516                              <3> 
   517                              <3>  extern ..@getcseipbyte_fault_skip_6_near_call
   518                              <3>  extern ..@hh_code1_indirection_memory_access_end
   519                              <3>  extern ..@hh_code1_indirection_memory_access_start
   520                              <3>  extern ..@readmem_fault_skip_2_near_call
   521                              <3>  extern ..@setcseipbyte_fault_skip_6_near_call
   522                              <3>  extern ..@writemem_fault_skip_2_near_call_a
   523                              <3>  extern ..@writemem_fault_skip_2_near_call_b, behind_code
   524                              <3>  extern behind_code2, convsegs.amount, ddebugareas
   525                              <3>  extern getline_extra_int22.cleartraceflag, msg.list_bp_cseip_32
   526                              <3> 
   527                              <3>  extern MN_O16
   528                              <3> 
   529                              <3>  extern MN_A16
   530                              <3> 
   531                              <3>  extern relocatedzero
   532                              <3> 
   533                              <3>  extern msg.bu_disabled
   534                              <3> 
   535                              <3>  extern reset_interrupts, set_interrupts
   536                              <3> 
   537                              <3>  extern startoptions6
   538                              <3> 
   539                              <3>  extern currentposition, msg.loader_bottom_not_allowed
   540                              <3>  extern msg.loader_too_low_load
   541                              <3> 
   542                              <3>  extern intr_loader_18, intr_loader_19, moveloader_hook_ints
   543                              <3> 
   544                              <3>  extern loader_query, loader_transfer_cmd3, loader_transfer_relocate
   545                              <3> 
   546                              <3>  extern cmd3_int_disable.set_bx_to_dx, cmd3_int_enable.set_bx_to_dx
   547                              <3>  extern ldebug_code_size, movesegrefstable, movetable
   548                              <3>  extern movetable.bottom, msg.isalready, msg.isnow, msg.loader_error
   549                              <3>  extern msg.move, msg.move_auxbuff_error, msg.move_auxdown
   550                              <3>  extern msg.move_auxup, msg.move_ebdanottop, msg.move_empty
   551                              <3>  extern msg.move_int_error, msg.move_int_panic
   552                              <3>  extern msg.move_must_be_bottom, msg.move_nottop, msg.move_oom
   553                              <3>  extern msg.move_rpl, msg.move_toolargeebda, msg.unsupportedmove
   554                              <3>  extern qq_int_unhook_sim.set_bx_to_dx
   555                              <3> 
   556                              <3>  extern moveloader.already, moveloader.bottom_to_hidden
   557                              <3>  extern moveloader.bottom_to_top, moveloader.hidden_to_bottom
   558                              <3>  extern moveloader.hidden_to_top, moveloader.top_to_bottom
   559                              <3>  extern moveloader.top_to_hidden
   560                              <3> 
   561                              <3>  extern moveloader.specificerror, moveloader_check_serial, msg.godebug
   562                              <3>  extern msg.loader_extra, msg.loader_flag, msg.loader_loadseg_low
   563                              <3>  extern msg.loader_must_be_hidden, msg.loader_sign, msg.loader_stack
   564                              <3>  extern msg.loadsupportsignature, msg.loadsupportsignature.size
   565                              <3> 
   566                              <3>  extern depack, hshrink_memory_source.offset
   567                              <3>  extern hshrink_memory_source.segment, indirect_hshrink_message_buffer
   568                              <3>  extern msg.hshrink_error, nontruncated_hshrink_message_buffer
   569                              <3> 
   570                              <3>  extern truncated_hshrink_message_buffer
   571                              <3> 
   572                              <3>  extern patch_boothelp_uncompressed
   573                              <3> 
   574                              <3>  extern msg.copybpb
   295                              <2> %endif
   710                              <1> %endif
   711                              <1> [list -]
   714                              <1> 
   715                              <1> %include "eld.mac"
     1                              <2> %if 0
     2                              <2> 
     3                              <2> Extensions for lDebug macros
     4                              <2> 
     5                              <2> Copyright (C) 2008-2025 E. C. Masloch
     6                              <2> 
     7                              <2> Usage of the works is permitted provided that this
     8                              <2> instrument is retained with the works, so that any entity
     9                              <2> that uses the works is notified of this instrument.
    10                              <2> 
    11                              <2> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <2> 
    13                              <2> %endif
    14                              <2> 
    15                              <2> %ifndef ELD_MAC
    16                              <2> %define ELD_MAC 1
    17                              <2> 
    18                              <2> %include "lmacros3.mac"
     1                              <3> [list -]
    19                              <2> 
    20                              <2> 		; ELD executable header
    21                              <2> 	struc ELD_HEADER
    22 00000000 ????????            <2> eldhSignature:		resb 4	; "ELD1"
    23 00000004 ??????              <2> 			resb 3	; reserved
    24 00000007 ??                  <2> 			resb 1	; 26 (Ctrl-Z)
    25 00000008 ????????            <2> eldhCodeOffset:		resd 1	; position displacement from eldhSignature
    26 0000000C ????                <2> eldhCodeImageLength:	resw 1	; amount bytes, at least 32
    27 0000000E ????                <2> eldhCodeAllocLength:	resw 1	; amount bytes, added to prior. sum < 64 KiB
    28 00000010 ????????            <2> eldhDataOffset:		resd 1
    29 00000014 ????                <2> eldhDataImageLength:	resw 1	; (zero allowed)
    30 00000016 ????                <2> eldhDataAllocLength:	resw 1	; (zero allowed)
    31 00000018 ????                <2> eldhCodeEntrypoint:	resw 1	; within code section, used as displacement
    32 0000001A ????????            <2> eldhReserved:		resb 4	; reserved
    33 0000001E ????                <2> eldhExtensionSize:	resw 1	; from eldhSignature, -> past eldhx fields in use
    34                              <2> 	endstruc
    35                              <2> 	endarea ELD_HEADER, 1
    36                              <2> 
    37                              <2> 	struc ELD_HEADERX
    38 00000000 <res 20h>           <2> eldhxHeader:		resb ELD_HEADER_size
    39 00000020 ????????            <2> eldhxDescriptionOffset:	resd 1	; zero if none, from eldhxHeader. <= 128 Bytes
    40 00000024 ????????            <2> eldhxHelpOffset:	resd 1	; zero if none, from eldhxHeader
    41 00000028 ????????            <2> eldhxLibTable:		resd 1	; zero if none, from eldhxHeader
    42 0000002C ????????            <2> eldhxDateTimeOffset:	resd 1	; zero if none, from eldhxHeader
    43                              <2> 	alignb 16
    44                              <2> 	endstruc
    45                              <2> 
    46                              <2> 	struc ELD_TRAILER_HEADER
    47 00000000 ????????????????    <2> eldthSignature:		resb 8	; "ELD1TAIL"
    48 00000008 ????????            <2> eldthHeaderOffset:	resd 1	; negative displacement from eldthSignature,
    49                              <2> 				;  add this dword to the seek offset
    50 0000000C ????                <2> eldthReserved:		resw 1	; reserved, must be initialised to zero
    51 0000000E ????                <2> eldthChecksum:		resw 1	; sum of all words in trailer header = 0
    52                              <2> 	endstruc
    53                              <2> 	endarea ELD_TRAILER_HEADER, 1
    54                              <2> 
    55                              <2> 	struc ELD_LIBTABLE
    56 00000000 ????                <2> eldltFormat:		resw 1
    57                              <2> 	; 0 = uncompressed
    58                              <2> 	; 2 = heatshrink compressed
    59                              <2> 	; 3 = lzexedat -4 compressed
    60                              <2> 	; 4 = lzexedat -4 -l compressed
    61 00000002 ????                <2> eldltAmount:		resw 1
    62 00000004 ????????            <2> eldltOffset:		resd 1	; from eldhxHeader
    63                              <2> eldltCompressedLength:		; (dword, only present if format 2, 3, or 4)
    64                              <2> 	endstruc
    65                              <2> 	endarea ELD_LIBTABLE, 1
    66                              <2> 
    67                              <2> 		; ELD instance header
    68                              <2> 	struc ELD_INSTANCE
    69 00000000 ????                <2> eldiStartCode:		resw 1	; -> this structure itself (para aligned)
    70 00000002 ????                <2> eldiEndCode:		resw 1	; -> behind memory used by instance (para aligned)
    71 00000004 ????                <2> eldiStartData:		resw 1	; -> data in data entry section (para aligned), or 0
    72 00000006 ????                <2> eldiEndData:		resw 1	; -> behind data (para aligned), or 0
    73 00000008 ????????????????    <2> eldiIdentifier:		resb 8	; blank-filled text
    74 00000010 ????                <2> eldiFlags:		resw 1	; flags
    75                              <2> eldiListing_size equ 14
    76 00000012 <res Eh>            <2> eldiListing:		resb eldiListing_size
    77                              <2> 				; ASCIZ listing file name
    78                              <2> 	endstruc
    79                              <2> 		; flags for eldiFlags:
    80                              <2> eldifResident:		equ 1
    81                              <2> 
    82                              <2> 		; ELD link info header
    83                              <2> 	struc ELD_LINKINFO
    84 00000000 ????                <2> eldlSignature:		resw 1	; 0E1D1h
    85 00000002 ????????            <2> eldlReserved:		resw 2
    86 00000006 ????                <2> eldlUseLinkHash:	resw 1
    87 00000008 ????                <2> eldlDataAmount:		resw 1
    88 0000000A ????                <2> eldlDataPrefixes:	resw 1
    89 0000000C ????                <2> eldlDataEntries:	resw 1
    90 0000000E ????                <2> eldlDataAddresses:	resw 1
    91 00000010 ????                <2> eldlCodeAmount:		resw 1
    92 00000012 ????                <2> eldlCodePrefixes:	resw 1
    93 00000014 ????                <2> eldlCodeEntries:	resw 1
    94 00000016 ????                <2> eldlCodeAddresses:	resw 1
    95                              <2> 	endstruc
    96                              <2> 
    97                              <2> 	numdef ELD_CODE_VSTART, 9001h
    98                              <2> 	numdef ELD_DATA_VSTART, 8000h
    99                              <2> 	numdef ELD_RELOC_VSTART, 8000h
   100                              <2> 
   101                              <2> 	numdef ELD_RECLAIM_HINT, 0
   102                              <2> 	strdef ELD_LISTING, ""
   103                              <2> 	numdef ELD_DATETIME, 0
   104                              <2> 
   105                              <2> %if _ELD_DATETIME
   106                              <2>  %define PUT_ELDHX_DATETIME_OFFSET at eldhxDateTimeOffset, dd DATAOFFSET + datetime - datastart
   107                              <2>  %macro PUT_ELD_DATETIME 0.nolist
   108                              <2> datetime:	asciz __UTC_DATE__,'T',__UTC_TIME__,'Z'
   109                              <2> 		asciz		; for future extension
   110                              <2>  %endmacro
   111                              <2> %else
   112                              <2>  %define PUT_ELDHX_DATETIME_OFFSET
   113                              <2>  %define PUT_ELD_DATETIME
   114                              <2> %endif
   115                              <2> 
   116                              <2> %endif
   716                              <1> 
   717                              <1> %include "install.mac"
     1                              <2> 
     2                              <2> %if 0
     3                              <2> 
     4                              <2> lDebug INSTALL command macros
     5                              <2> 
     6                              <2> Copyright (C) 2008-2023 E. C. Masloch
     7                              <2> 
     8                              <2> Usage of the works is permitted provided that this
     9                              <2> instrument is retained with the works, so that any entity
    10                              <2> that uses the works is notified of this instrument.
    11                              <2> 
    12                              <2> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    13                              <2> 
    14                              <2> %endif
    15                              <2> 
    16                              <2> 	struc INSTALLFLAG
    17 00000000 ????                <2> ifKeyword:	resw 1
    18 00000002 ????                <2> ifDescription:	resw 1
    19 00000004 ????                <2> ifOptions:	resw 1
    20 00000006 ????                <2> ifValue:	resw 1
    21 00000008 ????                <2> ifTrying:	resw 1
    22 0000000A ????                <2> ifReserved:	resw 1
    23                              <2> 	endstruc
    24                              <2> 
   718                              <1> 
   719                              <1> %if _SYMBOLIC
   720                              <1> 	defaulting 0			; disable defaulting
   721                              <1> %include "symbols.mac"
   722                              <1> [list -]
   723                              <1> 		; symbolic branch defines *without* defaulting!
   724                              <1> 	numdef ZZ_INSERT_TEMP, 1
   725                              <1> 	numdef XMS_SYMBOL_TABLE, 1
   726                              <1> 	numdef BUFFER_86MM_SLICE, 0
   727                              <1> 	numdef SECOND_SLICE, 0
   728                              <1> 
   729                              <1> 	defaulting 1			; re-enable defaulting
   730                              <1> 
   731                              <1> 		; symbolic branch defines
   732                              <1> 	numdef 86MM_SYMBOL_TABLE_MAX, 256, 256
   733                              <1> %endif
   734                              <1> 
   735                              <1> 	struc SEGADR
   736 00000000 ????????            <1> saOffset:	resd 1
   737 00000004 ????                <1> saSegSel:	resw 1
   738                              <1> %if _PM
   739 00000006 ????                <1> saSegment:	resw 1
   740 00000008 ????                <1> saSelector:	resw 1
   741                              <1> %endif
   742                              <1> 	endstruc
   743                              <1> 
   744                              <1> 	%macro segmentedaddress 0.nolist
   745                              <1> 	istruc SEGADR
   746                              <1> 	iend
   747                              <1> 	%endmacro
   748                              <1> 
   749                              <1> 	struc SEGOFS16ADR
   750 00000000 ????                <1> so16aOffset:	resw 1
   751 00000002 ????                <1> so16aSegSel:	resw 1
   752                              <1> %if _PM
   753 00000004 ????                <1> so16aSegment:	resw 1
   754 00000006 ????                <1> so16aSelector:	resw 1
   755                              <1> %endif
   756                              <1> 	endstruc
   757                              <1> 
   758                              <1> 	%macro segofs16address 0-1.nolist zero
   759                              <1> 	istruc SEGOFS16ADR
   760                              <1> %ifidni %1,zero
   761                              <1> %elifidni %1,minusone
   762                              <1> at so16aOffset,		dw -1
   763                              <1> at so16aSegSel,		dw -1
   764                              <1>  %if _PM
   765                              <1> at so16aSegment,	dw -1
   766                              <1> at so16aSelector,	dw -1
   767                              <1>  %endif
   768                              <1> %else
   769                              <1>  %error Unexpected initialiser keyword
   770                              <1> %endif
   771                              <1> 	iend
   772                              <1> 	%endmacro
   773                              <1> 
   774                              <1> 	struc SEGONLYADR
   775 00000000 ????                <1> soaSegSel:	resw 1
   776                              <1> %if _PM
   777 00000002 ????                <1> soaSegment:	resw 1
   778 00000004 ????                <1> soaSelector:	resw 1
   779                              <1> %endif
   780                              <1> 	endstruc
   781                              <1> 
   782                              <1> 	%macro segonlyaddress 0.nolist
   783                              <1> 	istruc SEGONLYADR
   784                              <1> 	iend
   785                              <1> 	%endmacro
   786                              <1> 
   787                              <1> 
   788                              <1> %if _LOADER
   789                              <1> 	struc MOVETABLEENTRY
   790                              <1> mteIdentifier:		resw 1
   791                              <1> mteArrayIndex:		resw 1
   792                              <1> mteStatusMessage:	resw 1
   793                              <1> mteFromArray:
   794                              <1> mteFromBottom:		resw 1
   795                              <1> mteFromTop:		resw 1
   796                              <1> mteFromHidden:		resw 1
   797                              <1> 	endstruc
   798                              <1> %endif
   799                              <1> 
   800                              <1> %if _BOOTLDR
   801                              <1>  %include "iniload.mac"
     1                              <2> %if 0
     2                              <2> 
     3                              <2> lDebug iniload/boot interfacing structs and macros
     4                              <2> 
     5                              <2> Copyright (C) 2008-2025 E. C. Masloch
     6                              <2> 
     7                              <2> Usage of the works is permitted provided that this
     8                              <2> instrument is retained with the works, so that any entity
     9                              <2> that uses the works is notified of this instrument.
    10                              <2> 
    11                              <2> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <2> 
    13                              <2> %endif
    14                              <2> 
    15                              <2> 
    16                              <2> 	struc BS
    17 00000000 ??????              <2> bsJump:	resb 3
    18 00000003 ????????????????    <2> bsOEM:	resb 8
    19                              <2> bsBPB:
    20                              <2> 	endstruc
    21                              <2> 
    22                              <2> 	struc EBPB		;        BPB sec
    23 00000000 ????                <2> bpbBytesPerSector:	resw 1	; offset 00h 0Bh
    24 00000002 ??                  <2> bpbSectorsPerCluster:	resb 1	; offset 02h 0Dh
    25 00000003 ????                <2> bpbReservedSectors:	resw 1	; offset 03h 0Eh
    26 00000005 ??                  <2> bpbNumFATs:		resb 1	; offset 05h 10h
    27 00000006 ????                <2> bpbNumRootDirEnts:	resw 1	; offset 06h 11h -- 0 for FAT32
    28 00000008 ????                <2> bpbTotalSectors:	resw 1	; offset 08h 13h
    29 0000000A ??                  <2> bpbMediaID:		resb 1	; offset 0Ah 15h
    30 0000000B ????                <2> bpbSectorsPerFAT:	resw 1	; offset 0Bh 16h -- 0 for FAT32
    31 0000000D ????                <2> bpbCHSSectors:		resw 1	; offset 0Dh 18h
    32 0000000F ????                <2> bpbCHSHeads:		resw 1	; offset 0Fh 1Ah
    33 00000011 ????????            <2> bpbHiddenSectors:	resd 1	; offset 11h 1Ch
    34 00000015 ????????            <2> bpbTotalSectorsLarge:	resd 1	; offset 15h 20h
    35                              <2> bpbNew:				; offset 19h 24h
    36                              <2> 
    37 00000019 ????????            <2> ebpbSectorsPerFATLarge:	resd 1	; offset 19h 24h
    38 0000001D ????                <2> ebpbFSFlags:		resw 1	; offset 1Dh 28h
    39 0000001F ????                <2> ebpbFSVersion:		resw 1	; offset 1Fh 2Ah
    40 00000021 ????????            <2> ebpbRootCluster:	resd 1	; offset 21h 2Ch
    41 00000025 ????                <2> ebpbFSINFOSector:	resw 1	; offset 25h 30h
    42 00000027 ????                <2> ebpbBackupSector:	resw 1	; offset 27h 32h
    43 00000029 <res Ch>            <2> ebpbReserved:		resb 12	; offset 29h 34h
    44                              <2> ebpbNew:			; offset 35h 40h
    45                              <2> 	endstruc
    46                              <2> 
    47                              <2> 	struc BPBN		; ofs B16 S16 B32 S32
    48 00000000 ??                  <2> bpbnBootUnit:		resb 1	; 00h 19h 24h 35h 40h
    49 00000001 ??                  <2> 			resb 1	; 01h 1Ah 25h 36h 41h
    50 00000002 ??                  <2> bpbnExtBPBSignature:	resb 1	; 02h 1Bh 26h 37h 42h -- 29h for valid BPBN
    51 00000003 ????????            <2> bpbnSerialNumber:	resd 1	; 03h 1Ch 27h 38h 43h
    52 00000007 <res Bh>            <2> bpbnVolumeLabel:	resb 11	; 07h 20h 2Bh 3Ch 47h
    53 00000012 ????????????????    <2> bpbnFilesystemID:	resb 8	; 12h 2Bh 36h 47h 52h
    54                              <2> 	endstruc		; 1Ah 33h 3Eh 4Fh 5Ah
    55                              <2> 
    56                              <2> 	struc DIRENTRY
    57 00000000 ????????????????    <2> deName:		resb 8
    58 00000008 ??????              <2> deExt:		resb 3
    59 0000000B ??                  <2> deAttrib:	resb 1
    60 0000000C ??                  <2> dePlusSize:	resb 1
    61 0000000D ??????????????      <2> 		resb 7
    62 00000014 ????                <2> deClusterHigh:	resw 1
    63 00000016 ????                <2> deTime:		resw 1
    64 00000018 ????                <2> deDate:		resw 1
    65 0000001A ????                <2> deClusterLow:	resw 1
    66 0000001C ????????            <2> deSize:		resd 1
    67                              <2> 	endstruc
    68                              <2> 
    69                              <2> ATTR_READONLY	equ 1
    70                              <2> ATTR_HIDDEN	equ 2
    71                              <2> ATTR_SYSTEM	equ 4
    72                              <2> ATTR_VOLLABEL	equ 8
    73                              <2> ATTR_DIRECTORY	equ 10h
    74                              <2> ATTR_ARCHIVE	equ 20h
    75                              <2> 
    76                              <2> lsvclSignature		equ "CL"
    77                              <2> lsvclBufferLength	equ 256
    78                              <2> 
    79                              <2> 	struc LOADSTACKVARS, -10h
    80 FFFFFFF0 ????????            <2> lsvFirstCluster:	resd 1
    81 FFFFFFF4 ????????            <2> lsvFATSector:		resd 1
    82 FFFFFFF8 ????                <2> lsvFATSeg:		resw 1
    83 FFFFFFFA ????                <2> lsvLoadSeg:		resw 1
    84 FFFFFFFC ????????            <2> lsvDataStart:		resd 1
    85                              <2> 	endstruc
    86                              <2> 
    87                              <2> 	struc LOADDATA, LOADSTACKVARS - 10h
    88 FFFFFFE0 ????                <2> ldMemoryTop:	resw 1
    89 FFFFFFE2 ????                <2> ldLoadTop:	resw 1
    90 FFFFFFE4 ????                <2> ldSectorSeg:	resw 1
    91 FFFFFFE6 ??                  <2> ldFATType:	resb 1
    92                              <2> ldFlags:
    93 FFFFFFE7 ??                  <2> ldHasLBA:	resb 1
    94 FFFFFFE8 ????                <2> ldClusterSize:	resw 1
    95 FFFFFFEA ????                <2> ldParaPerSector:resw 1
    96                              <2> ldDirCluster:			; dword
    97                              <2> ldLoadingSeg:		; word
    98                              <2> ldQueryPatchValue:	; word
    99                              <2> lsvCommandLine:		; word
   100                              <2> .start:		equ $ - lsvclBufferLength
   101 FFFFFFEC ????                <2> .signature:	resw 1
   102                              <2> ldLoadUntilSeg:		; word
   103                              <2> lsvExtra:		; word
   104 FFFFFFEE ??                  <2> .partition:	resb 1	; byte
   105 FFFFFFEF ??                  <2> .flags:		resb 1	; byte
   106                              <2> 	endstruc
   107                              <2> 
   108                              <2> ldhlfPreserveLoader	equ 4
   109                              <2> 
   110                              <2> lsvefNoDataStart	equ 1
   111                              <2> lsvefPartitionNumber	equ 2
   112                              <2> lsvefPreserveLoader	equ 4
   113                              <2> 
   114                              <2> %if lsvefPreserveLoader != ldhlfPreserveLoader
   115                              <2>  %error Unexpected flag values
   116                              <2> %endif
   117                              <2> 
   118                              <2> 	struc LOADCMDLINE, LOADDATA - lsvclBufferLength
   119                              <2> ldCommandLine:
   120 FFFFFEE0 <res 100h>          <2> .start:		resb lsvclBufferLength
   121                              <2> 	endstruc
   122                              <2> 
   123                              <2> ldfHasLBA:	equ 1
   124                              <2> ldfFATInvalid:	equ 2
   125                              <2> ldfFATBuffered:	equ 4
   126                              <2> ldfDataBuffered: equ 8
   127                              <2> 
   128                              <2> 	struc LOADDATA2, LOADDATA - 10h
   129 FFFFFFD0 ????????            <2> ldRootSector:		resd 1
   130 FFFFFFD4 ????                <2> ldEntriesPerSector:	resw 1
   131                              <2> ldDataSegment:		; word
   132 FFFFFFD6 ????                <2> ldLastAvailableSector:	resw 1
   133                              <2> ldDataSector:		; dword
   134 FFFFFFD8 ????                <2> ldParasLeft:		resw 1
   135 FFFFFFDA ????                <2> ldParasDone:		resw 1
   136                              <2> 	endstruc
   137                              <2> 
   138                              <2> 	struc LOADDATA3, LOADDATA2 - 10h
   139 FFFFFFC0 ????????            <2> ldMaxCluster:		resd 1
   140 FFFFFFC4 ????????            <2> ldFileSize:		resd 1
   141 FFFFFFC8 ????????            <2> ldCurrentCluster:	resd 1
   142 FFFFFFCC ????????            <2> ldCurrentSeek:		resd 1
   143                              <2> 	endstruc
   144                              <2> 
   145                              <2> 	struc LOADERIMAGEIDENT
   146 00000000 ????????            <2> liiSignature:		resb 4		; "NLDR"
   147 00000004 ????                <2> liiVersion:		resb 2		; "00"
   148 00000006 ????                <2> liiChecksum:		resw 1		; word sum of first 8 words = 0
   149 00000008 ????                <2> liiAmountParagraphs:	resw 1
   150 0000000A ????????????        <2> liiReserved:		resw 3
   151 00000010 ????                <2> liiEntryQuerySize:	resw 1		; 0 if not supported
   152                              <2> 		; INP:	cs => NLDR image ident
   153                              <2> 		;	ip = this word field content
   154                              <2> 		;	ax = 60h
   155                              <2> 		; OUT:	ax => behind memory requested (should be >= 60h)
   156                              <2> 		; CHG:	es, ds, di, si, bx, cx, dx
   157                              <2> 		; STT:	far called, UP, EI
   158 00000012 ????                <2> liiEntryRelocate:	resw 1		; 0 if not supported
   159                              <2> 		; INP:	cs => NLDR image ident
   160                              <2> 		;	ip = this word field content
   161                              <2> 		;	ax = 60h
   162                              <2> 		; OUT:	ax => relocated NLDR segment (usually 60h)
   163                              <2> 		; CHG:	es, ds, di, si, bx, cx, dx
   164                              <2> 		; STT:	far called, UP, EI
   165 00000014 ????                <2> liiEntryDebug:		resw 1		; 0 if not supported
   166                              <2> 		; INP:	es = ds = cs = ss => relocated NLDR
   167                              <2> 		;	ip = this word field content
   168                              <2> 		;	sp = next word field content
   169                              <2> 		; STT:	running as debuggee, UP, EI
   170 00000016 ????                <2> liiStackPointer:	resw 1
   171                              <2> 	endstruc
   172                              <2> 
   173                              <2> 	struc LBAPACKET
   174 00000000 ????                <2> lpSize:		resw 1
   175 00000002 ????                <2> lpCount:	resw 1
   176 00000004 ????????            <2> lpBuffer:	resd 1
   177 00000008 ????????????????    <2> lpSector:	resq 1
   178                              <2> 	endstruc
   179                              <2> 
   180                              <2> 	struc PARTINFO
   181 00000000 ??                  <2> piBoot:		resb 1
   182 00000001 ??????              <2> piStartCHS:	resb 3
   183 00000004 ??                  <2> piType:		resb 1
   184 00000005 ??????              <2> piEndCHS:	resb 3
   185 00000008 ????????            <2> piStart:	resd 1
   186 0000000C ????????            <2> piLength:	resd 1
   187                              <2> 	endstruc
   188                              <2> 
   189                              <2> ptEmpty:		equ 0
   190                              <2> ptFAT12:		equ 1
   191                              <2> ptFAT16_16BIT_CHS:	equ 4
   192                              <2> ptExtendedCHS:		equ 5
   193                              <2> ptFAT16_CHS:		equ 6
   194                              <2> ptFAT32_CHS:		equ 0Bh
   195                              <2> ptFAT32:		equ 0Ch
   196                              <2> ptFAT16:		equ 0Eh
   197                              <2> ptExtended:		equ 0Fh
   198                              <2> ptLinux:		equ 83h
   199                              <2> ptExtendedLinux:	equ 85h
   200                              <2> 
   201                              <2> 
   202                              <2> 		; Flags of load_unit_flags
   203                              <2> lufForceCHS:		equ 1
   204                              <2> lufForceLBA:		equ 2
   205                              <2> lufForceGeometry:	equ 4
   206                              <2> luf_mask_writable equ lufForceCHS | lufForceLBA | lufForceGeometry
   802                              <1> 
   803                              <1> LOAD_INPUT_FILE_SIZE equ fromparas(paras(-LOADDATA3 + bsBPB + ebpbNew + BPBN_size))
   804                              <1> 
   805                              <1> 	struc LOADSETTINGS
   806 00000000 ????                <1> lsKernelName:	resw 1	; -> kernel file default name
   807 00000002 ????                <1> lsAddName:	resw 1	; -> additional file default name, may be empty string
   808 00000004 ????                <1> lsMinPara:	resw 1	; how much to load at least, fail if file smaller
   809 00000006 ????                <1> lsMaxPara:	resw 1	; how much to load at most (will round up to sector size)
   810 00000008 ????                <1> lsOptions:	resw 1	; option flags
   811 0000000A ????                <1> lsSegment:	resw 1	; => where to load file
   812 0000000C ????????            <1> lsEntry:	resd 1	; relative segment for CS, value for IP
   813 00000010 ????????            <1> lsBPB:		resd 1	; segment for BPB (-1 auto-BPB), offset for BPB
   814 00000014 ????????            <1> lsCopyBPB:	resd 1	; if not all-zeroes, copy BPB to far pointer
   815 00000018 ????                <1> lsCheckOffset:	resw 1	; offset in file segment of word to check
   816 0000001A ????                <1> lsCheckValue:	resw 1	; value to check for word, 0 if unused
   817 0000001C ????????????????    <1> lsName:		resq 1	; ASCIZ load protocol name
   818                              <1> 	endstruc
   819                              <1> 
   820                              <1> 		numdef LUF_DEFAULT_DISKETTE, 0
   821                              <1> 		numdef LUF_DEFAULT_HARDDISK, 0
   822                              <1> %endif
   823                              <1> 
   824                              <1> 
   825                              <1> %include "mzheader.mac"
     1                              <2> 
     2                              <2> %if 0
     3                              <2> 
     4                              <2> lDebug MZ .EXE header macros
     5                              <2> 
     6                              <2> Copyright (C) 1995-2003 Paul Vojta
     7                              <2> Copyright (C) 2008-2023 E. C. Masloch
     8                              <2> 
     9                              <2> Usage of the works is permitted provided that this
    10                              <2> instrument is retained with the works, so that any entity
    11                              <2> that uses the works is notified of this instrument.
    12                              <2> 
    13                              <2> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    14                              <2> 
    15                              <2> %endif
    16                              <2> 
    17                              <2> 
    18                              <2> 	struc EXEHEADER
    19 00000000 ????                <2> exact_struc_at 00h, exeSignature:	resw 1
    20 00000002 ????                <2> exact_struc_at 02h, exeExtraBytes:	resw 1	; bytes in last page
    21 00000004 ????                <2> exact_struc_at 04h, exePages:		resw 1	; number of 512-byte pages. includes the header!
    22 00000006 ????                <2> exact_struc_at 06h, exeRelocItems:	resw 1	; number of relocation items
    23 00000008 ????                <2> exact_struc_at 08h, exeHeaderSize:	resw 1	; header size in 16-byte paragraphs
    24 0000000A ????                <2> exact_struc_at 0Ah, exeMinAlloc:	resw 1	; minimum (bss) allocation in paragraphs
    25 0000000C ????                <2> exact_struc_at 0Ch, exeMaxAlloc:	resw 1	; maximum (bss) allocation in paragraphs
    26 0000000E ????                <2> exact_struc_at 0Eh, exeInitSS:		resw 1	; init ss (is relocated)
    27 00000010 ????                <2> exact_struc_at 10h, exeInitSP:		resw 1	; init sp
    28 00000012 ????                <2> exact_struc_at 12h, exeChecksum:	resw 1
    29                              <2> exact_struc_at 14h, exeInitCSIP:
    30 00000014 ????                <2> exact_struc_at 14h, exeInitIP:		resw 1	; init ip
    31 00000016 ????                <2> exact_struc_at 16h, exeInitCS:		resw 1	; init cs (is relocated)
    32 00000018 ????                <2> exact_struc_at 18h, exeRelocTable:	resw 1	; byte offset of relocation table
    33                              <2> 		; Each relocation item is a word offset and a word segment.
    34                              <2> 		;  The segment of the item itself is relocated as well.
    35 0000001A ????                <2> exact_struc_at 1Ah, exeOverlayNum:	resw 1
    36                              <2> exact_struc_at 1Ch
    37                              <2> 	endstruc
   826                              <1> 
   827                              <1> 
   828                              <1> 	struc INPUTFILEHANDLE
   829 00000000 ????                <1> ifhHandle:	resw 1
   830 00000002 ????                <1> ifhFlags:	resw 1
   831 00000004 ????????            <1> ifhParentSeek:	resd 1
   832                              <1> 	endstruc
   833                              <1> 
   834                              <1> ifhfIsDup:		equ  100h	; before closing, seek it back
   835                              <1> 	; same value as LBA flag for boot load input files
   836                              <1> ifhfTestReserved1:	equ 1000h
   837                              <1> ifhfTestReserved2:	equ 2000h
   838                              <1> ifhfQuietInput:		equ 4000h	; do not display prompt and input
   839                              <1> ifhfQuietOutput:	equ 8000h	; do not display normal output
   840                              <1> 	; these four are valid for both input file handles and
   841                              <1> 	;  boot load input files.
   842                              <1> 
   843                              <1> 
   844                              <1> 	struc AREASTRUC
   845 00000000 <res 18h>           <1> areastrucEntry:		resb 24
   846 00000018 ????????            <1> areastrucNext:		resd 1
   847 0000001C ????????            <1> areastrucPrev:		resd 1
   848 00000020 ????                <1> areastrucSubAmount:	resw 1
   849 00000022 ????                <1> areastrucSubOffset:	resw 1
   850 00000024 ????                <1> areastrucFunAmount:	resw 1
   851 00000026 ????                <1> areastrucFunOffset:	resw 1
   852                              <1> 	endstruc
   853                              <1> 
   854                              <1> 	struc AREASTRUCSUB
   855 00000000 ????????            <1> areastrucsubLinear:	resd 1
   856 00000004 ????????            <1> areastrucsubLinearEnd:	resd 1
   857 00000008 ????                <1> areastrucsubListOffset:	resw 1
   858 0000000A ????                <1> areastrucsubListAmount:	resw 1
   859                              <1> 	endstruc
   860                              <1> 
   861                              <1> 	struc AREASTRUCFUN
   862 00000000 ????????            <1> areastrucfunLinear:	resd 1
   863 00000004 ????????            <1> areastrucfunLinearEnd:	resd 1
   864 00000008 ????                <1> areastrucfunListOffset:	resw 1
   865 0000000A ????                <1> areastrucfunListAmount:	resw 1
   866                              <1> 	endstruc
   867                              <1> 
   868                              <1> 	struc AREA
   869 00000000 ????                <1> areastart:		resw 1
   870 00000002 ????                <1> areaend:		resw 1
   871 00000004 ????                <1> areamessage:		resw 1
   872 00000006 ????                <1> 			resw 1
   873                              <1> 	endstruc
   874                              <1> 
   875                              <1> 
   876                              <1> %include "isvariab.mac"
     1                              <2> 
     2                              <2> %if 0
     3                              <2> 
     4                              <2> lDebug isvariable? function strutures and macros
     5                              <2> 
     6                              <2> Copyright (C) 2008-2025 E. C. Masloch
     7                              <2> 
     8                              <2> Usage of the works is permitted provided that this
     9                              <2> instrument is retained with the works, so that any entity
    10                              <2> that uses the works is notified of this instrument.
    11                              <2> 
    12                              <2> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    13                              <2> 
    14                              <2> %endif
    15                              <2> 
    16                              <2> 
    17                              <2> 	struc ISVARIABLESTRUC
    18 00000000 ????                <2> ivName:		resw 1		; -> name (up to 13 bytes, but actually only 11)
    19                              <2> 				;  (search for ivfNameLengthLimit for limit)
    20                              <2> 				;  (length given by ivFlags & ivfNameLengthMask)
    21                              <2> 	; The ivName pointer is only used for more-byte names. It actually
    22                              <2> 	;  contains the trailer of the name, excluding the prefix formed by
    23                              <2> 	;  the first two bytes. This suffix can be the empty string if the
    24                              <2> 	;  variable in question has a two-byte name.
    25                              <2> 	; (For one-byte names this field is unused and contains zero.)
    26 00000002 ????                <2> ivFlags:	resw 1
    27 00000004 ????                <2> ivAddress:	resw 1		; default -> variable
    28                              <2> 	; The ivAddress field is used by default_variable_setup as the base
    29                              <2> 	;  address for the variable(s). It is also used by var_ext_setup as
    30                              <2> 	;  the ELD code section offset to transfer control to. Otherwise, it
    31                              <2> 	;  is usually set to zero and unused.
    32 00000006 ????                <2> ivSetup:	resw 1		; -> set up code (in expr code section)
    33                              <2> 	; INP:	ax = array index (0-based)
    34                              <2> 	;	di = 0
    35                              <2> 	;	cl = default size of variable (1..4)
    36                              <2> 	;	ch = length of variable name
    37                              <2> 	;	bx -> ISVARIABLESTRUC structure
    38                              <2> 	; CHG:	ax, bx, cx, dx, si, di
    39                              <2> 	; OUT:	NC if valid,
    40                              <2> 	;	 bx -> var, di = 0 or di -> mask
    41                              <2> 	;	 cl = size of variable (1..4)
    42                              <2> 	;	 ch = length of variable name
    43 00000008 ??                  <2> ivArrayLast:	resb 1		; 0 if no array, FFh = 256 entries
    44                              <2> 	; The ivArrayLast field is used by the dispatcher to determine
    45                              <2> 	;  whether to support array index expressions. It is checked
    46                              <2> 	;  before decrementing the index if ivfArrayOneBased is set.
    47 00000009 ??                  <2> ivArrayBetween: resb 1		; how many bytes to skip for each index
    48                              <2> 	; The ivArrayBetween field is only used by default_variable_setup.
    49                              <2> 	endstruc
    50                              <2> 
    51                              <2> ivfNameLengthMask:	equ 15	; gives name trailer length, 0 to 11
    52                              <2> ivfNameLengthLimit:	equ 13
    53                              <2> ivfVarLengthShift:	equ 4
    54                              <2> ivfVarLengthMask:	equ 3 << ivfVarLengthShift
    55                              <2> 				; gives default variable size minus 1
    56                              <2> ivfReadOnly:		equ 80h	; variable cannot be written at all
    57                              <2> ivfArrayOneBased:	equ 100h; first array entry is 1 not 0 (ivArrayLast > 0)
    58                              <2> ivfArrayOptional:	equ 200h; array index expression is optional
    59                              <2> ivfSeparatorSpecial:	equ 400h; used for RIxxP/L/S/O
    60                              <2> 
    61                              <2> %define ISVARIABLESTRINGS db "",db ""
    62                              <2> %define IVS_ONEBYTE_NAMES ""
    63                              <2> %define IVS_MOREBYTE_NAMEHEADERS ""
    64                              <2> %assign IVS_HAVE_ONEBYTE 0
    65                              <2> %assign IVS_SINGLE_ONEBYTE 1
    66                              <2> 
    67                              <2> 		; %1 = name string
    68                              <2> 		; %2 = default variable length, 1 to 4
    69                              <2> 		; %3 = flags to set (except name length and var length)
    70                              <2> 		; %4 = ivAddress value
    71                              <2> 		; %5 = ivArrayLast, defaults to 0 (no array)
    72                              <2> 		; %6 = ivArrayBetween, defaults to 0 (immediately consecutive)
    73                              <2> 		; %7 = ivSetup, defaults to default_variable_setup
    74                              <2> 	%macro isvariablestruc 4-7.nolist 0, 0, default_variable_setup
    75                              <2> %push
    76                              <2> %strlen %$namelength %1
    77                              <2> %if %$namelength > ivfNameLengthLimit
    78                              <2>  %error Expected at most 13-byte name (or adjust isvariable? code)
    79                              <2> %endif
    80                              <2> %if IVS_ONEBYTE && %$namelength != 1
    81                              <2>  %error Expected a one-byte name
    82                              <2> %elif ! IVS_ONEBYTE && %$namelength < 2
    83                              <2>  %error Expected at least a two-byte name
    84                              <2> %endif
    85                              <2> %if IVS_ONEBYTE
    86                              <2>  %define IVS_SINGLE_ONEBYTE_NAME %1
    87                              <2>  %if IVS_HAVE_ONEBYTE
    88                              <2>   %assign IVS_SINGLE_ONEBYTE 0
    89                              <2>  %endif
    90                              <2>  %assign IVS_HAVE_ONEBYTE 1
    91                              <2>  %assign %$namelength 0
    92                              <2>  %xdefine IVS_ONEBYTE_NAMES IVS_ONEBYTE_NAMES, %1
    93                              <2>  %%name equ 0
    94                              <2> %else
    95                              <2>  %assign %$namelength %$namelength - 2
    96                              <2>  %substr %$nametrailer %1 3,-1
    97                              <2>  %substr %$nameheader %1 1,2
    98                              <2>  %xdefine IVS_MOREBYTE_NAMEHEADERS IVS_MOREBYTE_NAMEHEADERS, %$nameheader
    99                              <2>  %xdefine ISVARIABLESTRINGS ISVARIABLESTRINGS, %%name:, {db %$nametrailer}
   100                              <2> %endif
   101                              <2> 
   102                              <2> %assign %$varlength %2 - 1	; 0 means one byte, 1 means two bytes,
   103                              <2> 				;  2 means three bytes, 3 means four bytes
   104                              <2> 	istruc ISVARIABLESTRUC
   105                              <2> at ivName,		dw %%name
   106                              <2>  IV_NAME_RELOCATION
   107                              <2> at ivFlags,		dw %$$namelength | (%$$varlength << ivfVarLengthShift) | %3
   108                              <2> at ivAddress,		dw %4
   109                              <2>  IV_ADDRESS_RELOCATION
   110                              <2> at ivSetup,		dw %7
   111                              <2>  IV_SETUP_RELOCATION
   112                              <2> at ivArrayLast,		db %5
   113                              <2> at ivArrayBetween,	db %6
   114                              <2> 	iend
   115                              <2> %pop
   116                              <2> %ifndef SECTION_OF_%7
   117                              <2>  %error Unknown target section for symbol %7
   118                              <2> %elifnidni %[SECTION_OF_%7], _EXPR_SECTION
   119                              <2>  %error Wrong section for symbol %7: section_of=SECTION_OF_%7, expr=_EXPR_SECTION
   120                              <2> %endif
   121                              <2> 	%endmacro
   122                              <2> 
   123                              <2> %define IV_NAME_RELOCATION
   124                              <2> %define IV_ADDRESS_RELOCATION
   125                              <2> %define IV_SETUP_RELOCATION
   126                              <2> 
   127                              <2> 	%macro isvariablestrings 2-*.nolist
   128                              <2> %rep %0
   129                              <2>  %1
   130                              <2>  %rotate 1
   131                              <2> %endrep
   132                              <2> 	%endmacro
   877                              <1> 
   878                              <1> 
   879                              <1> %include "386.mac"
     1                              <2> 
     2                              <2> %if 0
     3                              <2> 
     4                              <2> lDebug 386 patch macros
     5                              <2> 
     6                              <2> Copyright (C) 2008-2026 E. C. Masloch
     7                              <2> 
     8                              <2> Usage of the works is permitted provided that this
     9                              <2> instrument is retained with the works, so that any entity
    10                              <2> that uses the works is notified of this instrument.
    11                              <2> 
    12                              <2> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    13                              <2> 
    14                              <2> %endif
    15                              <2> 
    16                              <2> 	numdef LINK, 0
    17                              <2> 
    18                              <2> 	numdef WPT_LABELS, 0
    19                              <2> 		; This used to be required, because CODESECTIONFIXUP used
    20                              <2> 		;  ldebug_data_entry_size, which is not yet defined during
    21                              <2> 		;  assembling of (most) lDEBUG_CODE fragments.
    22                              <2> 		; However, assembling DebugX with this option selected
    23                              <2> 		;  took more than 2 minutes, so the non-label variant
    24                              <2> 		;  is clearly to be preferred when available.
    25                              <2> 		; Now that lDEBUG_CODE has vstart=0 we can use the
    26                              <2> 		;  CODESECTIONFIXUP again and thus disable this option.
    27                              <2> 
    28                              <2> %ifn _LINK
    29                              <2> %define PATCH_NO386_TABLE ""
    30                              <2> %define PATCH_386_TABLE ""
    31                              <2> %define PATCH_NO386_TABLE2 ""
    32                              <2> %define PATCH_386_TABLE2 ""
    33                              <2> %define PATCH_NO386_TABLEENTRY ""
    34                              <2> %define PATCH_386_TABLEENTRY ""
    35                              <2> %endif
    36                              <2> 
    37                              <2> %if _ONLY386
    38                              <2> 		; Default patch macros if only running on 386+.
    39                              <2> %define _386_o32 o32
    40                              <2> %define _386_a32 a32
    41                              <2> %define _386_jmps jmp short
    42                              <2> %define _386_jmpn jmp near
    43                              <2> %define _no386_jmps comment
    44                              <2> %define _no386_jmpn comment
    45                              <2> 	%macro _386 0-1+.nolist
    46                              <2> [cpu 386]			; change CPU type
    47                              <2> 		%1		; write instruction
    48                              <2> __CPU__				; reset CPU type
    49                              <2> 	%endmacro
    50                              <2> %define _no386 comment
    51                              <2> %elif _ONLYNON386
    52                              <2> 		; Default patch macros if only running on non-386.
    53                              <2> %define _386_o32
    54                              <2> %define _386_a32
    55                              <2> %define _386_jmps comment
    56                              <2> %define _386_jmpn comment
    57                              <2> %define _no386_jmps jmp short
    58                              <2> %define _no386_jmpn jmp near
    59                              <2> %define _386 comment
    60                              <2> %define _no386
    61                              <2> %else
    62                              <2> 
    63                              <2> ; These macros are to make DEBUG's 386 support as small as
    64                              <2> ; possible. To achieve this, two patch tables are created
    65                              <2> ; in the initialisation code. One of the tables is used if
    66                              <2> ; the CPU is a 386+, the other one if it isn't. The bytes
    67                              <2> ; pointed to in the used table are over-written with NOP
    68                              <2> ; instructions. (The patched bytes are usually address or
    69                              <2> ; operand size prefixes or jumps that branch to 386/non-386
    70                              <2> ; code.)
    71                              <2> 
    72                              <2> ; There are a few special patches that require the
    73                              <2> ; initialisation code to write specific bytes other than
    74                              <2> ; NOP instructions for lower resident memory usage.
    75                              <2> ; Two are in the run: code, three in pmentry.asm.
    76                              <2> 
    77                              <2> %if _LINK
    78                              <2> 
    79                              <2> %imacro wllist 1-3.nolist
    80                              <2> %ifnempty %3
    81                              <2>  %deftok %%filenametoken %3
    82                              <2> %else
    83                              <2>  %deftok %%filenametoken __FILE__
    84                              <2> %endif
    85                              <2>  global ..@wllist_%1?%[%%l]%[%%filenametoken]
    86                              <2> ..@wllist_%1?%[%%l]%[%%filenametoken]: %2
    87                              <2> %endmacro
    88                              <2> 
    89                              <2> 	%macro patch386 2-3.nolist 1
    90                              <2> %define %%repeat
    91                              <2> %if %3 != 1
    92                              <2>  %define %%repeat r%3_
    93                              <2> %endif
    94                              <2> %ifidn _CURRENT_SECTION, lDEBUG_CODE
    95                              <2>  wllist %[%%repeat]Lpatch_%{1}386_table, %2
    96                              <2> %elifidn _CURRENT_SECTION, lDEBUG_CODE2
    97                              <2>  wllist %[%%repeat]Lpatch_%{1}386_table2, %2
    98                              <2> %elifidn _CURRENT_SECTION, lDEBUG_DATA_ENTRY
    99                              <2>  wllist %[%%repeat]Lpatch_%{1}386_tableentry, %2
   100                              <2> %else
   101                              <2>  %error Wrong section
   102                              <2> %endif
   103                              <2> 	%endmacro
   104                              <2> 
   105                              <2> 		; Operand size 32-bit prefix if 386+ CPU
   106                              <2> 	%macro _386_o32 0-1+.nolist
   107                              <2> _386		o32
   108                              <2> 		%1
   109                              <2> 	%endmacro
   110                              <2> 
   111                              <2> 		; Address size 32-bit prefix if 386+ CPU
   112                              <2> 	%macro _386_a32 0-1+.nolist
   113                              <2> _386		a32
   114                              <2> 		%1
   115                              <2> 	%endmacro
   116                              <2> 
   117                              <2> 		; Short jump if 386+ CPU
   118                              <2> 	%macro _386_jmps 1.nolist
   119                              <2> _386		jmp short %1
   120                              <2> 	%endmacro
   121                              <2> 
   122                              <2> 		; Near jump if 386+ CPU
   123                              <2> 	%macro _386_jmpn 1.nolist
   124                              <2> _386		jmp near %1
   125                              <2> 	%endmacro
   126                              <2> 
   127                              <2> 		; Short jump if no 386+ CPU
   128                              <2> 	%macro _no386_jmps 1.nolist
   129                              <2> _no386		jmp short %1
   130                              <2> 	%endmacro
   131                              <2> 
   132                              <2> 		; Near jump if no 386+ CPU
   133                              <2> 	%macro _no386_jmpn 1.nolist
   134                              <2> _no386		jmp near %1
   135                              <2> 	%endmacro
   136                              <2> 
   137                              <2> 		; Instruction if 386+ CPU
   138                              <2> 	%macro _386 0-1+.nolist
   139                              <2> [cpu 386]			; change CPU type
   140                              <2> %%entry:
   141                              <2> 		%1		; write instruction
   142                              <2> __CPU__				; reset CPU type
   143                              <2> %assign %%length ($ - %%entry)
   144                              <2>  patch386 no, equ %%entry, %%length
   145                              <2> 	%endmacro
   146                              <2> 
   147                              <2> 		; Instruction if no 386+ CPU
   148                              <2> 	%macro _no386 0-1+.nolist
   149                              <2> %%entry:
   150                              <2> 		%1		; write instruction
   151                              <2> %assign %%length ($ - %%entry)
   152                              <2>  patch386 , equ %%entry, %%length
   153                              <2> 	%endmacro
   154                              <2> 
   155                              <2> %else
   156                              <2> 	%macro patch386 2+.nolist
   157                              <2> %ifidn _CURRENT_SECTION, lDEBUG_CODE
   158                              <2>  %define PATCH_%{1}386_TABLE %[PATCH_%{1}386_TABLE], %2
   159                              <2> %elifidn _CURRENT_SECTION, lDEBUG_CODE2
   160                              <2>  %define PATCH_%{1}386_TABLE2 %[PATCH_%{1}386_TABLE2], %2
   161                              <2> %elifidn _CURRENT_SECTION, lDEBUG_DATA_ENTRY
   162                              <2>  %define PATCH_%{1}386_TABLEENTRY %[PATCH_%{1}386_TABLEENTRY], %2
   163                              <2> %else
   164                              <2>  %error Wrong section
   165                              <2> %endif
   166                              <2> 	%endmacro
   167                              <2> 
   168                              <2> %if _WPT_LABELS
   169                              <2> 	; These forms provide verbose info by defining a
   170                              <2> 	; meaningful label for each patch. That fills up
   171                              <2> 	; the map file and might take longer though.
   172                              <2> 		; Operand size 32-bit prefix if 386+ CPU
   173                              <2> 	%macro _386_o32 0-1+.nolist
   174                              <2> %%386_o32:	o32
   175                              <2> patch386 NO, %%386_o32
   176                              <2> 		%1
   177                              <2> 	%endmacro
   178                              <2> 
   179                              <2> 		; Address size 32-bit prefix if 386+ CPU
   180                              <2> 	%macro _386_a32 0-1+.nolist
   181                              <2> %%386_a32:	a32
   182                              <2> patch386 NO, %%386_a32
   183                              <2> 		%1
   184                              <2> 	%endmacro
   185                              <2> 
   186                              <2> 		; Short jump if 386+ CPU
   187                              <2> 	%macro _386_jmps 1.nolist
   188                              <2> %%386_jmps:	jmp short %1
   189                              <2> patch386 NO, %%386_jmps,%%386_jmps+1
   190                              <2> 	%endmacro
   191                              <2> 
   192                              <2> 		; Near jump if 386+ CPU
   193                              <2> 	%macro _386_jmpn 1.nolist
   194                              <2> %%386_jmpn:	jmp near %1
   195                              <2> patch386 NO, %%386_jmpn,%%386_jmpn+1,%%386_jmpn+2
   196                              <2> 	%endmacro
   197                              <2> 
   198                              <2> 		; Short jump if no 386+ CPU
   199                              <2> 	%macro _no386_jmps 1.nolist
   200                              <2> %%no386_jmps:	jmp short %1
   201                              <2> patch386 , %%no386_jmps,%%no386_jmps+1
   202                              <2> 	%endmacro
   203                              <2> 
   204                              <2> 		; Near jump if no 386+ CPU
   205                              <2> 	%macro _no386_jmpn 1.nolist
   206                              <2> %%no386_jmpn:	jmp near %1
   207                              <2> patch386 , %%no386_jmpn,%%no386_jmpn+1,%%no386_jmpn+2
   208                              <2> 	%endmacro
   209                              <2> 
   210                              <2> 		; Instruction if 386+ CPU
   211                              <2> 	%macro _386 0-1+.nolist
   212                              <2> [cpu 386]			; change CPU type
   213                              <2> %%386_instr:	%1		; write instruction
   214                              <2> __CPU__				; reset CPU type
   215                              <2> 
   216                              <2> %assign %%INSTRCOUNT 0
   217                              <2> %rep $-%%386_instr		; count size of instruction
   218                              <2>  patch386 NO, %%386_instr+%[%%INSTRCOUNT]
   219                              <2> 				; write a patch for each byte
   220                              <2>  %assign %%INSTRCOUNT %%INSTRCOUNT+1
   221                              <2> %endrep
   222                              <2> %undef %%INSTRCOUNT
   223                              <2> 	%endmacro
   224                              <2> 
   225                              <2> 		; Instruction if no 386+ CPU
   226                              <2> 	%macro _no386 0-1+.nolist
   227                              <2> %%no386_instr:	%1		; write instruction
   228                              <2> 
   229                              <2> %assign %%INSTRCOUNT 0
   230                              <2> %rep $-%%no386_instr		; count size of instruction
   231                              <2>  patch386 , %%no386_instr+%[%%INSTRCOUNT]
   232                              <2> 				; write a patch for each byte
   233                              <2>  %assign %%INSTRCOUNT %%INSTRCOUNT+1
   234                              <2> %endrep
   235                              <2> %undef %%INSTRCOUNT
   236                              <2> 	%endmacro
   237                              <2> %else	; _WPT_LABELS
   238                              <2> 		; Operand size 32-bit prefix if 386+ CPU
   239                              <2> 	%macro _386_o32 0-1+.nolist
   240                              <2> _386		o32
   241                              <2> 		%1
   242                              <2> 	%endmacro
   243                              <2> 
   244                              <2> 		; Address size 32-bit prefix if 386+ CPU
   245                              <2> 	%macro _386_a32 0-1+.nolist
   246                              <2> _386		a32
   247                              <2> 		%1
   248                              <2> 	%endmacro
   249                              <2> 
   250                              <2> 		; Short jump if 386+ CPU
   251                              <2> 	%macro _386_jmps 1.nolist
   252                              <2> _386		jmp short %1
   253                              <2> 	%endmacro
   254                              <2> 
   255                              <2> 		; Near jump if 386+ CPU
   256                              <2> 	%macro _386_jmpn 1.nolist
   257                              <2> _386		jmp near %1
   258                              <2> 	%endmacro
   259                              <2> 
   260                              <2> 		; Short jump if no 386+ CPU
   261                              <2> 	%macro _no386_jmps 1.nolist
   262                              <2> _no386		jmp short %1
   263                              <2> 	%endmacro
   264                              <2> 
   265                              <2> 		; Near jump if no 386+ CPU
   266                              <2> 	%macro _no386_jmpn 1.nolist
   267                              <2> _no386		jmp near %1
   268                              <2> 	%endmacro
   269                              <2> 
   270                              <2> 		; Instruction if 386+ CPU
   271                              <2> 	%macro _386 0-1+.nolist
   272                              <2> %push
   273                              <2> [cpu 386]			; change CPU type
   274                              <2> %assign %$entry $ + _CURRENT_SECTION %+ FIXUP
   275                              <2> 		%1		; write instruction
   276                              <2> __CPU__				; reset CPU type
   277                              <2> 
   278                              <2> %rep ($ + _CURRENT_SECTION %+ FIXUP) - %$entry
   279                              <2> 				; count size of instruction
   280                              <2>  patch386 NO, %[%$entry]	; write a patch for each byte
   281                              <2>  %assign %$entry %$entry+1
   282                              <2> %endrep
   283                              <2> %pop
   284                              <2> 	%endmacro
   285                              <2> 
   286                              <2> 		; Instruction if no 386+ CPU
   287                              <2> 	%macro _no386 0-1+.nolist
   288                              <2> %push
   289                              <2> %assign %$entry $ + _CURRENT_SECTION %+ FIXUP
   290                              <2> 		%1		; write instruction
   291                              <2> 
   292                              <2> %rep ($ + _CURRENT_SECTION %+ FIXUP) - %$entry
   293                              <2> 				; count size of instruction
   294                              <2>  patch386 , %[%$entry]		; write a patch for each byte
   295                              <2>  %assign %$entry %$entry+1
   296                              <2> %endrep
   297                              <2> %pop
   298                              <2> 	%endmacro
   299                              <2> %endif	; _WPT_LABELS
   300                              <2> %endif	; _LINK
   301                              <2> 
   302                              <2> %endif
   303                              <2> 
   304                              <2> 		; Patch macros but for cases where the 386+
   305                              <2> 		; instructions should only be generated for
   306                              <2> 		; DEBUGX (i.e. for 32-bit DPMI addressing code).
   307                              <2> %if _PM
   308                              <2> %define _386_PM_o32	_386_o32
   309                              <2> %define _386_PM_a32	_386_a32
   310                              <2> %define _386_PM_jmps	_386_jmps
   311                              <2> %define _386_PM_jmpn	_386_jmpn
   312                              <2> %define _386_PM		_386
   313                              <2> %else
   314                              <2> %define _386_PM_o32
   315                              <2> %define _386_PM_a32
   316                              <2> %define _386_PM_jmps	comment
   317                              <2> %define _386_PM_jmpn	comment
   318                              <2> %define _386_PM		comment
   319                              <2> %endif
   320                              <2> 
   321                              <2> 
   322                              <2> %ifn _LINK
   323                              <2> %macro __writepatchtable2 0-*.nolist
   324                              <2> %if %0 & 1
   325                              <2>  %fatal Expected even number of arguments
   326                              <2> %endif
   327                              <2> %rep %0 >> 1
   328                              <2> 	%1 %2
   329                              <2> %rotate 2
   330                              <2> %endrep
   331                              <2> %endmacro
   332                              <2> 
   333                              <2> %macro __patchtable2_entry 0.nolist
   334                              <2>   ; only if this isn't the first (pseudo-)entry
   335                              <2>   %if %$lastcount != 0
   336                              <2>     %assign %$runscount %[%$runscount]+1
   337                              <2>    ; if the offset from %$previous is less than 255
   338                              <2>    %if (%$last-%$previous) < 255
   339                              <2>     %assign %$$method2tablesize %$$method2tablesize+1
   340                              <2>     ; then write a single byte (number of bytes not to patch between)
   341                              <2>     %xdefine %$$method2list %$$method2list,db,%$last-%$previous
   342                              <2>    %else
   343                              <2>     ; otherwise write a 255 ("reposition") and write the 16-bit address afterwards
   344                              <2>     %assign %$$method2tablesize %$$method2tablesize+3
   345                              <2>     %xdefine %$$method2list %$$method2list,db,255,dw,%$last
   346                              <2>     %assign %$reposcount %[%$reposcount]+1
   347                              <2>    %endif
   348                              <2>    %if %$lastcount == 1
   349                              <2>     %assign %$onecount %[%$onecount]+1
   350                              <2>    %endif
   351                              <2>    %assign %$$method2tablesize %$$method2tablesize+1
   352                              <2>    ; and write the number of bytes to be patched
   353                              <2>    %xdefine %$$method2list %$$method2list,db,%$lastcount
   354                              <2>    ; define %$previous for the next entry: it points to the next non-patched byte
   355                              <2>    %define %$previous (%[%$last]+%[%$lastcount])
   356                              <2>   %endif
   357                              <2> %endmacro
   358                              <2> 
   359                              <2> %macro writepatchtable 2-*.nolist
   360                              <2> 
   361                              <2> 	numdef %{1}_FORCE_METHOD, 0
   362                              <2> %push
   363                              <2> 		; Determine length of simple table:
   364                              <2> %assign %$method1tablesize (%0 - 2)*2
   365                              <2> 
   366                              <2> %if !_%{1}_FORCE_METHOD || _%{1}_FORCE_METHOD == 2
   367                              <2> 		; Determine length of complicated table:
   368                              <2> %assign %$method2tablesize 0
   369                              <2> %define %$method2list db,""
   370                              <2> %push
   371                              <2> %if _WPT_LABELS
   372                              <2>  %define %$previous code_start	; if list contains labels
   373                              <2> %else
   374                              <2>  %define %$previous 0
   375                              <2> %endif
   376                              <2> %define %$last %[%$previous]
   377                              <2> %assign %$lastcount 0
   378                              <2> %assign %$onecount 0
   379                              <2> %assign %$reposcount 0
   380                              <2> %assign %$bytescount %0 - 2
   381                              <2> %assign %$runscount 0
   382                              <2> %rotate 1
   383                              <2> %rep %0 - 2
   384                              <2>  %rotate 1
   385                              <2>  ;if  it continues the previous patch   and not too long   and this isn't the first
   386                              <2>  %if ((%$last+%$lastcount) == %1) && (%$lastcount < 255) && (%$lastcount != 0)
   387                              <2>   ; then do not write an entry, just increase the patch's size
   388                              <2>   %assign %$lastcount %[%$lastcount]+1
   389                              <2>  %else
   390                              <2>   ; otherwise write the last entry
   391                              <2>   __patchtable2_entry
   392                              <2>   ; define new %$last to this parameter, %$lastcount to one
   393                              <2>   %define %$last %1
   394                              <2>   %assign %$lastcount 1
   395                              <2>  %endif
   396                              <2> %endrep
   397                              <2> __patchtable2_entry
   398                              <2> 
   399                              <2> ; at the end, there's a patch with offset 0, size 0
   400                              <2> %assign %$$method2tablesize %$$method2tablesize+2
   401                              <2> %xdefine %$$method2list %$$method2list,db,0,db,0
   402                              <2> 
   403                              <2> %assign %$$onecount %$onecount
   404                              <2> %assign %$$reposcount %$reposcount
   405                              <2> %assign %$$bytescount %$bytescount
   406                              <2> %assign %$$runscount %$runscount
   407                              <2> %pop
   408                              <2> %rotate 1
   409                              <2> %endif
   410                              <2> 
   411                              <2> %if _%{1}_FORCE_METHOD == 2
   412                              <2>  %define __%{1}_method 2
   413                              <2> %elif _%{1}_FORCE_METHOD == 1
   414                              <2>  %define __%{1}_method 1
   415                              <2> %else
   416                              <2>  %if _%{1}_FORCE_METHOD
   417                              <2>   %fatal Invalid forced method selected: _%{1}_FORCE_METHOD
   418                              <2>  %endif
   419                              <2>  %if %$method1tablesize > (%$method2tablesize+20)
   420                              <2>   %define __%{1}_method 2
   421                              <2>  %else
   422                              <2>   %define __%{1}_method 1
   423                              <2>  %endif
   424                              <2> %endif
   425                              <2> 
   426                              <2> 
   427                              <2> %1:
   428                              <2> %if __%{1}_method == 2
   429                              <2> 	__writepatchtable2 %$method2list
   430                              <2> 	endarea %1
   431                              <2> %assign %$size %1_size
   432                              <2> %warning %1: %$size bytes (Method 2)
   433                              <2> %warning 1B=%$onecount repo=%$reposcount run=%$runscount byte=%$bytescount
   434                              <2> %else
   435                              <2> %rotate 1
   436                              <2> %rep %0 - 2
   437                              <2> %rotate 1
   438                              <2> 	dw %1
   439                              <2> %endrep
   440                              <2> %rotate 1
   441                              <2> 	endarea %1
   442                              <2> %assign %$size %1_size
   443                              <2> %warning %1: %$size bytes (Method 1)
   444                              <2> %1.amount equ %1_size_w
   445                              <2> %endif
   446                              <2> %pop
   447                              <2> %endmacro
   448                              <2> %endif
   880                              <1> 
   881                              <1> 
   882                              <1> %if _VDD
   883                              <1> ; standard BOPs for communication with DEBXXVDD on NT platforms
   884                              <1> %macro RegisterModule 0.nolist
   885                              <1> 	db 0C4h, 0C4h, 58h, 0
   886                              <1> 	nop
   887                              <1> %endmacro
   888                              <1> %macro UnRegisterModule 0.nolist
   889                              <1> 	db 0C4h, 0C4h, 58h, 1
   890                              <1> 	nop
   891                              <1> %endmacro
   892                              <1> %macro DispatchCall 0.nolist
   893                              <1> 	db 0C4h, 0C4h, 58h, 2
   894                              <1> 	nop
   895                              <1> %endmacro
   896                              <1> %endif
   897                              <1> 
   898                              <1> %assign CODE_INSURE_COUNT 0
   899                              <1> 
   900                              <1> 		; The entry_to_code_seg/_sel dispatcher in lDEBUG_DATA_ENTRY
   901                              <1> 		;  detects mistaken debugger breakpoints in its
   902                              <1> 		;  in-code-parameter by checking for a low-byte
   903                              <1> 		;  value equal to 0CCh (one-byte int3 opcode).
   904                              <1> 		; Therefore, we insure that all destinations jumped to
   905                              <1> 		;  via that dispatcher do not happen to be located
   906                              <1> 		;  on an offset that gives 0CCh in the low byte.
   907                              <1> 	%imacro code_insure_low_byte_not_0CCh 0.nolist
   908                              <1> %ifn _LINK
   909                              <1>  %if (($ - _CURRENT_SECTION %+ _start) & 0FFh) == 0CCh
   910                              <1> 	nop
   911                              <1>   %assign CODE_INSURE_COUNT 1 + CODE_INSURE_COUNT
   912                              <1>  %endif
   913                              <1> %endif
   914                              <1> 	%endmacro
   915                              <1> 
   916                              <1> 
   917                              <1> 		; dual code segments
   918                              <1> %if _DUALCODE && _PM
   919                              <1> 
   920                              <1> %if _DEBUG
   921                              <1> %idefine dualfunction comment
   922                              <1> %else
   923                              <1> %idefine dualfunction code_insure_low_byte_not_0CCh
   924                              <1> %endif
   925                              <1> 
   926                              <1> %idefine dualreturn call _CURRENT_SECTION %+ _dualret_helper
   927                              <1> %idefine dualdistance far
   928                              <1> 	%imacro dualcall 1.nolist
   929                              <1> %ifndef SECTION_OF_%1
   930                              <1>  %error Unknown target section for symbol %1
   931                              <1> %endif
   932                              <1> 	call _CURRENT_SECTION %+ _to_ %+ %[SECTION_OF_%1] %+ _dualcall_helper
   933                              <1>  %if _DEBUG
   934                              <1> 	jmp strict short %%skipdata
   935                              <1>  %endif
   936                              <1> 	dw %1
   937                              <1> %%skipdata:
   938                              <1> 	%endmacro
   939                              <1> 	%imacro nearcall 1.nolist
   940                              <1> %ifndef SECTION_OF_%1
   941                              <1>  %error Unknown target section for symbol %1
   942                              <1> %endif
   943                              <1> %ifidni %[SECTION_OF_%1], _CURRENT_SECTION
   944                              <1> 	call %1
   945                              <1> %else
   946                              <1> 	call _CURRENT_SECTION %+ _to_ %+ %[SECTION_OF_%1] %+ _nearcall_helper
   947                              <1>  %if _DEBUG
   948                              <1> 	jmp strict short %%skipdata
   949                              <1>  %endif
   950                              <1> 	dw %1
   951                              <1> %%skipdata:
   952                              <1> %endif
   953                              <1> 	%endmacro
   954                              <1> 
   955                              <1> %elif _DUALCODE && ! _PM
   956                              <1> 
   957                              <1> %idefine dualfunction comment
   958                              <1> %idefine dualreturn
   959                              <1> %idefine dualdistance far
   960                              <1> 
   961                              <1> %ifn _LINK
   962                              <1> %define PATCH_RELOCATE_FROM_lDEBUG_CODE ""
   963                              <1> %define PATCH_RELOCATE_FROM_lDEBUG_CODE2 ""
   964                              <1> 	%imacro dualcall 1.nolist
   965                              <1> %ifndef SECTION_OF_%1
   966                              <1>  %error Unknown target section for symbol %1
   967                              <1> %endif
   968                              <1> %ifidni %[SECTION_OF_%1], _CURRENT_SECTION
   969                              <1> 	push cs
   970                              <1> 	call %1
   971                              <1> %else
   972                              <1> 	call relocatedzero:%1
   973                              <1> %push
   974                              <1> %assign %$entry ($ + _CURRENT_SECTION %+ FIXUP) - 2
   975                              <1> 	relocatelist _CURRENT_SECTION, %$entry
   976                              <1> %pop
   977                              <1> %endif
   978                              <1> 	%endmacro
   979                              <1> 	%imacro relocatelist 2.nolist
   980                              <1>  %define PATCH_RELOCATE_FROM_%1 %[PATCH_RELOCATE_FROM_%1],%2
   981                              <1> 	%endmacro
   982                              <1> %else		; _LINK
   983                              <1> 	%idefine dualcall dualcall_with_filename __FILE__,
   984                              <1> 	%imacro dualcall_with_filename 2.nolist
   985                              <1> %ifndef SECTION_OF_%2
   986                              <1>  %error Unknown target section for symbol %2
   987                              <1> %endif
   988                              <1> %ifidni %[SECTION_OF_%2], _CURRENT_SECTION
   989                              <1> 	push cs
   990                              <1> 	call %2
   991                              <1> %else
   992                              <1> 	call relocatedzero:%2
   993                              <1> %ifidn _CURRENT_SECTION, lDEBUG_CODE
   994                              <1>  wllist Lrelocate_from_code, equ $ - 2, %1
   995                              <1> %elifidn _CURRENT_SECTION, lDEBUG_CODE2
   996                              <1>  wllist Lrelocate_from_code2, equ $ - 2, %1
   997                              <1> %else
   998                              <1>  %error Wrong section
   999                              <1> %endif
  1000                              <1> %endif
  1001                              <1> 	%endmacro
  1002                              <1> %endif		; _LINK
  1003                              <1>  %if _DUALCODENEARDUAL
  1004                              <1> 
  1005                              <1> %if _LINK
  1006                              <1> 	%idefine nearcall nearcall_with_filename __FILE__,
  1007                              <1> 	%imacro nearcall_with_filename 2
  1008                              <1> %ifndef SECTION_OF_%2
  1009                              <1>  %error Unknown target section for symbol %2
  1010                              <1> %endif
  1011                              <1> %ifidni %[SECTION_OF_%2], _CURRENT_SECTION
  1012                              <1> 	call %2
  1013                              <1> %else
  1014                              <1>  %push
  1015                              <1>  %xdefine %$originalsection _CURRENT_SECTION
  1016                              <1>  %xdefine %$targetsection SECTION_OF_%2
  1017                              <1>  %deftok %%filenametoken SOURCEFILENAME
  1018                              <1>   %ifndef NEARCALL_THUNK_TO_%2%[%%filenametoken]
  1019                              <1> 	hiddenusesection %$targetsection
  1020                              <1> %define NEARCALL_THUNK_TO_%2%[%%filenametoken] %%nearcall_thunk_to_%2%[%%filenametoken]
  1021                              <1> section_of %%nearcall_thunk_to_%2%[%%filenametoken]
  1022                              <1> dualfunction
  1023                              <1> %%nearcall_thunk_to_%2%[%%filenametoken]:
  1024                              <1> 	call %2
  1025                              <1> 	dualreturn
  1026                              <1> 	retf
  1027                              <1> 
  1028                              <1> 	hiddenusesection %$originalsection
  1029                              <1>   %endif
  1030                              <1>  %pop
  1031                              <1> 	dualcall_with_filename %1, NEARCALL_THUNK_TO_%2%[%%filenametoken]
  1032                              <1> %endif
  1033                              <1> 	%endmacro
  1034                              <1> %elif _LINK_COMPAT	; _LINK
  1035                              <1> 	%imacro nearcall 1
  1036                              <1> %ifndef SECTION_OF_%1
  1037                              <1>  %error Unknown target section for symbol %1
  1038                              <1> %endif
  1039                              <1> %ifidni %[SECTION_OF_%1], _CURRENT_SECTION
  1040                              <1> 	call %1
  1041                              <1> %else
  1042                              <1>  %push
  1043                              <1>  %xdefine %$originalsection _CURRENT_SECTION
  1044                              <1>  %xdefine %$targetsection SECTION_OF_%1
  1045                              <1>  %deftok %%filenametoken SOURCEFILENAME
  1046                              <1>   %ifndef NEARCALL_THUNK_TO_%1%[%%filenametoken]
  1047                              <1> 	hiddenusesection %$targetsection
  1048                              <1> %define NEARCALL_THUNK_TO_%1%[%%filenametoken] %%nearcall_thunk_to_%1%[%%filenametoken]
  1049                              <1> section_of %%nearcall_thunk_to_%1%[%%filenametoken]
  1050                              <1> dualfunction
  1051                              <1> %%nearcall_thunk_to_%1%[%%filenametoken]:
  1052                              <1> 	call %1
  1053                              <1> 	dualreturn
  1054                              <1> 	retf
  1055                              <1> 
  1056                              <1> 	hiddenusesection %$originalsection
  1057                              <1>   %endif
  1058                              <1>  %pop
  1059                              <1> 	dualcall NEARCALL_THUNK_TO_%1%[%%filenametoken]
  1060                              <1> %endif
  1061                              <1> 	%endmacro
  1062                              <1> %else		; _LINK, _LINK_COMPAT
  1063                              <1> 	%imacro nearcall 1
  1064                              <1> %ifndef SECTION_OF_%1
  1065                              <1>  %error Unknown target section for symbol %1
  1066                              <1> %endif
  1067                              <1> %ifidni %[SECTION_OF_%1], _CURRENT_SECTION
  1068                              <1> 	call %1
  1069                              <1> %else
  1070                              <1>  %push
  1071                              <1>  %xdefine %$originalsection _CURRENT_SECTION
  1072                              <1>  %xdefine %$targetsection SECTION_OF_%1
  1073                              <1>   %ifndef NEARCALL_THUNK_TO_%1
  1074                              <1> 	hiddenusesection %$targetsection
  1075                              <1> %define NEARCALL_THUNK_TO_%1 %%nearcall_thunk_to_%1
  1076                              <1> section_of %%nearcall_thunk_to_%1
  1077                              <1> dualfunction
  1078                              <1> %%nearcall_thunk_to_%1:
  1079                              <1> 	call %1
  1080                              <1> 	dualreturn
  1081                              <1> 	retf
  1082                              <1> 
  1083                              <1> 	hiddenusesection %$originalsection
  1084                              <1>   %endif
  1085                              <1>  %pop
  1086                              <1> 	dualcall NEARCALL_THUNK_TO_%1
  1087                              <1> %endif
  1088                              <1> 	%endmacro
  1089                              <1> %endif		; _LINK, _LINK_COMPAT
  1090                              <1>  %else
  1091                              <1> 	%imacro nearcall 1.nolist
  1092                              <1> %ifndef SECTION_OF_%1
  1093                              <1>  %error Unknown target section for symbol %1
  1094                              <1> %endif
  1095                              <1> %ifidni %[SECTION_OF_%1], _CURRENT_SECTION
  1096                              <1> 	call %1
  1097                              <1> %else
  1098                              <1> 	call _CURRENT_SECTION %+ _to_ %+ %[SECTION_OF_%1] %+ _nearcall_helper
  1099                              <1>  %if _DEBUG
  1100                              <1> 	jmp strict short %%skipdata
  1101                              <1>  %endif
  1102                              <1> 	dw %1
  1103                              <1> %%skipdata:
  1104                              <1> %endif
  1105                              <1> 	%endmacro
  1106                              <1>  %endif
  1107                              <1> %elif ! _DUALCODE
  1108                              <1> 
  1109                              <1> %idefine dualfunction comment
  1110                              <1> %idefine dualreturn
  1111                              <1> %idefine dualdistance near
  1112                              <1> 	%imacro dualcall 1.nolist
  1113                              <1> 	call %1
  1114                              <1> 	%endmacro
  1115                              <1> 	%imacro nearcall 1.nolist
  1116                              <1> 	call %1
  1117                              <1> 	%endmacro
  1118                              <1> %assign _SYMBOLICDUALCODE 0
  1119                              <1> %assign _SYMBOLASMDUALCODE 0
  1120                              <1> 
  1121                              <1> %else
  1122                              <1>  %error Unexpected defines
  1123                              <1> %endif
  1124                              <1> 
  1125                              <1> %ifn _SYMBOLICDUALCODE
  1126                              <1>  %assign _SYMBOLASMDUALCODE 0
  1127                              <1> %endif
  1128                              <1> 
  1129                              <1>  %if _SYMBOLIC && _DUALCODE && _SYMBOLASMDUALCODE
  1130                              <1> %idefine dual2function	dualfunction
  1131                              <1> %idefine dual2return	dualreturn
  1132                              <1> %idefine dual2distance	dualdistance
  1133                              <1> %idefine dual2call	dualcall
  1134                              <1>  %else
  1135                              <1> %idefine dual2function comment
  1136                              <1> %idefine dual2return
  1137                              <1> %idefine dual2distance near
  1138                              <1> 	%imacro dual2call 1.nolist
  1139                              <1> 	call %1
  1140                              <1> 	%endmacro
  1141                              <1>  %endif
  1142                              <1> 
  1143                              <1> 
  1144                              <1> 	numdef CHECKSECTION, 0
  1145                              <1> 	numdef CHECKCALLSECTION, _CHECKSECTION
  1146                              <1> 	numdef CHECKJMPSECTION, _CHECKSECTION
  1147                              <1> 	numdef CHECKJCCSECTION, _CHECKSECTION
  1148                              <1> 
  1149                              <1> %if _CHECKCALLSECTION
  1150                              <1> 	%imacro call 1.nolist
  1151                              <1> 	%? %1
  1152                              <1> checksection %1, %?, call
  1153                              <1> 	%endmacro
  1154                              <1> %endif
  1155                              <1> %if _CHECKJMPSECTION
  1156                              <1> 	%imacro jmp 1.nolist
  1157                              <1> 	%? %1
  1158                              <1> checksection %1, %?, jmp
  1159                              <1> 	%endmacro
  1160                              <1> %endif
  1161                              <1> %if _CHECKJCCSECTION
  1162                              <1> 	%imacro je 1.nolist
  1163                              <1> 	%? %1
  1164                              <1> checksection %1, %?, jcc
  1165                              <1> 	%endmacro
  1166                              <1> 	%imacro jne 1.nolist
  1167                              <1> 	%? %1
  1168                              <1> checksection %1, %?, jcc
  1169                              <1> 	%endmacro
  1170                              <1> 	%imacro jz 1.nolist
  1171                              <1> 	%? %1
  1172                              <1> checksection %1, %?, jcc
  1173                              <1> 	%endmacro
  1174                              <1> 	%imacro jnz 1.nolist
  1175                              <1> 	%? %1
  1176                              <1> checksection %1, %?, jcc
  1177                              <1> 	%endmacro
  1178                              <1> 
  1179                              <1> 	%imacro jb 1.nolist
  1180                              <1> 	%? %1
  1181                              <1> checksection %1, %?, jcc
  1182                              <1> 	%endmacro
  1183                              <1> 	%imacro jnb 1.nolist
  1184                              <1> 	%? %1
  1185                              <1> checksection %1, %?, jcc
  1186                              <1> 	%endmacro
  1187                              <1> 	%imacro jbe 1.nolist
  1188                              <1> 	%? %1
  1189                              <1> checksection %1, %?, jcc
  1190                              <1> 	%endmacro
  1191                              <1> 	%imacro jnbe 1.nolist
  1192                              <1> 	%? %1
  1193                              <1> checksection %1, %?, jcc
  1194                              <1> 	%endmacro
  1195                              <1> 	%imacro jc 1.nolist
  1196                              <1> 	%? %1
  1197                              <1> checksection %1, %?, jcc
  1198                              <1> 	%endmacro
  1199                              <1> 	%imacro jnc 1.nolist
  1200                              <1> 	%? %1
  1201                              <1> checksection %1, %?, jcc
  1202                              <1> 	%endmacro
  1203                              <1> 	%imacro ja 1.nolist
  1204                              <1> 	%? %1
  1205                              <1> checksection %1, %?, jcc
  1206                              <1> 	%endmacro
  1207                              <1> 	%imacro jna 1.nolist
  1208                              <1> 	%? %1
  1209                              <1> checksection %1, %?, jcc
  1210                              <1> 	%endmacro
  1211                              <1> 	%imacro jae 1.nolist
  1212                              <1> 	%? %1
  1213                              <1> checksection %1, %?, jcc
  1214                              <1> 	%endmacro
  1215                              <1> 	%imacro jnae 1.nolist
  1216                              <1> 	%? %1
  1217                              <1> checksection %1, %?, jcc
  1218                              <1> 	%endmacro
  1219                              <1> 
  1220                              <1> 	%imacro jl 1.nolist
  1221                              <1> 	%? %1
  1222                              <1> checksection %1, %?, jcc
  1223                              <1> 	%endmacro
  1224                              <1> 	%imacro jnl 1.nolist
  1225                              <1> 	%? %1
  1226                              <1> checksection %1, %?, jcc
  1227                              <1> 	%endmacro
  1228                              <1> 	%imacro jle 1.nolist
  1229                              <1> 	%? %1
  1230                              <1> checksection %1, %?, jcc
  1231                              <1> 	%endmacro
  1232                              <1> 	%imacro jnle 1.nolist
  1233                              <1> 	%? %1
  1234                              <1> checksection %1, %?, jcc
  1235                              <1> 	%endmacro
  1236                              <1> 	%imacro jg 1.nolist
  1237                              <1> 	%? %1
  1238                              <1> checksection %1, %?, jcc
  1239                              <1> 	%endmacro
  1240                              <1> 	%imacro jng 1.nolist
  1241                              <1> 	%? %1
  1242                              <1> checksection %1, %?, jcc
  1243                              <1> 	%endmacro
  1244                              <1> 	%imacro jge 1.nolist
  1245                              <1> 	%? %1
  1246                              <1> checksection %1, %?, jcc
  1247                              <1> 	%endmacro
  1248                              <1> 	%imacro jnge 1.nolist
  1249                              <1> 	%? %1
  1250                              <1> checksection %1, %?, jcc
  1251                              <1> 	%endmacro
  1252                              <1> 
  1253                              <1> 	%imacro jo 1.nolist
  1254                              <1> 	%? %1
  1255                              <1> checksection %1, %?, jcc
  1256                              <1> 	%endmacro
  1257                              <1> 	%imacro jno 1.nolist
  1258                              <1> 	%? %1
  1259                              <1> checksection %1, %?, jcc
  1260                              <1> 	%endmacro
  1261                              <1> 	%imacro jp 1.nolist
  1262                              <1> 	%? %1
  1263                              <1> checksection %1, %?, jcc
  1264                              <1> 	%endmacro
  1265                              <1> 	%imacro jnp 1.nolist
  1266                              <1> 	%? %1
  1267                              <1> checksection %1, %?, jcc
  1268                              <1> 	%endmacro
  1269                              <1> 	%imacro jpe 1.nolist
  1270                              <1> 	%? %1
  1271                              <1> checksection %1, %?, jcc
  1272                              <1> 	%endmacro
  1273                              <1> 	%imacro jnpe 1.nolist
  1274                              <1> 	%? %1
  1275                              <1> checksection %1, %?, jcc
  1276                              <1> 	%endmacro
  1277                              <1> 	%imacro jpo 1.nolist
  1278                              <1> 	%? %1
  1279                              <1> checksection %1, %?, jcc
  1280                              <1> 	%endmacro
  1281                              <1> 	%imacro jnpo 1.nolist
  1282                              <1> 	%? %1
  1283                              <1> checksection %1, %?, jcc
  1284                              <1> 	%endmacro
  1285                              <1> 	%imacro js 1.nolist
  1286                              <1> 	%? %1
  1287                              <1> checksection %1, %?, jcc
  1288                              <1> 	%endmacro
  1289                              <1> 	%imacro jns 1.nolist
  1290                              <1> 	%? %1
  1291                              <1> checksection %1, %?, jcc
  1292                              <1> 	%endmacro
  1293                              <1> 
  1294                              <1> 	%imacro jcxz 1.nolist
  1295                              <1> 	%? %1
  1296                              <1> checksection %1, %?, jcc
  1297                              <1> 	%endmacro
  1298                              <1> 	%imacro jecxz 1.nolist
  1299                              <1> 	%? %1
  1300                              <1> checksection %1, %?, jcc
  1301                              <1> 	%endmacro
  1302                              <1> 	%imacro loop 1.nolist
  1303                              <1> 	%? %1
  1304                              <1> checksection %1, %?, jcc
  1305                              <1> 	%endmacro
  1306                              <1> 	%imacro loopz 1.nolist
  1307                              <1> 	%? %1
  1308                              <1> checksection %1, %?, jcc
  1309                              <1> 	%endmacro
  1310                              <1> 	%imacro loopnz 1.nolist
  1311                              <1> 	%? %1
  1312                              <1> checksection %1, %?, jcc
  1313                              <1> 	%endmacro
  1314                              <1> 	%imacro loope 1.nolist
  1315                              <1> 	%? %1
  1316                              <1> checksection %1, %?, jcc
  1317                              <1> 	%endmacro
  1318                              <1> 	%imacro loopne 1.nolist
  1319                              <1> 	%? %1
  1320                              <1> checksection %1, %?, jcc
  1321                              <1> 	%endmacro
  1322                              <1> %endif
  1323                              <1> 
  1324                              <1> 	%imacro checksection 3.nolist
  1325                              <1> %push
  1326                              <1>  %defstr %$string %1
  1327                              <1>  %substr %$shortword %$string 1, 5
  1328                              <1>  %substr %$shortsep %$string 6, 1
  1329                              <1>  %substr %$nearword %$string 1, 4
  1330                              <1>  %substr %$nearsep %$string 5, 1
  1331                              <1>  %substr %$farword %$string 1, 3
  1332                              <1>  %substr %$farsep %$string 4, 1
  1333                              <1>  %assign %$isshort 0
  1334                              <1>  %ifidni %$shortword, "short"
  1335                              <1>   %if %$shortsep == 32 || %$shortsep == 9
  1336                              <1>    %assign %$isshort 1
  1337                              <1>    %substr %$string %$string 7, -1
  1338                              <1>   %elif %$shortsep == '['
  1339                              <1>    %assign %$isshort 1
  1340                              <1>    %substr %$string %$string 6, -1
  1341                              <1>   %endif
  1342                              <1>  %endif
  1343                              <1>  %assign %$isnear 0
  1344                              <1>  %ifidni %$nearword, "near"
  1345                              <1>   %if %$nearsep == 32 || %$nearsep == 9
  1346                              <1>    %assign %$isnear 1
  1347                              <1>    %substr %$string %$string 6, -1
  1348                              <1>   %elif %$nearsep == '['
  1349                              <1>    %assign %$isnear 1
  1350                              <1>    %substr %$string %$string 5, -1
  1351                              <1>   %endif
  1352                              <1>  %endif
  1353                              <1>  %assign %$isfar 0
  1354                              <1>  %ifidni %$farword, "far"
  1355                              <1>   %if %$farsep == 32 || %$farsep == 9
  1356                              <1>    %assign %$isfar 1
  1357                              <1>    %substr %$string %$string 5, -1
  1358                              <1>   %elif %$farsep == '['
  1359                              <1>    %assign %$isfar 1
  1360                              <1>    %substr %$string %$string 4, -1
  1361                              <1>   %endif
  1362                              <1>  %endif
  1363                              <1> 
  1364                              <1>  %deftok %$token %$string
  1365                              <1> 
  1366                              <1>  %assign %$size 2
  1367                              <1>  %assign %$isreg 0
  1368                              <1>  %assign %$exit 0
  1369                              <1>  %rep 2
  1370                              <1>   %ifn %$exit
  1371                              <1>    %if %$size == 2
  1372                              <1>     %define %$regnames "ax  cx  dx  bx  sp  bp  si  di  "
  1373                              <1>    %elif %$size == 4
  1374                              <1>     %define %$regnames "eax ecx edx ebx esp ebp esi edi "
  1375                              <1>    %endif
  1376                              <1>    %assign %$index 0
  1377                              <1>    %rep 8
  1378                              <1>     %ifn %$exit
  1379                              <1>      %substr %$reg %$regnames %$index * 4 + 1, 4
  1380                              <1>      %deftok %$reg %$reg
  1381                              <1>      %ifnempty %$reg
  1382                              <1>       %ifidni %$reg, %$token
  1383                              <1>        %assign %$isreg %$size
  1384                              <1>        %assign %$exit 1
  1385                              <1>        %exitrep
  1386                              <1>       %endif
  1387                              <1>      %endif
  1388                              <1>     %endif
  1389                              <1>     %assign %$index %$index + 1
  1390                              <1>    %endrep
  1391                              <1>    %if %$exit
  1392                              <1>     %exitrep
  1393                              <1>    %endif
  1394                              <1>    %assign %$size %$size * 2
  1395                              <1>   %endif
  1396                              <1>  %endrep
  1397                              <1> 
  1398                              <1>  %assign %$ismulti 0
  1399                              <1>  %assign %$ismem 0
  1400                              <1>  %strlen %$length %$string
  1401                              <1>  %assign %$ii 0
  1402                              <1>  %rep %$length
  1403                              <1>   %substr %$point %$string %$ii + 1, 1
  1404                              <1>   %if %$point == 32 || %$point == 9
  1405                              <1>    %assign %$ismulti 1
  1406                              <1>   %endif
  1407                              <1>   %ifidn %$point, '['
  1408                              <1>    %assign %$ismem 1
  1409                              <1>   %endif
  1410                              <1>   %assign %$ii %$ii + 1
  1411                              <1>  %endrep
  1412                              <1> 
  1413                              <1>  %assign %$islocal 0
  1414                              <1>  %substr %$point %$string 1, 1
  1415                              <1>  %substr %$prefix %$string 1, 3
  1416                              <1>  %ifidn %$point, '.'
  1417                              <1>   %ifnidn %$prefix, '..@'
  1418                              <1>    %assign %$islocal 1
  1419                              <1>   %endif
  1420                              <1>  %endif
  1421                              <1> 
  1422                              <1>  %if %$isreg
  1423                              <1>   %if %$isreg == 4
  1424                              <1>    %warning 32-bit reg %3: %2 %1
  1425                              <1>   %else
  1426                              <1>    %warning 16-bit reg %3: %2 %1
  1427                              <1>   %endif
  1428                              <1>  %elif %$ismulti || %$ismem
  1429                              <1>   %warning not single %3: %2 %1
  1430                              <1>  %elif %$islocal
  1431                              <1>   %ifidni %3, call
  1432                              <1>    %warning local %3: %2 %1
  1433                              <1>   %endif
  1434                              <1>  %elifdef SECTION_OF_%[%$token]
  1435                              <1>   %ifnidni SECTION_OF_%[%$token], _CURRENT_SECTION
  1436                              <1>    %error Symbol %$token called wrongly: section_of=SECTION_OF_%[%$token], current=_CURRENT_SECTION
  1437                              <1>   %endif
  1438                              <1>  %endif
  1439                              <1> %pop
  1440                              <1> 	%endmacro
  1441                              <1> 
  1442                              <1> 
  1443                              <1> 	struc MEMREF
  1444 00000000 ????????            <1> mrLinear:		resd 1
  1445 00000004 ????????            <1> mrOffset:		resd 1
  1446 00000008 ????                <1> mrSegmentSelector:	resw 1
  1447 0000000A ????                <1> mrFlags:		resw 1
  1448 0000000C ????????            <1> mrLength:		resd 1
  1449                              <1> 	endstruc
  1450                              <1> 
  1451                              <1> 		; Currently only direct branches are allowed when
  1452                              <1> 		;  disassembling from the U command. (That is,
  1453                              <1> 		;  [disflags] & DIS_F_SHOW is clear.) All other
  1454                              <1> 		;  types of references depend on segment registers
  1455                              <1> 		;  and sometimes base and index registers, which are
  1456                              <1> 		;  not known ahead of time. They are only known for
  1457                              <1> 		;  the R command's disassembly. (DIS_F_SHOW set.)
  1458                              <1> 		; (When a mov ss or pop to ss will change ss, a
  1459                              <1> 		;  subsequent instruction using ss will not be
  1460                              <1> 		;  disassembled with the correct ss value.
  1461                              <1> 		;  This should be rare though. We may at a later
  1462                              <1> 		;  point detect this condition and not display
  1463                              <1> 		;  references with ss then.)
  1464                              <1> mrfBranchDirect:	equ    1
  1465                              <1> mrfMem:			equ    2
  1466                              <1> mrfMemSource:		equ    4
  1467                              <1> mrfMemDest:		equ    8
  1468                              <1> mrfA32:			equ   10h
  1469                              <1> mrfString:		equ   20h
  1470                              <1> mrfStringSource:	equ   40h
  1471                              <1> mrfStringDest:		equ   80h
  1472                              <1> mrfUsesSS:		equ  100h
  1473                              <1> mrfBranchIndirect:	equ  200h
  1474                              <1> 
  1475                              <1> 
  1476                              <1> %if _VXCHG && ! _VXCHGBIOS
  1477                              <1> 	struc XMSM
  1478 00000000 ????????            <1> .size_:		resd 1
  1479 00000004 ????                <1> .srchdl:	resw 1
  1480 00000006 ????????            <1> .srcadr:	resd 1
  1481 0000000A ????                <1> .dsthdl:	resw 1
  1482 0000000C ????????            <1> .dstadr:	resd 1
  1483                              <1> 	endstruc
  1484                              <1> %endif
  1485                              <1> 
  1486                              <1> 
  1487                              <1> 	; doscall is used by symbols.asm and run.asm and in
  1488                              <1> 	;  cmd3_close_handle, so define it prior
  1489                              <1> %if _PM && _NOEXTENDER
  1490                              <1> %macro doscall 0
  1491                              <1> 	nearcall _doscall
  1492                              <1> %endmacro
  1493                              <1> %else
  1494                              <1> 		; When we don't support non-extended DPMI all Int21 calls
  1495                              <1> 		; are either in Real Mode or extended (all are real Int21
  1496                              <1> 		; instructions).
  1497                              <1> %macro doscall 0
  1498                              <1> 	int 21h
  1499                              <1> %endmacro
  1500                              <1> %endif
  1501                              <1> 
  1502                              <1> 
  1503                              <1> %if _LINK
  1504                              <1> %imacro wlcalc 1-2.nolist
  1505                              <1> %deftok %%filenametoken __FILE__
  1506                              <1>  global wlcalc_%1?%[%%l]%[%%filenametoken]
  1507                              <1> wlcalc_%1?%[%%l]%[%%filenametoken]: %2
  1508                              <1> %endmacro
  1509                              <1> %endif
  1510                              <1> 
  1511                              <1> %if _BOOTLDR && _LINK
  1512                              <1> %macro lot_equate 2.nolist
  1513                              <1> LOAD_%2 equ %1
  1514                              <1> %endmacro
  1515                              <1> 
  1516                              <1> 	lot_equate    1, SET_DL_UNIT
  1517                              <1> 	lot_equate    2, SET_BL_UNIT
  1518                              <1> 	lot_equate    4, SET_SIDI_CLUSTER
  1519                              <1> 	lot_equate  10h, SET_DSSI_DPT
  1520                              <1> 	lot_equate  20h, PUSH_DPT
  1521                              <1> 	lot_equate  40h, DATASTART_HIDDEN
  1522                              <1> 	lot_equate  80h, SET_AXBX_DATASTART
  1523                              <1> 	lot_equate 100h, SET_DSBP_BPB
  1524                              <1> 	lot_equate 200h, LBA_SET_TYPE
  1525                              <1> 	lot_equate 400h, MESSAGE_TABLE
  1526                              <1> 	lot_equate 800h, SET_AXBX_ROOT_HIDDEN
  1527                              <1> 	lot_equate 1000h, CMDLINE
  1528                              <1> 	lot_equate 2000h, NO_BPB
  1529                              <1> 	lot_equate 4000h, SET_DSSI_PARTINFO
  1530                              <1> %endif
  1531                              <1> 
  1532                              <1> %if _HELP_COMPRESSED
  1533                              <1>  %assign NONCOMPRESSEDFLAG 1
  1534                              <1> %else
  1535                              <1>  %assign NONCOMPRESSEDFLAG 0
  1536                              <1> %endif
  1537                              <1> 
  1538                              <1> [list +]
  1539                              <1> 
  1540                              <1> %if _LINK
  1541                              <1>  %if _ONLY386
  1542                              <1> 	cpu 386
  1543                              <1>  %else
  1544                              <1> 	cpu 8086
  1545                              <1>  %endif
  1546                              <1> 
  1547                              <1> auxbuff_size: equ (_AUXBUFFSIZE+15) & ~15
  1548                              <1> 	endarea auxbuff, 1
  1549                              <1> 
  1550                              <1> auxbuff_max_size: equ (_AUXBUFFMAXSIZE+15) & ~15
  1551                              <1> 	endarea auxbuff_max, 1
  1552                              <1> 
  1553                              <1> %if _INIT_MAX
  1554                              <1>  auxbuff_init_size: equ (_AUXBUFFMAXSIZE+15) & ~15
  1555                              <1> %else
  1556                              <1>  auxbuff_init_size: equ (_AUXBUFFSIZE+15) & ~15
  1557                              <1> %endif
  1558                              <1> 	endarea auxbuff_init, 1
  1559                              <1> 
  1560                              <1>  %include "options.mac"
     1                              <2> 
     2                              <2> %if 0
     3                              <2> 
     4                              <2> lDebug options and internal flags
     5                              <2> 
     6                              <2> Copyright (C) 2008-2025 E. C. Masloch
     7                              <2> 
     8                              <2> Usage of the works is permitted provided that this
     9                              <2> instrument is retained with the works, so that any entity
    10                              <2> that uses the works is notified of this instrument.
    11                              <2> 
    12                              <2> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    13                              <2> 
    14                              <2> %endif
    15                              <2> 
    16                              <2> 
    17                              <2> dispregs32	equ	  1	; RX: 32-bit register display (R, T/P/G)
    18                              <2> traceints	equ	  2	; TM: trace into interrupts (T)
    19                              <2> cpdepchars	equ	  4	; allow dumping of CP-dependent characters (D, DX)
    20                              <2> fakeindos	equ	  8	; always assume InDOS flag non-zero (all)
    21                              <2> nonpagingdevice	equ	 10h	; disallow paged output with [more] prompt (all exc. P, T)
    22                              <2> 	; This option was never used anywhere:
    23                              <2> ; pagingdevice	equ	 20h	; allow paged output with [more] prompt (all exc. P, T)
    24                              <2> 				; paged output is by default on if the output device is StdOut, else off
    25                              <2> hexrn		equ	 40h	; display raw hexadecimal content of FPU registers (RN)
    26                              <2> ;novdd		equ	 80h	; don't use a registered NTVDM VDD (L, W)
    27                              <2> nondospaging	equ	100h	; paging: don't use DOS for input when waiting for a key
    28                              <2> opt1_86mnohlt	equ	200h	; (86 Mode:) HLT doesn't work, don't use it
    29                              <2> biosidles	equ	400h	; don't idle with HLT or Int2F.1680, only call BIOS Int16.00
    30                              <2> opt_usegetinput	equ	800h	; use getinput for int 21h interactive input
    31                              <2> use_si_units	equ    1000h	; in disp_*_size use SI units (kB = 1000, etc)
    32                              <2> use_jedec_units	equ    2000h	; in disp_*_size use JEDEC units (kB = 1024)
    33                              <2> enable_serial	equ    4000h	; enable serial I/O (preferred over DOS or BIOS terminal)
    34                              <2> int8_disable_serial equ	   8000h	; disable serial I/O when breaking due to intr8
    35                              <2> gg_do_not_skip_bp equ	 1_0000h	; gg: do not skip a breakpoint (bb or gg)
    36                              <2> gg_no_autorepeat equ	 2_0000h	; gg: do not auto-repeat
    37                              <2> tp_do_not_skip_bp equ	 4_0000h	; T/TP/P: do not skip a (bb) breakpoint
    38                              <2> gg_bb_hit_no_repeat equ	 8_0000h	; gg: do not auto-repeat after bb hit
    39                              <2> tp_bb_hit_no_repeat equ	10_0000h	; T/TP/P: do not auto-repeat after bb hit
    40                              <2> gg_unexpected_no_repeat equ 20_0000h	; gg: do not auto-repeat after unexpectedinterrupt
    41                              <2> tp_unexpected_no_repeat equ 40_0000h	; T/TP/P
    42                              <2> ss_no_dump:		equ 80_0000h
    43                              <2> %if _SYMBOLIC
    44                              <2> dd_no_blanks_sym:	equ 100_0000h
    45                              <2> zz_no_pm_xms:		equ 200_0000h
    46                              <2> %endif
    47                              <2> rr_disasm_no_rept:	equ 1000_0000h
    48                              <2> rr_disasm_no_show:	equ 2000_0000h
    49                              <2> opt_cmdline_quiet_input:equ 4000_0000h
    50                              <2> opt_cmdline_quiet_output:equ 8000_0000h
    51                              <2> %if _SYMBOLIC
    52                              <2> DEFAULTOPTIONS	equ zz_no_pm_xms
    53                              <2> %else
    54                              <2> DEFAULTOPTIONS	equ 0
    55                              <2> %endif
    56                              <2> 
    57                              <2> 
    58                              <2> opt2_db_header:		equ 1
    59                              <2> opt2_db_trailer:	equ 2
    60                              <2> opt2_dw_header:		equ 10h
    61                              <2> opt2_dw_trailer:	equ 20h
    62                              <2> opt2_dd_header:		equ 100h
    63                              <2> opt2_dd_trailer:	equ 200h
    64                              <2> opt2_getinput_dpmi:	equ 800h
    65                              <2> opt2_hh_compat:		equ 1000h
    66                              <2> opt2_getc_idle:		equ 2000h
    67                              <2> opt2_getc_idle_dpmi:	equ 4000h
    68                              <2> opt2_re_cancel_tpg:	equ 8000h
    69                              <2> opt2_nn_compat:		equ 1_0000h
    70                              <2> opt2_nn_capitalise:	equ 2_0000h
    71                              <2> %if _MS_0RANGE_COMPAT
    72                              <2> opt2_0range_compat:	equ 4_0000h
    73                              <2> %endif
    74                              <2> opt2_rr16_compat:	equ 8_0000h
    75                              <2> opt2_r_prompt_compat:	equ 10_0000h
    76                              <2> opt2_r_separate:	equ 20_0000h
    77                              <2> opt2_r_linebreak_always:equ 40_0000h
    78                              <2> opt2_dpminohlt:		equ 8000_0000h	; DPMI doesn't like hlt
    79                              <2> DEFAULTOPTIONS2	equ opt2_dw_header | opt2_dd_header | opt2_getc_idle_dpmi | opt2_dpminohlt
    80                              <2> 
    81                              <2> 
    82                              <2> opt3_tt_no_paging:	equ 1
    83                              <2> opt3_tp_no_paging:	equ 2
    84                              <2> opt3_pp_no_paging:	equ 4
    85                              <2> opt3_gg_no_paging:	equ 8
    86                              <2> opt3_silence_paging_set:equ 100h
    87                              <2> opt3_silence_paging_on:	equ 200h
    88                              <2> opt3_paging_rc:		equ 1000h
    89                              <2> opt3_paging_yy:		equ 2000h
    90                              <2> opt3_paging_re:		equ 4000h
    91                              <2> opt3_r_highlight_diff:	equ 10000h
    92                              <2> opt3_r_highlight_dumb:	equ 20000h
    93                              <2> opt3_r_highlight_full:	equ 40000h
    94                              <2> opt3_r_highlight_eip:	equ 80000h
    95                              <2> %if _PM
    96                              <2> opt3_ss_b_bit_set:	equ   10_0000h
    97                              <2>  %if _BREAK_INSTALLDPMI
    98                              <2> opt3_break_installdpmi:	equ   20_0000h
    99                              <2>  %endif
   100                              <2> %endif
   101                              <2> %if _DHIGHLIGHT
   102                              <2> opt3_d_highlight:	equ   80_0000h
   103                              <2> %endif
   104                              <2> %if _GETLINEHIGHLIGHT
   105                              <2> opt3_getline_highlight:	equ  100_0000h
   106                              <2> %endif
   107                              <2> opt3_no_idle_2F:	equ  200_0000h
   108                              <2> %if _DELAY_BEFORE_BP
   109                              <2> opt3_delay_before_bp:	equ  400_0000h
   110                              <2> %endif
   111                              <2> opt3_no_call_amis:	equ  800_0000h
   112                              <2> opt3_disable_autorepeat:equ 1000_0000h
   113                              <2> opt3_check_ctrlc_keyb:	equ 2000_0000h
   114                              <2> opt3_check_ctrlc_0bh:	equ 4000_0000h
   115                              <2> opt3_tsr_quit_leave_tf:	equ 8000_0000h
   116                              <2> DEFAULTOPTIONS3	equ opt3_tt_no_paging | opt3_tp_no_paging 		| opt3_pp_no_paging | opt3_gg_no_paging 		| opt3_check_ctrlc_keyb | opt3_check_ctrlc_0bh
   119                              <2> 
   120                              <2> 
   121                              <2> opt4_int_2F_hook:	equ 2
   122                              <2> opt4_int_08_hook:	equ 4
   123                              <2> opt4_int_2D_hook:	equ 8
   124                              <2> %if _CATCHINTFAULTCOND
   125                              <2> opt4_int_fault_hook:	equ 10h
   126                              <2> %endif
   127                              <2> opt4_int_serial_force:	equ 1_0000h
   128                              <2> opt4_int_2F_force:	equ 2_0000h
   129                              <2> opt4_int_08_force:	equ 4_0000h
   130                              <2> opt4_int_2D_force:	equ 8_0000h
   131                              <2> %if _CATCHINT0D
   132                              <2> opt4_int_0D_force:	equ   10_0000h
   133                              <2> %endif
   134                              <2> %if _CATCHINT0C
   135                              <2> opt4_int_0C_force:	equ   20_0000h
   136                              <2> %endif
   137                              <2> opt4_int_00_force:	equ  100_0000h
   138                              <2> opt4_int_01_force:	equ  200_0000h
   139                              <2> opt4_int_03_force:	equ  400_0000h
   140                              <2> opt4_int_06_force:	equ  800_0000h
   141                              <2> opt4_int_18_force:	equ 1000_0000h
   142                              <2> opt4_int_19_force:	equ 2000_0000h
   143                              <2> opt4_int_09_force:	equ 4000_0000h	; not used at the same time as 15h
   144                              <2> opt4_int_15_force:	equ 4000_0000h	; not used at the same time as 09h
   145                              <2> opt4_int_07_force:	equ 8000_0000h
   146                              <2> DEFAULTOPTIONS4 equ opt4_int_2F_hook
   147                              <2> 
   148                              <2> 
   149                              <2> %if _VXCHG
   150                              <2> opt6_vv_mode:		equ 1
   151                              <2> opt6_vv_keep:		equ 2
   152                              <2> opt6_vv_int16:		equ 10h
   153                              <2>  %if _VXCHG_DEFAULT_ON
   154                              <2> DEFAULTOPTIONS6 equ opt6_share_serial_irq | opt6_vv_mode
   155                              <2>  %else
   156                              <2> DEFAULTOPTIONS6 equ opt6_share_serial_irq
   157                              <2>  %endif
   158                              <2> %else
   159                              <2> DEFAULTOPTIONS6 equ opt6_share_serial_irq
   160                              <2> %endif
   161                              <2> %if _DEBUG
   162                              <2> opt6_debug_exception_late:	equ  20h
   163                              <2> opt6_debug_exception_early:	equ  40h
   164                              <2>  %if _DEBUG_COND
   165                              <2> opt6_debug_exception:	equ  80h
   166                              <2> opt6_debug_mode:	equ 100h
   167                              <2>  %endif
   168                              <2> %endif
   169                              <2> opt6_bios_output:	equ 200h
   170                              <2> opt6_flat_binary:	equ 400h
   171                              <2> opt6_big_stack:		equ 800h
   172                              <2> opt6_40_columns:	equ 1000h
   173                              <2> opt6_40_indent_odd:	equ 2000h
   174                              <2> opt6_40_dash:		equ 4000h
   175                              <2> opt6_share_serial_irq:	equ 1_0000h
   176                              <2> opt6_serial_EOI_call:	equ 2_0000h
   177                              <2> %if _RH
   178                              <2> opt6_rh_mode:		equ 10_0000h
   179                              <2> %endif
   180                              <2> %if _DEBUG
   181                              <2> opt6_debug_putrunint_early:	equ  40_0000h
   182                              <2>  %if _DEBUG_COND
   183                              <2> opt6_debug_putrunint:		equ  80_0000h
   184                              <2>  %endif
   185                              <2> %endif
   186                              <2> opt6_bios_io:		equ 100_0000h
   187                              <2> opt6_immasm_display_uu:	equ 200_0000h
   188                              <2> opt6_immasm_debug:	equ 400_0000h
   189                              <2> opt6_immasm_flag:	equ 800_0000h
   190                              <2> opt6_immasm_nobranch:	equ 1000_0000h
   191                              <2> opt6_r_flags_style2:	equ 2000_0000h
   192                              <2> opt6_r_flags_style3:	equ 4000_0000h
   193                              <2> opt6_r_linebreak_conditional:	equ 8000_0000h
   194                              <2> 
   195                              <2> 
   196                              <2> DEFAULTOPTIONS7 equ opt7_no_tsr_ll
   197                              <2> opt7_no_free_oneshot_eld:	equ 1
   198                              <2> opt7_debug_optional_link:	equ 2
   199                              <2> opt7_quiet_install:		equ 4
   200                              <2> opt7_quick_run:			equ 8
   201                              <2> opt7_houdini:			equ 100h
   202                              <2> opt7_debug_run:			equ 200h
   203                              <2> opt7_no_ensure:			equ 1000h
   204                              <2> opt7_no_tsr_ll:			equ 2000h
   205                              <2> 
   206                              <2> 
   207                              <2> oldpacket	equ	  1	; Int25/Int26 packet method available (L, W)
   208                              <2> newpacket	equ	  2	; Int21.7305 packet method available (L, W)
   209                              <2> ntpacket	equ	  4	; VDD registered and usable (L, W)
   210                              <2> pagedcommand	equ	  8	; allows paging in puts
   211                              <2> notstdinput	equ	 10h	; DEBUG's StdIn isn't a device with StdIn bit (is file or other device)
   212                              <2> inputfile	equ	 20h	; DEBUG's StdIn is a file, notstdinput also set
   213                              <2> notstdoutput	equ	 40h	; DEBUG's StdOut isn't a device with StdOut bit (is file or other device)
   214                              <2> outputfile	equ	  80h	; DEBUG's StdOut is a file, notstdoutput also set
   215                              <2> hooked2F	equ	 100h	; Int2F hooked
   216                              <2> nohook2F	equ	 200h	; don't hook Int2F.1687 (required for Win9x, DosEmu?)
   217                              <2> unused_dif1_dpminohlt equ 400h	; DPMI doesn't like hlt
   218                              <2> protectedmode	equ	 800h	; in (DPMI) protected mode
   219                              <2> debuggeeA20	equ	1000h	; state of debuggee's A20
   220                              <2> debuggerA20	equ	2000h	; state of debugger's A20 (will be on if possible)
   221                              <2> nodosloaded	equ	4000h	; No DOS loaded currently (Boot loader mode)
   222                              <2> has386		equ	8000h	; CPU is a 386
   223                              <2> usecharcounter	equ    1_0000h	; don't reset charcounter between calls to puts
   224                              <2> runningnt	equ    2_0000h	; running in NTVDM
   225                              <2> canswitchmode	equ    4_0000h	; can switch modes (auxbuff large enough, DPMI mode switch set up)
   226                              <2> modeswitched	equ    8_0000h	; switched mode (now in the mode that we weren't entered in)
   227                              <2> promptwaiting	equ   10_0000h	; puts: any more output needs to display a prompt first
   228                              <2> switchbuffer	equ   20_0000h	; mode switch needs a buffer (auxbuff)
   229                              <2> tsrmode		equ   40_0000h	; in TSR mode; DPI and DPP not valid
   230                              <2> attachedterm	equ   80_0000h	; the attached process terminated
   231                              <2> runningdosemu	equ  100_0000h	; running in dosemu
   232                              <2> ; load_is_ldp	equ  200_0000h	; boot load: partition specified as "ldp"
   233                              <2> tt_while:	equ  400_0000h	; tt: while condition specified
   234                              <2> tt_p:		equ  800_0000h	; tt: proceed past repeated string instructions
   235                              <2> tt_silent_mode:	equ 1000_0000h	; tt: run should be silent (dump at end)
   236                              <2> tt_silence:	equ 2000_0000h	; tt: silent writing (write to auxbuff instead)
   237                              <2> tt_no_bb:	equ 4000_0000h	; tt: do not use bb breakpoints
   238                              <2> tt_no_bb_first:	equ 8000_0000h	; tt: do not use bb breakpoints at first
   239                              <2> 
   240                              <2> 
   241                              <2> dif2_gg_is_first:	equ   1
   242                              <2> dif2_gg_skip_non_cseip:	equ   2
   243                              <2> dif2_gg_skip_cseip:	equ   4
   244                              <2> dif2_gg_is_gg:		equ   8
   245                              <2> dif2_gg_first_detected:	equ  10h
   246                              <2> dif2_gg_again:		equ  20h
   247                              <2> dif2_tpg_proceed_bp_set:equ  40h
   248                              <2> dif2_tpg_keep_proceed_bp: equ 80h
   249                              <2> dif2_tpg_have_bp:	equ 100h
   250                              <2> dif2_tpg_adjusted_cseip:equ 200h
   251                              <2> dif2_tpg_do_not_adjust:	equ 400h
   252                              <2> dif2_bp_failure:	equ 800h
   253                              <2> dif2_is_pp:		equ 1000h
   254                              <2> %if _SYMBOLIC
   255                              <2> dif2_createdprocess:	equ 800_0000h	; created empty debuggee process
   256                              <2> dif2_sym_req_xms:	equ 2000h
   257                              <2> dif2_sym_req_86mm:	equ 4000h
   258                              <2> dif2_sym_req_mask equ dif2_sym_req_86mm | dif2_sym_req_xms
   259                              <2> dif2_no_pm_xms:		equ 1_0000h
   260                              <2> dif2_xms_detection_done:equ 2_0000h
   261                              <2> %endif
   262                              <2> %if _INPUT_FILE_HANDLES
   263                              <2> dif2_input_file:	equ 10_0000h
   264                              <2> dif2_closed_input_file:	equ 20_0000h
   265                              <2> %endif
   266                              <2> dif2_did_getline_file:	equ 40_0000h
   267                              <2> %if _SYMBOLIC
   268                              <2> dif2_poison:		equ 80_0000h
   269                              <2> %endif
   270                              <2> dif2_boot_loaded_kernel:equ 100_0000h
   271                              <2> %if _INPUT_FILE_BOOT
   272                              <2> dif2_input_file_boot:	equ 200_0000h
   273                              <2> dif2_closed_input_file_boot:	equ 400_0000h
   274                              <2> %endif
   275                              <2> dif2_in_silence_dump:	equ 1000_0000h
   276                              <2> dif2_int31_segment:	equ 2000_0000h
   277                              <2> dif2_nn_compat:		equ 4000_0000h
   278                              <2> dif2_nn_capitalise:	equ 8000_0000h
   279                              <2> 
   280                              <2> 
   281                              <2> dif3_load_is_ldp:	equ 1	; boot load: partition specified as "ldp"
   282                              <2> dif3_load_is_sdp:	equ 2	; boot load: partition specified as "sdp"
   283                              <2> dif3_load_is_ydp:	equ 4	; boot load: partition specified as "ydp"
   284                              <2> dif3_load_is_dp:	equ dif3_load_is_ldp 				| dif3_load_is_sdp 				| dif3_load_is_ydp
   287                              <2> dif3_load_dir_dir:	equ 8
   288                              <2> dif3_input_terminal_override:	equ 10h
   289                              <2> dif3_input_serial_override:	equ 20h
   290                              <2> dif3_if_not:		equ 40h
   291                              <2> dif3_partition_changed:	equ 80h
   292                              <2> ;
   293                              <2> dif3_input_cmdline:	equ 100h; input reading from cmdline_buffer
   294                              <2> dif3_input_cmdline_closed: equ 200h
   295                              <2> dif3_at_line_end:	equ 400h
   296                              <2> dif3_quiet_input_single:equ 800h
   297                              <2> dif3_quiet_output:	equ 1000h
   298                              <2> dif3_unquiet_error:	equ 2000h
   299                              <2> dif3_unquiet_prompt:	equ 4000h
   300                              <2> dif3_unquiet:		equ dif3_unquiet_error | dif3_unquiet_prompt
   301                              <2> dif3_return_eof:	equ 8000h
   302                              <2> dif3_highlighting:	equ 1_0000h
   303                              <2> dif3_do_not_highlight:	equ 2_0000h
   304                              <2> dif3_int10_highlight:	equ 2_0000h
   305                              <2> dif3_nosymbols_1:	equ 4_0000h
   306                              <2> dif3_nosymbols_2:	equ 8_0000h
   307                              <2> %if _PM
   308                              <2> dif3_ss_b_bit_set:	equ  10_0000h
   309                              <2> %endif
   310                              <2> dif3_gotint19:		equ  20_0000h
   311                              <2> dif3_prior_pm:		equ  40_0000h
   312                              <2> %if _DELAY_BEFORE_BP
   313                              <2> dif3_delayed		equ  80_0000h
   314                              <2> %endif
   315                              <2> dif3_input_re:		equ 100_0000h	; input reading from re_buffer
   316                              <2> dif3_input_re_closed:	equ 200_0000h
   317                              <2> dif3_accept_getrange_0:	equ 400_0000h
   318                              <2> %if _INPUT_FILE_HANDLES || _INPUT_FILE_BOOT
   319                              <2> dif3_in_if:		equ 800_0000h
   320                              <2> %endif
   321                              <2> dif3_auxbuff_guarded_1:	equ 1000_0000h
   322                              <2> dif3_auxbuff_guarded_2:	equ 2000_0000h
   323                              <2> dif3_auxbuff_guarded_3:	equ 4000_0000h
   324                              <2> dif3_sss_is_reverse:	equ 8000_0000h
   325                              <2> 
   326                              <2> 
   327                              <2> dif4_int_serial_hooked:	equ 1
   328                              <2> dif4_int_2F_hooked:	equ 2
   329                              <2> dif4_int_08_hooked:	equ 4
   330                              <2> dif4_int_2D_hooked:	equ 8
   331                              <2> %if _CATCHINTFAULTCOND && _CATCHINT0D
   332                              <2> dif4_int_0D_hooked:	equ 10h
   333                              <2> %endif
   334                              <2> %if _CATCHINTFAULTCOND && _CATCHINT0C
   335                              <2> dif4_int_0C_hooked:	equ 20h
   336                              <2> %endif
   337                              <2> %if _LOADER
   338                              <2> dif4_int_18_hooked:	equ 1000h
   339                              <2> dif4_int_19_hooked:	equ 2000h
   340                              <2> %endif
   341                              <2> 
   342                              <2> 
   343                              <2> %if _VXCHG
   344                              <2> dif6_vv_mode:		equ 1
   345                              <2> %endif
   346                              <2> dif6_in_hook2F:		equ 2
   347                              <2> dif6_in_amis_hook2F:	equ 4
   348                              <2> dif6_debug_mode:	equ 100h
   349                              <2> dif6_locked:		equ 200h
   350                              <2> dif6_mcp:		equ 400h
   351                              <2> %if _RH
   352                              <2> dif6_rh_mode_was:	equ  8_0000h
   353                              <2> dif6_rh_mode:		equ 10_0000h
   354                              <2> dif6_rh_mode_2:		equ 20_0000h
   355                              <2> %endif
   356                              <2> dif6_device_mode:	equ 40_0000h
   357                              <2> dif6_cpdepchars:	equ 80_0000h
   358                              <2> %if _IMMASM
   359                              <2> dif6_immasm_no_output:	equ 100_0000h
   360                              <2> dif6_immasm:		equ 200_0000h
   361                              <2> dif6_immasm_rel8:	equ 400_0000h
   362                              <2> %endif
   363                              <2> 
   364                              <2> 
   365                              <2> disasm_lowercase	equ 1
   366                              <2> disasm_commablank	equ 2
   367                              <2> disasm_nasm		equ 4
   368                              <2> disasm_lowercase_refmem:equ 8
   369                              <2> disasm_show_short:	equ 10h
   370                              <2> disasm_show_near:	equ 20h
   371                              <2> disasm_show_far:	equ 40h
   372                              <2> disasm_nec:		equ 80h
   373                              <2> disasm_40_columns:	equ 100h
   374                              <2> disasm_no_indent:	equ 200h
   375                              <2> disasm_msdebug_mnemonofs: equ 400h
   376                              <2> disasm_a16_memref:	equ 1000h
   377                              <2> disasm_a32_memref:	equ 2000h
   378                              <2> disasm_a16_string:	equ 4000h
   379                              <2> disasm_a32_string:	equ 8000h
   380                              <2> disasm_hide_modrm:	equ 10000h
   381                              <2> disasm_asize_loop_nasm:	equ 20000h
   382                              <2> disasm_modrm_always:	equ 40000h
   383                              <2> DEFAULTASMOPTIONS equ disasm_lowercase|disasm_commablank|disasm_nasm 	| disasm_a16_memref | disasm_a32_memref 	| disasm_a16_string | disasm_a32_string
   386                              <2> 
   387                              <2> 	; serial_flags values
   388                              <2> sf_init_done:	equ 1
   389                              <2> sf_ctrl_c:	equ 2
   390                              <2> sf_double_ctrl_c:	equ 4
   391                              <2> sf_built_in_fifo:	equ 8
   392                              <2> sf_use_serial:		equ 10h
  1561                              <1> %endif
    20                                  %endif
    21                                  
    22                                  %if _LINK_COMPAT
    23                                  	usesection lDEBUG_DATA_ENTRY
    23          ------------------       note: usesection lDEBUG_DATA_ENTRY
    24                                  	align 4, db 0
    25                                  %endif
    26                                  
    27                                  %if _DHIGHLIGHT
    28                                  	usesection lDEBUG_DATA_ENTRY
    29                                  
    30                                  	align 2, db 0
    31                                  dd_h_number:	dw 0
    32                                  dd_h_text:	dw 0
    33                                  %endif
    34                                  
    35                                  %if _DNUM
    36                                  	usesection lDEBUG_DATA_ENTRY
    36          ------------------       note: usesection lDEBUG_DATA_ENTRY
    37                                  	align 4, db 0
    38 00000000 0000                    ddoffset:	dw 0		; offset word for dd
    39                                  				;  (number of skipped bytes at start of line)
    40                                   %if _PM
    41 00000002 0000                    		dw 0		; high word initialised to and fixed at zero
    42                                   %endif
    43 00000004 0000                    ddskipped:	dw 0
    44                                   %if _PM
    45 00000006 0000                    		dw 0		; high word initialised to and fixed at zero
    46                                   %endif
    47 00000008 0100                    ddsize:		dw 1		; size of dd item
    48 0000000A 00                      ddoffset2:	db 0
    49                                  %endif
    50                                  
    51                                  	usesection lDEBUG_DATA_ENTRY
    51          ------------------       note: usesection lDEBUG_DATA_ENTRY
    52 0000000B FF                      dd_text_and:	db 0FFh
    53                                  
    54                                  
    55                                  	usesection lDEBUG_CODE
    55          ------------------       note: usesection lDEBUG_CODE
    56                                  
    57                                  ..@dd_access_start:
    58                                  
    59                                  		; D command - hex/ASCII dump.
    60                                  ddd:
    61                                  %if _DTOP
    62 00000000 8026[0200]7F            	clropt [internalflags6], dif6_cpdepchars
    63                                  %endif
    64                                  %if _INT || _PM || _MCB || _DSTRINGS || 1
    65 00000005 E8(0000)                	call capitalise
    66                                  %endif
    67 00000008 86C4                    	xchg al, ah
    68 0000000A 8A44FE                  	mov al, byte [si - 2]
    69 0000000D E8(0000)                	call capitalise
    70 00000010 3C44                    	cmp al, 'D'
    71 00000012 86C4                    	xchg al, ah
    72 00000014 7403E9AC00              	jne .not_d_suffix
    73                                  %if _DSTRINGS
    74 00000019 3C5A                    	cmp al, 'Z'		; DZ command ?
    75 0000001B 7503E99B06              	je dz			; yes -->
    76 00000020 3C24                    	cmp al, '$'		; D$ command ?
    77 00000022 7503E96D06              	je dcpm			; yes -->
    78 00000027 3C23                    	cmp al, '#'		; D# command ?
    79 00000029 7503E98006              	je dcounted		; yes -->
    80 0000002E 3C57                    	cmp al, 'W'
    81 00000030 750B                    	jne .notstring
    82 00000032 50                      	push ax
    83 00000033 AC                      	lodsb
    84 00000034 3C23                    	cmp al, '#'		; DW# command ?
    85 00000036 58                      	pop ax
    86 00000037 7503E96506              	je dwcounted		; yes -->
    87 0000003C 4E                      	dec si
    88                                  .notstring:
    89                                  %endif
    90                                  %if _INT
    91 0000003D 3C49                    	cmp al, 'I'		; DI command ?
    92 0000003F 750D                    	jne .notdi
    93                                  %if 1
    94 00000041 50                      	push ax
    95 00000042 AC                      	lodsb
    96 00000043 4E                      	dec si
    97 00000044 24DF                    	and al, TOUPPER
    98 00000046 3C50                    	cmp al, 'P'		; distinguish 'di ...' and 'd ip'
    99 00000048 58                      	pop ax
   100 00000049 7403                    	je .notdi
   101                                  %endif
   102 0000004B E93107                  	jmp gateout		; yes -->
   103                                  .notdi:
   104                                  %endif
   105                                  %if _PM
   106 0000004E 3C4C                    	cmp al, 'L'		; DL command ?
   107 00000050 7503                    	jne .notdl
   108 00000052 E98605                  	jmp descout		; yes -->
   109                                  .notdl:
   110                                  %endif
   111                                  %if _DX
   112                                  	cmp al, 'X'		; DX command ?
   113                                  _386	je extmem		; yes -->
   114                                  .notdx:
   115                                  %endif
   116                                  %if _PM
   117 00000055 3C2E                    	cmp al, '.'
   118 00000057 7503E94505              	je descsubcommand
   119                                  %endif
   120                                  %if _MCB
   121 0000005C 3C4D                    	cmp al, 'M'		; DM command ?
   122 0000005E 7503                    	jne .notdm
   123 00000060 E9680D                  	jmp mcbout		; yes -->
   124                                  .notdm:
   125                                  %endif
   126                                  %if _DT
   127 00000063 3C54                    	cmp al, 'T'
   128 00000065 7508                    	jne @F
   129                                   %if _DTOP
   130 00000067 E84300                  	call .handletop0
   131 0000006A 745C                    	je .d_top
   132                                   %endif
   133 0000006C E9830F                  	jmp dumptable
   134                                  @@:
   135                                  %endif
   136                                  %if _DNUM
   137                                   %if _DQ
   138                                  	mov cx, 8
   139                                  	cmp al, 'Q'
   140                                  	je .d_suffix_size
   141                                  	mov cl, 1
   142                                   %else
   143 0000006F B90100                  	mov cx, 1
   144                                   %endif
   145 00000072 3C42                    	cmp al, 'B'
   146 00000074 7428                    	je .d_suffix_size
   147 00000076 41                      	inc cx			; = 2
   148 00000077 3C57                    	cmp al, 'W'
   149 00000079 7423                    	je .d_suffix_size
   150 0000007B 41                      	inc cx
   151 0000007C 41                      	inc cx			; = 4
   152 0000007D 3C44                    	cmp al, 'D'
   153 0000007F 7544                    	jne .not_d_suffix
   154                                  %if 1
   155 00000081 50                      	push ax
   156 00000082 56                      	push si
   157 00000083 AC                      	lodsb
   158 00000084 24DF                    	and al, TOUPPER
   159 00000086 3C49                    	cmp al, 'I'		; possibly "D DI" ?
   160 00000088 7408                    	je .check_dd_separator
   161 0000008A 3C58                    	cmp al, 'X'		; possibly "D DX" ?
   162 0000008C 7404                    	je .check_dd_separator
   163 0000008E 3C53                    	cmp al, 'S'		; possibly "D DS" ?
   164 00000090 7508                    	jne .check_dd_no_if_ZR	; no, --> NZ
   165                                  .check_dd_separator:
   166 00000092 AC                      	lodsb			; load next text
   167 00000093 E8(0000)EB02[0000]      	nearcall isseparator?	; if a separator then cannot be valid "DD"
   168                                  .check_dd_no_if_ZR:
   169 0000009A 5E                      	pop si
   170 0000009B 58                      	pop ax
   171 0000009C 7427                    	je .not_d_suffix
   172                                  %endif
   173                                  .d_suffix_size:
   174 0000009E 880E[0800]              	mov byte [ddsize], cl
   175                                  %if _DTOP
   176 000000A2 E80700                  	call .handletop
   177                                  %else
   178                                  	call skipwhite
   179                                  %endif
   180 000000A5 E8(0000)                	call iseol?
   181 000000A8 7571                    	jne dd1			; jump to getting range --> (with new size)
   182 000000AA EB21                    	jmp lastddd		; default range (ADS:ADO length 128),
   183                                  				;  but with new size -->
   184                                  %endif
   185                                  
   186                                  %if _DTOP
   187                                  .handletop:
   188 000000AC AC                      	lodsb
   189                                  .handletop0:
   190 000000AD E8(0000)                	call skipcomm0
   191 000000B0 4E                      	dec si
   192 000000B1 BA[0000]                	mov dx, msg.top
   193 000000B4 E8(0000)                	call isstring?
   194 000000B7 AC                      	lodsb
   195 000000B8 750A                    	jne @F			; --> NZ
   196 000000BA E8(0000)                	call skipcomm0
   197 000000BD 800E[0200]80            	setopt [internalflags6], dif6_cpdepchars
   198                                   %if _DT
   199 000000C2 38C0                    	cmp al, al		; ZR
   200                                   %endif
   201                                  @@:
   202 000000C4 C3                      	retn
   203                                  %endif
   204                                  
   205                                  .not_d_suffix:
   206                                  %if _DTOP
   207 000000C5 E8E5FF                  	call .handletop0
   208                                  %else
   209                                  	call skipwh0
   210                                  %endif
   211                                  .d_top:
   212 000000C8 E8(0000)                	call iseol?
   213                                  %if _DNUM
   214 000000CB 7549                    	jne dd1_bytes		; if an address was given --> (set byte size)
   215                                  %else
   216                                  	jne dd1
   217                                  %endif
   218                                  
   219                                  lastddd:
   220 000000CD 6631C0                  _386_PM	xor eax, eax
   221 000000D0 A1[0000]                	mov ax, word [dd_default_lines]
   222                                  				; default length in lines, if nonzero
   223 000000D3 85C0                    	test ax, ax
   224 000000D5 7409                    	jz @F
   225 000000D7 782F                    	js short .error
   226 000000D9 A3[0000]                	mov word [getrange_lines], ax
   227 000000DC 31C0                    	xor ax, ax
   228 000000DE EB0E                    	jmp @FF
   229                                  
   230                                  @@:
   231 000000E0 C706[0000]0080          	mov word [getrange_lines], 8000h
   232 000000E6 A1[0000]                	mov ax, word [dd_default_length]
   233 000000E9 85C0                    	test ax, ax
   234 000000EB 741B                    	jz short .error
   235 000000ED 48                      	dec ax
   236                                  @@:
   237                                  		; byte [ddsize] = size already set
   238 000000EE 66                      	_386_PM_o32	; mov edx, dword [d_addr]
   239 000000EF 8B16[0000]              	mov dx, word [d_addr]	; compute range of 80h or until end of segment
   240 000000F3 66                      	_386_PM_o32	; mov esi, edx
   241 000000F4 89D6                    	mov si, dx
   242 000000F6 8B1E[0400]              	mov bx, [d_addr + saSegSel]
   243 000000FA E8(0000)                _386_PM	call test_high_limit
   244 000000FD 750C                    _386_PM	jnz .32
   245 000000FF 01C2                    	add dx, ax
   246 00000101 734D                    	jnc dd2_0
   247 00000103 83CAFF                  	or dx, byte -1
   248 00000106 EB48                    	jmp short dd2_0
   249                                  
   250                                  .error:
   251 00000108 E9(0000)                	jmp error
   252                                  
   253                                  %if _PM
   254                                  [cpu 386]
   255                                  .32:
   256 0000010B 6601C2                  	add edx, eax
   257 0000010E 7340                    	jnc dd2_0		; if no overflow
   258 00000110 6683CAFF                	or edx, byte -1
   259 00000114 EB3A                    	jmp short dd2_0
   260                                  __CPU__
   261                                  %endif
   262                                  
   263                                  %if _DNUM
   264                                  dd1_bytes:
   265 00000116 C606[0800]01            	mov byte [ddsize], 1
   266                                  %endif
   267                                  dd1:
   268 0000011B 8B0E[0000]              	mov cx, word [dd_default_length]
   269                                  				; default length (128 bytes)
   270 0000011F 8B3E[0000]              	mov di, word [dd_default_lines]
   271                                  				; default length in lines, if nonzero
   272 00000123 8B1E[0000]              	mov bx, word [reg_ds]
   273 00000127 C706[0000]0080          	mov word [getrange_lines], 8000h
   274 0000012D E8(0000)EB02[0000]      	nearcall getrangeX.lines	; get address range into bx:(e)dx
   275                                  
   276 00000134 E8(0000)                	call chkeol		; expect end of line here
   277                                  
   278 00000137 891E[0400]              	mov word [d_addr + saSegSel], bx
   279                                  				; save segment (offset is saved later)
   280                                  %if _PM
   281 0000013B E8(0000)                	call ispm
   282 0000013E 7506                    	jnz .86m
   283                                  .pm:
   284 00000140 891E[0800]              	mov word [d_addr + saSelector], bx
   285 00000144 EB04                    	jmp @F
   286                                  .86m:
   287 00000146 891E[0600]              	mov word [d_addr + saSegment], bx
   288                                  @@:
   289                                  %endif
   290 0000014A 66                      	_386_PM_o32	; mov esi, edx
   291 0000014B 89D6                    	mov si, dx		; bx:(e)si = start
   292 0000014D 66                      	_386_PM_o32	; mov edx, ecx
   293 0000014E 89CA                    	mov dx, cx		; bx:(e)dx = last
   294                                  %if _PM && 0
   295                                  	jmp short dd2_1
   296                                  %endif
   297                                  
   298                                  		; Parsing is done.  Print first line.
   299                                  dd2_0:
   300                                  %if _PM
   301 00000150 E8(0000)                	call ispm
   302 00000153 750B                    	jnz dd2_1
   303                                  [cpu 286]
   304 00000155 0F00E3                  	verr bx			; readable ?
   305                                  __CPU__
   306 00000158 7406                    	jz dd2_1
   307                                  %if 1
   308 0000015A BA[0C00]                	mov dx, .errmsg
   309 0000015D E9(0000)                	jmp putsz_error
   310                                  	usesection lDEBUG_DATA_ENTRY
   310          ------------------       note: usesection lDEBUG_DATA_ENTRY
   311 0000000C 5365676D656E742069-     .errmsg:asciz "Segment is not readable.",13,10
   311 00000015 73206E6F7420726561-
   311 0000001E 6461626C652E0D0A00 
   312                                  	usesection lDEBUG_CODE
   312          ------------------       note: usesection lDEBUG_CODE
   313                                  %else
   314                                  	mov bx, word [reg_ds]
   315                                  	mov word [d_addr + saSegSel], bx
   316                                  %if _PM
   317                                  	call ispm
   318                                  	jnz .86m
   319                                  .pm:
   320                                  	mov word [d_addr + saSelector], bx
   321                                  	jmp @F
   322                                  .86m:
   323                                  	mov word [d_addr + saSegment], bx
   324                                  @@:
   325                                  %endif
   326                                  %endif
   327                                  dd2_1:
   328                                  %endif
   329 00000160 F606[0100]80            	testopt [getrange_lines], 8000h
   330 00000165 7503                    	jnz .notlines
   331 00000167 E8E800                  	call dd_get_one_line_range
   332                                  
   333                                  .notlines:
   334                                  
   335                                  %if _DNUM
   336 0000016A A1[0800]                	mov ax, word [ddsize]
   337 0000016D 48                      	dec ax			; 0 = byte, 1 = word, 3 = dword
   338 0000016E 21F0                    	and ax, si		; how many bytes to skip at the beginning
   339 00000170 A2[0A00]                	mov byte [ddoffset2], al
   340                                  %endif
   341                                  
   342 00000173 B80100                  	mov ax, opt2_db_header
   343                                  %if _DNUM
   344 00000176 803E[0800]02            	cmp byte [ddsize], 2
   345 0000017B 7207                    	jb @F
   346 0000017D B010                    	mov al, opt2_dw_header
   347 0000017F 7403                    	je @F
   348 00000181 B80001                  	mov ax, opt2_dd_header
   349                                  	; fixme dq
   350                                  @@:
   351                                  %endif
   352 00000184 E82900                  	call dd_header_or_trailer
   353                                  
   354                                  
   355                                  dd_loop_line:
   356                                  %if _SYMBOLIC
   357                                  dd_with_sym:
   358                                  	lframe near
   359                                  	lvar dword,	startlinear
   360                                  	lvar dword,	endlinear
   361                                  	lvar word,	sym_index
   362                                  	lvar word,	sym_count
   363                                  	lenter
   364                                  	xor ax, ax
   365                                  	lvar dword,	offset
   366                                  	 push ax		; (zero-initialise high word)
   367                                  	 push ax
   368                                  	lvar dword,	adjust
   369                                  	 push ax		; (zero-initialise high word)
   370                                  	 push ax		; (zero-initialise offset (low) word)
   371                                  
   372                                  	_386_PM_o32
   373                                  	mov word [bp + ?offset], si
   374                                  
   375                                  	push bx
   376                                  	_386_PM_o32
   377                                  	push si
   378                                  	_386_PM_o32
   379                                  	push dx
   380                                  
   381                                  	testopt [internalflags3], dif3_nosymbols_1 | dif3_nosymbols_2
   382                                  	jnz .justdisplay
   383                                  
   384                                  	_386_PM_o32
   385                                  	xchg dx, si		; bx:(e)dx = start address, bx:(e)si = end
   386                                  	call getlinear_32bit	; dx:ax = start linear
   387                                  	jc .justdisplay
   388                                  
   389                                  	mov word [bp + ?startlinear + 2], dx
   390                                  	mov word [bp + ?startlinear], ax
   391                                  	push dx
   392                                  	push ax
   393                                  
   394                                  	_386_PM_o32
   395                                  	xchg dx, si		; bx:(e)dx = end address
   396                                  	call getlinear_32bit	; dx:ax = end linear
   397                                  
   398                                  	mov word [bp + ?endlinear + 2], dx
   399                                  	mov word [bp + ?endlinear], ax
   400                                  	pop bx
   401                                  	pop cx			; cx:bx = start linear
   402                                  	jc .justdisplay
   403                                  
   404                                  	xchg ax, bx
   405                                  	xchg dx, cx		; cx:bx = end linear, dx:ax = start linear
   406                                  
   407                                  	nearcall binsearchmain	; es:di -> first entry, cx = number, bx = index
   408                                  	mov word [bp + ?sym_index], bx
   409                                  	test cx, cx
   410                                  	jz .justdisplay
   411                                  
   412                                  	_386_PM_o32
   413                                  	pop dx
   414                                  	_386_PM_o32
   415                                  	pop si
   416                                  	pop bx
   417                                  
   418                                  .loop:
   419                                  	mov word [bp + ?sym_count], cx
   420                                  
   421                                  .loop_no_cx:
   422                                  	 push word [bp + ?sym_index]
   423                                  	 push ax		; (reserve space, uninitialised)
   424                                  	dualcall getfarpointer.main
   425                                  	 pop di
   426                                  	 pop es
   427                                  
   428                                  	mov bx, word [bp + ?adjust + 2]
   429                                  	mov cx, word [bp + ?adjust]
   430                                  				; bx:cx = adjust
   431                                  
   432                                  	add cx, word [bp + ?startlinear]
   433                                  	adc bx, word [bp + ?startlinear + 2]
   434                                  				; bx:cx = adjust + start linear (adjust linear)
   435                                  
   436                                  	neg bx
   437                                  	neg cx
   438                                  	sbb bx, byte 0		; neg bx:cx
   439                                  
   440                                  	add cx, word [es:di + smLinear]
   441                                  	adc bx, word [es:di + smLinear + 2]
   442                                  				; bx:cx = next linear - adjust linear
   443                                  				; bx:cx = how far from adjust linear to next
   444                                  
   445                                  	test bx, bx		; is there a chunk of ddsize at least ?
   446                                  	jnz .chunk
   447                                  %if _DNUM
   448                                  	cmp cx, [ddsize]
   449                                  %else
   450                                  	cmp cx, 1
   451                                  %endif
   452                                  	jae .chunk		; yes, display a chunk -->
   453                                  
   454                                  _386_PM	and ecx, 0FFFFh
   455                                  	_386_PM_o32
   456                                  	push si
   457                                  	_386_PM_o32
   458                                  	add si, cx
   459                                  	push ss
   460                                  	pop es
   461                                  	mov di, line_out
   462                                  	call dd_display_offset
   463                                  
   464                                  	testopt [options], dd_no_blanks_sym
   465                                  	jnz @FF
   466                                  
   467                                  	pop ax			; ax = original si value
   468                                  	push ax
   469                                  
   470                                  	push si
   471                                  	mov si, ax
   472                                  %if _DNUM
   473                                  	mov cx, word [ddsize]
   474                                  %else
   475                                  	mov cx, 1
   476                                  %endif
   477                                  	mov ax, cx
   478                                  	dec cx
   479                                  	and cx, si		; how many bytes to skip at the beginning
   480                                  	sub si, cx		; = offset after skipped to first displayed
   481                                  	add cx, cx		; how many digits to skip at the beginning
   482                                  	and si, 0Fh		; = offset in single line
   483                                  	add ax, ax		; = 8 for dword, 4 for word, 2 for byte
   484                                  	inc ax			; = 9 for dword, 5 for word, 3 for byte
   485                                  	db __TEST_IMM16		; (skip add in first iteration)
   486                                  @@:
   487                                  	add cx, ax		; (in subsequent iterations:) add blanks
   488                                  %if _DNUM
   489                                  	sub si, word [ddsize]	; still a whole unit to add ? (subtract it)
   490                                  %else
   491                                  	sub si, 1
   492                                  %endif
   493                                  	jae @B			; yes -->
   494                                  				; cx = number of blanks to skip
   495                                  	mov al, 32
   496                                  	rep stosb		; store blanks for each byte
   497                                  	pop si
   498                                  @@:
   499                                  
   500                                  	push dx
   501                                  	call putsline		; puts offset + blanks
   502                                  
   503                                  	 push word [bp + ?sym_index]
   504                                  	dualcall displaystring	; puts symbol label
   505                                  
   506                                  	 push word [bp + ?sym_index]
   507                                  	 push ax
   508                                  	dualcall getfarpointer.main
   509                                  	 pop di
   510                                  	 pop es
   511                                  	xor dx, dx
   512                                  _386_PM	call test_high_limit	; 32-bit segment ?
   513                                  _386_PM	jz .16			; no --> (don't display zero high word)
   514                                  _386_PM	push esi
   515                                  _386_PM	pop si
   516                                  _386_PM	pop dx
   517                                  .16:
   518                                  	cmp dx, word [es:di + smOffset + 2]
   519                                  	mov dx, msg.dd_after_symbol.non_wrt
   520                                  	jne .wrt
   521                                  	cmp si, word [es:di + smOffset]
   522                                  	je .non_wrt
   523                                  .wrt:
   524                                  	mov dx, msg.dd_after_symbol.1_wrt
   525                                  	call disp_message
   526                                  
   527                                  	mov ax, word [d_addr + 4]
   528                                  	push ss
   529                                  	pop es
   530                                  	mov di, line_out
   531                                  	call hexword
   532                                  	push bx
   533                                  	push cx
   534                                  	call putsline
   535                                  	pop cx
   536                                  	pop bx
   537                                  
   538                                  	mov dx, msg.dd_after_symbol.2_wrt
   539                                  .non_wrt:
   540                                  	call disp_message	; puts after
   541                                  	pop dx
   542                                  
   543                                  	_386_PM_o32
   544                                  	pop si
   545                                  
   546                                  	inc word [bp + ?sym_index]
   547                                  				; point to next symbol's SYMMAIN (if any)
   548                                  	mov cx, word [bp + ?sym_count]
   549                                  	loop .j_loop		; loop if any more to go
   550                                  	jmp .justdisplay_no_pop	; if none, just display remainder -->
   551                                  
   552                                  
   553                                  .j_loop:
   554                                  	jmp .loop
   555                                  
   556                                  
   557                                  		; Display a chunk.
   558                                  		;
   559                                  		; INP:	(e)si = start offset to display
   560                                  		;	(e)dx = end offset to display
   561                                  		;	bx:cx = how far from adjust linear to next
   562                                  		;		(there is always a next symbol if we are here)
   563                                  .chunk:
   564                                  %if _DNUM
   565                                  	mov ax, word [ddsize]
   566                                  	dec ax
   567                                  	not ax
   568                                  	and cx, ax
   569                                  %endif
   570                                  
   571                                  	add word [bp + ?adjust], cx
   572                                  	adc word [bp + ?adjust + 2], bx
   573                                  
   574                                  _386_PM	push word [bp + ?adjust + 2]
   575                                  _386_PM	push ax
   576                                  _386_PM	pop eax
   577                                  	mov ax, word [bp + ?adjust]
   578                                  				; (e)ax = adjust
   579                                  	_386_PM_o32
   580                                  	dec ax			; (e)ax = adjust - 1
   581                                  
   582                                  		; have:	(e)si = prior start offset, (e)dx = end offset
   583                                  		; want:	(e)si = unchanged, (e)dx = intermediate end offset,
   584                                  		;	preserve intermediate start offset, stack = end offset
   585                                  	_386_PM_o32
   586                                  	push dx			; stack := end offset
   587                                  	_386_PM_o32
   588                                  	mov dx, word [bp + ?offset]
   589                                  				; (e)dx := start offset
   590                                  	_386_PM_o32
   591                                  	add dx, ax		; (e)dx := intermediate end offset
   592                                  
   593                                  	call dd_display		; display, (e)dx := intermediate start offset
   594                                  
   595                                  		; have:	(e)si scrambled, (e)dx = intermediate start offset,
   596                                  		;	stack = end offset
   597                                  		; want:	(e)si = intermediate start offset, (e)dx = end offset
   598                                  	_386_PM_o32
   599                                  	mov si, dx		; (e)si := intermediate start offset
   600                                  	_386_PM_o32
   601                                  	pop dx			; (e)dx := end offset
   602                                  	jmp .loop_no_cx
   603                                  
   604                                  .justdisplay:
   605                                  	_386_PM_o32
   606                                  	pop dx
   607                                  	_386_PM_o32
   608                                  	pop si
   609                                  	pop bx
   610                                  
   611                                  .justdisplay_no_pop:
   612                                  	lleave
   613                                  %endif
   614                                  
   615 00000187 E8FE00                  	call dd_display
   616                                  
   617 0000018A F606[0100]80            	testopt [getrange_lines], 8000h
   618 0000018F 750E                    	jnz .notlines
   619 00000191 FF0E[0000]              	dec word [getrange_lines]
   620 00000195 7408                    	jz .linesdone
   621 00000197 66                      	_386_PM_o32
   622 00000198 89D6                    	mov si, dx		; = new start offset
   623 0000019A E8B500                  	call dd_get_one_line_range
   624                                  				; get a new end offset
   625 0000019D EBE8                    	jmp dd_loop_line
   626                                  
   627                                  .linesdone:
   628                                  .notlines:
   629 0000019F B80200                  	mov ax, opt2_db_trailer
   630                                  %if _DNUM
   631 000001A2 803E[0800]02            	cmp byte [ddsize], 2
   632 000001A7 7207                    	jb @F
   633 000001A9 B020                    	mov al, opt2_dw_trailer
   634 000001AB 7403                    	je @F
   635 000001AD B80002                  	mov ax, opt2_dd_trailer
   636                                  	; fixme dq
   637                                  %endif
   638                                  @@:
   639                                  		; fall through
   640                                  
   641                                  
   642                                  		; INP:	ax = flag value to check
   643                                  		;	 (determines whether "header" or "trailer" is written,
   644                                  		;	  and which flag must be set in word [options2])
   645                                  		;	byte [ddoffset2] = how many bytes to skip at the start
   646                                  		;	bx = segment/selector
   647                                  		; CHG:	ax, cx, di
   648                                  		; STT:	ds = es = ss
   649                                  dd_header_or_trailer:
   650 000001B0 8506[0000]              	test word [options2], ax
   651 000001B4 7503E99800              	jz .ret
   652 000001B9 53                      	push bx
   653 000001BA 56                      	push si
   654 000001BB 52                      	push dx
   655                                  
   656 000001BC BF[0000]                	mov di, line_out
   657                                  %if _40COLUMNS
   658 000001BF F606[0100]10            	testopt [options6], opt6_40_columns
   659 000001C4 7417                    	jz @F
   660 000001C6 89D8                    	mov ax, bx
   661 000001C8 E8(0000)                	call hexword
   662 000001CB B03A                    	mov al, ':'
   663 000001CD AA                      	stosb
   664                                   %if _PM
   665 000001CE B9FBFF                  	mov cx, -5
   666 000001D1 B80600                  	mov ax, 4 + 2
   667 000001D4 E8(0000)                	call test_high_limit	; 32-bit segment ?
   668 000001D7 7422                    	jz .add			; no -->
   669 000001D9 B00A                    	mov al, 8 + 2
   670 000001DB EB1E                    	jmp .add
   671                                   %else
   672                                  	mov cx, 1
   673                                  	jmp .blank
   674                                   %endif
   675                                  @@:
   676                                  %endif
   677                                  
   678                                  %if _LINK
   679 000001DD B9[0000]                	mov cx, msg.header.length
   680                                   wlcalc word_subr_0, equ $ - 2
   681                                  %else
   682                                  	mov cx, - msg.header.length
   683                                  %endif
   684 000001E0 BA[0000]                	mov dx, msg.header
   685 000001E3 A91101                  	test ax, opt2_db_header | opt2_dw_header | opt2_dd_header	; fixme dq
   686 000001E6 7506                    	jnz @F
   687                                  %if _LINK
   688 000001E8 B9[0000]                	mov cx, msg.trailer.length
   689                                   wlcalc word_subr_0, equ $ - 2
   690                                  %else
   691                                  	mov cx, - msg.trailer.length
   692                                  %endif
   693 000001EB BA[0000]                	mov dx, msg.trailer
   694                                  @@:
   695 000001EE E8(0000)                	call putsz		; put initial word
   696                                  				; cx = minus length of initial word
   697 000001F1 B80B00                  	mov ax, 4 + 1 + 4 + 2	; length of address with 16-bit offset
   698                                  %if _PM
   699                                  	; mov bx, word [d_addr + saSegSel]
   700 000001F4 E8(0000)                	call test_high_limit	; 32-bit segment ?
   701 000001F7 7402                    	jz .16			; no -->
   702 000001F9 B00F                    	mov al, 4 + 1 + 8 + 2	; length of address with 32-bit offset
   703                                  .16:
   704                                  %endif
   705                                  .add:
   706 000001FB 01C1                    	add cx, ax		; length of address minus length of word
   707                                  				;  = length to pad
   708                                  .blank:
   709 000001FD B020                    	mov al, 32
   710 000001FF F3AA                    	rep stosb		; pad
   711                                  				; ch = 0
   712                                  
   713 00000201 B83020                  	mov ax, '0 '		; al = '0', ah = blank
   714                                  %if _DNUM
   715 00000204 8A0E[0A00]              	mov cl, byte [ddoffset2]; cx = ddoffset2
   716 00000208 E304                    	jcxz @FF		; if none to skip -->
   717                                  @@:
   718 0000020A AB                      	stosw
   719 0000020B 40                      	inc ax			; increment the number (up to '7')
   720 0000020C E2FC                    	loop @B			; loop for skipping -->
   721                                  @@:
   722                                  %endif
   723 0000020E 2C30                    	sub al, '0'		; = back to numerical (0 .. 7)
   724 00000210 89C2                    	mov dx, ax		; dl = numerical offset
   725                                  
   726 00000212 52                      	push dx
   727                                  %if _DNUM
   728 00000213 8B1E[0800]              	mov bx, [ddsize]	; ddsize
   729                                  %else
   730                                  	mov bx, 1
   731                                  %endif
   732 00000217 BE1000                  	mov si, 16		; loop counter
   733                                  %if _40COLUMNS
   734 0000021A F606[0100]10            	testopt [options6], opt6_40_columns
   735 0000021F 7402                    	jz @F
   736 00000221 D1EE                    	shr si, 1
   737                                  %endif
   738                                  @@:
   739 00000223 88D0                    	mov al, dl		; next numerical offset
   740 00000225 E8(0000)                	call hexnyb		; display it
   741                                  %if _DNUM
   742 00000228 89D9                    	mov cx, bx
   743 0000022A 01C9                    	add cx, cx		; cx = 2 * ddsize
   744 0000022C B020                    	mov al, 32
   745 0000022E F3AA                    	rep stosb		; pad to next position
   746                                  %else
   747                                  	mov al, 32
   748                                  	stosb
   749                                  	stosb
   750                                  %endif
   751 00000230 01DA                    	add dx, bx		; increment dl by how many positions we use
   752 00000232 29DE                    	sub si, bx		; decrement loop counter
   753 00000234 77ED                    	ja @B			; don't jump if si was below-or-equal-to bx
   754 00000236 5A                      	pop dx
   755                                  
   756 00000237 B91000                  	mov cx, 16		; loop counter
   757                                  %if _40COLUMNS
   758 0000023A F606[0100]10            	testopt [options6], opt6_40_columns
   759 0000023F 7402                    	jz @F
   760 00000241 D1E9                    	shr cx, 1
   761                                  %endif
   762                                  @@:
   763 00000243 88D0                    	mov al, dl
   764 00000245 E8(0000)                	call hexnyb		; display an offset
   765                                  		; Note that this will wrap around for the last 1 to 7
   766                                  		;  characters if byte [ddoffset2] is non-zero.
   767 00000248 42                      	inc dx			; increment offset
   768 00000249 E2F8                    	loop @B			; loop
   769                                  
   770 0000024B E8(0000)                	call putsline_crlf
   771                                  
   772 0000024E 5A                      	pop dx
   773 0000024F 5E                      	pop si
   774 00000250 5B                      	pop bx
   775                                  .ret:
   776 00000251 C3                      	retn
   777                                  
   778                                  
   779                                  		; INP:	(e)si = start
   780                                  		;	word [ddsize] = size of element, 1 or 2 or 4
   781                                  		; OUT:	(e)dx = end
   782                                  dd_get_one_line_range:
   783 00000252 66                      	_386_PM_o32
   784 00000253 89F2                    	mov dx, si
   785                                  %if _DNUM
   786 00000255 6631C0                  _386_PM	xor eax, eax
   787 00000258 A1[0800]                	mov ax, word [ddsize]
   788 0000025B 48                      	dec ax
   789 0000025C 21F0                    	and ax, si
   790                                  %else
   791                                  	_386_PM_o32
   792                                  	xor ax, ax
   793                                  %endif
   794                                  %if _40COLUMNS
   795 0000025E 80CA07                  	or dl, 7
   796 00000261 F606[0100]10            	testopt [options6], opt6_40_columns
   797 00000266 7503                    	jnz @F
   798                                  %endif
   799 00000268 80CA0F                  	or dl, 15
   800                                  @@:
   801                                  
   802                                   %if _PM
   803 0000026B 53                      	push bx
   804 0000026C 8B1E[0400]              	mov bx, word [d_addr + saSegSel]
   805 00000270 E8(0000)                	call test_high_limit	; 32-bit segment ?
   806 00000273 5B                      	pop bx
   807 00000274 740A                    	jz .16			; no -->
   808                                  .32:
   809 00000276 66                      	_386_PM_o32
   810 00000277 01C2                    	add dx, ax
   811 00000279 7304                    	jnc @F
   812 0000027B 66                      	_386_PM_o32
   813 0000027C 83CAFF                  	or dx, strict byte -1
   814                                  @@:
   815 0000027F C3                      	retn
   816                                  .16:
   817                                   %endif
   818 00000280 01C2                    	add dx, ax
   819 00000282 7303                    	jnc @F
   820 00000284 83CAFF                  	or dx, strict byte -1
   821                                  @@:
   822 00000287 C3                      	retn
   823                                  
   824                                  
   825                                  		; INP:	word [d_addr + saSegSel] = segment/selector to dump
   826                                  		;	(e)si = start offset
   827                                  		;	(e)dx = end offset
   828                                  		;	if _DNUM:
   829                                  		;	 byte [ddsize] = 1, 2, 4, or 8
   830                                  		;	 (for byte, word, dword, or qword)
   831                                  		; OUT:	(d)word [d_addr] updated
   832                                  		;	(e)dx = (d)word [d_addr]
   833                                  		;	displayed
   834                                  dd_display:
   835 00000288 16                      	push ss
   836 00000289 07                      	pop es
   837                                  dd2_loop:
   838 0000028A E8(0000)                	call handle_serial_flags_ctrl_c
   839                                  
   840 0000028D C706[0000][CD00]        	mov word [lastcmd], lastddd
   841                                  
   842 00000293 BF[0000]                	mov di, line_out	; reset di for next line
   843                                  %if _40COLUMNS
   844 00000296 BBF0FF                  	mov bx, ~0Fh
   845 00000299 F606[0100]10            	testopt [options6], opt6_40_columns
   846 0000029E 7402                    	jz @F
   847 000002A0 B3F8                    	mov bl, ~7
   848                                  @@:
   849                                  %endif
   850 000002A2 E8AC01                  	call dd_display_offset.masklownybble
   851                                  				; ax = offset & ~ 0Fh
   852                                  %if _40COLUMNS
   853 000002A5 89C3                    	mov bx, ax
   854                                  %endif
   855                                  
   856                                  %if _DNUM
   857 000002A7 8B0E[0800]              	mov cx, word [ddsize]
   858 000002AB 51                      	push cx
   859 000002AC 49                      	dec cx			; 0 = byte, 1 = word, 3 = dword
   860 000002AD 21F1                    	and cx, si		; how many bytes to skip at the beginning
   861                                  		; eg:	si = 101h, cx = 1, skip 1 byte,  ax = 101h
   862                                  		;	si = 102h, cx = 3, skip 2 bytes, ax = 102h
   863                                  		;	si = 103h, cx = 3, skip 3 bytes, ax = 103h
   864                                  		;	si = 103h, cx = 1, skip 1 byte,  ax = 101h
   865                                  		;	si = 10Fh, cx = 1, skip 1 byte,  ax = 101h
   866                                  		;	si = 10Fh, cx = 3, skip 3 bytes, ax = 103h
   867 000002AF 01C8                    	add ax, cx		; = where to start
   868 000002B1 890E[0000]              	mov word [ddoffset], cx
   869                                  %endif
   870 000002B5 50                      	 push ax
   871 000002B6 B82020                  	mov ax, 32 << 8 | 32
   872                                  %if _DNUM
   873 000002B9 F3AB                    	rep stosw
   874                                  %endif
   875                                  %if _40COLUMNS
   876                                   %if (opt6_40_columns | opt6_40_indent_odd) & 0FFFF_00FFh
   877                                    %error Expected option flags in same byte
   878                                   %endif
   879 000002BB F606[0100]30            	testopt [options6], opt6_40_columns | opt6_40_indent_odd
   880 000002C0 7408                    	jz @F			; neither set -->
   881 000002C2 7B06                    	jpo @F			; only one set -->
   882 000002C4 F6C308                  	test bl, 8
   883 000002C7 7401                    	jz @F
   884 000002C9 AA                      	stosb
   885                                  @@:
   886                                  %endif
   887 000002CA 58                      	 pop ax
   888                                  %if _DNUM
   889 000002CB 59                      	pop cx
   890                                  %else
   891                                  	mov cx, 1
   892                                  %endif
   893                                  
   894 000002CC BB3000                  	mov bx, (2+1)*16	; 16 bytes (2 digits each)
   895                                  %if _DNUM
   896 000002CF 80F902                  	cmp cl, 2
   897 000002D2 7206                    	jb @F			; if it is 1 -->
   898 000002D4 B328                    	mov bl, (4+1)*8		; 8 words (4 digits each)
   899 000002D6 7402                    	je @F			; if it is 2 -->
   900                                  				; it is 4
   901 000002D8 B324                    	mov bl, (8+1)*4		; 4 dwords (8 digits each)
   902                                   %if _DQ
   903                                  	cmp cl, 4
   904                                  	je @F
   905                                  	mov bl, (16+1)*2	; 2 qwords (16 digits each)
   906                                   %endif
   907                                  @@:
   908                                  %endif
   909                                  %if _40COLUMNS
   910 000002DA F606[0100]10            	testopt [options6], opt6_40_columns
   911 000002DF 7402                    	jz @F
   912 000002E1 D1EB                    	shr bx, 1		; half as many items
   913                                  @@:
   914                                  %endif
   915 000002E3 01FB                    	add bx, di
   916 000002E5 E8(0000)                	call prephack		; set up for faking int vectors 23 and 24
   917                                  
   918 000002E8 50                      	push ax
   919                                  		; blank the start of the line if offset isn't paragraph aligned
   920                                  dd3:
   921 000002E9 39F0                    	cmp ax, si		; skip to position in line
   922 000002EB 7429                    	je dd4			; if we're there yet
   923 000002ED 7718                    	ja .error
   924                                  %if _DNUM
   925 000002EF 50                      	push ax
   926 000002F0 B82020                  	mov ax, 32 << 8| 32
   927 000002F3 51                      	 push cx
   928 000002F4 F3AB                    	rep stosw		; store two blanks (2 * 1) if byte,
   929                                  				;  four blanks (2 * 2) if word,
   930                                  				;  eight blanks (2 * 4) if dword
   931 000002F6 59                      	 pop cx
   932 000002F7 AA                      	stosb			; store additional blank as separator
   933 000002F8 51                      	 push cx
   934                                  @@:
   935 000002F9 268807                  	mov byte [es:bx], al
   936 000002FC 43                      	inc bx
   937 000002FD E2FA                    	loop @B			; store as many blanks in text dump as bytes
   938 000002FF 59                      	 pop cx
   939 00000300 58                      	pop ax
   940 00000301 0306[0800]              	add ax, word [ddsize]	; -> behind the byte/word/dword just written
   941                                  %else
   942                                  	push ax
   943                                  	mov ax, 32 << 8| 32
   944                                  	stosw			; store two blanks
   945                                  	stosb			; store additional blank as separator
   946                                  	mov byte [es:bx], al	; store a blank in text dump
   947                                  	inc bx
   948                                  	pop ax
   949                                  	inc ax			; -> behind the byte just written
   950                                  %endif
   951 00000305 EBE2                    	jmp short dd3
   952                                  
   953                                  
   954                                  .error:
   955 00000307 BA[2700]                	mov dx, .msg_internal_error
   956 0000030A E8(0000)                	call putsz_error
   957 0000030D B80106                  	mov ax, 0601h
   958 00000310 E8(0000)                	call setrc
   959 00000313 E9(0000)                	jmp cmd3
   960                                  
   961                                  	usesection lDEBUG_DATA_ENTRY
   961          ------------------       note: usesection lDEBUG_DATA_ENTRY
   962                                  .msg_internal_error:
   963 00000027 496E7465726E616C20-     		asciz "Internal error in dd3.",13,10
   963 00000030 6572726F7220696E20-
   963 00000039 6464332E0D0A00     
   964                                  	usesection lDEBUG_CODE
   964          ------------------       note: usesection lDEBUG_CODE
   965                                  
   966                                  
   967                                  		; Begin main loop over lines of output.
   968                                  dd4:
   969 00000316 58                      	pop ax
   970                                  %if _40COLUMNS
   971 00000317 66                      	_386_PM_o32	; xor ecx, ecx
   972 00000318 31C9                    	xor cx, cx
   973 0000031A B10F                    	mov cl, 0Fh
   974 0000031C F606[0100]10            	testopt [options6], opt6_40_columns
   975 00000321 7402                    	jz @F
   976 00000323 B107                    	mov cl, 7
   977                                  @@:
   978                                   %if _PM
   979 00000325 53                      	push bx
   980 00000326 8B1E[0400]              	mov bx, word [d_addr + saSegSel]
   981 0000032A E8(0000)                	call test_high_limit	; 32-bit segment ?
   982 0000032D 5B                      	pop bx
   983 0000032E 7401                    	jz .16			; no -->
   984 00000330 66                      	_386_PM_o32	; add ecx, eax
   985                                   %endif
   986                                  .16:
   987 00000331 01C1                    	add cx, ax
   988                                  %else
   989                                  	_386_PM_o32	; mov ecx, eax
   990                                  	mov cx, ax
   991                                   %if _PM
   992                                  	push bx
   993                                  	mov bx, word [d_addr + saSegSel]
   994                                  	call test_high_limit	; 32-bit segment ?
   995                                  	pop bx
   996                                  	jz .16			; no -->
   997                                  	_386_PM_o32	; add ecx, strict byte 0Fh
   998                                   %endif
   999                                  .16:
  1000                                  	add cx, strict byte 0Fh
  1001                                  %endif
  1002 00000333 7205                    	jc @F
  1003 00000335 66                      	_386_PM_o32	; cmp ecx, edx
  1004 00000336 39D1                    	cmp cx, dx		; compare with end address
  1005 00000338 7202                    	jb dd5			; if we write to the end of the line -->
  1006                                  @@:
  1007                                  	;_386_PM_o32	; mov ecx, edx
  1008 0000033A 89D1                    	mov cx, dx		; only write until (e)dx, inclusive
  1009                                  dd5:
  1010                                  	;_386_PM_o32	; sub ecx, esi
  1011 0000033C 29F1                    	sub cx, si
  1012                                  	;_386_PM_o32	; inc ecx
  1013 0000033E 41                      	inc cx			; cx = number of bytes to print this line
  1014                                  				;      up to 16. no 32-bit register required
  1015                                  %if _DNUM
  1016 0000033F 8326[0400]00            	and word [ddskipped], 0
  1017                                  %endif
  1018                                  
  1019 00000344 E8(0000)                	call dohack		; substitute interrupt vectors
  1020                                  %if _DHIGHLIGHT
  1021                                  	mov word [dd_h_number], di
  1022                                  	mov word [dd_h_text], bx
  1023                                  %endif
  1024 00000347 8E1E[0400]              	mov ds, word [d_addr + saSegSel]
  1025                                  
  1026                                  dd6:
  1027                                  %if _DNUM
  1028 0000034B 36A1[0800]              	mov ax, word [ss:ddsize]
  1029 0000034F 39C8                    	cmp ax, cx		; ddsize <= left bytes ?
  1030 00000351 7617                    	jbe dd6_simple		; yes, display ddsize bytes -->
  1031                                  
  1032 00000353 50                      	push ax
  1033 00000354 51                      	push cx
  1034 00000355 57                      	push di
  1035 00000356 F7D9                    	neg cx			; - left bytes
  1036 00000358 01C1                    	add cx, ax		; ddsize - left bytes = how many skipped
  1037 0000035A 36890E[0400]            	mov word [ss:ddskipped], cx
  1038                                  
  1039 0000035F 89C1                    	mov cx, ax		; 1 = bytes, 2 = words, 4 = dwords
  1040 00000361 49                      	dec cx			; 0 = bytes, 1 = words, 3 = dwords
  1041 00000362 B85858                  	mov ax, 'XX'
  1042 00000365 F3AB                    	rep stosw		; fill filler digits not to be written
  1043 00000367 5F                      	pop di
  1044 00000368 59                      	pop cx
  1045 00000369 58                      	pop ax
  1046                                  %endif
  1047                                  
  1048                                  dd6_simple:
  1049                                  %if _DNUM
  1050 0000036A 01C0                    	add ax, ax		; 2 = bytes, 4 = words, 8 = dwords
  1051 0000036C 50                      	push ax
  1052                                  @@:
  1053 0000036D 48                      	dec ax
  1054 0000036E 48                      	dec ax
  1055                                  		; first iteration: 0 = bytes, 2 = words, 6 = dwords
  1056                                  		; second iteration: 0 = words, 4 = dwords
  1057                                  		; third iteration: (0 = 3byte,) 2 = dwords
  1058                                  		; fourth iteration: 0 = dwords
  1059 0000036F 57                      	push di
  1060 00000370 01C7                    	add di, ax		; -> where to write next 2 hex digits
  1061 00000372 50                      	 push ax
  1062                                  %endif
  1063 00000373 67                      	_386_PM_a32
  1064 00000374 AC                      	lodsb			; al = data
  1065 00000375 E8E500                  	call dd_store		; stores number at es:di->, char at es:bx->
  1066                                  %if _DNUM
  1067 00000378 58                      	 pop ax
  1068 00000379 5F                      	pop di			; -> start of hex digits space
  1069 0000037A 85C0                    	test ax, ax		; did we write the left-most digits?
  1070 0000037C E0EF                    	loopnz @B		; not yet --> (or no more bytes to display)
  1071 0000037E 58                      	pop ax			; = how many digits we wrote
  1072 0000037F 01C7                    	add di, ax		; -> after right-most digit
  1073 00000381 B020                    	mov al, 32
  1074 00000383 AA                      	stosb			; store a blank
  1075 00000384 85C9                    	test cx, cx
  1076 00000386 75C3                    	jnz dd6			; (16-bit. cx <= 16)
  1077                                  
  1078 00000388 16                      	push ss			; restore ds
  1079 00000389 1F                      	pop ds
  1080 0000038A 66                      	_386_PM_o32
  1081 0000038B 2B36[0000]              	sub si, word [ddoffset]
  1082 0000038F 66                      	_386_PM_o32
  1083 00000390 0336[0400]              	add si, word [ddskipped]
  1084                                  %else
  1085                                  	mov al, 32
  1086                                  	stosb			; store a blank
  1087                                  	loop dd6
  1088                                  	push ss			; restore ds
  1089                                  	pop ds
  1090                                  %endif
  1091                                  
  1092                                  dd9:
  1093                                  %if _40COLUMNS
  1094 00000394 B80F00                  	mov ax, 0Fh
  1095 00000397 F606[0100]10            	testopt [options6], opt6_40_columns
  1096 0000039C 7402                    	jz @F
  1097 0000039E B007                    	mov al, 7
  1098                                  @@:
  1099 000003A0 85C6                    	test si, ax
  1100                                  %else
  1101                                  	test si, 0Fh		; space out till end of line
  1102                                  %endif
  1103 000003A2 7418                    	jz dd10
  1104                                  %if _DNUM
  1105                                  %if _40COLUMNS
  1106 000003A4 50                      	 push ax
  1107                                  %endif
  1108 000003A5 B82020                  	mov ax, 32 << 8 | 32
  1109 000003A8 8B0E[0800]              	mov cx, word [ddsize]
  1110 000003AC 51                      	push cx
  1111 000003AD F3AB                    	rep stosw		; store blanks for the number
  1112 000003AF AA                      	stosb			; store additional blank as separator
  1113 000003B0 59                      	pop cx
  1114                                   %if _40COLUMNS
  1115 000003B1 58                      	 pop ax
  1116                                   %endif
  1117                                  @@:
  1118 000003B2 66                      	_386_PM_o32
  1119 000003B3 46                      	inc si			; skip as many bytes
  1120                                   %if _40COLUMNS
  1121 000003B4 85C6                    	test si, ax
  1122                                   %else
  1123                                  	test si, 0Fh
  1124                                   %endif
  1125 000003B6 7404                    	jz dd10
  1126 000003B8 E2F8                    	loop @B
  1127                                  %else
  1128                                   %if _40COLUMNS
  1129                                  	 push ax
  1130                                   %endif
  1131                                  	mov ax, 32 << 8 | 32
  1132                                  	stosw			; store blanks for the number
  1133                                  	stosb			; store additional blank as separator
  1134                                  	_386_PM_o32
  1135                                  	inc si			; skip as many bytes
  1136                                   %if _40COLUMNS
  1137                                  	 pop ax
  1138                                   %endif
  1139                                  %endif
  1140 000003BA EBD8                    	jmp short dd9
  1141                                  
  1142                                  dd10:
  1143                                  %if _DNUM
  1144 000003BC 66                      	_386_PM_o32
  1145 000003BD 0336[0000]              	add si, word [ddoffset]
  1146 000003C1 66                      	_386_PM_o32
  1147 000003C2 2B36[0400]              	sub si, word [ddskipped]
  1148                                  %endif
  1149                                  
  1150 000003C6 B91900                  	mov cx, (1 + 8 * (2 + 1))	; go back 8 bytes (2 digits each)
  1151                                  %if _DNUM
  1152 000003C9 803E[0800]02            	cmp byte [ddsize], 2
  1153 000003CE 7206                    	jb @F				; if it is 1 -->
  1154 000003D0 B115                    	mov cl, (1 + 4 * (4 + 1))	; go back 4 words (4 digits each)
  1155 000003D2 7402                    	je @F				; if it is 2 -->
  1156                                  					; it is 4
  1157 000003D4 B113                    	mov cl, (1 + 2 * (8 + 1))	; go back 2 dwords (8 digits each)
  1158                                   %if _DQ
  1159                                  	cmp byte [ddsize], 4
  1160                                  	je @F
  1161                                  	mov cl, (1 + 1 * (16 + 1))	; go back 1 qwords (16 digits each)
  1162                                   %endif
  1163                                  %endif
  1164                                  @@:
  1165                                  %if _40COLUMNS
  1166 000003D6 F606[0100]10            	testopt [options6], opt6_40_columns
  1167 000003DB 740B                    	jz @F
  1168 000003DD F606[0100]40            	testopt [options6], opt6_40_dash
  1169 000003E2 7409                    	jz .nodash			; do not write a dash
  1170                                   %if 1
  1171                                  		; calculate dash position
  1172 000003E4 49                      	dec cx
  1173 000003E5 D1E9                    	shr cx, 1
  1174 000003E7 41                      	inc cx
  1175                                   %else
  1176                                  		; dispatch for dash position
  1177                                  	mov cx, (1 + 4 * (2 + 1))	; go back 4 bytes (2 digits each)
  1178                                  	cmp byte [ddsize], 2
  1179                                  	jb @F				; if it is 1 -->
  1180                                  	mov cl, (1 + 2 * (4 + 1))	; go back 2 words (4 digits each)
  1181                                  	je @F				; if it is 2 -->
  1182                                  					; it is 4
  1183                                  	mov cl, (1 + 1 * (8 + 1))	; go back 1 dwords (8 digits each)
  1184                                   %endif
  1185                                   %if _DQ
  1186                                  	cmp byte [ddsize], 4
  1187                                  	ja .nodash
  1188                                   %endif
  1189                                  @@:
  1190                                  %endif
  1191 000003E8 29CF                    	sub di, cx
  1192 000003EA C6052D                  	mov byte [di], '-'
  1193                                  .nodash:
  1194 000003ED E8(0000)                	call unhack
  1195 000003F0 89DF                    	mov di, bx
  1196 000003F2 52                      	push dx
  1197                                  %if _DHIGHLIGHT
  1198                                  	testopt [options3], opt3_d_highlight
  1199                                  	jz .justputs
  1200                                  	mov ax, 13 | 10 << 8
  1201                                  	stosw
  1202                                  	push si
  1203                                  %if 0
  1204                                  	mov si, line_out
  1205                                  	mov dx, si
  1206                                  @@:
  1207                                  	lodsb
  1208                                  	cmp al, 32
  1209                                  	jne @B
  1210                                  @@:
  1211                                  	lodsb
  1212                                  	cmp al, 32
  1213                                  	je @B
  1214                                  	dec si
  1215                                  	mov cx, si
  1216                                  	sub cx, dx
  1217                                  	call puts
  1218                                  %else
  1219                                  	mov dx, line_out
  1220                                  	mov si, word [dd_h_number]
  1221                                  	mov cx, si
  1222                                  	sub cx, dx
  1223                                  	call puts
  1224                                  	mov dx, si
  1225                                  .hl:
  1226                                  	call emit_highlight
  1227                                  @@:
  1228                                  	lodsb
  1229                                  	cmp si, word [dd_h_text]
  1230                                  	jae .text_dx
  1231                                  	cmp al, 'X'
  1232                                  	je @B
  1233                                  	nearcall getnyb
  1234                                  	jnc @B
  1235                                  	mov cx, si
  1236                                  	sub cx, dx
  1237                                  	call puts
  1238                                  	mov dx, si
  1239                                  	cmp si, word [dd_h_text]
  1240                                  	jae .text
  1241                                  @@:
  1242                                  	lodsb
  1243                                  	cmp si, word [dd_h_text]
  1244                                  	jae .text_dx
  1245                                  	cmp al, 32
  1246                                  	je @B
  1247                                  	cmp al, '-'
  1248                                  	je @B
  1249                                  	call emit_unhighlight
  1250                                  @@:
  1251                                  	lodsb
  1252                                  	cmp si, word [dd_h_text]
  1253                                  	jae .text_dx
  1254                                  	cmp al, 'X'
  1255                                  	je @B
  1256                                  	nearcall getnyb
  1257                                  	jnc @B
  1258                                  	mov cx, si
  1259                                  	sub cx, dx
  1260                                  	call puts
  1261                                  	mov dx, si
  1262                                  	cmp si, word [dd_h_text]
  1263                                  	jae .text
  1264                                  @@:
  1265                                  	lodsb
  1266                                  	cmp si, word [dd_h_text]
  1267                                  	jae .text_dx
  1268                                  	cmp al, 32
  1269                                  	je @B
  1270                                  	cmp al, '-'
  1271                                  	je @B
  1272                                  	jmp .hl
  1273                                  
  1274                                  .text_dx:
  1275                                  	mov cx, si
  1276                                  	sub cx, dx
  1277                                  	call puts
  1278                                  	mov dx, si
  1279                                  .text:
  1280                                  	call emit_highlight
  1281                                  	lodsb
  1282                                  	cmp al, 13
  1283                                  	je .done_unhl
  1284                                  	mov cx, 1
  1285                                  	call puts
  1286                                  	mov dx, si
  1287                                  	call emit_unhighlight
  1288                                  	lodsb
  1289                                  	cmp al, 13
  1290                                  	je .done
  1291                                  	mov cx, 1
  1292                                  	call puts
  1293                                  	mov dx, si
  1294                                  	jmp .text
  1295                                  
  1296                                  .done_unhl:
  1297                                  	call emit_unhighlight
  1298                                  .done:
  1299                                  	mov dx, si
  1300                                  	dec dx
  1301                                  	mov cx, 2
  1302                                  	call puts
  1303                                   %endif
  1304                                  	pop si
  1305                                  	jmp @F
  1306                                  %endif
  1307                                  .justputs:
  1308 000003F3 E8(0000)                	call putsline_crlf
  1309                                  @@:
  1310 000003F6 5A                      	pop dx
  1311 000003F7 66                      	_386_PM_o32	; dec esi
  1312 000003F8 4E                      	dec si
  1313 000003F9 66                      	_386_PM_o32	; cmp esi, edx
  1314 000003FA 39D6                    	cmp si, dx
  1315 000003FC 66                      	_386_PM_o32	; inc esi
  1316 000003FD 46                      	inc si
  1317 000003FE 7303E987FE              	jb dd2_loop		; display next line -->
  1318                                  dd11:
  1319                                  		; This check is necessary to wrap around at FFFFh (64 KiB)
  1320                                  		; for 16-bit segments instead of at FFFFFFFFh (4 GiB).
  1321 00000403 8B1E[0400]              	mov bx, word [d_addr + saSegSel]
  1322                                  				; reset bx (also set segment for trailer)
  1323 00000407 E8(0000)                _386_PM	call test_high_limit	; 32-bit segment ?
  1324 0000040A 7401                    _386_PM	jz .16			; no -->
  1325 0000040C 66                      	_386_PM_o32	; inc edx
  1326                                  .16:
  1327 0000040D 42                      	inc dx			; set up the address for the next 'D' command.
  1328 0000040E 66                      	_386_PM_o32	; mov dword [d_addr], edx
  1329 0000040F 8916[0000]              	mov word [d_addr], dx
  1330 00000413 C3                      	retn
  1331                                  
  1332                                  
  1333                                  		; INP:	(e)si = offset (to display)
  1334                                  		;	(e)dx = end offset (for range check of 16-bit segment)
  1335                                  		;	word [d_addr + saSegSel] = segment/selector
  1336                                  		;	es:di -> where to write to
  1337                                  		; OUT:	bx = segment/selector
  1338                                  dd_display_offset:
  1339                                  .:
  1340 00000414 A1[0400]                	mov ax, word [d_addr + saSegSel]
  1341 00000417 89C3                    	mov bx, ax
  1342                                  %if _40COLUMNS
  1343 00000419 F606[0100]10            	testopt [options6], opt6_40_columns
  1344 0000041E 7506                    	jnz @F
  1345                                  %endif
  1346 00000420 E8(0000)                	call hexword
  1347 00000423 B03A                    	mov al, ':'
  1348 00000425 AA                      	stosb
  1349                                  @@:
  1350 00000426 66                      	_386_PM_o32	; mov eax, esi
  1351 00000427 89F0                    	mov ax, si
  1352 00000429 E8(0000)                _386_PM	call test_high_limit	; 32-bit segment ?
  1353 0000042C 740B                    _386_PM	jz .386_16		; no --> (don't display zero high word)
  1354 0000042E E8(0000)                _386_PM	call hexword_high	; yes, display high word of address
  1355                                  .common:
  1356 00000431 E8(0000)                	call hexword
  1357 00000434 B82020                  	mov ax, 32<<8|32
  1358 00000437 AB                      	stosw
  1359 00000438 C3                      	retn
  1360                                  
  1361                                  		; Insure that the high word is zero.
  1362                                  %if _PM
  1363                                  .386_16:
  1364                                  ;_386	test esi, ~0FFFFh
  1365                                  ;_386	jnz .error
  1366 00000439 66F7C20000FFFF          _386	test edx, ~0FFFFh
  1367 00000440 74EF                    _386	jz .common
  1368                                  ;.error:
  1369 00000442 B83C01                  _386	mov ax, 013Ch
  1370 00000445 E8(0000)                _386	call setrc
  1371 00000448 BA[0000]                _386	mov dx, msg.ofs32
  1372 0000044B E8(0000)                _386	call putsz_error
  1373 0000044E E9(0000)                _386	jmp cmd3
  1374                                  %endif
  1375                                  
  1376                                  		; INP:	(e)si = offset (to display)
  1377                                  		;	(e)dx = end offset (for range check of 16-bit segment)
  1378                                  		;	word [d_addr + saSegSel] = segment/selector
  1379                                  		;	es:di -> where to write to
  1380                                  		;	if _40COLUMNS:
  1381                                  		;	 bx = mask to apply to si
  1382                                  		; OUT:	bx = segment/selector
  1383                                  		;	(e)ax = offset & ~0Fh (or offset & bx)
  1384                                  .masklownybble:
  1385 00000451 56                      	push si
  1386                                  %if _40COLUMNS
  1387 00000452 21DE                    	and si, bx
  1388                                  %else
  1389                                  	and si, ~0Fh
  1390                                  %endif
  1391 00000454 66                      	_386_PM_o32
  1392 00000455 56                      	push si
  1393 00000456 E8BBFF                  	call .
  1394 00000459 66                      	_386_PM_o32
  1395 0000045A 58                      	pop ax
  1396 0000045B 5E                      	pop si
  1397 0000045C C3                      	retn
  1398                                  
  1399                                  
  1400                                  		; Store a character into the buffer. Characters that can't
  1401                                  		; be displayed are replaced by a dot.
  1402                                  		;
  1403                                  		; INP:	al = character
  1404                                  		;	es:bx-> buffer for displayed characters
  1405                                  		;	es:di-> buffer for hexadecimal number
  1406                                  		; OUT:	es:bx-> behind displayed character
  1407                                  		;	es:di-> behind hexadecimal number and space
  1408                                  		; CHG:	ax
  1409                                  		; STT:	ds unknown
  1410                                  dd_store: section_of_function
  1411 0000045D E8(0000)                	call hexbyte		; dump hexadecimal number
  1412 00000460 362206[0B00]            	and al, byte [ss:dd_text_and]
  1413                                  				; for MSDebug compatibility
  1414 00000465 3C20                    	cmp al, 32		; below blank ?
  1415 00000467 7216                    	jb .ctrl		; control char -->
  1416 00000469 3C7F                    	cmp al, 127		; DEL ?
  1417 0000046B 7412                    	je .ctrl		; yes, control char -->
  1418 0000046D 7212                    	jb .noctrl		; below, not a control char -->
  1419 0000046F 36F606[0000]04          	testopt [ss:options], cpdepchars
  1420                                  				; allow CP-dependent characters ?
  1421 00000475 750A                    	jnz .noctrl		; yes -->
  1422                                  %if _DTOP
  1423 00000477 36F606[0200]80          	testopt [ss:internalflags6], dif6_cpdepchars
  1424                                  				; allow CP-dependent characters ?
  1425 0000047D 7502                    	jnz .noctrl		; yes -->
  1426                                  %endif
  1427                                  .ctrl:
  1428 0000047F B02E                    	mov al, '.'		; replace by dot
  1429                                  .noctrl:
  1430 00000481 268807                  	mov byte [es:bx], al	; store dot or printable text byte
  1431 00000484 43                      	inc bx
  1432 00000485 C3                      	retn
  1433                                  
  1434                                  
  1435                                  %if _PM
  1436                                  	usesection lDEBUG_DATA_ENTRY
  1436          ------------------       note: usesection lDEBUG_DATA_ENTRY
  1437                                  	align 2, db 0
  1438 00000040 FFFF                    daresult:	dw -1
  1439                                  
  1440                                  	usesection lDEBUG_CODE
  1440          ------------------       note: usesection lDEBUG_CODE
  1441                                  
  1442                                  descalloc:
  1443 00000486 E8(0000)                	call skipwhite
  1444 00000489 E8(0000)                	call chkeol
  1445 0000048C 31C0                    	xor ax, ax
  1446 0000048E B90100                  	mov cx, 1
  1447 00000491 CD31                    	int 31h
  1448 00000493 7210                    	jc .error
  1449 00000495 BF[0000]                	mov di, msg.d.a_success_sel
  1450 00000498 E8(0000)                	call hexword
  1451 0000049B BA[0000]                	mov dx, msg.d.a_success
  1452                                  .display:
  1453 0000049E E8(0000)                	call putsz
  1454 000004A1 A3[4000]                	mov word [daresult], ax
  1455 000004A4 C3                      	retn
  1456                                  
  1457                                  .error:
  1458 000004A5 BF[0000]                	mov di, msg.d.a_error_code
  1459 000004A8 E8(0000)                	call hexword
  1460 000004AB BA[0000]                	mov dx, msg.d.a_error
  1461 000004AE 3D0080                  	cmp ax, 8000h
  1462 000004B1 7303                    	jae @F
  1463 000004B3 B80108                  	mov ax, 0801h
  1464                                  @@:
  1465 000004B6 E8(0000)                	call setrc
  1466 000004B9 B8FFFF                  	mov ax, -1
  1467 000004BC EBE0                    	jmp .display
  1468                                  
  1469                                  
  1470                                  descdealloc:
  1471 000004BE E8(0000)                	call skipwhite
  1472 000004C1 E8(0000)EB02[0000]      	nearcall getword
  1473 000004C8 E8(0000)                	call chkeol
  1474 000004CB B80100                  	mov ax, 1
  1475 000004CE 89D3                    	mov bx, dx
  1476 000004D0 CD31                    	int 31h
  1477 000004D2 7206                    	jc .error
  1478 000004D4 BA[0000]                	mov dx, msg.d.d_success
  1479                                  .display:
  1480 000004D7 E9(0000)                	jmp putsz
  1481                                  
  1482                                  .error:
  1483 000004DA BF[0000]                	mov di, msg.d.d_error_code
  1484 000004DD E8(0000)                	call hexword
  1485 000004E0 BA[0000]                	mov dx, msg.d.d_error
  1486 000004E3 3D0080                  	cmp ax, 8000h
  1487 000004E6 7303                    	jae @F
  1488 000004E8 B80208                  	mov ax, 0802h
  1489                                  @@:
  1490 000004EB E8(0000)                	call setrc
  1491 000004EE EBE7                    	jmp .display
  1492                                  
  1493                                  
  1494                                  descbase:
  1495 000004F0 E8(0000)                	call skipwhite
  1496 000004F3 E8(0000)EB02[0000]      	nearcall getword
  1497 000004FA 89D1                    	mov cx, dx
  1498 000004FC E8(0000)EB02[0000]      	nearcall getdword
  1499 00000503 E8(0000)                	call chkeol
  1500 00000506 87CB                    	xchg cx, bx		; cx:dx = base, bx = desc
  1501 00000508 B80700                  	mov ax, 7
  1502 0000050B CD31                    	int 31h
  1503 0000050D 7206                    	jc .error
  1504 0000050F BA[0000]                	mov dx, msg.d.b_success
  1505                                  .display:
  1506 00000512 E9(0000)                	jmp putsz
  1507                                  
  1508                                  .error:
  1509 00000515 BF[0000]                	mov di, msg.d.b_error_code
  1510 00000518 E8(0000)                	call hexword
  1511 0000051B BA[0000]                	mov dx, msg.d.b_error
  1512 0000051E 3D0080                  	cmp ax, 8000h
  1513 00000521 7303                    	jae @F
  1514 00000523 B80308                  	mov ax, 0803h
  1515                                  @@:
  1516 00000526 E8(0000)                	call setrc
  1517 00000529 EBE7                    	jmp .display
  1518                                  
  1519                                  
  1520                                  desclimit:
  1521 0000052B E8(0000)                	call skipwhite
  1522 0000052E E8(0000)EB02[0000]      	nearcall getword
  1523 00000535 89D1                    	mov cx, dx
  1524 00000537 E8(0000)EB02[0000]      	nearcall getdword
  1525 0000053E E8(0000)                	call chkeol
  1526 00000541 87CB                    	xchg cx, bx		; cx:dx = limit, bx = desc
  1527 00000543 B80800                  	mov ax, 8
  1528 00000546 CD31                    	int 31h
  1529 00000548 7206                    	jc .error
  1530 0000054A BA[0000]                	mov dx, msg.d.l_success
  1531                                  .display:
  1532 0000054D E9(0000)                	jmp putsz
  1533                                  
  1534                                  .error:
  1535 00000550 BF[0000]                	mov di, msg.d.l_error_code
  1536 00000553 E8(0000)                	call hexword
  1537 00000556 BA[0000]                	mov dx, msg.d.l_error
  1538 00000559 3D0080                  	cmp ax, 8000h
  1539 0000055C 7303                    	jae @F
  1540 0000055E B80408                  	mov ax, 0804h
  1541                                  @@:
  1542 00000561 E8(0000)                	call setrc
  1543 00000564 EBE7                    	jmp .display
  1544                                  
  1545                                  
  1546                                  desctype:
  1547 00000566 E8(0000)                	call skipwhite
  1548 00000569 E8(0000)EB02[0000]      	nearcall getword
  1549 00000570 89D3                    	mov bx, dx
  1550 00000572 E8(0000)EB02[0000]      	nearcall getword
  1551 00000579 E8(0000)                	call chkeol
  1552 0000057C 89D1                    	mov cx, dx		; cx = type, bx = desc
  1553 0000057E B80900                  	mov ax, 9
  1554 00000581 CD31                    	int 31h
  1555 00000583 7206                    	jc .error
  1556 00000585 BA[0000]                	mov dx, msg.d.t_success
  1557                                  .display:
  1558 00000588 E9(0000)                	jmp putsz
  1559                                  
  1560                                  .error:
  1561 0000058B BF[0000]                	mov di, msg.d.t_error_code
  1562 0000058E E8(0000)                	call hexword
  1563 00000591 BA[0000]                	mov dx, msg.d.t_error
  1564 00000594 3D0080                  	cmp ax, 8000h
  1565 00000597 7303                    	jae @F
  1566 00000599 B80508                  	mov ax, 0805h
  1567                                  @@:
  1568 0000059C E8(0000)                	call setrc
  1569 0000059F EBE7                    	jmp .display
  1570                                  
  1571                                  
  1572                                  descsubcommand:
  1573 000005A1 AC                      	lodsb
  1574 000005A2 3C3F                    	cmp al, '?'
  1575 000005A4 742B                    	je deschelp
  1576 000005A6 E8(0000)                	call ispm
  1577 000005A9 7563                    	jne display_nodesc
  1578 000005AB E8(0000)                	call capitalise
  1579 000005AE 3C41                    	cmp al, 'A'
  1580 000005B0 7503E9D1FE              	je descalloc
  1581 000005B5 3C44                    	cmp al, 'D'
  1582 000005B7 7503E902FF              	je descdealloc
  1583 000005BC 3C42                    	cmp al, 'B'
  1584 000005BE 7503E92DFF              	je descbase
  1585 000005C3 3C4C                    	cmp al, 'L'
  1586 000005C5 7503E961FF              	je desclimit
  1587 000005CA 3C54                    	cmp al, 'T'
  1588 000005CC 7498                    	je desctype
  1589 000005CE E9(0000)                	jmp error
  1590                                  
  1591                                  deschelp:
  1592 000005D1 AC                      	lodsb
  1593 000005D2 E8(0000)                	call chkeol
  1594 000005D5 BA[0000]                	mov dx, msg.deschelp
  1595 000005D8 E9(0000)                	jmp putsz_exthelp	; print string and return
  1596                                  
  1597                                  
  1598                                  		; DL command
  1599                                  descout:
  1600 000005DB E8(0000)                	call skipwhite
  1601 000005DE E8(0000)EB02[0000]      	nearcall getword; get word into DX
  1602 000005E5 89D3                    	mov bx, dx
  1603 000005E7 E8(0000)                	call skipcomm0
  1604 000005EA BA0100                  	mov dx, 1
  1605 000005ED E8(0000)                	call iseol?
  1606 000005F0 7414                    	je .onlyone
  1607 000005F2 E8(0000)                	call capitalise
  1608 000005F5 3C4C                    	cmp al, 'L'
  1609 000005F7 7503                    	jne .notlength
  1610 000005F9 E8(0000)                	call skipcomma
  1611                                  .notlength:
  1612 000005FC E8(0000)EB02[0000]      	nearcall getword
  1613 00000603 E8(0000)                	call chkeol
  1614                                  .onlyone:
  1615 00000606 42                      	inc dx		; (note js at nextdesc changed to jz)
  1616 00000607 89D6                    	mov si, dx	; save count
  1617 00000609 E8(0000)                	call ispm
  1618 0000060C 740D                    	je nextdesc
  1619                                  display_nodesc:
  1620 0000060E BA[0000]                	mov dx, nodesc
  1621 00000611 B80008                  	mov ax, 0800h
  1622 00000614 E8(0000)                	call setrc
  1623 00000617 E9(0000)                	jmp putsz
  1624                                  desc_done:
  1625 0000061A C3                      	retn
  1626                                  subcpu 286
  1627                                  nextdesc:
  1628 0000061B 4E                      	dec si
  1629 0000061C 74FC                    	jz desc_done
  1630 0000061E BF[0000]                	mov di, descriptor
  1631 00000621 89D8                    	mov ax, bx
  1632 00000623 E8(0000)                	call hexword
  1633 00000626 BF[0000]                	mov di, descriptor.base
  1634 00000629 57                      	push di
  1635 0000062A B83F3F                  	mov ax, "??"
  1636 0000062D AB                      	stosw
  1637 0000062E AB                      	stosw
  1638 0000062F AB                      	stosw
  1639 00000630 AB                      	stosw
  1640                                  %ifn _LINK
  1641                                  	add di, byte (descriptor.limit - (descriptor.base + 8))
  1642                                  %else
  1643 00000631 83C7F8                  	add di, strict byte -8
  1644                                   wlcalc byte_ext_descriptor.limit, equ $ - 1
  1645                                   wlcalc byte_minusext_descriptor.base, equ $ - 1
  1646                                  %endif
  1647 00000634 AB                      	stosw
  1648 00000635 AB                      	stosw
  1649 00000636 AB                      	stosw
  1650 00000637 AB                      	stosw
  1651                                  %ifn _LINK
  1652                                  	add di, byte (descriptor.attrib - (descriptor.limit + 8))
  1653                                  %else
  1654 00000638 83C7F8                  	add di, strict byte -8
  1655                                   wlcalc byte_ext_descriptor.attrib, equ $ - 1
  1656                                   wlcalc byte_minusext_descriptor.limit, equ $ - 1
  1657                                  %endif
  1658 0000063B AB                      	stosw
  1659 0000063C AB                      	stosw
  1660 0000063D 5F                      	pop di
  1661                                  ;	lar ax, bx
  1662                                  ;	jnz skipdesc	; tell that this descriptor is invalid
  1663 0000063E B80600                  	mov ax, 6
  1664 00000641 CD31                    	int 31h
  1665 00000643 720A                    	jc desc_o1
  1666 00000645 89C8                    	mov ax, cx
  1667 00000647 E8(0000)                	call hexword
  1668 0000064A 89D0                    	mov ax, dx
  1669 0000064C E8(0000)                	call hexword
  1670                                  desc_o1:
  1671 0000064F BF[0000]                	mov di, descriptor.limit
  1672 00000652 EB2B                    	_no386_jmps use16desc
  1673                                  subcpu 386
  1674 00000654 660F03C3                	lsl eax, ebx
  1675 00000658 751A                    	jnz desc_out
  1676 0000065A 50                      	push ax
  1677 0000065B 66C1E810                	shr eax, 16
  1678 0000065F E8(0000)                	call hexword
  1679 00000662 58                      	pop ax
  1680 00000663 E8(0000)                	call hexword
  1681 00000666 660F02C3                	lar eax, ebx
  1682 0000066A 66C1E808                	shr eax, 8
  1683                                  desc_o2:
  1684 0000066E BF[0000]                	mov di, descriptor.attrib
  1685 00000671 E8(0000)                	call hexword
  1686                                  desc_out:
  1687 00000674 BA[0000]                	mov dx, descriptor
  1688 00000677 E8(0000)                	call putsz
  1689 0000067A 83C308                  	add bx, byte 8
  1690 0000067D EB9C                    	jmp short nextdesc
  1691                                  subcpureset	; subcpu 386
  1692                                  use16desc:
  1693 0000067F 0F03C3                  	lsl ax, bx
  1694 00000682 75F0                    	jnz desc_out
  1695 00000684 E8(0000)                	call hexword
  1696 00000687 B82020                  	mov ax, 32<<8|32
  1697 0000068A AB                      	stosw
  1698 0000068B AB                      	stosw
  1699 0000068C 0F02C3                  	lar ax, bx
  1700 0000068F C1E808                  	shr ax, 8
  1701 00000692 EBDA                    	jmp short desc_o2
  1702                                  subcpureset	; subcpu 286
  1703                                  %endif
  1704                                  
  1705                                  %if _DSTRINGS
  1706                                  		; D$ command
  1707                                  dcpm:
  1708 00000694 C606[0000]24            	mov byte [dstringtype], 36
  1709 00000699 C706[0000][0000]        	mov word [dstringaddr], dcpm_addr
  1710 0000069F EB25                    	jmp short dstring
  1711                                  
  1712                                  		; DW# command
  1713                                  dwcounted:
  1714 000006A1 C606[0000]FE            	mov byte [dstringtype], 0FEh
  1715 000006A6 C706[0000][0000]        	mov word [dstringaddr], dwcount_addr
  1716 000006AC EB18                    	jmp short dstring
  1717                                  
  1718                                  		; D# command
  1719                                  dcounted:
  1720 000006AE C606[0000]FF            	mov byte [dstringtype], 0FFh
  1721 000006B3 C706[0000][0000]        	mov word [dstringaddr], dcount_addr
  1722 000006B9 EB0B                    	jmp short dstring
  1723                                  
  1724                                  		; DZ command
  1725                                  dz:
  1726 000006BB C606[0000]00            	mov byte [dstringtype], 0
  1727 000006C0 C706[0000][0000]        	mov word [dstringaddr], dz_addr
  1728                                  
  1729                                  		; common code for all string commands
  1730                                  dstring:
  1731 000006C6 E8(0000)                	call skipwhite
  1732 000006C9 E8(0000)                	call iseol?
  1733 000006CC 7509                    	jne .getaddr		; if an address was given
  1734                                  .last:
  1735 000006CE 8B1E[0000]              	mov bx, word [dstringaddr]
  1736 000006D2 66                      	_386_PM_o32	; mov edx, dword [bx]
  1737 000006D3 8B17                    	mov dx, word [bx]
  1738 000006D5 EB24                    	jmp short .haveaddr	; edx = offset, [bx + saSegSel] = segment
  1739                                  .getaddr:
  1740 000006D7 8B1E[0000]              	mov bx, word [reg_ds]
  1741 000006DB E8(0000)EB02[0000]      	nearcall getaddrX	; get address into bx:(e)dx
  1742 000006E2 E8(0000)                	call chkeol		; expect end of line here
  1743                                  %if _PM
  1744 000006E5 53                      	push bx
  1745                                  %endif
  1746 000006E6 53                      	push bx
  1747 000006E7 8B1E[0000]              	mov bx, word [dstringaddr]
  1748 000006EB 8F4704                  	pop word [bx + saSegSel]; save segment (offset behind string is saved later)
  1749                                  %if _PM
  1750 000006EE E8(0000)                	call ispm
  1751 000006F1 7505                    	jnz .86m
  1752                                  .pm:
  1753 000006F3 8F4708                  	pop word [bx + saSelector]
  1754 000006F6 EB03                    	jmp @F
  1755                                  .86m:
  1756 000006F8 8F4706                  	pop word [bx + saSegment]
  1757                                  @@:
  1758                                  %endif
  1759                                  .haveaddr:
  1760 000006FB C706[0000][CE06]        	mov word [lastcmd], dstring.last
  1761 00000701 E8(0000)                	call prephack
  1762 00000704 66                      	_386_PM_o32	; mov esi, edx
  1763 00000705 89D6                    	mov si, dx
  1764 00000707 800E[0200]01            	setopt [internalflags], usecharcounter
  1765 0000070C C606[0000]01            	mov byte [ charcounter ], 1
  1766                                  				; initialize
  1767 00000711 E8(0000)                	call dohack
  1768 00000714 BF[0000]                	mov di, line_out	; es:di -> line_out
  1769 00000717 8E5F04                  	mov ds, word [bx + saSegSel]
  1770                                  				; ds:(e)si-> string
  1771 0000071A 36803E[0000]FE          	cmp byte [ss:dstringtype], 0FEh
  1772 00000720 723E                    	jb .terminated		; terminated string -->
  1773 00000722 9F                      	lahf
  1774 00000723 67                      	_386_PM_a32
  1775 00000724 AC                      	lodsb			; load first byte
  1776 00000725 31C9                    	xor cx, cx
  1777 00000727 88C1                    	mov cl, al		; low byte of count
  1778 00000729 9E                      	sahf
  1779 0000072A 7504                    	jne .counted		; only byte count -->
  1780 0000072C 67                      	_386_PM_a32
  1781 0000072D AC                      	lodsb			; load second byte
  1782 0000072E 88C5                    	mov ch, al		; high byte of count
  1783                                  .counted:
  1784 00000730 E33C                    	jcxz .done		; length zero -->
  1785                                  .loop:
  1786 00000732 67                      	_386_PM_a32
  1787 00000733 AC                      	lodsb			; get character
  1788 00000734 E80400                  	call .char		; display
  1789 00000737 E2F9                    	loop .loop		; until done -->
  1790 00000739 EB33                    	jmp short .done
  1791                                  
  1792                                  		; INP:	al = text to display
  1793                                  		;	di -> after last buffered text in line_out
  1794                                  		; OUT:	di -> after text stored in buffer
  1795                                  		;	 (in range line_out + 1 .. line_out_end)
  1796                                  		;	buffer content so far dumped if buffer was full
  1797                                  		; STT:	es = ss
  1798                                  		;	ds unknown
  1799                                  		;	in hacked state (dohack called)
  1800                                  		; CHG:	dx
  1801                                  .char:
  1802 0000073B 81FF[0000]              	cmp di, line_out_end	; end of buffer ?
  1803 0000073F 720B                    	jb @F			; not yet, only store to buffer -->
  1804                                  
  1805 00000741 1E                      	push ds
  1806 00000742 E80900                  	call .dump
  1807                                  				; go back to special state
  1808 00000745 E8(0000)                	call dohack
  1809 00000748 1F                      	pop ds
  1810 00000749 BF[0000]                	mov di, line_out	; reset buffer to start
  1811                                  
  1812                                  @@:
  1813 0000074C AA                      	stosb			; store the text byte to buffer
  1814 0000074D C3                      	retn
  1815                                  
  1816                                  		; INP:	di -> after last stored text in line_out
  1817                                  		; OUT:	ds set to ss
  1818                                  		;	unhack called
  1819                                  		;	putsline called
  1820                                  		; CHG:	ds, dx
  1821                                  		; STT:	es = ss
  1822                                  .dump:
  1823 0000074E 50                      	push ax
  1824 0000074F 51                      	push cx
  1825 00000750 53                      	push bx
  1826 00000751 16                      	 push ss
  1827 00000752 1F                      	 pop ds
  1828 00000753 E8(0000)                	call unhack		; restore state
  1829 00000756 E8(0000)                	call putsline		; write buffered content
  1830 00000759 E8(0000)                	call handle_serial_flags_ctrl_c
  1831                                  				; handle Control-C
  1832 0000075C 5B                      	pop bx
  1833 0000075D 59                      	pop cx
  1834 0000075E 58                      	pop ax
  1835 0000075F C3                      	retn
  1836                                  
  1837                                  .terminated:
  1838 00000760 67                      	_386_PM_a32
  1839 00000761 AC                      	lodsb			; load character
  1840 00000762 363A06[0000]            	cmp al, byte [ss:dstringtype]
  1841 00000767 7405                    	je .done		; it's the terminator -->
  1842 00000769 E8CFFF                  	call .char		; display
  1843 0000076C EBF2                    	jmp short .terminated	; and get next -->
  1844                                  
  1845                                  .done:
  1846                                  		; Finally dump the last chunk (may be empty).
  1847 0000076E E8DDFF                  	call .dump		; this resets ds and calls unhack
  1848 00000771 66                      	_386_PM_o32	; mov dword [bx], esi
  1849 00000772 8937                    	mov word [bx], si
  1850 00000774 B00D                    	mov al, 13
  1851 00000776 E8(0000)                	call putc
  1852 00000779 B00A                    	mov al, 10
  1853 0000077B E8(0000)                	call putc
  1854 0000077E C3                      	retn
  1855                                  %endif
  1856                                  
  1857                                   %define extcall nearcall
  1858                                   %define extcallcall nearcall
  1859                                   %imacro internalcoderelocation 0-*.nolist
  1860                                   %endmacro
  1861                                   %imacro internaldatarelocation 0-*.nolist
  1862                                   %endmacro
  1863                                   %imacro linkdatarelocation 0-*.nolist
  1864                                   %endmacro
  1865                                   %define relocated(address) address
  1866                                   %assign ELD 0
  1867                                  
  1868                                  %if _INT
  1869                                   %include "dishared.asm"
     1                              <1> 
     2                              <1> %if 0
     3                              <1> 
     4                              <1> lDebug DI commands - Dump data
     5                              <1> 
     6                              <1> Copyright (C) 1995-2003 Paul Vojta
     7                              <1> Copyright (C) 2008-2025 E. C. Masloch
     8                              <1> 
     9                              <1> Usage of the works is permitted provided that this
    10                              <1> instrument is retained with the works, so that any entity
    11                              <1> that uses the works is notified of this instrument.
    12                              <1> 
    13                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    14                              <1> 
    15                              <1> %endif
    16                              <1> 
    17                              <1> 
    18                              <1> 		; DI command
    19                              <1> gateout:
    20 0000077F 31C9                <1> 	xor cx, cx
    21 00000781 AC                  <1> 	lodsb
    22                              <1> %if !_LOADER
    23 00000782 E8(0000)            <1> 	extcallcall capitalise
    24 00000785 3C52                <1> 	cmp al, 'R'
    25 00000787 7502                <1> 	jne @F
    26 00000789 41                  <1> 	inc cx		; always 86 Mode
    27 0000078A AC                  <1> 	lodsb
    28                              <1> @@:
    29 0000078B E8(0000)            <1> 	extcallcall capitalise
    30 0000078E 3C4D                <1> 	cmp al, 'M'
    31 00000790 7503                <1> 	jne @F
    32 00000792 FEC5                <1> 	inc ch		; show MCB names
    33 00000794 AC                  <1> 	lodsb
    34                              <1> @@:
    35 00000795 E8(0000)            <1> 	extcallcall capitalise
    36 00000798 3C4C                <1> 	cmp al, 'L'
    37 0000079A 7504                <1> 	jne @F
    38 0000079C 80CD02              <1> 	or ch, 2	; follow AMIS interrupt lists
    39 0000079F AC                  <1> 	lodsb
    40                              <1> @@:
    41                              <1> %endif
    42 000007A0 E8(0000)            <1> 	extcallcall skipcomm0
    43                              <1> 
    44 000007A3 4E                  <1> 	dec si
    45 000007A4 BA[0000]            <1> 	mov dx, relocated(msg.in)
    46                              <1> linkdatarelocation msg.in
    47 000007A7 E8(0000)            <1> 	extcallcall isstring?
    48 000007AA 7568                <1> 	jne .not_in
    49                              <1> 
    50 000007AC E8(0000)            <1> 	extcallcall skipcomma
    51 000007AF 4E                  <1> 	dec si
    52 000007B0 56                  <1> 	push si
    53 000007B1 51                  <1> 	push cx
    54                              <1> .in.loop:
    55 000007B2 E8(0000)            <1> 	extcallcall skipwhite
    56 000007B5 4E                  <1> 	dec si
    57                              <1> 
    58 000007B6 E8(0000)EB02[0000]  <1> 	extcallcall get_value_range; OUT:	cx:di = from, bx:dx = to
    59 000007BD 730D                <1> 	jnc @F
    60 000007BF 7508                <1> 	jnz .error
    61 000007C1 81FFFF00            <1> 	cmp di, 255
    62 000007C5 7702                <1> 	ja .error
    63 000007C7 E317                <1> 	jcxz .in.next
    64                              <1> .error:
    65 000007C9 E9(0000)            <1> 	jmp error
    66                              <1> 
    67                              <1> @@:
    68 000007CC 81FFFF00            <1> 	cmp di, 255
    69 000007D0 77F7                <1> 	ja .error
    70 000007D2 E302                <1> 	jcxz @F
    71 000007D4 EBF3                <1> 	jmp .error
    72                              <1> 
    73                              <1> @@:
    74 000007D6 85DB                <1> 	test bx, bx
    75 000007D8 75EF                <1> 	jnz .error
    76 000007DA 81FAFF00            <1> 	cmp dx, 255
    77 000007DE 77E9                <1> 	ja .error
    78                              <1> 
    79                              <1> .in.next:
    80                              <1> @@:
    81 000007E0 E8(0000)            <1> 	extcallcall skipwh0
    82 000007E3 3C2C                <1> 	cmp al, ','
    83 000007E5 74CB                <1> 	je .in.loop
    84 000007E7 E8(0000)            <1> 	extcallcall chkeol
    85 000007EA 59                  <1> 	pop cx
    86 000007EB E8A500              <1> 	call .prepare
    87 000007EE 5E                  <1> 	pop si
    88                              <1> 
    89                              <1> .indo.loop:
    90 000007EF E8(0000)            <1> 	extcallcall skipwhite
    91 000007F2 4E                  <1> 	dec si
    92                              <1> 
    93 000007F3 51                  <1> 	push cx
    94 000007F4 E8(0000)EB02[0000]  <1> 	extcallcall get_value_range; OUT:	cx:di = from, bx:dx = to
    95 000007FB 59                  <1> 	pop cx
    96 000007FC 720D                <1> 	jc .indo.next
    97                              <1> 
    98 000007FE 89FB                <1> 	mov bx, di
    99 00000800 A8                  <1> 	db __TEST_IMM8		; (skip inc)
   100                              <1> @@:
   101 00000801 43                  <1> 	inc bx
   102 00000802 52                  <1> 	push dx
   103 00000803 E8A200              <1> 	call .do
   104 00000806 5A                  <1> 	pop dx
   105 00000807 39D3                <1> 	cmp bx, dx
   106 00000809 72F6                <1> 	jb @B
   107                              <1> 
   108                              <1> .indo.next:
   109 0000080B 4E                  <1> 	dec si
   110 0000080C E8(0000)            <1> 	extcallcall skipwhite
   111 0000080F 3C2C                <1> 	cmp al, ','
   112 00000811 74DC                <1> 	je .indo.loop
   113 00000813 C3                  <1> 	retn
   114                              <1> 
   115                              <1> 
   116                              <1> 
   117                              <1> .not_in:
   118 00000814 AC                  <1> 	lodsb
   119 00000815 E8(0000)EB02[0000]  <1> 	extcallcall getbyte; get byte into DL
   120 0000081C 30F6                <1> 	xor dh, dh
   121 0000081E 89D3                <1> 	mov bx, dx
   122 00000820 E8(0000)            <1> 	extcallcall skipcomm0
   123 00000823 BA0100              <1> 	mov dx, 1
   124 00000826 E8(0000)            <1> 	extcallcall iseol?
   125 00000829 745B                <1> 	je .onlyone
   126 0000082B E8(0000)            <1> 	extcallcall capitalise
   127 0000082E 3C4C                <1> 	cmp al, 'L'
   128 00000830 7543                <1> 	jne .notlength
   129 00000832 E8(0000)            <1> 	extcallcall skipcomma
   130 00000835 E8(0000)EB02[0000]  <1> 	extcallcall getword; get byte into DL
   131 0000083C 85D2                <1> 	test dx, dx
   132 0000083E 741A                <1> 	jz .err
   133 00000840 81FA0001            <1> 	cmp dx, 100h
   134 00000844 740A                <1> 	je .checkrange
   135 00000846 50                  <1> 	push ax
   136 00000847 80E41F              <1> 	and ah, 1Fh
   137 0000084A 80FC08              <1> 	cmp ah, 8
   138 0000084D 58                  <1> 	pop ax
   139 0000084E 770A                <1> 	ja .err
   140                              <1> .checkrange:
   141 00000850 52                  <1> 	push dx
   142 00000851 01DA                <1> 	add dx, bx
   143 00000853 81FA0001            <1> 	cmp dx, 100h
   144 00000857 5A                  <1> 	pop dx
   145 00000858 7629                <1> 	jna .rangeok
   146                              <1> .err:
   147 0000085A E9(0000)            <1> 	jmp error
   148                              <1> 
   149                              <1> .last:
   150 0000085D 31DB                <1> 	xor bx, bx
   151 0000085F 8A1E[0000]          <1> 	mov bl, byte [lastint]
   152                              <1> internaldatarelocation
   153 00000863 8B0E[0000]          <1> 	mov cx, word [lastint_is_86m_and_mcb]
   154                              <1> internaldatarelocation
   155 00000867 BA0100              <1> 	mov dx, 1
   156 0000086A FEC3                <1> 	inc bl
   157 0000086C 7518                <1> 	jnz .onlyone
   158 0000086E C706[0000][0000]    <1> 	mov word [relocated(lastcmd)], relocated(dmycmd)
   159                              <1> linkdatarelocation lastcmd, -4
   160                              <1> linkdatarelocation dmycmd
   161 00000874 C3                  <1> 	retn
   162                              <1> 
   163                              <1> .notlength:
   164 00000875 E8(0000)EB02[0000]  <1> 	extcallcall getbyte
   165 0000087C 30F6                <1> 	xor dh, dh
   166 0000087E 28DA                <1> 	sub dl, bl
   167 00000880 72D8                <1> 	jc .err
   168 00000882 42                  <1> 	inc dx
   169                              <1> .rangeok:
   170 00000883 E8(0000)            <1> 	extcallcall chkeol
   171                              <1> .onlyone:
   172 00000886 E80A00              <1> 	call .prepare
   173 00000889 89D6                <1> 	mov si, dx	; save count
   174                              <1> .next:
   175 0000088B E81A00              <1> 	call .do
   176 0000088E 43                  <1> 	inc bx
   177 0000088F 4E                  <1> 	dec si
   178 00000890 75F9                <1> 	jnz .next
   179 00000892 C3                  <1> 	retn
   180                              <1> 
   181                              <1> 
   182                              <1> .prepare:
   183 00000893 F6C502              <1> 	test ch, 2
   184 00000896 7403                <1> 	jz @F
   185 00000898 E8(0000)            <1> 	extcallcall guard_auxbuff
   186                              <1> @@:
   187                              <1> %if ELD
   188                              <1> 	mov word [relocateddata], .last
   189                              <1> linkdatarelocation lastcmd_transfer_ext_address, -4
   190                              <1> internalcoderelocation
   191                              <1> 	mov word [relocateddata], relocateddata
   192                              <1> linkdatarelocation lastcmd, -4
   193                              <1> linkdatarelocation lastcmd_transfer_ext_entry
   194                              <1> %else
   195 0000089B C706[0000][5D08]    <1> 	mov word [lastcmd], .last
   196                              <1> %endif
   197 000008A1 890E[0000]          <1> 	mov word [lastint_is_86m_and_mcb], cx
   198                              <1> internaldatarelocation
   199                              <1> %if ELD
   200                              <1> 	extcallcall prephack
   201                              <1> 	retn
   202                              <1> %else
   203 000008A5 E9(0000)            <1> 	jmp prephack
   204                              <1> %endif
   205                              <1> 
   206                              <1> 
   207                              <1> 		; INP:	bx = interrupt number
   208                              <1> 		;	cx = options
   209                              <1> 		; CHG:	di, eax. edx, bp
   210                              <1> 		; STT:	ds = es = ss
   211                              <1> 		;	prephack called
   212                              <1> .do:
   213 000008A8 881E[0000]          <1> 	mov byte [lastint], bl
   214                              <1> internaldatarelocation
   215 000008AC E8(0000)            <1> 	extcallcall handle_serial_flags_ctrl_c
   216 000008AF E8(0000)            <1> 	extcallcall dohack
   217 000008B2 BF[0000]            <1> 	mov di, relocated(line_out)
   218                              <1> linkdatarelocation line_out
   219 000008B5 B8696E              <1> 	mov ax, "in"
   220 000008B8 AB                  <1> 	stosw
   221 000008B9 B87420              <1> 	mov ax, "t "
   222 000008BC AB                  <1> 	stosw
   223 000008BD 88D8                <1> 	mov al, bl
   224 000008BF E8(0000)            <1> 	extcallcall hexbyte
   225 000008C2 B020                <1> 	mov al, 32
   226 000008C4 AA                  <1> 	stosb
   227                              <1> %if _PM
   228 000008C5 84C9                <1> 	test cl, cl
   229 000008C7 7545                <1> 	jnz .rm
   230 000008C9 E8(0000)            <1> 	extcallcall ispm
   231 000008CC 7540                <1> 	jnz .rm
   232                              <1> 
   233 000008CE B80402              <1> 	mov ax, 0204h
   234 000008D1 80FB20              <1> 	cmp bl, 20h
   235 000008D4 80D701              <1> 	adc bh, 1	; if below, bh = 2
   236                              <1> .loopexception:
   237 000008D7 51                  <1> 	push cx
   238 000008D8 CD31                <1> 	int 31h
   239 000008DA 89C8                <1> 	mov ax, cx
   240 000008DC 59                  <1> 	pop cx
   241 000008DD 7303E9BC00          <1> 	jc .failed
   242 000008E2 E8(0000)            <1> 	extcallcall hexword
   243 000008E5 B03A                <1> 	mov al, ':'
   244 000008E7 AA                  <1> 	stosb
   245                              <1> %if ELD && 1
   246                              <1> 	testopt [relocateddata], 8000h
   247                              <1> linkdatarelocation internalflags, -3
   248                              <1> 	jz @F
   249                              <1> 	o32
   250                              <1> @@:
   251                              <1> %else
   252 000008E8 66                  <1> 	_386_PM_o32	; mov eax, edx
   253                              <1> %endif
   254 000008E9 89D0                <1> 	mov ax, dx
   255 000008EB 803E[0000]00        <1> 	cmp byte [relocated(dpmi32)], 0
   256                              <1> linkdatarelocation dpmi32, -3
   257 000008F0 7403                <1> 	jz .gate16
   258 000008F2 E8(0000)            <1> 	extcallcall hexword_high
   259                              <1> .gate16:
   260 000008F5 E8(0000)            <1> 	extcallcall hexword
   261 000008F8 B020                <1> 	mov al, 32
   262 000008FA AA                  <1> 	stosb
   263 000008FB B80202              <1> 	mov ax, 0202h
   264 000008FE FECF                <1> 	dec bh
   265 00000900 75D5                <1> 	jnz .loopexception
   266 00000902 4F                  <1> 	dec di
   267 00000903 E8(0000)            <1> 	extcallcall unhack
   268 00000906 53                  <1> 	push bx
   269 00000907 51                  <1> 	push cx
   270 00000908 E8(0000)            <1> 	extcallcall putsline_crlf
   271 0000090B 59                  <1> 	pop cx
   272 0000090C 5B                  <1> 	pop bx
   273 0000090D C3                  <1> 	retn
   274                              <1> 
   275                              <1> .rm:
   276                              <1> %endif
   277 0000090E 53                  <1> 	push bx
   278 0000090F 51                  <1> 	push cx
   279 00000910 56                  <1> 	push si
   280                              <1> 
   281 00000911 53                  <1> 	push bx
   282 00000912 31ED                <1> 	xor bp, bp
   283 00000914 D1E3                <1> 	shl bx, 1
   284 00000916 D1E3                <1> 	shl bx, 1
   285 00000918 31D2                <1> 	xor dx, dx
   286                              <1> %if _PM
   287 0000091A E8(0000)            <1> 	extcallcall setes2dx
   288                              <1> %else
   289                              <1> 	mov es, dx			; es => IVT
   290                              <1> %endif
   291 0000091D 268B4702            <1> 	mov ax, word [es:bx + 2]	; ax = segment
   292 00000921 268B17              <1> 	mov dx, word [es:bx]
   293 00000924 5B                  <1> 	pop bx
   294                              <1> 
   295                              <1> %if !_LOADER
   296 00000925 F6C502              <1> 	test ch, 2
   297 00000928 7403E98100          <1> 	jnz int_list
   298                              <1> %endif
   299                              <1> 
   300                              <1> .loop_chain:
   301 0000092D 50                  <1> 	push ax				; segment
   302 0000092E 52                  <1> 	push dx
   303                              <1> 
   304 0000092F 16                  <1> 	 push ss
   305 00000930 07                  <1> 	 pop es				; ! es = ss
   306 00000931 E8(0000)            <1> 	extcallcall hexword
   307 00000934 B03A                <1> 	mov al, ':'
   308 00000936 AA                  <1> 	stosb
   309 00000937 89D0                <1> 	mov ax, dx
   310 00000939 E8(0000)            <1> 	extcallcall hexword
   311                              <1> 
   312 0000093C 5B                  <1> 	pop bx
   313 0000093D 5A                  <1> 	pop dx				; segment
   314                              <1> 
   315 0000093E 8916[0200]          <1> 	mov word [intaddress + 2], dx
   316                              <1> internaldatarelocation
   317 00000942 891E[0000]          <1> 	mov word [intaddress], bx
   318                              <1> internaldatarelocation
   319                              <1> 
   320 00000946 45                  <1> 	inc bp
   321 00000947 81FD0001            <1> 	cmp bp, 256
   322 0000094B 774C                <1> 	ja .toomany			; --> (! es = ss)
   323                              <1> 
   324 0000094D E82903              <1> 	call check_int_chain
   325 00000950 722C                <1> 	jc .end_chain
   326                              <1> 
   327 00000952 52                  <1> 	push dx				; segment
   328 00000953 50                  <1> 	push ax
   329 00000954 16                  <1> 	 push ss
   330 00000955 07                  <1> 	 pop es
   331 00000956 E8(0000)            <1> 	extcallcall unhack
   332 00000959 51                  <1> 	push cx
   333 0000095A E8(0000)            <1> 	extcallcall copy_single_counted_string
   334 0000095D 59                  <1> 	pop cx
   335 0000095E E8C703              <1> 	call .mcbname
   336 00000961 51                  <1> 	push cx
   337 00000962 E8(0000)            <1> 	extcallcall putsline_crlf
   338 00000965 59                  <1> 	pop cx
   339 00000966 E8(0000)            <1> 	extcallcall handle_serial_flags_ctrl_c
   340 00000969 E8(0000)            <1> 	extcallcall dohack
   341 0000096C BF[0000]            <1> 	mov di, relocated(line_out)
   342                              <1> linkdatarelocation line_out
   343 0000096F B8202D              <1> 	mov ax, " -"
   344 00000972 AB                  <1> 	stosw
   345 00000973 B82D3E              <1> 	mov ax, "->"
   346 00000976 AB                  <1> 	stosw
   347 00000977 B020                <1> 	mov al, 32
   348 00000979 AA                  <1> 	stosb
   349                              <1> 
   350 0000097A 5A                  <1> 	pop dx
   351 0000097B 58                  <1> 	pop ax				; (ax = segment)
   352 0000097C EBAF                <1> 	jmp .loop_chain
   353                              <1> 
   354                              <1> .end_chain:
   355 0000097E 16                  <1> 	 push ss
   356 0000097F 07                  <1> 	 pop es
   357 00000980 750A                <1> 	jnz @F
   358                              <1> .end_chain_string:
   359 00000982 E8(0000)            <1> 	extcallcall unhack
   360 00000985 51                  <1> 	push cx
   361 00000986 E8(0000)            <1> 	extcallcall copy_single_counted_string
   362 00000989 59                  <1> 	pop cx
   363 0000098A EB03                <1> 	jmp @FF
   364                              <1> @@:
   365 0000098C E8(0000)            <1> 	extcallcall unhack
   366                              <1> @@:
   367 0000098F E89603              <1> 	call .mcbname
   368 00000992 E8(0000)            <1> 	extcallcall putsline_crlf
   369                              <1> .86next:
   370 00000995 5E                  <1> 	pop si
   371 00000996 59                  <1> 	pop cx
   372 00000997 5B                  <1> 	pop bx
   373 00000998 C3                  <1> 	retn
   374                              <1> 
   375                              <1> .toomany:
   376 00000999 BE[0000]            <1> 	mov si, msg.di_toomany
   377                              <1> internaldatarelocation
   378 0000099C EBE4                <1> 	jmp .end_chain_string
   379                              <1> 
   380                              <1>  %if _PM
   381                              <1> .failed:
   382 0000099E E8(0000)            <1> 	extcallcall unhack
   383 000009A1 5A                  <1> 	pop dx				; discard a near return address
   384 000009A2 BA[0000]            <1> 	mov dx, gatewrong
   385                              <1> internaldatarelocation
   386 000009A5 B83401              <1> 	mov ax, 0134h
   387 000009A8 E8(0000)            <1> 	extcallcall setrc
   388                              <1> %if ELD
   389                              <1> 	extcallcall putsz
   390                              <1> 	retn
   391                              <1> %else
   392 000009AB E9(0000)            <1> 	jmp putsz
   393                              <1> %endif
   394                              <1>  %endif
   395                              <1> 
   396                              <1> 
   397                              <1> %if 0
   398                              <1> 
   399                              <1> For the DIL command we fill the auxiliary buffer with entries
   400                              <1> for each interrupt entrypoint. They are found by starting from
   401                              <1> the IVT as well as the AMIS interrupt lists. Of course, any
   402                              <1> entrypoint may be found from more than one point.
   403                              <1> 
   404                              <1> The format is as follows:
   405                              <1> 
   406                              <1> dword - vector
   407                              <1> word - flags and AMIS multiplex number (low byte)
   408                              <1> 	flag 200h = unclaimed, AMIS multiplex number not initialised
   409                              <1> 	flag 100h = immediately from IVT (and is the very first entry in auxbuff)
   410                              <1> 	if this word is -1 then it is not an entry, it is a terminator
   411                              <1> word - which entry in an AMIS interrupt list
   412                              <1> 
   413                              <1> A terminator is an entry with all ones (-1).
   414                              <1> Two consecutive terminators indicate the last chain ended.
   415                              <1> After a single terminator another chain follows.
   416                              <1> Any chain after the very first is a hidden chain,
   417                              <1> that is, its handlers are not reachable from the IVT
   418                              <1> by walking the downlinks.
   419                              <1> 
   420                              <1> A hidden chain may be found which eventually feeds into
   421                              <1> another hidden chain found previously. In this case, the
   422                              <1> new unique handlers (at least 1) are prepended to the
   423                              <1> pre-existing hidden chain, and the downlinks past this
   424                              <1> point are not walked further (as they're already known).
   425                              <1> 
   426                              <1> If an AMIS interface points to a handler that we already
   427                              <1> know (in the first IVT-based chain or any hidden chain)
   428                              <1> then its downlink will not be walked again. However, the
   429                              <1> multiplex number and list index will be entered into the
   430                              <1> entry for this interrupt handler.
   431                              <1> 
   432                              <1> Finally, after the IVT and all interrupt lists of all AMIS
   433                              <1> multiplexers have been processed, the auxbuff list is used
   434                              <1> to display the found chains (one IVT, any amount hidden).
   435                              <1> 
   436                              <1> %endif
   437                              <1> 
   438                              <1> %if !_LOADER
   439                              <1> int_list:
   440 000009AE 57                  <1> 	push di
   441 000009AF 51                  <1> 	push cx
   442 000009B0 53                  <1> 	push bx
   443 000009B1 92                  <1> 	xchg ax, dx			; dx = segment
   444                              <1> 
   445 000009B2 368E06[0000]        <1> 	mov es, word [ss:relocated(auxbuff_segorsel)]
   446                              <1> linkdatarelocation auxbuff_segorsel
   447 000009B7 31FF                <1> 	xor di, di			; -> auxbuff
   448 000009B9 AB                  <1> 	stosw				; store offset
   449 000009BA 92                  <1> 	xchg ax, dx			; dx = offset
   450 000009BB AB                  <1> 	stosw				; store segment
   451 000009BC 92                  <1> 	xchg ax, dx			; dx = segment
   452 000009BD 93                  <1> 	xchg bx, ax			; bx = offset
   453 000009BE B80003              <1> 	mov ax, 300h			; flag for IVT | unused
   454 000009C1 AB                  <1> 	stosw				; which multiplex number
   455 000009C2 31C0                <1> 	xor ax, ax
   456 000009C4 AB                  <1> 	stosw				; which int list entry = none = 0
   457                              <1> 
   458                              <1> .loop_ivt_chain:
   459 000009C5 E8B102              <1> 	call check_int_chain
   460 000009C8 721A                <1> 	jc .end_ivt_chain
   461                              <1> 
   462                              <1> %if ! ELD && _AUXBUFFSIZE == _AUXBUFFMAXSIZE
   463                              <1> 	cmp di, _AUXBUFFSIZE - 8 * 3	; enough for 1 entry + 2 terminators ?
   464                              <1> %else
   465 000009CA 363B3E[0000]        <1> 	cmp di, word [ss:relocated(auxbuff_current_size_minus_24)]
   466                              <1> linkdatarelocation auxbuff_current_size_minus_24
   467                              <1> %endif
   468 000009CF 773A                <1> 	ja .error
   469 000009D1 368E06[0000]        <1> 	mov es, word [ss:relocated(auxbuff_segorsel)]
   470                              <1> linkdatarelocation auxbuff_segorsel
   471 000009D6 AB                  <1> 	stosw				; store offset
   472 000009D7 92                  <1> 	xchg ax, dx
   473 000009D8 AB                  <1> 	stosw				; store segment
   474 000009D9 92                  <1> 	xchg ax, dx
   475 000009DA 93                  <1> 	xchg bx, ax
   476 000009DB B80002              <1> 	mov ax, 200h			; flag for unused
   477 000009DE AB                  <1> 	stosw				; found in chain = 200h
   478 000009DF 31C0                <1> 	xor ax, ax
   479 000009E1 AB                  <1> 	stosw
   480 000009E2 EBE1                <1> 	jmp .loop_ivt_chain
   481                              <1> 
   482                              <1> .end_ivt_chain:
   483 000009E4 B8FFFF              <1> 	mov ax, -1
   484 000009E7 368E06[0000]        <1> 	mov es, word [ss:relocated(auxbuff_segorsel)]
   485                              <1> linkdatarelocation auxbuff_segorsel
   486 000009EC B90800              <1> 	mov cx, 8
   487 000009EF F3AB                <1> 	rep stosw			; terminator is all-ones
   488                              <1> 					; (two terminators actually)
   489                              <1> 
   490 000009F1 B02D                <1> 	mov al, 2Dh
   491 000009F3 E8(0000)            <1> 	extcallcall intchk			; ZR if offset = -1 or segment = 0
   492                              <1> 					; CHG: ax, dx, bx
   493 000009F6 7412                <1> 	jz .done
   494                              <1> 
   495 000009F8 31C0                <1> 	xor ax, ax
   496                              <1> .loopplex:
   497 000009FA B000                <1> 	mov al, 00h			; AMIS installation check
   498                              <1> 		; function 0 changes dx, di, cx, al
   499                              <1> %if _PM
   500 000009FC E8(0000)            <1> 	extcallcall call_int2D
   501                              <1> %else
   502                              <1> 	int 2Dh				; enquire whether there's anyone
   503                              <1> 					;  but we don't care who it might be
   504                              <1> %endif
   505 000009FF FEC0                <1> 	inc al				; = FFh ?
   506 00000A01 7503E91101          <1> 	jz .search			; yes, it is in use -->
   507                              <1> .nextplex:
   508 00000A06 FEC4                <1> 	inc ah
   509 00000A08 75F0                <1> 	jnz .loopplex			; try next multiplexer -->
   510                              <1> 
   511                              <1> .done:
   512 00000A0A A8                  <1> 	db __TEST_IMM8			; (NC)
   513                              <1> .error:
   514 00000A0B F9                  <1> 	stc
   515                              <1> 
   516 00000A0C 5B                  <1> 	pop bx
   517 00000A0D 59                  <1> 	pop cx
   518 00000A0E 5F                  <1> 	pop di
   519 00000A0F 16                  <1> 	 push ss
   520 00000A10 1F                  <1> 	 pop ds
   521 00000A11 16                  <1> 	 push ss
   522 00000A12 07                  <1> 	 pop es
   523                              <1> 
   524 00000A13 BE[0000]            <1> 	mov si, msg.di_error
   525                              <1> internaldatarelocation
   526 00000A16 7303E9B900          <1> 	jc .error_string
   527                              <1> 
   528 00000A1B 31F6                <1> 	xor si, si
   529                              <1> 
   530                              <1> .loop_chain:
   531 00000A1D 8E1E[0000]          <1> 	mov ds, word [relocated(auxbuff_segorsel)]
   532                              <1> linkdatarelocation auxbuff_segorsel
   533 00000A21 AD                  <1> 	lodsw
   534 00000A22 92                  <1> 	xchg ax, dx
   535 00000A23 AD                  <1> 	lodsw
   536 00000A24 833CFF              <1> 	cmp word [si], -1
   537 00000A27 8D7404              <1> 	lea si, [si + 4]
   538 00000A2A 747A                <1> 	je .next_seq
   539                              <1> 
   540                              <1> .next_chain:
   541 00000A2C 16                  <1> 	 push ss
   542 00000A2D 1F                  <1> 	 pop ds
   543                              <1> 
   544 00000A2E 50                  <1> 	push ax				; segment
   545 00000A2F 52                  <1> 	push dx
   546                              <1> 
   547 00000A30 16                  <1> 	 push ss
   548 00000A31 07                  <1> 	 pop es
   549 00000A32 E8(0000)            <1> 	extcallcall hexword
   550 00000A35 B03A                <1> 	mov al, ':'
   551 00000A37 AA                  <1> 	stosb
   552 00000A38 89D0                <1> 	mov ax, dx
   553 00000A3A E8(0000)            <1> 	extcallcall hexword
   554                              <1> 
   555 00000A3D 5B                  <1> 	pop bx
   556 00000A3E 5A                  <1> 	pop dx				; segment
   557                              <1> 
   558 00000A3F 8916[0200]          <1> 	mov word [intaddress + 2], dx
   559                              <1> internaldatarelocation
   560 00000A43 891E[0000]          <1> 	mov word [intaddress], bx
   561                              <1> internaldatarelocation
   562                              <1> 
   563 00000A47 56                  <1> 	push si
   564 00000A48 E82E02              <1> 	call check_int_chain
   565 00000A4B 722E                <1> 	jc .end_chain
   566                              <1> 
   567 00000A4D 16                  <1> 	 push ss
   568 00000A4E 07                  <1> 	 pop es
   569 00000A4F E8(0000)            <1> 	extcallcall unhack
   570 00000A52 51                  <1> 	push cx
   571 00000A53 E8(0000)            <1> 	extcallcall copy_single_counted_string
   572 00000A56 59                  <1> 	pop cx
   573 00000A57 5E                  <1> 	pop si
   574 00000A58 E88B00              <1> 	call .mpx
   575 00000A5B 56                  <1> 	push si
   576 00000A5C E8C902              <1> 	call gateout.mcbname
   577 00000A5F 51                  <1> 	push cx
   578 00000A60 E8(0000)            <1> 	extcallcall putsline_crlf
   579 00000A63 59                  <1> 	pop cx
   580 00000A64 E8(0000)            <1> 	extcallcall handle_serial_flags_ctrl_c
   581 00000A67 E8(0000)            <1> 	extcallcall dohack
   582 00000A6A BF[0000]            <1> 	mov di, relocated(line_out)
   583                              <1> linkdatarelocation line_out
   584 00000A6D B8202D              <1> 	mov ax, " -"
   585 00000A70 AB                  <1> 	stosw
   586 00000A71 B82D3E              <1> 	mov ax, "->"
   587 00000A74 AB                  <1> 	stosw
   588 00000A75 B020                <1> 	mov al, 32
   589 00000A77 AA                  <1> 	stosb
   590                              <1> 
   591 00000A78 5E                  <1> 	pop si
   592 00000A79 EBA2                <1> 	jmp .loop_chain
   593                              <1> 
   594                              <1> .end_chain:
   595 00000A7B 16                  <1> 	 push ss
   596 00000A7C 07                  <1> 	 pop es
   597 00000A7D 750A                <1> 	jnz @F
   598 00000A7F E8(0000)            <1> 	extcallcall unhack
   599 00000A82 51                  <1> 	push cx
   600 00000A83 E8(0000)            <1> 	extcallcall copy_single_counted_string
   601 00000A86 59                  <1> 	pop cx
   602 00000A87 EB03                <1> 	jmp @FF
   603                              <1> @@:
   604 00000A89 E8(0000)            <1> 	extcallcall unhack
   605                              <1> @@:
   606 00000A8C 5E                  <1> 	pop si
   607 00000A8D E85600              <1> 	call .mpx
   608 00000A90 56                  <1> 	push si
   609 00000A91 E89402              <1> 	call gateout.mcbname
   610 00000A94 51                  <1> 	push cx
   611 00000A95 E8(0000)            <1> 	extcallcall putsline_crlf
   612 00000A98 59                  <1> 	pop cx
   613 00000A99 BF[0000]            <1> 	mov di, relocated(line_out)
   614                              <1> linkdatarelocation line_out
   615 00000A9C E8(0000)            <1> 	extcallcall handle_serial_flags_ctrl_c
   616 00000A9F E8(0000)            <1> 	extcallcall dohack
   617 00000AA2 5E                  <1> 	pop si
   618 00000AA3 E977FF              <1> 	jmp .loop_chain
   619                              <1> 
   620                              <1> .next_seq:
   621 00000AA6 AD                  <1> 	lodsw
   622 00000AA7 92                  <1> 	xchg ax, dx
   623 00000AA8 AD                  <1> 	lodsw
   624 00000AA9 833CFF              <1> 	cmp word [si], -1
   625 00000AAC 8D7404              <1> 	lea si, [si + 4]
   626 00000AAF 741A                <1> 	je @F
   627                              <1> 
   628 00000AB1 16                  <1> 	 push ss
   629 00000AB2 1F                  <1> 	 pop ds
   630 00000AB3 16                  <1> 	 push ss
   631 00000AB4 07                  <1> 	 pop es
   632 00000AB5 E8(0000)            <1> 	extcallcall unhack
   633 00000AB8 51                  <1> 	push cx
   634 00000AB9 56                  <1> 	push si
   635 00000ABA BE[0000]            <1> 	mov si, msg.di_hidden
   636                              <1> internaldatarelocation
   637 00000ABD E8(0000)            <1> 	extcallcall copy_single_counted_string
   638 00000AC0 5E                  <1> 	pop si
   639 00000AC1 59                  <1> 	pop cx
   640 00000AC2 E8(0000)            <1> 	extcallcall handle_serial_flags_ctrl_c
   641 00000AC5 E8(0000)            <1> 	extcallcall dohack
   642                              <1> 
   643 00000AC8 E961FF              <1> 	jmp .next_chain
   644                              <1> 
   645                              <1> @@:
   646 00000ACB 16                  <1> 	 push ss
   647 00000ACC 1F                  <1> 	 pop ds
   648 00000ACD 16                  <1> 	 push ss
   649 00000ACE 07                  <1> 	 pop es
   650 00000ACF E8(0000)            <1> 	extcallcall unhack
   651 00000AD2 EB0F                <1> 	jmp @F
   652                              <1> 
   653                              <1> 
   654                              <1> .error_string:
   655 00000AD4 E8(0000)            <1> 	extcallcall copy_single_counted_string
   656                              <1> 
   657 00000AD7 E8(0000)            <1> 	extcallcall unhack
   658 00000ADA E8(0000)            <1> 	extcallcall putsline_crlf
   659 00000ADD B83301              <1> 	mov ax, 0133h
   660 00000AE0 E8(0000)            <1> 	extcallcall setrc
   661                              <1> @@:
   662                              <1> %if 0	; _DEBUG
   663                              <1> 	mov es, word [auxbuff_segorsel]
   664                              <1> 	int3
   665                              <1> 	push ss
   666                              <1> 	pop es
   667                              <1> %endif
   668 00000AE3 E9AFFE              <1> 	jmp gateout.86next
   669                              <1> 
   670                              <1> 
   671                              <1> .mpx:
   672 00000AE6 8E06[0000]          <1> 	mov es, word [relocated(auxbuff_segorsel)]
   673                              <1> linkdatarelocation auxbuff_segorsel
   674 00000AEA 268B44FC            <1> 	mov ax, word [es:si - 4]
   675 00000AEE 268B54FE            <1> 	mov dx, word [es:si - 2]
   676 00000AF2 16                  <1> 	push ss
   677 00000AF3 07                  <1> 	pop es
   678 00000AF4 F6C402              <1> 	test ah, 2
   679 00000AF7 751D                <1> 	jnz @F
   680 00000AF9 56                  <1> 	push si
   681 00000AFA 51                  <1> 	push cx
   682 00000AFB BE[0000]            <1> 	mov si, msg.di_multiplex.1
   683                              <1> internaldatarelocation
   684 00000AFE E8(0000)            <1> 	extcallcall copy_single_counted_string
   685 00000B01 E8(0000)            <1> 	extcallcall hexbyte
   686 00000B04 BE[0000]            <1> 	mov si, msg.di_multiplex.2
   687                              <1> internaldatarelocation
   688 00000B07 E8(0000)            <1> 	extcallcall copy_single_counted_string
   689 00000B0A 92                  <1> 	xchg ax, dx
   690 00000B0B E8(0000)            <1> 	extcallcall hexword
   691 00000B0E BE[0000]            <1> 	mov si, msg.di_multiplex.3
   692                              <1> internaldatarelocation
   693 00000B11 E8(0000)            <1> 	extcallcall copy_single_counted_string
   694 00000B14 59                  <1> 	pop cx
   695 00000B15 5E                  <1> 	pop si
   696                              <1> @@:
   697 00000B16 C3                  <1> 	retn
   698                              <1> 
   699                              <1> 
   700                              <1> 		; INP:	ah = multiplex number of AMIS TSR to search through
   701                              <1> 		;	ss:sp-> interrupt number (byte), must be preserved
   702                              <1> 		; CHG:	es, di, dx, bx
   703                              <1> .search:
   704 00000B17 B004                <1> 	mov al, 04h
   705 00000B19 5B                  <1> 	pop bx
   706 00000B1A 53                  <1> 	push bx				; low byte is the interrupt number
   707                              <1> 		; function 4 changes dx, bx, al
   708                              <1> %if _PM
   709 00000B1B E8(0000)            <1> 	extcallcall call_int2D
   710                              <1> %else
   711                              <1> 	int 2Dh
   712                              <1> %endif
   713 00000B1E 3C03                <1> 	cmp al, 03h			; returned its interrupt entry ?
   714                              <1> 		; RBIL doesn't explicitly state that this interrupt entry has to
   715                              <1> 		; be IISP compatible. But I'm too lazy to look up the older AMIS,
   716                              <1> 		; and SearchIISPChain checks the interrupt entry anyway.
   717 00000B20 743D                <1> 	je .search_dxbx
   718 00000B22 3C04                <1> 	cmp al, 04h			; returned list of hooked interrupts ?
   719 00000B24 7403E9DDFE          <1> 	jne .nextplex			; no, try next multiplexer -->
   720 00000B29 89DF                <1> 	mov di, bx
   721 00000B2B 5B                  <1> 	pop bx
   722 00000B2C 53                  <1> 	push bx				; bl = interrupt number
   723 00000B2D 31C9                <1> 	xor cx, cx			; = index into list
   724 00000B2F 88D8                <1> 	mov al, bl
   725                              <1> .search_intlist_seg:
   726                              <1> %if _PM
   727 00000B31 E8(0000)            <1> 	extcallcall setes2dx
   728                              <1> %else
   729                              <1> 	mov es, dx			; es:di-> list
   730                              <1> %endif
   731                              <1> .search_intlist:		; Search the returned list for the required interrupt number.
   732 00000B34 AE                  <1> 	scasb				; our interrupt number ?
   733 00000B35 740E                <1> 	je .search_found_intlist
   734 00000B37 26807DFF2D          <1> 	cmp byte [es:di-1], 2Dh		; was last in list ?
   735 00000B3C 7503E9C5FE          <1> 	je .nextplex
   736 00000B41 AF                  <1> 	scasw				; skip pointer
   737 00000B42 41                  <1> 	inc cx
   738 00000B43 EBEF                <1> 	jmp short .search_intlist	; try next entry -->
   739                              <1> 
   740                              <1> .search_found_intlist:
   741 00000B45 268B1D              <1> 	mov bx, word [es:di]		; dx:bx = es:bx -> IISP entry
   742 00000B48 AF                  <1> 	scasw				; skip pointer
   743 00000B49 52                  <1> 	push dx				; preserve dx for .search_intlist_seg
   744 00000B4A 57                  <1> 	push di
   745 00000B4B E82200              <1> 	call .add
   746 00000B4E 5F                  <1> 	pop di
   747 00000B4F 5A                  <1> 	pop dx
   748 00000B50 7303E9B6FE          <1> 	jc .error
   749                              <1> 	; je .search_found		; found entry -->
   750                              <1> 		; This specific jump supports TSRs that hook the same
   751                              <1> 		; interrupt more than once; jumping to .nextplex instead
   752                              <1> 		; (as previously) aborts the search after the first match
   753                              <1> 		; in the interrupt list. This support might become useful.
   754 00000B55 3C2D                <1> 	cmp al, 2Dh			; was last in list ?
   755 00000B57 7503E9AAFE          <1> 	je .nextplex
   756 00000B5C 41                  <1> 	inc cx
   757 00000B5D EBD2                <1> 	jmp short .search_intlist_seg
   758                              <1> 
   759                              <1> .search_dxbx:
   760                              <1> %if _PM
   761 00000B5F E8(0000)            <1> 	extcallcall setes2dx
   762                              <1> %else
   763                              <1> 	mov es, dx			; es:bx-> (IISP) interrupt entry
   764                              <1> %endif
   765                              <1> 		; The entry we found now is possibly behind the non-IISP entry that
   766                              <1> 		; terminated our first SearchIISPChain call (at .hard). We then
   767                              <1> 		; possibly might find our entry in this hidden part of the chain.
   768 00000B62 B9FFFF              <1> 	mov cx, -1			; indicator for return = 3 (no list)
   769 00000B65 E80800              <1> 	call .add
   770 00000B68 7303E99EFE          <1> 	jc .error
   771                              <1> 	; jne .nextplex			; didn't find our entry in the chain -->
   772 00000B6D E996FE              <1> 	jmp .nextplex
   773                              <1> 
   774                              <1> 
   775                              <1> int_list.add:
   776 00000B70 31FF                <1> 	xor di, di			; start at beginning of buffer
   777 00000B72 368E1E[0000]        <1> 	mov ds, word [ss:relocated(auxbuff_segorsel)]
   778                              <1> linkdatarelocation auxbuff_segorsel
   779                              <1> 					; ds => auxbuff
   780 00000B77 BEFFFF              <1> 	mov si, -1			; check all
   781 00000B7A E8D900              <1> 	call .check			; check for match
   782 00000B7D 7516                <1> 	jne @F				; not matched, di -> second terminator
   783 00000B7F F6450502            <1> 	testopt [di + 4], 200h		; not yet claimed by a multiplexer ?
   784 00000B83 7503E9CC00          <1> 	jz .error			; no, error -->
   785 00000B88 886504              <1> 	mov byte [di + 4], ah		; store the multiplex number
   786 00000B8B 806505FD            <1> 	clropt [di + 4], 200h		; indicate it is claimed
   787 00000B8F 894D06              <1> 	mov word [di + 6], cx		; = how many list entries before ours,
   788                              <1> 					;  or = -1 if not from a list
   789 00000B92 E9BE00              <1> 	jmp .done
   790                              <1> 
   791                              <1> @@:
   792                              <1> 		; ds:di -> second terminator (will be overwritten)
   793                              <1> %if ! ELD && _AUXBUFFSIZE == _AUXBUFFMAXSIZE
   794                              <1> 	cmp di, _AUXBUFFSIZE - 8 * 3	; enough for 1 entry + 2 terminators ?
   795                              <1> %else
   796 00000B95 363B3E[0000]        <1> 	cmp di, word [ss:relocated(auxbuff_current_size_minus_24)]
   797                              <1> linkdatarelocation auxbuff_current_size_minus_24
   798                              <1> %endif
   799 00000B9A 7603E9B500          <1> 	ja .error
   800 00000B9F 8D75F8              <1> 	lea si, [di - 8]		; check up to this point later
   801                              <1> 					;  si -> first of two terminators
   802                              <1> 
   803 00000BA2 93                  <1> 	xchg ax, bx
   804 00000BA3 368E06[0000]        <1> 	mov es, word [ss:relocated(auxbuff_segorsel)]
   805                              <1> linkdatarelocation auxbuff_segorsel
   806                              <1> 					; => auxbuff
   807 00000BA8 AB                  <1> 	stosw				; store offset
   808 00000BA9 92                  <1> 	xchg ax, dx			; dx = offset
   809 00000BAA AB                  <1> 	stosw				; store segment
   810 00000BAB 92                  <1> 	xchg ax, dx			; dx = segment
   811 00000BAC 93                  <1> 	xchg ax, bx			; dx:bx = vector -> handler
   812 00000BAD 50                  <1> 	push ax
   813 00000BAE B000                <1> 	mov al, 0			; flags = 0 (claimed, not IVT)
   814 00000BB0 86C4                <1> 	xchg al, ah
   815 00000BB2 AB                  <1> 	stosw				; which multiplex number
   816 00000BB3 89C8                <1> 	mov ax, cx
   817 00000BB5 AB                  <1> 	stosw				; which int list entry
   818 00000BB6 58                  <1> 	pop ax				; preserve multiplex number
   819                              <1> 
   820                              <1> .loop_chain:
   821 00000BB7 50                  <1> 	push ax
   822 00000BB8 56                  <1> 	push si
   823 00000BB9 E8BD00              <1> 	call check_int_chain		; does it go on ?
   824 00000BBC 5E                  <1> 	pop si
   825 00000BBD 5B                  <1> 	pop bx
   826 00000BBE 7303                <1> 	jnc @F		; for _LINK compat
   827 00000BC0 E97F00              <1> 	jmp strict near .end_chain	; no -->
   828                              <1> @@:
   829                              <1> 
   830                              <1> %if ! ELD && _AUXBUFFSIZE == _AUXBUFFMAXSIZE
   831                              <1> 	cmp di, _AUXBUFFSIZE - 8 * 3	; enough for 1 entry + 2 terminators ?
   832                              <1> %else
   833 00000BC3 363B3E[0000]        <1> 	cmp di, word [ss:relocated(auxbuff_current_size_minus_24)]
   834                              <1> linkdatarelocation auxbuff_current_size_minus_24
   835                              <1> %endif
   836 00000BC8 7603E98700          <1> 	ja .error
   837 00000BCD 368E06[0000]        <1> 	mov es, word [ss:relocated(auxbuff_segorsel)]
   838                              <1> linkdatarelocation auxbuff_segorsel
   839 00000BD2 AB                  <1> 	stosw				; store offset
   840 00000BD3 92                  <1> 	xchg ax, dx
   841 00000BD4 AB                  <1> 	stosw				; store segment
   842 00000BD5 92                  <1> 	xchg ax, dx
   843 00000BD6 93                  <1> 	xchg bx, ax			; ah = multiplex number, bx = offset
   844 00000BD7 50                  <1> 	push ax
   845 00000BD8 B80002              <1> 	mov ax, 200h
   846 00000BDB AB                  <1> 	stosw				; found in chain = 200h (unclaimed)
   847 00000BDC 31C0                <1> 	xor ax, ax
   848 00000BDE AB                  <1> 	stosw
   849 00000BDF 58                  <1> 	pop ax
   850 00000BE0 57                  <1> 	push di
   851 00000BE1 31FF                <1> 	xor di, di			; start at beginning
   852 00000BE3 E87000              <1> 	call .check			; already listed in another chain ?
   853 00000BE6 7403                <1> 	je @F
   854 00000BE8 5F                  <1> 	pop di
   855 00000BE9 EBCC                <1> 	jmp .loop_chain			; no, try to walk downlink -->
   856                              <1> 
   857                              <1> @@:
   858 00000BEB 5B                  <1> 	pop bx
   859                              <1> 
   860                              <1> 		; The idea is that if the AMIS interrupt list
   861                              <1> 		;  pointed to an entry not yet matched then
   862                              <1> 		;  it is the start of a hidden chain. If a
   863                              <1> 		;  subsequent handler in this hidden chain
   864                              <1> 		;  points to another handler that does match
   865                              <1> 		;  this can only be a valid case if this other
   866                              <1> 		;  handler also was the start of a hidden chain.
   867                              <1> 		; If this is the case, prepend the unique new
   868                              <1> 		;  handlers to that hidden chain in the buffer.
   869 00000BEC F6450501            <1> 	testopt [di + 4], 100h		; is it from the IVT ? (very first entry)
   870 00000BF0 7562                <1> 	jnz .error			; yes, error -->
   871 00000BF2 837DFCFF            <1> 	cmp word [di - 8 + 4], -1	; is it the start of a hidden chain ?
   872 00000BF6 755C                <1> 	jne .error			; no, error -->
   873                              <1> 		; di -> match (insert to move here)
   874                              <1> 		; bx -> after repeat
   875                              <1> 		; bx - 8 -> repeat
   876                              <1> 		; bx - 16 -> last entry to move (at least 1 to move)
   877                              <1> 		; si -> single terminator
   878                              <1> 		; si + 8 -> first entry to move (at least 1 to move)
   879                              <1> 
   880 00000BF8 83EB10              <1> 	sub bx, 16			; -> last entry to move
   881                              <1> 
   882                              <1> .insert:
   883                              <1> 		; di -> match (insert to move here)
   884                              <1> 		; bx + 8 -> repeat
   885                              <1> 		; bx -> last entry to move
   886                              <1> 		; si -> single terminator
   887                              <1> 		; si + 8 -> first entry to move
   888                              <1> 
   889 00000BFB FF7706              <1> 	push word [bx + 6]
   890 00000BFE FF7704              <1> 	push word [bx + 4]
   891 00000C01 FF7702              <1> 	push word [bx + 2]
   892 00000C04 FF37                <1> 	push word [bx]			; get the last entry
   893 00000C06 57                  <1> 	push di
   894 00000C07 56                  <1> 	push si
   895 00000C08 51                  <1> 	push cx				; preserve interrupt list index
   896 00000C09 368E06[0000]        <1> 	mov es, word [ss:relocated(auxbuff_segorsel)]
   897                              <1> linkdatarelocation auxbuff_segorsel
   898 00000C0E 89F9                <1> 	mov cx, di			; = where to insert
   899                              <1> 					;  -> first to displace
   900 00000C10 F7D9                <1> 	neg cx
   901 00000C12 89DE                <1> 	mov si, bx			; -> after end of source
   902 00000C14 8D7F08              <1> 	lea di, [bx + 8]		; -> after end of dest
   903 00000C17 01F1                <1> 	add cx, si			; after end of source - first to displace
   904                              <1> 					; = how many bytes to displace
   905 00000C19 D1E9                <1> 	shr cx, 1
   906 00000C1B FD                  <1> 	std				; _AMD_ERRATUM_109_WORKAROUND as below
   907 00000C1C A7                  <1> 	cmpsw				; si -= 2, di -= 2
   908                              <1> 
   909                              <1> 	numdef AMD_ERRATUM_109_WORKAROUND, 1
   910                              <1> 		; Refer to comment in init.asm init_movp.
   911                              <1> 
   912                              <1> %if _AMD_ERRATUM_109_WORKAROUND
   913 00000C1D E308                <1> 	jcxz @FF
   914 00000C1F 83F914              <1> 	cmp cx, 20
   915 00000C22 7703                <1> 	ja @FF
   916                              <1> @@:
   917 00000C24 A5                  <1> 	movsw
   918 00000C25 E2FD                <1> 	loop @B
   919                              <1> @@:
   920                              <1> %endif
   921 00000C27 F3A5                <1> 	rep movsw			; relocate up the following entries
   922                              <1> 					;  by 8 bytes (size of 1 entry)
   923 00000C29 FC                  <1> 	cld
   924 00000C2A 59                  <1> 	pop cx
   925 00000C2B 5E                  <1> 	pop si
   926 00000C2C 5F                  <1> 	pop di
   927 00000C2D 8F05                <1> 	pop word [di]
   928 00000C2F 8F4502              <1> 	pop word [di + 2]
   929 00000C32 8F4504              <1> 	pop word [di + 4]
   930 00000C35 8F4506              <1> 	pop word [di + 6]		; insert moved entry
   931 00000C38 83C608              <1> 	add si, 8			; -> at moved single terminator
   932                              <1> 
   933                              <1> 		; di -> match (inserted here, insert next here)
   934                              <1> 		; bx + 8 -> repeat
   935                              <1> 		; bx -> last entry to move (if any)
   936                              <1> 		; si -> single terminator
   937                              <1> 		; si + 8 -> first entry to move
   938 00000C3B 39DE                <1> 	cmp si, bx			; if last to move != terminator
   939 00000C3D 75BC                <1> 	jne .insert			; then move another ->
   940 00000C3F 89F7                <1> 	mov di, si			; -> where to put double terminator
   941                              <1> 
   942 00000C41 93                  <1> 	xchg ax, bx
   943                              <1> .end_chain:
   944 00000C42 53                  <1> 	push bx
   945 00000C43 51                  <1> 	push cx				; preserve interrupt list index
   946 00000C44 B8FFFF              <1> 	mov ax, -1
   947 00000C47 368E06[0000]        <1> 	mov es, word [ss:relocated(auxbuff_segorsel)]
   948                              <1> linkdatarelocation auxbuff_segorsel
   949 00000C4C B90800              <1> 	mov cx, 8
   950 00000C4F F3AB                <1> 	rep stosw			; terminator is all-ones
   951                              <1> 					; (two terminators actually)
   952 00000C51 59                  <1> 	pop cx
   953 00000C52 58                  <1> 	pop ax				; preserve multiplex number
   954                              <1> 
   955                              <1> .done:
   956 00000C53 A8                  <1> 	db __TEST_IMM8			; (NC)
   957                              <1> .error:
   958 00000C54 F9                  <1> 	stc
   959                              <1> 
   960 00000C55 C3                  <1> 	retn
   961                              <1> 
   962                              <1> 
   963                              <1> 		; INP:	dx:bx = 86 Mode far pointer to handler
   964                              <1> 		;	di -> to check
   965                              <1> 		;	si = end of area to check (-1 = check all)
   966                              <1> 		; OUT:	ZR if match found, ds:di -> matching entry
   967                              <1> 		;	NZ if no match found,
   968                              <1> 		;	 di -> at second consecutive terminator
   969                              <1> 		;	 or di >= si
   970                              <1> 		; CHG:	-
   971                              <1> 		; STT:	ds => auxbuff
   972                              <1> 		; REM:	continues loop if di < si and the flags word
   973                              <1> 		;	 is not -1 in two consecutive entries.
   974                              <1> 		;	an entry with a flags word -1 is skipped.
   975                              <1> .check:
   976 00000C56 391D                <1> 	cmp word [di + 0], bx
   977 00000C58 7506                <1> 	jne .mismatch
   978 00000C5A 395502              <1> 	cmp word [di + 2], dx
   979 00000C5D 7501                <1> 	jne .mismatch
   980                              <1> .match:
   981 00000C5F C3                  <1> 	retn				; (ZR)
   982                              <1> 
   983                              <1> .mismatch:
   984 00000C60 83C708              <1> 	add di, 8
   985                              <1> 
   986 00000C63 39F7                <1> 	cmp di, si
   987 00000C65 730F                <1> 	jae .checkret
   988                              <1> 
   989 00000C67 837D04FF            <1> 	cmp word [di + 4], -1
   990 00000C6B 75E9                <1> 	jne .check
   991                              <1> 
   992 00000C6D 83C708              <1> 	add di, 8
   993 00000C70 837D04FF            <1> 	cmp word [di + 4], -1
   994 00000C74 75E0                <1> 	jne .check
   995                              <1> .checkret:
   996 00000C76 85FF                <1> 	test di, di			; (NZ)
   997 00000C78 C3                  <1> 	retn
   998                              <1> %endif	; !_LOADER
   999                              <1> 
  1000                              <1> 
  1001                              <1> 		; INP:	dx:bx = 86 Mode far pointer to int handler
  1002                              <1> 		; OUT:	NC if chain found,
  1003                              <1> 		;	 dx:ax = 86 Mode far pointer to next
  1004                              <1> 		;	 ss:si -> type message (counted)
  1005                              <1> 		;	CY if chain not found,
  1006                              <1> 		;	 NZ if no chain
  1007                              <1> 		;	 ZR if chain but next is FFFFh:FFFFh,
  1008                              <1> 		;	  ss:si -> type message
  1009                              <1> 		; STT:	es != ss, ds != ss
  1010                              <1> check_int_chain:
  1011                              <1> %if _PM
  1012 00000C79 E8(0000)            <1> 	extcallcall setes2dx
  1013                              <1> %else
  1014                              <1> 	mov es, dx			; es:bx -> entrypoint
  1015                              <1> %endif
  1016 00000C7C E8(0000)            <1> 	extcallcall IsIISPEntry?
  1017 00000C7F 7531                <1> 	jnz .not_iisp
  1018                              <1> 
  1019 00000C81 26FF7704            <1> 	push word [es:bx + ieNext + 2]
  1020 00000C85 26FF7702            <1> 	push word [es:bx + ieNext]
  1021                              <1> 
  1022 00000C89 BE[0000]            <1> 	mov si, msg.di_uninst_iisp
  1023                              <1> internaldatarelocation
  1024 00000C8C 26813F90EA          <1> 	cmp word [ es:bx + ieEntry ], 0EA90h	; nop\jmp far imm16:imm16 ?
  1025 00000C91 7414                <1> 	je @F
  1026 00000C93 BE[0000]            <1> 	mov si, msg.di_iisp
  1027                              <1> internaldatarelocation
  1028 00000C96 26807F09EB          <1> 	cmp byte [ es:bx + ieJmphwreset ], 0EBh	; jmp short ?
  1029 00000C9B 7507                <1> 	jne .nonstd
  1030 00000C9D 26813FEB10          <1> 	cmp word [ es:bx + ieEntry ], 010EBh	; jmp short $+18 ?
  1031 00000CA2 7403                <1> 	je @F
  1032                              <1> .nonstd:
  1033 00000CA4 BE[0000]            <1> 	mov si, msg.di_nonstd_iisp
  1034                              <1> internaldatarelocation
  1035                              <1> @@:
  1036 00000CA7 58                  <1> 	pop ax
  1037 00000CA8 5A                  <1> 	pop dx				; segment
  1038                              <1> 
  1039 00000CA9 50                  <1> 	push ax
  1040 00000CAA 21D0                <1> 	and ax, dx
  1041 00000CAC 40                  <1> 	inc ax
  1042 00000CAD 58                  <1> 	pop ax
  1043 00000CAE 7476                <1> 	jz .CY
  1044                              <1> 
  1045 00000CB0 F8                  <1> 	clc
  1046 00000CB1 C3                  <1> 	retn
  1047                              <1> 
  1048                              <1> 
  1049                              <1> .not_iisp:
  1050 00000CB2 83FBF8              <1> 	cmp bx, -8
  1051 00000CB5 771A                <1> 	ja .not_fd
  1052 00000CB7 26803FE8            <1> 	cmp byte [es:bx], 0E8h
  1053 00000CBB 7514                <1> 	jne .not_fd
  1054 00000CBD 26807F03EA          <1> 	cmp byte [es:bx + 3], 0EAh
  1055 00000CC2 750D                <1> 	jne .not_fd
  1056 00000CC4 26FF7706            <1> 	push word [es:bx + 4 + 2]
  1057 00000CC8 26FF7704            <1> 	push word [es:bx + 4]
  1058 00000CCC BE[0000]            <1> 	mov si, msg.di_freedos_reloc
  1059                              <1> internaldatarelocation
  1060 00000CCF EBD6                <1> 	jmp @B
  1061                              <1> 
  1062                              <1> .not_fd:
  1063 00000CD1 83FBFB              <1> 	cmp bx, -5
  1064 00000CD4 7713                <1> 	ja .not_jmpfar
  1065 00000CD6 BE[0000]            <1> 	mov si, msg.di_jmpfar
  1066                              <1> internaldatarelocation
  1067 00000CD9 26803FEA            <1> 	cmp byte [es:bx], 0EAh
  1068 00000CDD 750A                <1> 	jne .not_jmpfar
  1069 00000CDF 26FF7703            <1> 	push word [es:bx + 1 + 2]
  1070 00000CE3 26FF7701            <1> 	push word [es:bx + 1]
  1071 00000CE7 EBBE                <1> 	jmp @B
  1072                              <1> 
  1073                              <1> .not_jmpfar:
  1074 00000CE9 BE[0000]            <1> 	mov si, msg.di_jmpfarindirect
  1075                              <1> internaldatarelocation
  1076 00000CEC 26803FEB            <1> 	cmp byte [es:bx], 0EBh
  1077 00000CF0 750D                <1> 	jne .not_testhook_try_jmpfarindirect
  1078 00000CF2 BE[0000]            <1> 	mov si, msg.di_testhook
  1079                              <1> internaldatarelocation
  1080 00000CF5 268A4701            <1> 	mov al, byte [es:bx + 1]
  1081 00000CF9 98                  <1> 	cbw
  1082 00000CFA 83C002              <1> 	add ax, 2
  1083 00000CFD 01C3                <1> 	add bx, ax
  1084                              <1> .not_testhook_try_jmpfarindirect:
  1085 00000CFF 83FBFA              <1> 	cmp bx, -6
  1086 00000D02 7720                <1> 	ja .not_testhook_or_jmpfarindirect
  1087 00000D04 26813F2EFF          <1> 	cmp word [es:bx], 0FF2Eh
  1088 00000D09 7519                <1> 	jne .not_testhook_or_jmpfarindirect
  1089 00000D0B 26807F022E          <1> 	cmp byte [es:bx + 2], 2Eh
  1090 00000D10 7512                <1> 	jne .not_testhook_or_jmpfarindirect
  1091 00000D12 268B5F03            <1> 	mov bx, word [es:bx + 3]
  1092 00000D16 83FBFC              <1> 	cmp bx, -4
  1093 00000D19 7709                <1> 	ja .not_testhook_or_jmpfarindirect
  1094 00000D1B 26FF7702            <1> 	push word [es:bx + 2]
  1095 00000D1F 26FF37              <1> 	push word [es:bx]
  1096 00000D22 EB83                <1> 	jmp @B
  1097                              <1> 
  1098                              <1> .not_testhook_or_jmpfarindirect:
  1099 00000D24 85E4                <1> 	test sp, sp			; NZ
  1100                              <1> .CY:
  1101 00000D26 F9                  <1> 	stc
  1102 00000D27 C3                  <1> 	retn
  1103                              <1> 
  1104                              <1> 
  1105                              <1> gateout.mcbname:
  1106                              <1> %if !_LOADER
  1107 00000D28 F6C501              <1> 	test ch, 1
  1108 00000D2B 7503E99A00          <1> 	jz .ret
  1109 00000D30 8B16[0000]          <1> 	mov dx, word [relocated(firstmcb)]
  1110                              <1> linkdatarelocation firstmcb
  1111 00000D34 83FAFF              <1> 	cmp dx, -1
  1112 00000D37 7503E98E00          <1> 	je .ret
  1113 00000D3C 51                  <1> 	push cx
  1114 00000D3D A1[0000]            <1> 	mov ax, word [intaddress]
  1115                              <1> internaldatarelocation
  1116 00000D40 B104                <1> 	mov cl, 4
  1117 00000D42 D3E8                <1> 	shr ax, cl
  1118 00000D44 0306[0200]          <1> 	add ax, word [intaddress + 2]	; => segment of handler
  1119                              <1> internaldatarelocation
  1120 00000D48 7251                <1> 	jc .hma
  1121                              <1> .loop:
  1122                              <1> %if _PM
  1123 00000D4A E8(0000)            <1> 	extcallcall setes2dx
  1124                              <1> %else
  1125                              <1> 	mov es, dx
  1126                              <1> %endif
  1127 00000D4D 89D1                <1> 	mov cx, dx
  1128 00000D4F 26030E0300          <1> 	add cx, word [es:3]
  1129 00000D54 41                  <1> 	inc cx
  1130 00000D55 39D0                <1> 	cmp ax, dx
  1131 00000D57 7247                <1> 	jb .next
  1132 00000D59 39C8                <1> 	cmp ax, cx
  1133 00000D5B 7343                <1> 	jae .next
  1134 00000D5D 268B160100          <1> 	mov dx, word [es:1]
  1135 00000D62 BE[0000]            <1> 	mov si, msg.di_system_mcb
  1136                              <1> internaldatarelocation
  1137 00000D65 83FA50              <1> 	cmp dx, 50h
  1138 00000D68 725A                <1> 	jb .copy
  1139 00000D6A 4A                  <1> 	dec dx
  1140                              <1> %if _PM
  1141 00000D6B E8(0000)            <1> 	extcallcall setes2dx
  1142                              <1> %else
  1143                              <1> 	mov es, dx
  1144                              <1> %endif
  1145 00000D6E 06                  <1> 	 push es
  1146 00000D6F 1F                  <1> 	 pop ds
  1147 00000D70 16                  <1> 	 push ss
  1148 00000D71 07                  <1> 	 pop es
  1149 00000D72 B020                <1> 	mov al, 32
  1150 00000D74 AA                  <1> 	stosb
  1151 00000D75 89F8                <1> 	mov ax, di
  1152 00000D77 BE0800              <1> 	mov si, 8
  1153 00000D7A 89F1                <1> 	mov cx, si
  1154 00000D7C 57                  <1> 	push di
  1155 00000D7D F3A4                <1> 	rep movsb
  1156 00000D7F B000                <1> 	mov al, 0
  1157 00000D81 AA                  <1> 	stosb			; append zero-value byte
  1158 00000D82 5F                  <1> 	pop di			; -> name in buffer
  1159 00000D83 16                  <1> 	 push ss
  1160 00000D84 1F                  <1> 	 pop ds
  1161                              <1> @@:
  1162 00000D85 AE                  <1> 	scasb			; is it zero ?
  1163 00000D86 75FD                <1> 	jne @B			; no, continue -->
  1164                              <1> 				; first dec makes it -> at the zero
  1165                              <1> @@:
  1166 00000D88 4F                  <1> 	dec di
  1167 00000D89 39F8                <1> 	cmp ax, di
  1168 00000D8B 7408                <1> 	je .empty
  1169 00000D8D 807DFF20            <1> 	cmp byte [di - 1], 32
  1170 00000D91 74F5                <1> 	je @B
  1171 00000D93 EB34                <1> 	jmp .ret_cx
  1172                              <1> 
  1173                              <1> .empty:
  1174 00000D95 4F                  <1> 	dec di
  1175 00000D96 BE[0000]            <1> 	mov si, msg.di_empty
  1176                              <1> internaldatarelocation
  1177 00000D99 EB29                <1> 	jmp .copy
  1178                              <1> 
  1179                              <1> .hma:
  1180 00000D9B BE[0000]            <1> 	mov si, msg.di_hma
  1181                              <1> internaldatarelocation
  1182 00000D9E EB24                <1> 	jmp .copy
  1183                              <1> 
  1184                              <1> .next:
  1185 00000DA0 89CA                <1> 	mov dx, cx
  1186 00000DA2 3B16[0000]          <1> 	cmp dx, word [relocated(firstumcb)]
  1187                              <1> linkdatarelocation firstumcb
  1188                              <1> 				; is next one the first UMCB ?
  1189 00000DA6 74A2                <1> 	je .loop		; yes, ignore the "Z" (if any) -->
  1190 00000DA8 26803E00004D        <1> 	cmp byte [es:0], "M"	; check current signature
  1191 00000DAE 749A                <1> 	je .loop		; if "M" then loop to next -->
  1192                              <1> 
  1193 00000DB0 8B36[0000]          <1> 	mov si, word [relocated(firstumcb)]
  1194                              <1> linkdatarelocation firstumcb
  1195 00000DB4 46                  <1> 	inc si
  1196 00000DB5 7503                <1> 	jnz @F
  1197 00000DB7 BE00A0              <1> 	mov si, 0A000h
  1198                              <1> @@:
  1199 00000DBA 39F0                <1> 	cmp ax, si
  1200 00000DBC BE[0000]            <1> 	mov si, msg.di_system_upper
  1201                              <1> internaldatarelocation
  1202 00000DBF 7303                <1> 	jae @F
  1203 00000DC1 BE[0000]            <1> 	mov si, msg.di_system_low
  1204                              <1> internaldatarelocation
  1205                              <1> @@:
  1206                              <1> .copy:
  1207 00000DC4 16                  <1> 	 push ss
  1208 00000DC5 07                  <1> 	 pop es
  1209 00000DC6 E8(0000)            <1> 	extcallcall copy_single_counted_string
  1210                              <1> .ret_cx:
  1211 00000DC9 59                  <1> 	pop cx
  1212                              <1> .ret:
  1213                              <1> %endif	; !_LOADER
  1214 00000DCA C3                  <1> 	retn
  1870                                  %endif
  1871                                  
  1872                                  %if _MCB
  1873                                   %include "dmshared.asm"
     1                              <1> 
     2                              <1> %if 0
     3                              <1> 
     4                              <1> lDebug DM command - Dump MCB chain
     5                              <1> 
     6                              <1> Copyright (C) 2008-2025 E. C. Masloch
     7                              <1> 
     8                              <1> Usage of the works is permitted provided that this
     9                              <1> instrument is retained with the works, so that any entity
    10                              <1> that uses the works is notified of this instrument.
    11                              <1> 
    12                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    13                              <1> 
    14                              <1> %endif
    15                              <1> 
    16                              <1> 		; DM command
    17                              <1> mcbout:
    18                              <1> %if _MCBPOSITION
    19                              <1> 	xor bx, bx
    20                              <1> 	extcallcall skipcomma
    21                              <1> 	dec si
    22                              <1> 	mov dx, msg.keyword_position
    23                              <1> internaldatarelocation
    24                              <1> 	extcallcall isstring?
    25                              <1> 	jne .no_position
    26                              <1> 	not bx
    27                              <1> .no_position:
    28                              <1> 	extcallcall skipcomma
    29                              <1> 	dec si
    30                              <1> 	mov byte [mcbposition], bl
    31                              <1> internaldatarelocation
    32                              <1> %endif
    33                              <1> 
    34                              <1> %if _MCBLIMIT
    35                              <1> 	mov bx, -1
    36                              <1> 	extcallcall skipcomma
    37                              <1> 	dec si
    38                              <1> 	mov dx, msg.keyword_limit
    39                              <1> internaldatarelocation
    40                              <1> 	extcallcall isstring?
    41                              <1> 	jne .no_limit
    42                              <1> 	extcallcall skipequals
    43                              <1> 	extcallcall skipcomm0
    44                              <1> 	extcallcall getword
    45                              <1> 	dec si
    46                              <1> 	mov bx, dx
    47                              <1> .no_limit:
    48                              <1> 	extcallcall skipcomma
    49                              <1> 	dec si
    50                              <1> 	mov word [mcblimit], bx
    51                              <1> internaldatarelocation
    52                              <1> %endif
    53                              <1> 
    54                              <1> %if _SDSUB
    55                              <1> 	xor bx, bx
    56                              <1> 	extcallcall skipcomma
    57                              <1> 	dec si
    58                              <1> 	mov dx, msg.keyword_skipsd
    59                              <1> internaldatarelocation
    60                              <1> 	extcallcall isstring?
    61                              <1> 	jne .sd
    62                              <1> 	not bx
    63                              <1> .sd:
    64                              <1> 	extcallcall skipcomma
    65                              <1> 	dec si
    66                              <1> 	mov byte [skipsd], bl
    67                              <1> internaldatarelocation
    68                              <1> %endif
    69                              <1> 
    70                              <1> %if ELD
    71                              <1> 	xor bx, bx
    72                              <1> 	extcallcall skipcomma
    73                              <1> 	dec si
    74                              <1> 	mov dx, msg.keyword_header
    75                              <1> internaldatarelocation
    76                              <1> 	extcallcall isstring?
    77                              <1> 	je .header
    78                              <1> 	mov dx, msg.keyword_table
    79                              <1> internaldatarelocation
    80                              <1> 	extcallcall isstring?
    81                              <1> 	jne .nottable
    82                              <1> .table:
    83                              <1> 	mov bl, -1
    84                              <1> 	db __TEST_IMM16		; skip mov
    85                              <1> .header:
    86                              <1> 	mov bh, -1
    87                              <1> .nottable:
    88                              <1> 	extcallcall skipcomma
    89                              <1> 	mov word [header_high_table_low], bx
    90                              <1> internaldatarelocation
    91                              <1> %else
    92 00000DCB E8(0000)            <1> 	extcallcall skipwhite
    93                              <1> %endif
    94 00000DCE 8B16[0000]          <1> 	mov dx, word [relocated(firstmcb)]
    95                              <1> linkdatarelocation firstmcb
    96 00000DD2 E8(0000)            <1> 	extcallcall iseol?
    97 00000DD5 740A                <1> 	je .lolmcb
    98 00000DD7 E8(0000)EB02[0000]  <1> 	extcallcall getword
    99                              <1> %if _MCBLIMIT
   100                              <1> 	extcallcall skipcomm0
   101                              <1> 	dec si
   102                              <1> 	push dx
   103                              <1> 	mov dx, msg.keyword_limit
   104                              <1> internaldatarelocation
   105                              <1> 	extcallcall isstring?
   106                              <1> 	jne .no_limit_2
   107                              <1> 	extcallcall skipequals
   108                              <1> 	extcallcall skipcomm0
   109                              <1> 	extcallcall getword
   110                              <1> 	mov word [mcblimit], dx
   111                              <1> internaldatarelocation
   112                              <1> 	dec si
   113                              <1> .no_limit_2:
   114                              <1> 	pop dx
   115                              <1> 	extcallcall skipcomma
   116                              <1> %endif
   117 00000DDE E8(0000)            <1> 	extcallcall chkeol
   118                              <1> .lolmcb:
   119 00000DE1 89D6                <1> 	mov si, dx
   120 00000DE3 BF[0000]            <1> 	mov di, relocated(line_out)
   121                              <1> linkdatarelocation line_out
   122 00000DE6 B85053              <1> 	mov ax, "PS"
   123 00000DE9 AB                  <1> 	stosw
   124 00000DEA B8503A              <1> 	mov ax, "P:"
   125 00000DED AB                  <1> 	stosw
   126 00000DEE B020                <1> 	mov al, 32
   127 00000DF0 AA                  <1> 	stosb
   128 00000DF1 A1[0000]            <1> 	mov ax, word [relocated(pspdbe)]
   129                              <1> linkdatarelocation pspdbe
   130 00000DF4 E8(0000)            <1> 	extcallcall hexword
   131 00000DF7 E8(0000)            <1> 	extcallcall putsline_crlf	; destroys cx,dx,bx
   132                              <1> %if ELD
   133                              <1> 	mov dx, msg.headertable
   134                              <1> internaldatarelocation
   135                              <1> %if _MCBPOSITION
   136                              <1> 	rol byte [mcbposition], 1
   137                              <1> internaldatarelocation
   138                              <1> 	jnc .notableposition
   139                              <1> 	mov dx, msg.headertableposition
   140                              <1> internaldatarelocation
   141                              <1> .notableposition:
   142                              <1> %endif
   143                              <1> 	rol byte [header_high_table_low], 1
   144                              <1> internaldatarelocation
   145                              <1> 	jc @F
   146                              <1> 	mov dx, msg.headerheader
   147                              <1> internaldatarelocation
   148                              <1> %if _MCBPOSITION
   149                              <1> 	rol byte [mcbposition], 1
   150                              <1> internaldatarelocation
   151                              <1> 	jnc .noheaderposition
   152                              <1> 	mov dx, msg.headerheaderposition
   153                              <1> internaldatarelocation
   154                              <1> .noheaderposition:
   155                              <1> %endif
   156                              <1> 	rol byte [header_high_table_low + 1], 1
   157                              <1> internaldatarelocation
   158                              <1> 	jnc @FF
   159                              <1> @@:
   160                              <1> 	extcallcall putsz
   161                              <1> @@:
   162                              <1> %endif
   163 00000DFA B14D                <1> 	mov cl, 'M'
   164                              <1> .next:
   165 00000DFC 83FEFF              <1> 	cmp si, byte -1
   166 00000DFF 7405                <1> 	je .invmcb
   167 00000E01 83FE50              <1> 	cmp si, byte 50h
   168 00000E04 7306                <1> 	jae .valmcb
   169                              <1> .invmcb:
   170 00000E06 BA[0000]            <1> 	mov dx, msg.invmcbadr
   171                              <1> internaldatarelocation
   172 00000E09 E9(0000)            <1> 	jmp putsz
   173                              <1> .valmcb:
   174                              <1> %if _MCBLIMIT
   175                              <1> 	cmp word [mcblimit], si
   176                              <1> internaldatarelocation
   177                              <1> 	jae @F
   178                              <1> 	retn
   179                              <1> @@:
   180                              <1> %endif
   181 00000E0C BF[0000]            <1> 	mov di, relocated(line_out)
   182                              <1> linkdatarelocation line_out
   183 00000E0F 1E                  <1> 	push ds
   184                              <1> %if _PM
   185 00000E10 E8D600              <1> 	extcallcall setds2si
   186                              <1> %else
   187                              <1> 	mov ds, si
   188                              <1> %endif
   189 00000E13 8A2E0000            <1> 	mov ch, byte [0000]
   190 00000E17 8B1E0100            <1> 	mov bx, word [0001]
   191 00000E1B 8B160300            <1> 	mov dx, word [0003]
   192                              <1> 
   193 00000E1F 89F0                <1> 	mov ax, si
   194 00000E21 E8(0000)            <1> 	extcallcall hexword		; segment address of MCB
   195                              <1> %if ELD
   196                              <1> 	mov ah, 4
   197                              <1> %endif
   198                              <1> %if _MCBPOSITION
   199                              <1> 	rol byte [ss:mcbposition], 1
   200                              <1> internaldatarelocation
   201                              <1> 	jnc .noposition
   202                              <1> %if ELD
   203                              <1> 	mov ah, 3
   204                              <1> 	call stosb_repeated
   205                              <1> %else
   206                              <1> 	mov al, 32
   207                              <1> 	stosb
   208                              <1> %endif
   209                              <1> 	mov ax, si
   210                              <1> 	push bx
   211                              <1> 	push dx
   212                              <1> 	push cx
   213                              <1> 	xor dx, dx		; dx:ax = position as segment
   214                              <1> 	mov cx, 16		; cx = 16, multiplier (get position in bytes)
   215                              <1> 	mov bx, 5+4		; bx = 5+4, width
   216                              <1> 	extcallcall disp_dxax_times_cx_width_bx_size.store
   217                              <1> 	pop cx
   218                              <1> 	pop dx
   219                              <1> 	pop bx
   220                              <1> %if ELD
   221                              <1> 	mov ah, 1
   222                              <1> %endif
   223                              <1> 
   224                              <1> .noposition:
   225                              <1> %endif
   226                              <1> 
   227                              <1> %if ELD
   228                              <1> 	call stosb_repeated
   229                              <1> %else
   230 00000E24 B020                <1> 	mov al, 32
   231 00000E26 AA                  <1> 	stosb
   232                              <1> %endif
   233 00000E27 88E8                <1> 	mov al, ch
   234 00000E29 E8(0000)            <1> 	extcallcall hexbyte		; 'M' or 'Z'
   235                              <1> %if ELD
   236                              <1> 	mov ah, 3
   237                              <1> 	call stosb_repeated
   238                              <1> %else
   239 00000E2C B020                <1> 	mov al, 32
   240 00000E2E AA                  <1> 	stosb
   241                              <1> %endif
   242 00000E2F 89D8                <1> 	mov ax, bx
   243 00000E31 E8(0000)            <1> 	extcallcall hexword		; MCB owner
   244                              <1> %if ELD
   245                              <1> 	mov ah, 1
   246                              <1> 	call stosb_repeated
   247                              <1> %else
   248 00000E34 B020                <1> 	mov al, 32
   249 00000E36 AA                  <1> 	stosb
   250                              <1> %endif
   251 00000E37 89D0                <1> 	mov ax, dx
   252 00000E39 E8(0000)            <1> 	extcallcall hexword		; MCB size in paragraphs
   253                              <1> 
   254 00000E3C B020                <1> 	mov al, 32
   255 00000E3E AA                  <1> 	stosb
   256 00000E3F 89D0                <1> 	mov ax, dx		; ax = size in paragraphs
   257 00000E41 53                  <1> 	push bx
   258 00000E42 50                  <1> 	push ax
   259 00000E43 52                  <1> 	push dx
   260 00000E44 51                  <1> 	push cx
   261 00000E45 31D2                <1> 	xor dx, dx		; dx:ax = size in paragraphs
   262 00000E47 B91000              <1> 	mov cx, 16		; cx = 16, multiplier (get size in bytes)
   263 00000E4A BB0900              <1> 	mov bx, 5+4		; bx = 5+4, width
   264                              <1> 
   265 00000E4D E8A900              <1> 	extcallcall disp_dxax_times_cx_width_bx_size.store
   266 00000E50 59                  <1> 	pop cx
   267 00000E51 5A                  <1> 	pop dx
   268 00000E52 58                  <1> 	pop ax
   269 00000E53 5B                  <1> 	pop bx
   270                              <1> 
   271 00000E54 85DB                <1> 	test bx, bx
   272 00000E56 7472                <1> 	jz .freemcb		; free MCBs have no name -->
   273                              <1> %if ELD
   274                              <1> 	mov ah, 1
   275                              <1> 	call stosb_repeated
   276                              <1> %else
   277 00000E58 B020                <1> 	mov al, 32
   278 00000E5A AA                  <1> 	stosb
   279                              <1> %endif
   280 00000E5B 56                  <1> 	push si
   281 00000E5C 51                  <1> 	push cx
   282 00000E5D 52                  <1> 	push dx
   283                              <1> 
   284 00000E5E 1E                  <1> 	push ds
   285 00000E5F BE0800              <1> 	mov si, 8
   286 00000E62 B90200              <1> 	mov cx, 2
   287 00000E65 39F3                <1> 	cmp bx, si		; is it a "system" MCB? (owner 0008h or 0007h)
   288 00000E67 7707                <1> 	ja @F
   289 00000E69 803C53              <1> 	cmp byte [si], "S"	; "S", "SD", "SC" ?
   290 00000E6C 7408                <1> 	je .nextmcbchar		; yes, limit name to two characters -->
   291 00000E6E EB04                <1> 	jmp .nextmcbchar_cx_si	; no, assume full name given
   292                              <1> @@:
   293 00000E70 4B                  <1> 	dec bx			; => owner block's MCB
   294                              <1> %if _PM
   295 00000E71 E87700              <1> 	extcallcall setds2bx
   296                              <1> %else
   297                              <1> 	mov ds, bx
   298                              <1> %endif
   299                              <1> .nextmcbchar_cx_si:
   300 00000E74 89F1                <1> 	mov cx, si		; = 8
   301                              <1> .nextmcbchar:			; copy name of owner MCB
   302 00000E76 AC                  <1> 	lodsb
   303 00000E77 AA                  <1> 	stosb
   304 00000E78 84C0                <1> 	test al, al
   305 00000E7A E0FA                <1> 	loopnz .nextmcbchar	; was not NUL and more bytes left ?
   306 00000E7C 84C0                <1> 	test al, al
   307 00000E7E 7501                <1> 	jnz @F
   308 00000E80 4F                  <1> 	dec di
   309                              <1> @@:
   310 00000E81 1F                  <1> 	pop ds
   311                              <1> 
   312 00000E82 833E010008          <1> 	cmp word [1], 8
   313 00000E87 753E                <1> 	jne .not_s_mcb
   314 00000E89 833E080053          <1> 	cmp word [8], "S"	; S MCB ?
   315 00000E8E 7537                <1> 	jne .not_s_mcb_check_sd
   316                              <1> 
   317 00000E90 B82074              <1> 	mov ax, " t"
   318 00000E93 AB                  <1> 	stosw
   319 00000E94 B87970              <1> 	mov ax, "yp"
   320 00000E97 AB                  <1> 	stosw
   321 00000E98 B86520              <1> 	mov ax, "e "
   322 00000E9B AB                  <1> 	stosw
   323                              <1> 
   324 00000E9C 31C0                <1> 	xor ax, ax
   325 00000E9E A00A00              <1> 	mov al, [10]
   326 00000EA1 E8(0000)            <1> 	extcallcall hexbyte
   327                              <1> 
   328 00000EA4 16                  <1> 	 push ss
   329 00000EA5 1F                  <1> 	 pop ds
   330 00000EA6 BE[0000]            <1> 	mov si, smcbtypes
   331                              <1> internaldatarelocation
   332                              <1> .s_mcb_loop:
   333 00000EA9 833CFF              <1> 	cmp word [si], -1
   334 00000EAC 740E                <1> 	je .s_mcb_unknown
   335 00000EAE 3904                <1> 	cmp word [si], ax
   336 00000EB0 7405                <1> 	je .s_mcb_known
   337 00000EB2 83C604              <1> 	add si, 4
   338 00000EB5 EBF2                <1> 	jmp .s_mcb_loop
   339                              <1> 
   340                              <1> .s_mcb_known:
   341 00000EB7 8B7402              <1> 	mov si, word [si + 2]
   342 00000EBA EB03                <1> 	jmp .s_mcb_common
   343                              <1> 
   344                              <1> .s_mcb_unknown:
   345 00000EBC BE[0000]            <1> 	mov si, smcbmsg_unknown
   346                              <1> internaldatarelocation
   347                              <1> .s_mcb_common:
   348 00000EBF B020                <1> 	mov al, 32
   349                              <1> @@:
   350 00000EC1 AA                  <1> 	stosb
   351 00000EC2 AC                  <1> 	lodsb
   352 00000EC3 84C0                <1> 	test al, al
   353 00000EC5 75FA                <1> 	jnz @B
   354                              <1> %if _SDSUB
   355                              <1> @@:
   356                              <1> 	jmp .not_s_mcb
   357                              <1> %endif
   358                              <1> 
   359                              <1> .not_s_mcb_check_sd:
   360                              <1> 
   361                              <1> %if _SDSUB
   362                              <1> 	rol byte [ss:skipsd], 1
   363                              <1> internaldatarelocation
   364                              <1> 	jc @B
   365                              <1> 
   366                              <1> 	cmp word [8], "SD"
   367                              <1> 	jne @B
   368                              <1> 
   369                              <1> 	pop dx
   370                              <1> 	pop cx
   371                              <1> 	pop si
   372                              <1> 
   373                              <1> 	push si
   374                              <1> 	push cx
   375                              <1> 	push dx
   376                              <1> 
   377                              <1> 	mov bp, si
   378                              <1> 	add bp, dx
   379                              <1> 	jc @F
   380                              <1> 	inc bp
   381                              <1> 	jnz @FF
   382                              <1> @@:
   383                              <1> 	mov bp, -1
   384                              <1> @@:
   385                              <1> 	xor dx, dx
   386                              <1> .loop_sd:
   387                              <1> 	add si, dx
   388                              <1> 	jc .done_sd
   389                              <1> 
   390                              <1> 	inc si
   391                              <1> 	jz .done_sd
   392                              <1> 
   393                              <1> 	cmp si, bp
   394                              <1> 	jae .done_sd
   395                              <1> 
   396                              <1> 	 push ss
   397                              <1> 	 pop ds
   398                              <1> 	extcallcall putsline_crlf	; destroys cx,dx,bx
   399                              <1> 
   400                              <1> 	mov di, relocated(line_out)
   401                              <1> linkdatarelocation line_out
   402                              <1> %if _PM
   403                              <1> 	extcallcall setds2si
   404                              <1> %else
   405                              <1> 	mov ds, si
   406                              <1> %endif
   407                              <1> 	mov ch, byte [0000]
   408                              <1> 	mov bx, word [0001]
   409                              <1> 	mov dx, word [0003]
   410                              <1> 
   411                              <1> 	mov al, 32
   412                              <1> 	stosb				; indent SD sub-MCBs
   413                              <1> 
   414                              <1> 	mov ax, si
   415                              <1> 	extcallcall hexword		; segment address of MCB
   416                              <1> %if ELD
   417                              <1> 	mov ah, 4
   418                              <1> %endif
   419                              <1> %if _MCBPOSITION
   420                              <1> 	rol byte [ss:mcbposition], 1
   421                              <1> internaldatarelocation
   422                              <1> 	jnc .sdnoposition
   423                              <1> %if ELD
   424                              <1> 	mov ah, 3
   425                              <1> 	call stosb_repeated
   426                              <1> %else
   427                              <1> 	mov al, 32
   428                              <1> 	stosb
   429                              <1> %endif
   430                              <1> 	mov ax, si
   431                              <1> 	push bx
   432                              <1> 	push dx
   433                              <1> 	push cx
   434                              <1> 	xor dx, dx		; dx:ax = position as segment
   435                              <1> 	mov cx, 16		; cx = 16, multiplier (get position in bytes)
   436                              <1> 	mov bx, 5+4		; bx = 5+4, width
   437                              <1> 	extcallcall disp_dxax_times_cx_width_bx_size.store
   438                              <1> 	pop cx
   439                              <1> 	pop dx
   440                              <1> 	pop bx
   441                              <1> %if ELD
   442                              <1> 	mov ah, 1
   443                              <1> %endif
   444                              <1> 
   445                              <1> .sdnoposition:
   446                              <1> %endif
   447                              <1> 
   448                              <1> %if ELD
   449                              <1> 	call stosb_repeated
   450                              <1> %else
   451                              <1> 	mov al, 32
   452                              <1> 	stosb
   453                              <1> %endif
   454                              <1> 	mov al, ch
   455                              <1> 	extcallcall hexbyte		; 'M' or 'Z'
   456                              <1> %if ELD
   457                              <1> 	mov ah, 3
   458                              <1> 	call stosb_repeated
   459                              <1> %else
   460                              <1> 	mov al, 32
   461                              <1> 	stosb
   462                              <1> %endif
   463                              <1> 	mov ax, bx
   464                              <1> 	extcallcall hexword		; MCB owner
   465                              <1> %if ELD
   466                              <1> 	mov ah, 1
   467                              <1> 	call stosb_repeated
   468                              <1> %else
   469                              <1> 	mov al, 32
   470                              <1> 	stosb
   471                              <1> %endif
   472                              <1> 	mov ax, dx
   473                              <1> 	extcallcall hexword		; MCB size in paragraphs
   474                              <1> 
   475                              <1> 	mov al, 32
   476                              <1> 	stosb
   477                              <1> 	mov ax, dx		; ax = size in paragraphs
   478                              <1> 	push bx
   479                              <1> 	push ax
   480                              <1> 	push dx
   481                              <1> 	push cx
   482                              <1> 	xor dx, dx		; dx:ax = size in paragraphs
   483                              <1> 	mov cx, 16		; cx = 16, multiplier (get size in bytes)
   484                              <1> 	mov bx, 5+4		; bx = 5+4, width
   485                              <1> 
   486                              <1> 	extcallcall disp_dxax_times_cx_width_bx_size.store
   487                              <1> 	pop cx
   488                              <1> 	pop dx
   489                              <1> 	pop ax
   490                              <1> 	pop bx
   491                              <1> 
   492                              <1> %if ELD
   493                              <1> 	mov ah, 1
   494                              <1> 	call stosb_repeated
   495                              <1> %else
   496                              <1> 	mov al, 32
   497                              <1> 	stosb
   498                              <1> %endif
   499                              <1> 	push si
   500                              <1> 	push cx
   501                              <1> 	push dx
   502                              <1> 
   503                              <1> 	mov al, "'"
   504                              <1> 	stosb
   505                              <1> 	mov al, ch
   506                              <1> 	cmp al, 32
   507                              <1> 	jbe @F
   508                              <1> 	cmp al, 127
   509                              <1> 	jb @FF
   510                              <1> @@:
   511                              <1> 	mov al, '.'
   512                              <1> @@:
   513                              <1> 	stosb
   514                              <1> 	mov ax, "' "
   515                              <1> 	stosw
   516                              <1> 
   517                              <1> 	mov al, ch
   518                              <1> 	mov ah, 0
   519                              <1> 	push ds
   520                              <1> 	 push ss
   521                              <1> 	 pop ds
   522                              <1> 	mov si, sdsubmcbtypes
   523                              <1> internaldatarelocation
   524                              <1> .sd_mcb_loop:
   525                              <1> 	cmp word [si], -1
   526                              <1> 	je .sd_mcb_unknown
   527                              <1> 	cmp word [si], ax
   528                              <1> 	je .sd_mcb_known
   529                              <1> 	add si, 4
   530                              <1> 	jmp .sd_mcb_loop
   531                              <1> 
   532                              <1> .sd_mcb_known:
   533                              <1> 	mov si, word [si + 2]
   534                              <1> 	jmp .sd_mcb_common
   535                              <1> 
   536                              <1> .sd_mcb_unknown:
   537                              <1> 	mov si, smcbmsg_unknown
   538                              <1> internaldatarelocation
   539                              <1> .sd_mcb_common:
   540                              <1> 	db __TEST_IMM8		; (skip stosb in first iteration)
   541                              <1> @@:
   542                              <1> 	stosb
   543                              <1> 	lodsb
   544                              <1> 	test al, al
   545                              <1> 	jnz @B
   546                              <1> 	pop ds
   547                              <1> 
   548                              <1> 	pop dx
   549                              <1> 	pop cx
   550                              <1> 	push cx
   551                              <1> 	push dx
   552                              <1> 
   553                              <1> 	cmp ch, 'D'
   554                              <1> 	jne .sd_no_name
   555                              <1> 
   556                              <1> 	mov si, 8
   557                              <1> 	mov cx, si
   558                              <1> .nextsdmcbchar:			; copy name of SD sub-MCB
   559                              <1> 	lodsb
   560                              <1> 	stosb
   561                              <1> 	test al, al
   562                              <1> 	loopnz .nextsdmcbchar	; was not NUL and more bytes left ?
   563                              <1> 	test al, al
   564                              <1> 	jnz @F
   565                              <1> 	dec di
   566                              <1> @@:
   567                              <1> 
   568                              <1> .sd_no_name:
   569                              <1> 	pop dx
   570                              <1> 	pop cx
   571                              <1> 	pop si
   572                              <1> 
   573                              <1> 	test ch, ch
   574                              <1> 	jz .done_sd
   575                              <1> 
   576                              <1> 	test dx, dx
   577                              <1> 	jz .done_sd
   578                              <1> 
   579                              <1> 	jmp .loop_sd
   580                              <1> 
   581                              <1> .done_sd:
   582                              <1> %endif
   583                              <1> 
   584                              <1> .not_s_mcb:
   585 00000EC7 5A                  <1> 	pop dx
   586 00000EC8 59                  <1> 	pop cx
   587 00000EC9 5E                  <1> 	pop si
   588                              <1> .freemcb:
   589                              <1> 
   590 00000ECA 1F                  <1> 	pop ds
   591 00000ECB 80FD4D              <1> 	cmp ch, 'M'
   592 00000ECE 7406                <1> 	je .disp
   593 00000ED0 80FD5A              <1> 	cmp ch, 'Z'
   594 00000ED3 7401                <1> 	je .disp
   595                              <1> .ret:
   596 00000ED5 C3                  <1> 	retn
   597                              <1> 
   598                              <1> .disp:
   599 00000ED6 88E9                <1> 	mov cl, ch
   600 00000ED8 52                  <1> 	push dx
   601 00000ED9 51                  <1> 	push cx
   602 00000EDA E8(0000)            <1> 	extcallcall putsline_crlf	; destroys cx,dx,bx
   603 00000EDD 59                  <1> 	pop cx
   604 00000EDE 5A                  <1> 	pop dx
   605 00000EDF 01D6                <1> 	add si, dx
   606 00000EE1 72F2                <1> 	jc .ret			; over FFFFh, must be end of chain --> (hmm)
   607 00000EE3 46                  <1> 	inc si
   608 00000EE4 74EF                <1> 	jz .ret
   609 00000EE6 E913FF              <1> 	jmp .next
   610                              <1> 
   611                              <1> %if ELD
   612                              <1> stosb_repeated:
   613                              <1> 	mov al, 32
   614                              <1> 	stosb
   615                              <1> 	rol byte [ss:header_high_table_low], 1
   616                              <1> internaldatarelocation
   617                              <1> 	jnc .ret
   618                              <1> 	push cx
   619                              <1> 	xor cx, cx
   620                              <1> 	mov cl, ah
   621                              <1> 	rep stosb
   622                              <1> 	pop cx
   623                              <1> .ret:
   624                              <1> 	retn
   625                              <1> %endif
  1874                                  %endif	; _MCB
  1875                                  
  1876                                  %if _DX
  1877                                   %include "dxshared.asm"
  1878                                  %endif
  1879                                  
  1880                                   %undef extcall
  1881                                   %undef extcallcall
  1882                                   %unimacro internalcoderelocation 0-*.nolist
  1883                                   %unimacro internaldatarelocation 0-*.nolist
  1884                                   %unimacro linkdatarelocation 0-*.nolist
  1885                                   %undef relocated
  1886                                  
  1887                                  %if _PM
  1888                                  setds2si: section_of_function
  1889 00000EE9 89F3                    	mov bx, si
  1890                                  setds2bx: section_of_function
  1891 00000EEB E8(0000)                	call ispm
  1892 00000EEE 7505                    	jnz sd2s_ex
  1893 00000EF0 89DA                    	mov dx, bx
  1894 00000EF2 E8(0000)                	call setrmsegm
  1895                                  sd2s_ex:
  1896 00000EF5 8EDB                    	mov ds, bx
  1897 00000EF7 C3                      	retn
  1898                                  %elif _EXTENSIONS
  1899                                  setds2si: section_of_function
  1900                                  	mov bx, si
  1901                                  setds2bx: section_of_function
  1902                                  	mov ds, bx
  1903                                  	retn
  1904                                  %endif
  1905                                  
  1906                                  
  1907                                  		; INP:	dx:ax = numerator
  1908                                  		;	cx = multiplier (0 to take si:dx:ax as numerator)
  1909                                  		;	bx = field width
  1910                                  		;	es:di -> buffer where to store
  1911                                  		; STT:	UP, ds = ss
  1912                                  		; OUT:	written to buffer, es:di -> behind written string
  1913                                  disp_dxax_times_cx_width_bx_size: section_of_function
  1914 00000EF8 A8                      	db __TEST_IMM8		; (skip stc, NC)
  1915                                  .store: section_of_function disp_dxax_times_cx_width_bx_size
  1916 00000EF9 F9                      	stc
  1917                                  
  1918                                  	lframe near
  1919                                  	lequ 4 + 4 + 2,		buffer_size
  1920                                  		; 4: "2048" or "26.5" (maximum number)
  1921                                  		; 4: " ?iB" (IEC prefixed unit)
  1922                                  		; 2: ???
  1923                                  	lvar ?buffer_size,	buffer
  1924                                  	lvar 6,			dividend
  1925 00000EFA 5589E58D66F0            	lenter
  1926                                  	lvar word,		bit_0_is_store
  1927 00000F00 9C                      	 pushf
  1928                                  	lvar word,		width
  1929 00000F01 53                      	 push bx
  1930 00000F02 56                      	push si
  1931 00000F03 1E                      	push ds
  1932 00000F04 51                      	push cx
  1933 00000F05 50                      	push ax
  1934 00000F06 52                      	push dx
  1935 00000F07 06                      	push es
  1936 00000F08 57                      	push di
  1937                                  
  1938 00000F09 16                      	 push ss	; push cs
  1939 00000F0A 1F                      	 pop ds
  1940 00000F0B 16                      	 push ss
  1941 00000F0C 07                      	 pop es
  1942                                  
  1943 00000F0D E310                    	jcxz .use_si
  1944                                  
  1945 00000F0F 52                      	push dx
  1946 00000F10 F7E1                    	mul cx
  1947 00000F12 97                      	xchg ax, di
  1948 00000F13 87D6                    	xchg dx, si		; si:di = first mul
  1949                                  
  1950 00000F15 58                      	pop ax
  1951 00000F16 F7E1                    	mul cx
  1952 00000F18 01F0                    	add ax, si
  1953 00000F1A 83D200                  	adc dx, 0		; dx:ax = second mul + adj, dx:ax:di = mul
  1954                                  
  1955 00000F1D EB05                    	jmp @F
  1956                                  
  1957                                  .use_si:
  1958 00000F1F 89C7                    	mov di, ax
  1959 00000F21 92                      	xchg ax, dx
  1960 00000F22 89F2                    	mov dx, si
  1961                                  
  1962                                  @@:
  1963 00000F24 897EF0                  	mov word [bp + ?dividend], di
  1964 00000F27 8946F2                  	mov word [bp + ?dividend + 2], ax
  1965 00000F2A 8956F4                  	mov word [bp + ?dividend + 4], dx
  1966                                  
  1967                                  		; set up divisor for the unit prefixes
  1968 00000F2D B90004                  	mov cx, 1024		; 1000 here if SI units
  1969 00000F30 F606[0100]10            	testopt [options], use_si_units	; SI units ?
  1970 00000F35 7403                    	jz @F			; no -->
  1971 00000F37 B9E803                  	mov cx, 1000		; yes, use 1000
  1972                                  @@:
  1973                                  
  1974 00000F3A BE[0000]                	mov si, msg.prefixes	; -> first prefix (blank)
  1975 00000F3D 31D2                    	xor dx, dx		; init remainder (not really needed)
  1976                                  .loop:
  1977 00000F3F 837EF400                	cmp word [bp + ?dividend + 4], 0
  1978 00000F43 750D                    	jnz .divide
  1979 00000F45 837EF200                	cmp word [bp + ?dividend + 2], 0
  1980 00000F49 7507                    	jnz .divide
  1981 00000F4B 817EF00008              	cmp word [bp + ?dividend], 2048
  1982                                  				; is dividend <= 2048 ?
  1983 00000F50 7614                    	jbe .end		; yes, end unit division loop -->
  1984                                  .divide:
  1985 00000F52 46                      	inc si			; -> next prefix
  1986                                  
  1987 00000F53 31D2                    	xor dx, dx
  1988 00000F55 BF0600                  	mov di, 6
  1989                                  .loop_divide:
  1990 00000F58 8B43EE                  	mov ax, [bp + ?dividend - 2 + di]
  1991 00000F5B F7F1                    	div cx
  1992 00000F5D 8943EE                  	mov word [bp + ?dividend - 2 + di], ax
  1993 00000F60 4F                      	dec di
  1994 00000F61 4F                      	dec di
  1995 00000F62 75F4                    	jnz .loop_divide
  1996                                  				; dx = last remainder
  1997 00000F64 EBD9                    	jmp .loop
  1998                                  
  1999                                  .end:
  2000                                  				; dx = last remainder
  2001 00000F66 B80A00                  	mov ax, 10		; ax = 10
  2002 00000F69 F7E2                    	mul dx			; dx:ax = last remainder * 10
  2003 00000F6B F7F1                    	div cx			; divide by unit multiplier,
  2004                                  				;  ax = 0..9 tenth digit
  2005 00000F6D 92                      	xchg dx, ax		; dl = 0..9 tenth digit
  2006                                  
  2007 00000F6E 8D7EFF                  	lea di, [bp + ?buffer + ?buffer_size - 1]
  2008 00000F71 FD                      	std			; _AMD_ERRATUM_109_WORKAROUND does not apply
  2009 00000F72 B042                    	mov al, "B"
  2010 00000F74 AA                      	stosb
  2011 00000F75 AC                      	lodsb			; al = prefix (blank or kMGT)
  2012 00000F76 3C20                    	cmp al, 32		; unit is Bytes ?
  2013 00000F78 7416                    	je @FF			; yes, skip past unit handling -->
  2014                                  
  2015 00000F7A F606[0100]10            	testopt [options], use_si_units
  2016                                  				; SI units ?
  2017 00000F7F 750E                    	jnz @F			; yes -->
  2018 00000F81 24DF                    	and al, ~20h		; uppercase, don't do this if SI units
  2019 00000F83 F606[0100]20            	testopt [options], use_jedec_units
  2020                                  				; JEDEC units ?
  2021 00000F88 7505                    	jnz @F			; yes -->
  2022 00000F8A 50                      	push ax
  2023 00000F8B B069                    	mov al, "i"
  2024 00000F8D AA                      	stosb			; don't store this if SI or JEDEC units
  2025 00000F8E 58                      	pop ax			; preserve unit prefix
  2026                                  @@:
  2027 00000F8F AA                      	stosb			; store prefix letter
  2028                                  @@:
  2029 00000F90 3C20                    	cmp al, 32		; unit is Bytes ?
  2030 00000F92 B020                    	 mov al, 32
  2031 00000F94 AA                      	 stosb			; (store a blank)
  2032 00000F95 8B46F0                  	 mov ax, word [bp + ?dividend]
  2033                                  				; (ax = dividend, <= 2048)
  2034 00000F98 740D                    	je @F			; yes, no tenth digit to display -->
  2035 00000F9A 83F864                  	cmp ax, 100		; displaying above-or-equal 100 ?
  2036 00000F9D 7308                    	jae @F			; yes, display no tenth digit -->
  2037 00000F9F 92                      	xchg ax, dx		; al = tenth digit
  2038 00000FA0 0430                    	add al, '0'		; make it text
  2039 00000FA2 AA                      	stosb			; store fractional digit
  2040 00000FA3 B02E                    	mov al, '.'
  2041 00000FA5 AA                      	stosb			; store decimal point
  2042 00000FA6 92                      	xchg ax, dx		; get back ax = dividend
  2043                                  @@:
  2044 00000FA7 B90A00                  	mov cx, 10
  2045                                  .loop_write:
  2046 00000FAA 31D2                    	xor dx, dx
  2047 00000FAC F7F1                    	div cx
  2048 00000FAE 92                      	xchg ax, dx
  2049                                  				; ax = remainder (next digit)
  2050                                  				; dx = result of div
  2051 00000FAF 0430                    	add al, '0'
  2052 00000FB1 AA                      	stosb
  2053 00000FB2 92                      	xchg ax, dx		; ax = result of div
  2054 00000FB3 85C0                    	test ax, ax		; any more ?
  2055 00000FB5 75F3                    	jnz .loop_write		; loop -->
  2056                                  
  2057 00000FB7 FC                      	cld
  2058                                  
  2059 00000FB8 47                      	inc di			; -> first digit
  2060 00000FB9 8D5E00                  	lea bx, [bp + ?buffer + ?buffer_size]
  2061                                  				; -> behind 'B'
  2062 00000FBC 29FB                    	sub bx, di		; = length of string
  2063 00000FBE 89FE                    	mov si, di
  2064                                  
  2065 00000FC0 5F                      	pop di
  2066 00000FC1 07                      	pop es			; restore es:di
  2067                                  				; -> where to store (if storing)
  2068                                  
  2069 00000FC2 8B4EEC                  	mov cx, [bp + ?width]
  2070 00000FC5 29D9                    	sub cx, bx
  2071 00000FC7 760F                    	jbe .none_blank
  2072 00000FC9 B020                    	mov al, 32
  2073 00000FCB F646EE01                	test byte [bp + ?bit_0_is_store], 1
  2074 00000FCF 7505                    	jnz @F
  2075                                  .loop_blank_disp:
  2076 00000FD1 E8(0000)                	nearcall disp_al
  2077 00000FD4 E2FB                    	loop .loop_blank_disp
  2078                                  		; now cx = 0 so the rep stosb is a nop
  2079                                  @@:
  2080 00000FD6 F3AA                    	rep stosb
  2081                                  .none_blank:
  2082                                  
  2083                                  
  2084 00000FD8 89D9                    	mov cx, bx
  2085 00000FDA F646EE01                	test byte [bp + ?bit_0_is_store], 1
  2086 00000FDE 7506                    	jnz @F
  2087                                  
  2088                                  		; ! note ss = ds
  2089 00000FE0 89F2                    	mov dx, si		; ds:dx -> string
  2090 00000FE2 E8(0000)                	call disp_message_length_cx
  2091 00000FE5 A9                      	db __TEST_IMM16		; (skip rep movsb)
  2092                                  @@:
  2093                                  		; ! note ss = ds
  2094                                  		; ds:si -> string, cx = length
  2095 00000FE6 F3A4                    	rep movsb
  2096                                  
  2097 00000FE8 5A                      	pop dx
  2098 00000FE9 58                      	pop ax
  2099 00000FEA 59                      	pop cx
  2100 00000FEB 1F                      	pop ds
  2101 00000FEC 5E                      	pop si
  2102 00000FED 5B                      	pop bx
  2103 00000FEE 89EC5D                  	lleave
  2104 00000FF1 C3                      	lret
  2105                                  
  2106                                  %if _DT
  2107                                  		; DT command
  2108                                  dumptable:
  2109 00000FF2 E8(0000)                	call skipcomma
  2110 00000FF5 31DB                    	xor bx, bx
  2111 00000FF7 E8(0000)                	call capitalise
  2112 00000FFA 3C54                    	cmp al, 'T'
  2113 00000FFC 7504                    	jne @F
  2114 00000FFE E8(0000)                	call skipcomma
  2115 00001001 43                      	inc bx
  2116                                  @@:
  2117 00001002 53                      	push bx
  2118 00001003 E8(0000)                	call iseol?
  2119 00001006 742B                    	je .table
  2120 00001008 E8(0000)EB02[0000]      	nearcall getdword
  2121 0000100F E8(0000)                	call chkeol
  2122 00001012 5E                      	pop si
  2123                                  .loopsingle:
  2124 00001013 53                      	push bx
  2125 00001014 52                      	push dx
  2126 00001015 92                      	xchg ax, dx
  2127 00001016 B4FF                    	mov ah, -1
  2128 00001018 E84700                  	call .item
  2129 0000101B 5A                      	pop dx
  2130 0000101C 5B                      	pop bx
  2131 0000101D E89D00                  	call .blank
  2132 00001020 88F2                    	mov dl, dh
  2133 00001022 88DE                    	mov dh, bl
  2134 00001024 88FB                    	mov bl, bh
  2135 00001026 B700                    	mov bh, 0
  2136 00001028 84DB                    	test bl, bl
  2137 0000102A 75E7                    	jnz .loopsingle
  2138 0000102C 85D2                    	test dx, dx
  2139 0000102E 75E3                    	jnz .loopsingle
  2140 00001030 E9(0000)                	jmp trimputs
  2141                                  
  2142                                  
  2143                                  .table:
  2144 00001033 BE[0000]                	mov si, msg.tableheader
  2145 00001036 85DB                    	test bx, bx
  2146 00001038 7403                    	jz @F
  2147 0000103A BE[0000]                	mov si, msg.tableheadertop
  2148                                  @@:
  2149 0000103D E8(0000)                	call copy_single_counted_string
  2150 00001040 5E                      	pop si
  2151 00001041 B000                    	mov al, 0		; low nybble is base, high nybble column
  2152                                  
  2153                                  .line:
  2154 00001043 85F6                    	test si, si
  2155 00001045 7402                    	jz @F
  2156 00001047 0C80                    	or al, 128
  2157                                  @@:
  2158 00001049 B408                    	mov ah, 8		; reset items per row
  2159                                  .column:
  2160 0000104B E81400                  	call .item
  2161                                  
  2162 0000104E 0410                    	add al, 16		; next column is 16 codepoints higher
  2163 00001050 FECC                    	dec ah			; more columns to go ?
  2164 00001052 75F7                    	jnz .column		; yes -->
  2165                                  
  2166 00001054 50                      	push ax
  2167 00001055 E8(0000)                	call trimputs		; display
  2168 00001058 BF[0000]                	mov di, line_out
  2169 0000105B 58                      	pop ax
  2170                                  
  2171 0000105C 40                      	inc ax			; increment base (low nybble)
  2172 0000105D 240F                    	and al, 15		; test low nybble
  2173 0000105F 75E2                    	jnz .line		; loop if not yet overflowed -->
  2174                                  
  2175 00001061 C3                      	retn
  2176                                  
  2177                                  
  2178                                  .item:
  2179 00001062 B90300                  	mov cx, 3		; width = 3 columns
  2180 00001065 31D2                    	xor dx, dx
  2181 00001067 50                      	 push ax
  2182 00001068 B400                    	mov ah, 0		; dx:ax = number
  2183 0000106A E8(0000)                	call dec_dword_minwidth	; decimal
  2184 0000106D 57                      	  push di
  2185 0000106E 29CF                    	sub di, cx		; -> start of decimal number written
  2186 00001070 49                      	dec cx
  2187 00001071 B030                    	mov al, '0'		; ASCII zero
  2188                                  @@:
  2189 00001073 AE                      	scasb			; a leading zero ?
  2190 00001074 7506                    	jne @F			; no -->
  2191 00001076 C645FF20                	mov byte [di - 1], 32	; replace by blank
  2192 0000107A E2F7                    	loop @B			; check for another leading zero -->
  2193                                  @@:
  2194 0000107C 5F                      	  pop di		; restore -> after decimal number written
  2195 0000107D 58                      	 pop ax
  2196 0000107E E83C00                  	call .blank
  2197 00001081 E8(0000)                	call hexbyte		; hexadecimal
  2198 00001084 E83600                  	call .blank
  2199 00001087 88C3                    	mov bl, al		; = index
  2200 00001089 3C20                    	cmp al, 32
  2201 0000108B 720E                    	jb .named
  2202                                  
  2203 0000108D B320                    	mov bl, (asciitablenames.del - asciitablenames.) / 3
  2204                                  				; point to DEL entry
  2205 0000108F 3C7F                    	cmp al, 127
  2206 00001091 7408                    	je .named
  2207 00001093 B321                    	mov bl, (asciitablenames.top - asciitablenames.) / 3
  2208                                  				; point to top entry
  2209 00001095 7218                    	jb .printable
  2210 00001097 85F6                    	test si, si
  2211 00001099 7514                    	jnz .printable
  2212                                  .named:
  2213 0000109B B700                    	mov bh, 0		; bx = index
  2214 0000109D 89DA                    	mov dx, bx
  2215 0000109F 01DB                    	add bx, bx
  2216 000010A1 01D3                    	add bx, dx		; times 3
  2217 000010A3 81C3[4200]              	add bx, asciitablenames	; -> padded 3-byte text
  2218 000010A7 87F3                    	xchg si, bx
  2219 000010A9 A5                      	movsw
  2220 000010AA A4                      	movsb
  2221 000010AB 87DE                    	xchg bx, si
  2222 000010AD EB07                    	jmp @F
  2223                                  .printable:
  2224 000010AF E81000                  	call .quote
  2225 000010B2 AA                      	stosb
  2226 000010B3 E80C00                  	call .quote
  2227                                  @@:
  2228 000010B6 E80400                  	call .blank
  2229 000010B9 3C50                    	cmp al, 80
  2230 000010BB 7214                    	jb @F
  2231                                  
  2232                                  .blank:
  2233 000010BD 50                      	push ax
  2234 000010BE B020                    	mov al, 32
  2235 000010C0 EB0D                    	jmp .retstosb
  2236                                  
  2237                                  .quote:
  2238 000010C2 85C0                    	test ax, ax
  2239 000010C4 790B                    	jns @F
  2240 000010C6 50                      	push ax
  2241 000010C7 3C27                    	cmp al, "'"
  2242 000010C9 B027                    	mov al, "'"
  2243 000010CB 7502                    	jne .retstosb
  2244 000010CD B022                    	mov al, '"'
  2245                                  .retstosb:
  2246 000010CF AA                      	stosb
  2247 000010D0 58                      	pop ax
  2248                                  @@:
  2249 000010D1 C3                      	retn
  2250                                  
  2251                                  
  2252                                  	usesection lDEBUG_DATA_ENTRY
  2252          ------------------       note: usesection lDEBUG_DATA_ENTRY
  2253                                  
  2254                                  %imacro asciitableentry 1.nolist
  2255                                   %defstr %%string %1
  2256                                  	fill 3, 32, db %%string
  2257                                  %endmacro
  2258                                  
  2259                                  asciitablenames:
  2260 00000042 4E554C                  .:	asciitableentry NUL
  2261 00000045 534F48                  	asciitableentry SOH
  2262 00000048 535458                  	asciitableentry STX
  2263 0000004B 455458                  	asciitableentry ETX
  2264 0000004E 454F54                  	asciitableentry EOT
  2265 00000051 454E51                  	asciitableentry ENQ
  2266 00000054 41434B                  	asciitableentry ACK
  2267 00000057 42454C                  	asciitableentry BEL
  2268 0000005A 425320                  	asciitableentry BS
  2269 0000005D 544142                  	asciitableentry TAB
  2270 00000060 4C4620                  	asciitableentry LF
  2271 00000063 565420                  	asciitableentry VT
  2272 00000066 464620                  	asciitableentry FF
  2273 00000069 435220                  	asciitableentry CR
  2274 0000006C 534F20                  	asciitableentry SO
  2275 0000006F 534920                  	asciitableentry SI
  2276 00000072 444C45                  	asciitableentry DLE
  2277 00000075 444331                  	asciitableentry DC1
  2278 00000078 444332                  	asciitableentry DC2
  2279 0000007B 444333                  	asciitableentry DC3
  2280 0000007E 444334                  	asciitableentry DC4
  2281 00000081 4E414B                  	asciitableentry NAK
  2282 00000084 53594E                  	asciitableentry SYN
  2283 00000087 455442                  	asciitableentry ETB
  2284 0000008A 43414E                  	asciitableentry CAN
  2285 0000008D 454D20                  	asciitableentry EM
  2286 00000090 535542                  	asciitableentry SUB
  2287 00000093 455343                  	asciitableentry ESC
  2288 00000096 465320                  	asciitableentry FS
  2289 00000099 475320                  	asciitableentry GS
  2290 0000009C 525320                  	asciitableentry RS
  2291 0000009F 555320                  	asciitableentry US
  2292 000000A2 44454C                  .del:	asciitableentry DEL
  2293                                  %if (.del - .) / 3 != 32
  2294                                   %error Wrong table size
  2295                                  %endif
  2296 000000A5 746F70                  .top:	asciitableentry top
  2297                                  
  2298                                  	usesection lDEBUG_CODE
  2298          ------------------       note: usesection lDEBUG_CODE
  2299                                  
  2300                                  %endif
  2301                                  
  2302                                  ..@dd_access_end:
