global {
	outputname "unalf14.s";
	inputname "unalf14.raw";
	startaddr $7173;
	cpu "6502";
	comments 3;
	commentcolumn 32;
};
asminc { file "unalf14.osequates"; };

label { name "zp_b0"; addr $b0; };
label { name "zp_b1"; addr $b1; };
label { name "acc16_l"; addr $b2; };
label { name "acc16_h"; addr $b3; };
label { name "zp_b4"; addr $b4; };
label { name "zp_b5"; addr $b5; };
label { name "stackptr_l"; addr $b6; };
label { name "stackptr_h"; addr $b7; };
label { name "zp_b8"; addr $b8; };
label { name "zp_b9"; addr $b9; };
label { name "outbuf_ptr_l"; addr $ba; };
label { name "outbuf_ptr_h"; addr $bb; };
label { name "zp_bc"; addr $bc; };
label { name "zp_bd"; addr $bd; };
label { name "zp_be"; addr $be; };
label { name "zp_bf"; addr $bf; };

range { type bytetable; start $7173; end $71b7; };
range { type texttable; start $71b8; end $7359; };
range { type texttable; start $7c32; end $7ca7; };
range { type texttable; start $7f1d; end $7f3c; };
range { type bytetable; start $7a79; end $7a83; };
range { type texttable; start $7a84; end $7a8a; };
range { type texttable; start $7925; end $7943; };
range { type texttable; start $7d82; end $7d85; };
range { type bytetable; start $7e38; end $7e4d; };
range { type bytetable; start $7fca; end $7fdd; };
range { type texttable; start $7e07; end $7e0b; };

label { name "copy_cli_arg"; comment "copy sparta cli arg to linbuf, append EOL ($9b)"; addr $7c11; };
label { name "cca_loop"; addr $7c16; };
label { name "cca_append_eol"; addr $7c29; };
label { name "have_infile"; comment "either a filename was passed as an argument (sparta), or enterd at the prompt"; addr $7386; };
label { name "have_outdir"; comment "either a dir was passed as an argument (sparta), or enterd at the prompt"; addr $73ee; };
label { name "get_cli_arg"; comment "spartados only; returns with C clear if there's an arg, or set if not"; addr $7bce; };
label { name "sparta_exit"; addr $73b9; };
label { name "shift_counter"; addr $71ac; };
label { name "init_counters"; addr $780c; };
label { name "out_ptr_hi_ok"; addr $7841; };
label { name "out_len_hi_ok"; addr $7849; };
label { name "outbuf_not_full"; addr $7898; };
label { name "push_acc16"; comment "push 2 byte 'register' to software stack"; addr $78f6; };
label { name "pop_acc16"; comment "pop 2 byte 'register' from software stack"; addr $7944; };
label { name "store_outbyte"; comment "save decrunched byte in outbuf, update checksum, write outbuf if full"; addr $7826; };
label { name "setup_io_bufs"; addr $7978; };
label { name "cleanup_and_exit"; addr $787f; };
label { name "init_outbuf"; addr $7886; };
label { name "alf_header"; comment "arc/alf signature, $1a"; addr $718d; };
label { name "alf_hdr_sig"; comment "alf signature, $0f"; addr $718e; };
label { name "alf_hdr_filename"; comment "null-terminated compressed filename, 13 bytes"; addr $718f; };
label { name "alf_hdr_compsize0"; comment "compressed size, 4 bytes, LSB first"; addr $719c; };
label { name "alf_hdr_compsize1"; addr $719d; };
label { name "alf_hdr_compsize2"; addr $719e; };
label { name "alf_hdr_compsize3"; comment "always 0, archived file never >= 16MB"; addr $719f; };
label { name "alf_hdr_date0"; comment "2 bytes, MS-DOS date format (see Arcinfo)"; addr $71a0; };
label { name "alf_hdr_date1"; addr $71a1; };
label { name "alf_hdr_time0"; comment "2 bytes, MS-DOS time format (see Arcinfo)"; addr $71a2; };
label { name "alf_hdr_time1"; addr $71a3; };
label { name "alf_hdr_cksum_l"; comment "CRC stored in file header"; addr $71a4; };
label { name "alf_hdr_cksum_h"; addr $71a5; };
label { name "alf_hdr_origsize0"; comment "uncompressed size, 4 bytes, LSB first"; addr $71a6; };
label { name "alf_hdr_origsize1"; addr $71a7; };
label { name "alf_hdr_origsize2"; addr $71a8; };
label { name "alf_hdr_origsize3"; comment "last byte in alf header"; addr $71a9; };

label { name "output_dir"; addr $7050; };
label { name "copy_outdir"; addr $740d; };
label { name "cod_loop"; addr $7410; };

