
%if 0

lDebug sectioning directives

Copyright (C) 1995-2003 Paul Vojta
Copyright (C) 2008-2026 E. C. Masloch

Usage of the works is permitted provided that this
instrument is retained with the works, so that any entity
that uses the works is notified of this instrument.

DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.

%endif

%if _LINK
	group DATAGROUP lDEBUG_DATA_ENTRY ASMTABLE1 ASMTABLE2 DATASTACKBASE
	group INITGROUP INIT WLEMITALIGNINITEND
	addsection lDEBUG_DATA_ENTRY, align=1
	addsection ASMTABLE1, align=1
	addsection ASMTABLE2, align=1
	addsection DATASTACKBASE, align=1
	addsection MESSAGESEGMENT, align=1
	addsection lDEBUG_CODE, align=1
	addsection lDEBUG_CODE2, align=1
	addsection INIT, align=1
	addsection WLEMITALIGNINITEND, align=16
	addsection DEVICESHIM, align=1
	addsection WLEMITALIGNRELOCZERO, align=16

APPINITSTACK_SIZE equ 512	; must be even
BOOTINITSTACK_SIZE equ 512	; must be divisible by 16
[list -]
%else
	org 100h
	addsection lDEBUG_DATA_ENTRY, align=16 start=100h
data_entry_start:
%define DATASECTIONFIXUP -data_entry_start+100h
_CURRENT_SECTION %+ _start:
%xdefine %[_CURRENT_SECTION %+ FIXUP] - _CURRENT_SECTION %+ _start+100h

	addsection ASMTABLE1, align=16 follows=lDEBUG_DATA_ENTRY
	addsection ASMTABLE2, align=16 follows=ASMTABLE1
	addsection MESSAGESEGMENT, align=16 follows=ASMTABLE2 vstart=0
messagesegment_start:
	addsection lDEBUG_CODE, align=16 follows=MESSAGESEGMENT vstart=0
code_start:
%define CODESECTIONFIXUP -code_start+0
_CURRENT_SECTION %+ _start:
%xdefine %[_CURRENT_SECTION %+ FIXUP] - _CURRENT_SECTION %+ _start+0
	addsection lDEBUG_CODE2, align=16 follows=lDEBUG_CODE vstart=0
code2_start:
%define CODE2SECTIONFIXUP -code2_start+0
_CURRENT_SECTION %+ _start:
%xdefine %[_CURRENT_SECTION %+ FIXUP] - _CURRENT_SECTION %+ _start+0

	addsection DATASTACK, align=16 follows=ASMTABLE2 nobits
	addsection INIT, align=16 follows=lDEBUG_CODE2 vstart=0
%if _DEVICE
	addsection DEVICESHIM, align=16 follows=INIT vstart=0
%endif
	addsection RELOCATEDZERO, vstart=0 nobits
relocatedzero:
%endif
%if _LINK
[list +]
%endif


	usesection lDEBUG_CODE
section_of puts, trimputs, puts_ext_done, puts_ext_next
section_of putsz_exthelp, code_retf
section_of puts_getline_ext_done
section_of puts_copyoutput_ext_done
section_of guard_auxbuff, guard_re
section_of handle_serial_flags_ctrl_c
section_of hexword_high
section_of call_int2D
section_of copy_single_counted_string
section_of intchk
section_of IsIISPEntry?
section_of dd_store
section_of dohack, getsegmented, hexbyte, hexnyb, iseol?.notsemicolon
section_of peekc, getc, prephack, readmem, setds2si, setds2bx, setes2dx
section_of silence_get_start, silence_get_start.have_di, silence_count_zeroes
section_of setrmlimit, skipcomm0, unhack
section_of skipequals
section_of to_errret_pop
section_of cmd3.have_cx_convenience
section_of verifysegm, verifysegm_or_error
section_of pp16, resetmode, resetmode_and_test_d_b_bit
section_of pp_fix32bitflags, proceedbreakpoint
section_of putsz, hexword, skipcomma, cmd3, cmd3_not_ext, cmd3_preprocessed
section_of hexdword
section_of cmd3_not_inject, cmd3_injected
section_of aa_not_inject, aa_injected, aa_before_getline, aa_after_getline
section_of transfer_ext_cx_nearcall_from_code2
section_of traceone, unexpectedinterrupt, dumpregs_no_disasm
section_of aa_imm_entry, ia_restore_a_addr, ia_restore_u_addr, disasm
section_of ia_restore_ds
%ifn _SYMBOLIC
section_of selector_to_segment
%endif
section_of disp_al, disp_al_hex, disp_al_nybble_hex, disp_ax_dec, disp_ax_hex
section_of disp_dxax_times_cx_width_bx_size
section_of disp_dxax_times_cx_width_bx_size.store
section_of disp_message, disp_message_length_cx
section_of ispm
section_of setrc, error
section_of _doscall, _doscall_return_es, _doscall_return_es_parameter_es_ds
section_of intcall_ext_return_es, close_ext, doscall_extseg
section_of yy_reset_buf
section_of init_bootcmd