label { name "cksum_ok"; addr $75da; };
label { name "uncrunch_blk"; addr $75db; };
label { name "alfext"; addr $7e07; };
label { name "entrypoint"; addr $7fc7; };
label { name "startup"; addr $735a; };
label { name "open_read"; comment "X = IOCB<<4, A=<buf, Y=>buf"; addr $7b76; };
label { name "open_write"; addr $7b7b; };
label { name "open_update"; comment "not used?"; addr $7b80; };
label { name "open_append"; comment "not used?"; addr $7b85; };
label { name "open_dir"; addr $7b8a; };
label { name "finish_open"; comment "#$03 in A = CIO OPEN command"; addr $7b8d; };
label { name "close_iocb"; addr $7b48; };
label { name "putchar"; comment "print character in A, saves A/X/Y regs"; addr $7a9f; };
label { name "stardotstar"; comment "filespec for directory"; addr $7d82; };
label { name "exit"; addr $739a; };
label { name "printstr"; comment "X = LSB, Y = MSB of string. SELF MODIFYING!"; addr $7a8b; };
label { name "printstr_done"; addr $7a9e; };
label { name "printstr_loop"; comment "$B9 = LDA abs,y"; addr $7a93; };
label { name "printstr_op_lo"; comment "gets modified"; addr $7a94; };
label { name "printstr_op_hi"; comment "gets modified"; addr $7a95; };
label { name "msg_skipping"; addr $7f1d; };
label { name "emsg_locate"; addr $7f28; };
label { name "pskp_loop"; addr $7f08; };
label { name "pskp_done"; addr $7f13; };
label { name "check_arc_sig"; comment "first byte of header is $1A, just like ARC"; addr $748c; };
label { name "check_alf_sig"; comment "2nd byte of header (compression type) is $0F"; addr $749d; };

label { name "readblock"; addr $7acf; };
label { name "writeblock"; addr $7ad3; };
label { name "do_block_io"; addr $7ad5; };
label { name "save_SDMCTL"; addr $7173; };
label { name "MEMLO_hi"; addr $02e8; };

label { name "buf_adr_l"; addr $7a7b; };
label { name "buf_adr_h"; addr $7a7c; };
label { name "buf_len_l"; addr $7a7d; };
label { name "buf_len_h"; addr $7a7e; };
label { name "save_x"; addr $7a81; };
label { name "save_y"; addr $7a82; };
label { name "save_a"; addr $7a83; };
label { name "toupper"; addr $7b51; };
label { name "le_z"; addr $7b56; };
label { name "ge_a"; addr $7b5b; };
label { name "open_kdev"; addr $7bb4; };
label { name "close_kdev"; addr $7bc3; };
label { name "getc0"; comment "read 1 byte from E: (IOCB0)"; addr $7b06; };
label { name "getcx"; addr $7b08; };
label { name "getline"; comment "read a line of input from E:"; addr $7b19; };
label { name "nextchar"; addr $7b1e; };
label { name "do_backspace"; addr $7b40; };
label { name "getline_done"; addr $7b39; };
label { name "linbuf_idx"; addr $7a79; };
label { name "linbuf"; addr $7120; };
label { name "ucase_linbuf"; addr $7b5e; };
label { name "ucase_linbuf_loop"; addr $7b69; };
label { name "ucase_linbuf_done"; addr $7b75; };
label { name "disable_screen"; addr $7432; };
label { name "open_input"; addr $743b; };
label { name "disable_screen_flag"; addr $71b3; };
label { name "read_alf_header"; comment "29 ($1D) bytes, read into alf_header"; addr $7450; };

label { name "copy_filename"; addr $73c4; };
label { name "copy_filename_loop"; addr $73d0; };
label { name "ensure_d_prefix"; addr $7dcf; };
label { name "ensure_suffix"; addr $7e0c; };
label { name "input_file"; addr $7000; };
label { name "lday_input_file"; comment "lda #<input_file ; ldy #>input_file"; addr $743d; };
label { name "open_fileadr_l"; addr $7a7f; };
label { name "open_fileadr_h"; addr $7a80; };
label { name "kdev"; addr $7a84; };
label { name "p3dev"; comment "unused?"; addr $7a87; };
label { name "lday_kdev"; comment "lda #<kdev ; ldy #>kdev"; addr $7bbb; };
label { name "outfile_l"; addr $70a0; };
label { name "outfile_h"; addr $70a1; };
label { name "open_outfile"; comment "lda #<outfile ; ldy #>outfile"; addr $750d; };
label { name "uncrunch_file"; addr $754e; };
label { name "next_header"; addr $7546; };
label { name "cksum_l"; comment "calculated"; addr $717f; };
label { name "cksum_h"; addr $7180; };
label { name "write_output"; addr $79c0; };
label { name "have_output"; addr $79c9; };
label { name "outbuf_adr_l"; addr $7187; };
label { name "outbuf_adr_h"; addr $7188; };
label { name "outbuf_len_l"; addr $71b1; };
label { name "outbuf_len_h"; addr $71b2; };
label { name "inbuf_adr_l"; addr $7185; };
label { name "inbuf_adr_h"; addr $7186; };
label { name "inbuf_len_l"; addr $7183; };
label { name "inbuf_len_h"; addr $7184; };