section_of InDOS, bootgetmemorysize
section_of chkeol, decword, decdword
section_of dec_dword_minwidth
section_of getexpression.lit_isdigit?, getexpression.lit_ishexdigit?
section_of getlinearaddr
section_of getlinear_d_b
section_of getlinear_high_limit
section_of getlinear_32bit
section_of getlinear_high_limit.do_not_use_test
section_of getlinear_common
section_of ifsep, iseol?, isseparator?, isstring?, movp
section_of putc, putsline, putsline_crlf, putsz_error
section_of setrmsegm
section_of skipwh0, skipwhite
section_of test_d_b_bit, test_high_limit, push_cxdx_or_edx
section_of capitalise
section_of setes2ax
section_of zz_copy_strings_to_str_buffer
section_of call_xms_move, zz_call_xms, zz_detect_xms
section_of code2_to_code_ret_to_ext
section_of yy_dos_parse_name, yy_open_file, yy_check_lfn
section_of yy_common_parse_name
section_of yy_common_parse_name_bx_buffer
section_of retry_open_scriptspath
section_of yy_boot_read.bx, yy_boot_seek_start.bx, yy_boot_seek_current.bx
section_of yy_boot_parse_name, yy_boot_open_file
section_of yy_boot_parse_name_bx_buffer
section_of near_transfer_ext_return, scan_dir_aux, read_sector
section_of yy_boot_init_dir, got_yyentry, scan_dir_entry
section_of ..@yy_filename_empty, boot_parse_fn
section_of count_store, count_store.maybe_0
section_of loader_get_resident_address, loader_prepare_resident


 %if _SYMBOLIC && _DUALCODE && _SYMBOLASMDUALCODE
	usesection lDEBUG_CODE2
 %else
	usesection lDEBUG_CODE
 %endif
section_of bxcx_to_cx_paragraphs
section_of zz_list_symbol.first, zz_list_symbol.subsequent
section_of zz_xms_to_86mm, zz_xms_try_free, zz_xms_try_free_handle
section_of zz_86mm_to_xms, zz_del_match.add_poison_entrypoint
section_of zz_free_nonxms, zz_free_xms, zz_free_reset, zz_free_dos
section_of zz_get_literal, zz_restore_strat, zz_save_strat
section_of zz_switch_s, zz_transfer_buffer


%if _SYMBOLIC
 %if _DUALCODE && _SYMBOLICDUALCODE
	usesection lDEBUG_CODE2
 %else
	usesection lDEBUG_CODE
 %endif
section_of shift_left_4_bxcx
section_of selector_to_segment

section_of anti_normalise_pointer_with_displacement_bxcx, displaystring
section_of getfarpointer.hash, getfarpointer.main, getfarpointer.str
section_of move_delete_farpointer.hash, move_delete_farpointer.hash.sidi
section_of move_delete_farpointer.main, move_delete_farpointer.str.sidi
section_of move_insert_farpointer.hash, move_insert_farpointer.hash.sidi
section_of move_insert_farpointer.main, move_insert_farpointer.main.sidi
section_of move_insert_farpointer.str.sidi
section_of normalise_pointer, normalise_pointer_with_displacement_bxcx
section_of pointer_to_linear
section_of save_slice_farpointer.hash, save_slice_farpointer.main
section_of save_slice_farpointer.str
section_of segment_to_selector
section_of zz_insert, zz_match_symbol, zz_match_symbol.continue, zz_relocate

section_of binsearchhash, binsearchmain
section_of check_second_slice
section_of disp_size_hash, disp_size_main, disp_size_str
section_of displayresult, getstring1, getstring2
section_of increment_ss_ref_count
section_of list_sym_storage_usage, str_index_to_pointer
section_of zz_commit_insert, zz_compact, zz_compact_expand_check_nonxms
section_of zz_compact_expand_check_xms
section_of zz_delete_hash, zz_delete_main, zz_delete_main_and_its_hash
section_of zz_delete_string, zz_expand, zz_expand_common
section_of zz_get_symstr_length_bytes
section_of zz_get_symstr_length_bytes.ssLength_in_cx
section_of zz_get_symstr_length_indices
section_of zz_get_symstr_length_indices.ssLength_in_cx
section_of zz_hash, zz_hash.bx_init
section_of zz_insert_main.linklist, zz_reloc_main, zz_reloc_str
section_of zz_store_pre_str, zz_store_string, zz_store_string.hash_bx
section_of zz_unlink_main_next
%endif