# text strings:
label { name "msg_banner"; addr $71b8; };
label { name "prompt_infile"; addr $71dd; };
label { name "prompt_outdir"; addr $71f2; };
label { name "msg_complete"; addr $7206; };
label { name "msg_uncrunching"; addr $721b; };
label { name "prompt_screen_off"; addr $7229; };
label { name "emsg_not_alf"; addr $7241; };
label { name "emsg_outdir_too_long"; addr $7259; };
label { name "emsg_outdir_invalid"; addr $7277; };
label { name "emsg_open_input"; addr $7294; };
label { name "emsg_eof_extra"; addr $72ae; };
label { name "emsg_write_output"; addr $72d5; };
label { name "emsg_read_input"; addr $72f0; };
label { name "emsg_input_overrun"; addr $730a; };
label { name "emsg_checksum"; addr $7320; };
label { name "emsg_memlo"; addr $7338; };
label { name "emsg_stk_overrun"; addr $7925; };
label { name "emsg_stk_underrun"; addr $7934; };

label { name "emsg_read_main_dir"; addr $7c32; };
label { name "emsg_credir_failed"; addr $7c50; };
label { name "emsg_outpath_build"; addr $7c72; };
label { name "msg_credir_issued"; addr $7c8f; };

# code that prints text strings:
label { name "print_emsg_locate"; comment "ldx #<emsg_locate : ldy #>emsg_locate"; addr $7f9f; };
label { name "print_msg_skipping"; comment "ldx #<msg_skipping : ldy #>msg_skipping"; addr $7eff; };
label { name "print_emsg_outpath_build"; comment "ldx #<emsg_outpath_build : ldy #>emsg_outpath_build"; addr $7cca; };
label { name "print_emsg_read_main_dir"; comment "ldx #<emsg_read_main_dir : ldy #>emsg_read_main_dir"; addr $7cd4; };
label { name "print_msg_credir_issued"; comment "ldx #<msg_credir_issued : ldy #>msg_credir_issued"; addr $7d2d; };
label { name "print_emsg_credir_failed"; comment "ldx #<emsg_credir_failed : ldy #>emsg_credir_failed"; addr $7d61; };

label { name "print_msg_banner"; comment "ldx #<msg_banner : ldy #>msg_banner"; addr $736a; };
label { name "print_prompt_infile"; comment "ldx #<prompt_infile : ldy #>prompt_infile"; addr $738b; };
label { name "print_msg_complete"; comment "ldx #<msg_complete : ldy #>msg_complete"; addr $739d; };
label { name "print_emsg_memlo"; comment "ldx #<emsg_memlo : ldy #>emsg_memlo"; addr $73ba; };
label { name "print_prompt_outdir"; comment "ldx #<prompt_outdir : ldy #>prompt_outdir"; addr $73e4; };
label { name "print_emsg_outdir_invalid2"; comment "ldx #<emsg_outdir_invalid : ldy #>emsg_outdir_invalid"; addr $7403; };
label { name "print_prompt_screen_off"; comment "ldx #<prompt_screen_off : ldy #>prompt_screen_off"; addr $741e; };
label { name "print_emsg_open_input"; comment "ldx #<emsg_open_input : ldy #>emsg_open_input"; addr $7446; };
label { name "print_emsg_eof_extra"; comment "ldx #<emsg_eof_extra : ldy #>emsg_eof_extra"; addr $7482; };
label { name "print_emsg_not_alf"; comment "ldx #<emsg_not_alf : ldy #>emsg_not_alf"; addr $7493; };
label { name "print_emsg_outdir_too_long"; comment "ldx #<emsg_outdir_too_long : ldy #>emsg_outdir_too_long"; addr $74bd; };
label { name "print_emsg_outdir_invalid"; comment "ldx #<emsg_outdir_invalid : ldy #>emsg_outdir_invalid"; addr $74d5; };
label { name "print_emsg_write_output"; comment "ldx #<emsg_write_output : ldy #>emsg_write_output"; addr $7518; };
label { name "print_msg_uncrunching"; comment "ldx #<msg_uncrunching : ldy #>msg_uncrunching"; addr $7522; };
label { name "print_filename"; comment "ldx #<outfile ; ldy #>outfile"; addr $7529; };
label { name "print_emsg_checksum"; comment "ldx #<emsg_checksum : ldy #>emsg_checksum"; addr $75d3; };
label { name "print_emsg_write_output_2"; comment "ldx #<emsg_checksum : ldy #>emsg_checksum"; addr $7878; };
label { name "print_emsg_stk_overrun"; comment "ldx #<emsg_stk_overrun : ldy #>emsg_stk_overrun"; addr $7912; };
label { name "print_emsg_stk_underrun"; comment "ldx #<emsg_stk_underrun : ldy #>emsg_stk_underrun"; addr $7962; };