%if _DUALCODE
	usesection lDEBUG_CODE2
%else
	usesection lDEBUG_CODE
%endif
section_of FloatToStr


 %if _DUALCODE && _EXPRDUALCODE
	usesection lDEBUG_CODE2
 %else
	usesection lDEBUG_CODE
 %endif

section_of getofsforbx, checkpointer, getrangeX
section_of getrangeX_have_address_need_length
section_of getrange, getaddr, getofsforbx_remember_bitness
section_of remember_bitness, getaddr_taken
section_of getstr, get_length, get_length_keyword
section_of isbracketorunaryoperator?, isunaryoperator?, isoperator?
section_of ..@call_operator_dispatchers
section_of isseparator?, istype?, isunsignedtype?
section_of handlesegment, handle3byte, handlebyte, handleword
section_of handledword, handlepointer
section_of uoh_abs, uoh_minus, calculate_minus_bxdx, uoh_plus
section_of uoh_not_bitwise, uoh_not_boolean
section_of od_minus, od_plus, od_multiply, od_divide, od_modulo, od_retn
section_of od_above, od_below, od_equal, od_not, od_or, od_and, od_xor
section_of od_cond, od_o, od_a, od_x, od_c, od_string_common
section_of of_modulo, of_minus, of_plus, or_hhtype, of_multiply
section_of set_hhtype, of_divide, of_power
section_of of_compare_below_equal, of_compare_below, of_compare_not_equal
section_of of_compare_equal, of_compare_above_equal, of_compare_above
section_of toboolean, of_helper_compare_true, of_rightop, of_helper_compare
section_of of_shift_right, of_shift_right_signed, of_shift_left
section_of of_helper_getshiftdata, of_bit_mirror
section_of of_or_bitwise, or_hhtype_1, of_or_boolean, of_clr_bitwise
section_of of_and_bitwise, of_and_boolean, of_xor_bitwise, of_xor_boolean
section_of of_helper_retbool, of_helper_getbool

section_of var_cip_setup, var_csp_setup, var_lfsr_setup, var_reverselfsr_setup
section_of var_dpspsel_setup, var_seldbg_setup, var_mt_setup
section_of var_ioi_setup, var_psps_setup, var_ppr_setup, var_ppi_setup
section_of var_iok_setup, var_rhcount_setup
section_of var_get_psp_segment, var_get_psp_selector
section_of var_bootldpunit_setup, var_bootsdpunit_setup, var_bootydpunit_setup
section_of var_bootldppart_setup, var_bootsdppart_setup, var_bootydppart_setup
section_of var_bootunitflags_setup

section_of issymbol?, isvariable?, var_mm_setup, var_ri_setup, var_ysf_setup
section_of default_variable_setup
section_of var_ext_setup
section_of var_ext_setup_done

section_of getstmmxdigit
section_of getexpression.lit_ishexdigit?, getexpression.lit_isdigit?
section_of of_cond, count_unary_operators, count_unary_operators_restrict
section_of get3byte.checksignificantbits, getbyte, checksignificantbitscommon
section_of getnyb, get_value_range

section_of getaddrX, getword, getdword, getexpression

section_of getrangeX.lines, getrangeX.ecx_and_0_valid
section_of getrange.lines, getrange.ecx_and_0_valid, get_length.lines
section_of getrangeX.lines_and_uu, getrange.lines_and_uu
section_of isseparator?.except_L_or_dot, isvariable?.return_name
section_of getword.checksignificantbits, getbyte.checksignificantbits

section_of seg_bx_to_sel
section_of getexpression.countsignificantbits
section_of ..@rr_checksignificantbits, ..@rr_operatordispatchers
section_of ..@rr_operatorfunctions, ..@parsecm_getaddr
section_of stack_check.internal


	usesection INIT
section_of init_capitalise
section_of init_skipwhite, init_skipwh0
section_of init_skipcomma, init_skipcomm0
section_of init_skipequals


	usesection lDEBUG_DATA_ENTRY
section_of entry_retn


%if _LINK
 %include "extern.mac"
%endif
