;------------------------------------------------------------------------
;
;		Copyright 2006 Intergraded Logic Systems
;                  Source Code is Copyright Stephen J. Carden
;
;
;			Please do not share this source!
;------------------------------------------------------------------------
;	unarc file utility for real.dos v1.0) 
;
;------------------------------------------------------------------------
;                         Real.dos unarc.com
;			This program is to replace
;		      		unarc.com
;Super Unarc Source Code!  Written By Robert Puff 
;
;
;        Disassembly
;   By Stephen J. Carden   1991
;
;						4-11-92
;	Code History.     updated design,   November 5, 2005
;		added some tings to the intro
;
;
;
;
;
;       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;------------------------------------------------------------------------
; Notes: o This source code MAY NOT be placed for download on any BBS's!
;        o "mea" is a macro that loads the address of the first field
;          into the pointer specified by the second field.
;------------------------------------------------------------------------
; Assembler:  MADMAC (tm) ST Cross Assembler (Atari Corp)
;             XASM   st and IBM VERSIONS
;------------------------------------------------------------------------

com_file_name:		.macro
;			dc.b   12,"filename.ext",$9b
			dc.b   12,"UnArc.com   ",$9b
			.endm

;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; File revision history. Version Number in hex
;
file_ver:		equ   $26
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; the Month in dec for the first time this revision 
;was compiled
;
c_month:		equ   5
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; the day in dec for the first time this revision 
;was compiled
c_day:			equ   30
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; the year in dec for the first time this revision 
;was compiled
c_year:			equ   2010
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; Type of compiler used in program
;
; 0 = unknown Compiler
; 1 = xasm
; 2 = mac_65
; 3 = basic
; 4 = compiled basic xl
; 5 = C65
; 6 = Action
;
; We can add more as time goes on!
;
;
;
xasm:			equ	1
mac_65:			equ	2 
basic:			equ	3
basicxl:		equ	4
c65:			equ	5
action:			equ	6

file_compiler:		equ	xasm
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; is this relocatable code ?
; anyother value other than 1 or 2 would be unknown
r..yes:			equ	1
r..no:			equ	2
;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; Gotta define if it can be relocated
l_relocatable:		equ	r..no
;
;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; Gotta define if it can be relocated
r..crl:			equ	$7d
r..crlf:		equ	$9b
r..space:		equ	$20

l_frstscreenbyte:	equ	r..space
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; The language the output file is in. 
;
;
; 0	=	Undifined
; 1	=	English
; 2	=	German
;
r..language:		equ	1
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;
;        System Equates
;----------------------------
DISK0:			equ	$00
KBD:			equ	$30
MODEM:			equ	$50
; 
;----------------------------
SCREEN_ON:		equ	$BB
CW_QUERY:		equ	$B1
TD_STAMP:		equ	$CD
PASSWORD:		equ	$CE
OVER_WRITE:		equ	$CC
DISK_SWAP:		equ	$BC
SPARTADOS?:		equ	$CF
IN_BATCH:		equ	$C8
HOLDSTACK:		equ	$CB
V_ARC:			equ	$BA
GOT_PW:			equ	$D1
;

;
;
; 
;--------------Buffers-------------------------------
BEGIN:			equ	$3000
r5153:			equ	$3000
r5253:			equ	BEGIN+256
R52D9:			equ	r5253+134
R5353:			equ	R52D9+122
R5453:			equ	R5353+256
r_hi_mem:		equ	R5453+19373
;---------------end of buffers------------------------







			.include	equates
			.include	globals
			.include	macros

			.org	$4000

win_start:
header_info:
			.include	header		; this reads info out of the header and displays to screen

			ldy	#LBUF    			; loading the offset into comtab
.a:			lda	(comtab),y
			cmp	#' '				; looking for the space in the parm line
			beq	.gotspacechar 			; got the space let'S see if there is anything we can use
			cmp	#$9b				; nope!!  no parm
			beq	.noparmerror 			; let'S see if they are playing with the consol

			iny
			lda	#consol_start			; gonna look for the Start key
			cmp	consol				; comparing to the consol key
			beq	.tellfilehistory		; got the start key now lets print all the compiling info
			lda	#consol_any			; any consol key
			cmp	consol				; CONSOL KEY
			bne	.abort				; YEP!!!  abort screen
			jmp	.a

.noparmerror:		jmp	noparmerror
.tellfilehistory:	jmp	my_file_notice
.abort:			jmp	peek.a.byte.abort


.gotspacechar:
			jmp	start_unarc


;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; Aborted the program with a consol key
;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
peek.a.byte.abort:
			jsr	printsi
			dc.b	$9b,$9b
			dc.b	" "
			dc.b	<+128>,""
			dc.b	$9B
			dc.b	" "
			dc.b	<+128>,"|    UnArc uncompresses files    |"
			dc.b	$9B
			dc.b	" "
			dc.b	<+128>,"| Written by: Stephen J. Carden  |"
			dc.b	$9B
			dc.b	" "
			dc.b	<+128>,"|          & Robert Puff         |"
			dc.b	$9B
			dc.b	" "
			dc.b	<+128>,""
			dc.b	$9B,$9B,$FF
			rts
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; Well they did not pass the parms the program requires
; so now they get the syntax error message
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
noparmerror:
			JSR	printsi
			dc.b	$9b,$9b
			dc.b	"Syntax:"
			dc.b	<+128>,"Error"
			dc.b	$9b
			dc.b	" Usage:"
			dc.b	$9b
			dc.b	" UnArc [Source] [Destination] /n",$9b
			dc.b	" UnArc Dn:>path>file.arc Dn:>*.* /n",$9b
			dc.b	" /n Options [/ACPQSX] not Required",$9b
			dc.b	" Q = Extract with Query",$9b
			dc.b	" O = Over right",$9b
			dc.b	" P = Use the fourth parameter as an",$9b
			dc.b	"     encryption password",$9b
			dc.b	" T =Use time/date stamp from source ",$9b
			dc.b	"    file when writing destination files",$9b
			dc.b	" S = Have screen remain fully on",$9b
			dc.b	" X = Enable Disk Swaps",$9b




			dc.b	$FF
			rts


;--------------
;  help menu section
;--------------
my_file_notice:
			.include	notice

			rts



;
;--------------------------------------------
;printsi Routeen macro             
;this is a slow print to the screen
;usage jsr	printsi
;    .byte $9b," string to be printed",$ff
;--------------------------------------------
;
printsi:		pla
			sta	pstr+1
			pla
			sta	pstr+2
prsl:			inc	pstr+1
			bne	pstr
			inc	pstr+2
pstr:			lda	$ffff
			cmp	#$ff
			beq	estri
			jsr	fast_output
			jmp	prsl
estri:			lda	pstr+2
			pha
			lda	pstr+1
			pha
			rts
;
;-------------------------;
;actual screen handler    ;
;screen offset definitions;
;-------------------------;
scr_offset:		dc.w	0
			dc.w	40
			dc.w	80
			dc.w	120
			dc.w	160
			dc.w	200
			dc.w	240
			dc.w	280
			dc.w	320
			dc.w	360
			dc.w	400
			dc.w	440
			dc.w	480
			dc.w	520
			dc.w	560
			dc.w	600
			dc.w	640
			dc.w	680
			dc.w	720
			dc.w	760
			dc.w	800
			dc.w	840
			dc.w	880
			dc.w	920
;
;sprint:
;echo:
fast_output:		sta	$5a
			cmp	#32
			bcc	do_look
			cmp	#125
			bcc	do_here
do_look:		ldy	#0
lookup:			lda	char_table,y
			beq	do_here
			cmp	$5a
			beq	go_cio
			iny
			bne	lookup
go_cio:			lda	$5a
			jmp	putlocal
do_here:		ldy	#0
			lda	$5d
			sta	($5e),y
			lda	$5a
			cmp	#$9b
			beq	docr
notcr:			jsr	get_adr
			lda	$5a
			and	#$7f
			cmp	#32
			bcc	add64
			cmp	#96
			bcc	sub32
			jmp	asis
add64:			clc
			adc	#64
			jmp	asis
sub32:			sec
			sbc	#32
asis:			bit	$5a
			bpl	xxlate
			ora	#$80
xxlate:			ldy	#0
			sta	($5e),y
			inc	$55
			inc	$63
			lda	$55
			cmp	#40
			bcs	next_row
			iny
			lda	($5e),y
			sta	$5d
			ora	#$80
			ldx	752
			bne	nocurs1
			sta	($5e),y
nocurs1:		inc	$5e
			bne	nooav
			inc	$5e+1
nooav:			rts
docr:			lda	#0
			sta	$63
next_row:		lda	$52
			sta	$55
			inc	$54
			ldy	$54
			cpy	#24
			bcs	scroll
			jsr	get_adr
			ldy	#0
			lda	($5e),y
			sta	$5d
			ldx	752
			bne	nocurs2
			ora	#$80
			sta	($5e),y
nocurs2:		rts
scroll:			dec	$54
			lda	$58
			sta	$68
			clc
			adc	#40
			sta	$5e
			lda	$58+1
			sta	$68+1
			adc	#0
			sta	$5e+1
			ldy	#0
			ldx	#3
scloop:			lda	($5e),y
			sta	($68),y
			iny
			bne	scloop
			inc	$5e+1
			inc	$68+1
			dex
			bne	scloop
scloop2:		lda	($5e),y
			sta	($68),y
			iny
			cpy	#152
			bcc	scloop2
			lda	$58
			clc
			adc	#920&$ff
			sta	$5e
			lda	$58+1
			adc	#920/256
			sta	$5e+1
			ldy	#0
			tya
clear:			sta	($5e),y
			iny
			cpy	#40
			bcc	clear
			ldx	752
			bne	nocurs3
			lda	#$80
			ldy	$55
			sta	($5e),y
nocurs3:		lda	#0
			sta	$5d
			lda	$5e
			clc
			adc	$55
			sta	$5e
			lda	$5e+1
			adc	#0
			sta	$5e+1
			rts
get_adr:		lda	$54
			asl
			tay
			lda	$58
			clc
			adc	scr_offset,y
			sta	$5e
			lda	$58+1
			adc	scr_offset+1,y
			sta	$5e+1
			lda	$5e
			clc
			adc	$55
			sta	$5e
			lda	$5e+1
			adc	#0
			sta	$5e+1
			rts
char_table:
			dc.b	27,28,29,30,31,125,126,127
			dc.b	156,157,158,159,253,254,255,0
putlocal:		ldx	#11
			stx	$0342
			ldx	#0
			stx	$0348
			stx	$0349
			jmp	$e456
;
;------------
; PRINT BYTE 
;------------
echo:
sprint:			sta	$b8
			lda	#$04
			sta	$034a
			stx	$b6
			sty	$b7
			ldx	#$06
			lda	$e400+1,x
			sta	$b3
			lda	$e400,x
			sta	$b2
			lda	$b8
			jsr	.a
			ldx	$b6
			ldy	$b7
			lda	#$0c
			sta	$034a
			lda	$b8
			rts
;
.a:			inc	$b2
			jmp	($b2)
			rts






			.org	$8000




f.MEMLO    dc.w BEGIN
f.MEMTOP   dc.w R_HI_MEM
;
; 
L3000
         RTS 
DLIST
         dc.b $70,$70,$70
         dc.b $42
L3005    dc.w 0
; 
         dc.b 2,2,2,2,2,2,2,2
         dc.b 2,2,2,2,2,2,2,2
         dc.b 2,2,2,2,2,2,2
         dc.b $41
         dc.w DLIST
; 
DLIST2
         dc.b $70,$70,$70,$70
         dc.b $70,$70,$70,$70
         dc.b $70,$70,$70,$70
         dc.b $70,$70
         dc.b $42
         dc.w L3035
         dc.b $41
         dc.w DLIST2
; 
; 
L3035    dc.b <internal>, " "
L3036
         dc.b <internal>, "                 "
; 
L3047
         dc.b <internal>, "                      "
; 
; 
L305D    LDA #$00
I_305F   STA L51AA
         LDA $02C5   ;COLOR1 
         STA R3197
         LDA $02C6   ;COLOR2 
         STA R3198
         LDY #$7F
I_3070   LDA I_30BB,Y
I_3073   STA L91D9,Y
         DEY 
         BPL I_3070
         SEI 
         LDA #$00
         STA NMIEN
         JSR L91D9
         BCC I_30A2
         LDY #$00
I_3086    dc.b $2c  
I_3087   LDY #$07
         LDX #$00
I_308B   LDA I_30AD,Y
         STA L51AA,X
         INY 
I_3092   INX 
         CPX #$07
         BCC I_308B
          X_Y  R52D9
I_309B   LDA #$C0
         STA NMIEN
         CLI 
         RTS 
; 
I_30A2   JSR L9218
         BCS I_3087
          X_Y  R5153
         BNE I_309B
I_30AD
         dc.b $01,$EF,$00,$FF,$10,$01,$D3
         dc.b $02,$00,$01,$00,$00,$FF,$CF
; 
L91D9    ;           ALSO
I_30BB   LDY #$FF
         LDX RAM_WINDOW
         LDA PORTB
         AND #$EF
         STY RAM_WINDOW
         STA PORTB
         INY 
         ORA #$10
         PHA 
         LDA RAM_WINDOW
         STA $8E
         PLA 
         STY RAM_WINDOW
         STA PORTB
         DEY 
         CPY RAM_WINDOW
         STX RAM_WINDOW
         BEQ I_30E6
         CLC 
         RTS 
; 
I_30E6   LDA PORTB
         AND #$EF
         LDX $8E
         STA PORTB
         STX RAM_WINDOW
         ORA #$10
         STA PORTB
         SEC 
         RTS 
;
L9218    ;           ALSO
I_30FA
         LDX #$00
         STX $CFFF
         LDY RAM_WINDOW
         STX RAM_WINDOW
         INX 
         STX $CFFF
         LDA RAM_WINDOW
         STX RAM_WINDOW
I_310F   DEX 
         STX $CFFF
         CPX RAM_WINDOW
         STY RAM_WINDOW
         BEQ I_311D
         CLC 
         RTS 
; 
I_311D   INX 
         STX $CFFF
         STA RAM_WINDOW
         DEX 
         STX $CFFF
         SEC 
         RTS 
; 
L312A    STX $BF
L312C    STY $BF+1
         STX $C1
         TYA 
         CLC 
         ADC #$20
         STA $C1+1
         STX $C3
         ADC #$10
         STA $C3+1
         STX $B2
         ADC #$10
         STA $B2+1
         LDA f.MEMTOP
         SEC 
         SBC $B2
         TAY 
         LDA f.MEMTOP+1
         SBC $B2+1
         LSR
         STA $B4+1
         STA $B8+1
         TYA 
         ror
         STA $B4
         STA $B8
         CLC 
         ADC $B2
         STA $B6
         LDA $B8+1
         ADC $B2+1
         STA $B6+1
         LDA #$00
         STA IN_BATCH
         STA V_ARC
         STA SCREEN_ON
         STA CW_QUERY
         STA DISK_SWAP
         STA OVER_WRITE
         STA TD_STAMP
         STA PASSWORD
         STA SPARTADOS?
;         INC SCREEN_ON
         LDA #$FF
         STA color0
         LDA #$80
         STA COLOR2
         RTS 
;
         dc.b 0
         dc.b 0,0,0
         dc.b 0,0
         dc.b 0,0,0,0
         dc.b 0,0,0,0
         dc.b 0,0,0
         dc.b 0
         dc.b 0
         dc.b 0
; 
A_PRINT  STY $BD
         STX $BD+1
         JSR A_PUTL
         LDY $BD
         LDX $BD+1
         RTS 
; 
A_CRLF   LDA #$9B
A_PUTL   PHA 
         JSR L31AD
         PLA 
         RTS 
; 
L31AD    TAY 
L31AE    LDA #$00
         PHA 
L31B1    LDA #$00
         PHA 
         LDX #DISK0
         TYA 
         RTS 
; 
A_GETKBD JSR A_GETKEY
         CPY #$80
         BCS A_GETKBD
         RTS 
; 
A_GETKEY LDX #KBD
         LDA #$07
         STA ICCOM,X
         LDA #$00
         STA ICBLL,X
         STA ICBLH,X
         JMP CIOV
; 
p_print    STX FPTR2
         STY FPTR2+1
L31D6    LDY #$00
         LDA (FPTR2),Y
         BEQ L31EB
L31DC    JSR A_PUTL
         CPY #$80
         BCS L31DC
         INC FPTR2
         BNE L31D6
         INC FPTR2+1
         BNE L31D6
L31EB    RTS 
; 
CLOSE0   LDX #DISK0
          dc.b $2c  
CLOSE1   LDX #DISK1
          dc.b $2c  
CLOSE2   LDX #DISK2
          dc.b $2c  
CLOSE_KBD LDX #KBD
; 
C_CLOSE
         LDA #$0C
         STA ICCOM,X
         JMP CIOV
; 
L31FF    CPY #$80
         BCS L3204
         RTS 
; 
L3204    STY FR0
         LDA #$00
         STA FR0+1
         STX $8F
         JSR L4D10
         LDX $8F
         CPX #$20
         BEQ L321B
; 
          X_Y  disker
         BNE L321F
L321B
          X_Y  diskerw
L321F    JSR p_print
         JSR A_PRCARD
         PLA 
         PLA 
L3227    JSR CLOSE1
         LDA $0340+DISK2
         CMP #$FF
         BEQ L3237
         JSR L4E55
         JSR CLOSE2
L3237    JSR L4D10
         JSR L348B
         JSR A_CRLF
         LDA IN_BATCH
         BEQ L3247
         JMP L3DF1
; 
L3247
          X_Y  presr
; 
         JSR p_print
         LDA #$FF
         STA 764
         JSR A_GETKBD
         JMP L3C58
; 
disker
         dc.b $9B
	dc.b	<+128>,"Disk Read Error"
	dc.b	" #ý",0
; 
diskerw
         dc.b $9B
	dc.b	<+128>,"Disk Write Error"
	dc.b	" #ý",0
; 
presr
         dc.b $9B,"Press "
	dc.b	<+128>,"Return"
	dc.b	" to continue...",0
; 
; 
A_PRCARD
         JSR IFP
         JSR $D8E6
         LDY #$00
L32A7    LDA (INBUFF),Y
         PHA 
         AND #$7F
         JSR A_PRINT
         INY 
         PLA 
         BPL L32A7
         RTS 
; 
L32B4    LDA $99
         BNE L32C6
         ORA $99+1
         BNE L32C4
         ORA $99+2
         BNE L32C2
         SEC 
         RTS 
; 
L32C2    DEC $99+2
L32C4    DEC $99+1
L32C6    DEC $99
L32C8    LDA $82
         BNE L331A
         ORA $82+1
         BNE L3314
         STX $80
         JSR L4E2D
         LDX #DISK1
         LDA #$07
         STA ICCOM,X
         LDA $B2
         STA ICBAL,X
         STA L331C+1
         LDA $B2+1
         STA ICBAH,X
         STA L331C+2
         LDA $B4
         STA ICBLL,X
         LDA $B4+1
         STA ICBLH,X
         JSR CIOV
         BPL L3302
         CPY #136
         BEQ L3302
         JMP L31FF
; 
L3302    LDA ICBLL,X
         STA $82
         LDA ICBLH,X
         STA $82+1
         LDX $80
         ORA $82
         BNE L3314
         SEC 
         RTS 
; 
L3314    LDA $82
         BNE L331A
         DEC $82+1
L331A    DEC $82
L331C    LDA $FFFF
         LDY $D0
         BEQ L332F
         EOR R316A,Y
         INY 
         CPY GOT_PW
         BCC L332D
         LDY #$01
L332D    STY $D0
L332F    INC L331C+1
         BNE L3337
         INC L331C+2
L3337    CLC 
         RTS 
; 
L3339    LDY #$01
L333B
         LDA $B6,Y
         STA L334B+1,Y
         LDA $B8,Y
         STA $85,Y
         DEY 
         BPL L333B
         RTS 
; 
L334B    STA $FFFF
         LDY $8A
         BEQ L335E
         CLC 
         ADC $88
         STA $88
         BCC L336D
         INC $88+1
         JMP L336D
; 
L335E    EOR $88
         TAY 
         LDA crclo,Y
         EOR $88+1
         STA $88
         LDA crchi,Y
         STA $88+1
L336D    INC L334B+1
         BNE L3375
         INC L334B+2
L3375    LDA $85
         BNE L337B
         DEC $85+1
L337B    DEC $85
         BNE L3383
         LDA $85+1
         BEQ L339E
L3383    LDA $8B
         BNE L338F
         LDA $8B+1
         BNE L338D
         DEC $8B+2
L338D    DEC $8B+1
L338F    DEC $8B
         BNE L3399
         LDA $8B+1
         ORA $8B+2
         BEQ L339B
L3399    CLC 
         RTS 
; 
L339B    JMP L33EF
; 
L339E    STX $80
         JSR L3339
         LDA WORK_BUF
         CMP #$4E
         BEQ L33D3
         JSR L4E55
         JSR L33D8
         LDA #$0B
         LDX #DISK2
         STA ICCOM,X
         LDA $B6
         STA ICBAL,X
         LDA $B6+1
         STA ICBAH,X
         LDA $B8
         STA ICBLL,X
         LDA $B8+1
         STA ICBLH,X
         JSR CIOV
         BPL L33D3
         JMP L31FF
; 
L33D3    LDX $80
         JMP L3383
; 
L33D8    LDA $0340+DISK2
         CMP #$FF
         BEQ L33E0
         RTS 
; 
L33E0    JSR CIOV_SI
         dc.b DISK2
         dc.b 3
         dc.w WORK_BUF
         dc.w 0
         dc.w 9
; 
L33EB
         JSR L31FF
         RTS 
; 
L33EF    LDA L334B+1
         CMP $B6
         BNE L33FD
         LDA L334B+2
         CMP $B6+1
         BEQ L3438
L33FD    LDA WORK_BUF
         CMP #$4E
         BEQ L3438
         JSR L4E55
         JSR L33D8
         LDA #$0B
         LDX #DISK2
         STA ICCOM,X
         LDA $B6
         STA ICBAL,X
         STA L334B+1
         LDA $B6+1
         STA ICBAH,X
         STA L334B+2
         SEC 
         LDA $B8
         SBC $85
         STA ICBLL,X
         LDA $B8+1
         SBC $85+1
         STA ICBLH,X
         JSR CIOV
         BPL L3438
         JMP L31FF
; 
L3438    JSR CLOSE2
         PHP 
         JSR L348B
         PLP 
         BPL L3445
         JMP L31FF
; 
L3445    LDA $B6
         STA $85
         LDA $B6+1
         STA $85+1
         LDA $88
         CMP ARC_CRC
         BNE L345D
         LDA $88+1
         CMP ARC_CRC+1
         BNE L345D
L345B    SEC 
         RTS 
; 
L345D
          X_Y  L346C
; 
         JSR p_print
         LDA #$00
         STA R3196
         JMP L345B
; 
L346C
; 
         dc.b "Error: "
	 dc.b <+128>,"File fails CRC check"
	 dc.b "ý",$9B,0
; 
; 
L348B    LDA SPARTADOS?
         BEQ L3499
         LDA TD_STAMP
         BEQ L3499
         LDY #25
         LDA #$00
         STA ($0A),Y
L3499    RTS 
; 
;  
crclo
; 
         dc.b $00,$C1,$81,$40,$01,$C0,$80,$41
         dc.b $01,$C0,$80,$41,$00,$C1,$81,$40
         dc.b $01,$C0,$80,$41,$00,$C1,$81,$40
         dc.b $00,$C1,$81,$40,$01,$C0,$80,$41
         dc.b $01,$C0,$80,$41,$00,$C1,$81,$40
         dc.b $00,$C1,$81,$40,$01,$C0,$80,$41
         dc.b $00,$C1,$81,$40,$01,$C0,$80,$41
         dc.b $01,$C0,$80,$41,$00,$C1,$81,$40
         dc.b $01,$C0,$80,$41,$00,$C1,$81,$40
         dc.b $00,$C1,$81,$40,$01,$C0,$80,$41
         dc.b $00,$C1,$81,$40,$01,$C0,$80,$41
         dc.b $01,$C0,$80,$41,$00,$C1,$81,$40
         dc.b $00,$C1,$81,$40,$01,$C0,$80,$41
         dc.b $01,$C0,$80,$41,$00,$C1,$81,$40
         dc.b $01,$C0,$80,$41,$00,$C1,$81,$40
         dc.b $00,$C1,$81,$40,$01,$C0,$80,$41
         dc.b $01,$C0,$80,$41,$00,$C1,$81,$40
         dc.b $00,$C1,$81,$40,$01,$C0,$80,$41
         dc.b $00,$C1,$81,$40,$01,$C0,$80,$41
         dc.b $01,$C0,$80,$41,$00,$C1,$81,$40
         dc.b $00,$C1,$81,$40,$01,$C0,$80,$41
         dc.b $01,$C0,$80,$41,$00,$C1,$81,$40
         dc.b $01,$C0,$80,$41,$00,$C1,$81,$40
         dc.b $00,$C1,$81,$40,$01,$C0,$80,$41
         dc.b $00,$C1,$81,$40,$01,$C0,$80,$41
         dc.b $01,$C0,$80,$41,$00,$C1,$81,$40
         dc.b $01,$C0,$80,$41,$00,$C1,$81,$40
         dc.b $00,$C1,$81,$40,$01,$C0,$80,$41
         dc.b $01,$C0,$80,$41,$00,$C1,$81,$40
         dc.b $00,$C1,$81,$40,$01,$C0,$80,$41
         dc.b $00,$C1,$81,$40,$01,$C0,$80,$41
         dc.b $01,$C0,$80,$41,$00,$C1,$81,$40
; 
crchi
         dc.b $00,$C0,$C1,$01,$C3,$03,$02,$C2
         dc.b $C6,$06,$07,$C7,$05,$C5,$C4,$04
         dc.b $CC,$0C,$0D,$CD,$0F,$CF,$CE,$0E
         dc.b $0A,$CA,$CB,$0B,$C9,$09,$08,$C8
         dc.b $D8,$18,$19,$D9,$1B,$DB,$DA,$1A
         dc.b $1E,$DE,$DF,$1F,$DD,$1D,$1C,$DC
         dc.b $14,$D4,$D5,$15,$D7,$17,$16,$D6
         dc.b $D2,$12,$13,$D3,$11,$D1,$D0,$10
         dc.b $F0,$30,$31,$F1,$33,$F3,$F2,$32
         dc.b $36,$F6,$F7,$37,$F5,$35,$34,$F4
         dc.b $3C,$FC,$FD,$3D,$FF,$3F,$3E,$FE
         dc.b $FA,$3A,$3B,$FB,$39,$F9,$F8,$38
         dc.b $28,$E8,$E9,$29,$EB,$2B,$2A,$EA
         dc.b $EE,$2E,$2F,$EF,$2D,$ED,$EC,$2C
         dc.b $E4,$24,$25,$E5,$27,$E7,$E6,$26
         dc.b $22,$E2,$E3,$23,$E1,$21,$20,$E0
         dc.b $A0,$60,$61,$A1,$63,$A3,$A2,$62
         dc.b $66,$A6,$A7,$67,$A5,$65,$64,$A4
         dc.b $6C,$AC,$AD,$6D,$AF,$6F,$6E,$AE
         dc.b $AA,$6A,$6B,$AB,$69,$A9,$A8,$68
         dc.b $78,$B8,$B9,$79,$BB,$7B,$7A,$BA
         dc.b $BE,$7E,$7F,$BF,$7D,$BD,$BC,$7C
         dc.b $B4,$74,$75,$B5,$77,$B7,$B6,$76
         dc.b $72,$B2,$B3,$73,$B1,$71,$70,$B0
         dc.b $50,$90,$91,$51,$93,$53,$52,$92
         dc.b $96,$56,$57,$97,$55,$95,$94,$54
         dc.b $9C,$5C,$5D,$9D,$5F,$9F,$9E,$5E
         dc.b $5A,$9A,$9B,$5B,$99,$59,$58,$98
         dc.b $88,$48,$49,$89,$4B,$8B,$8A,$4A
         dc.b $4E,$8E,$8F,$4F,$8D,$4D,$4C,$8C
         dc.b $44,$84,$85,$45,$87,$47,$46,$86
         dc.b $82,$42,$43,$83,$41,$81,$80,$40
;  
; 
L369A
         dc.b $7D,$9B,"Enter complete source filename:",$9B,0
; 
; 
L36BD
         dc.b $9B,"Destination Drive # or Path [&mask]:",$9B,0
; 
; 
L36E4
         dc.b $9B
	 dc.b	<+128>,"Invalid Pathname!"
	 dc.b	$9B
         dc.b "Examples: 1, D2:*.BAS, D2:DIR>, or P:",$9B,0
; 
L371E
         dc.b "S/D Sectors:",0
; 
; 
L372B
         dc.b "  Bytes Saved:",0
; 
; 
L373A
         dc.b $9B
         dc.b <+128>,"[1-9]"
	 dc.b " Dirs, "
	 dc.b	<+128>,"[P]"
	 dc.b	"athname.  Extract?",0
; 
; 
L375D
         dc.b <+128>,"Un-Storing"
	 dc.b	0
; 
L3768
         dc.b <+128>,"Un-Packing"
	 dc.b	0

; 
L3773
         dc.b <+128>,"Un-Squeezing"
	 dc.b	0

; 
L3780
         dc.b <+128>,"Un-Crunching"
	 dc.b	0

; 
L378D
         dc.b <+128>,"Un-Alfing"
	 dc.b	0

; 
L3797
         dc.b <+128>,"Un-Squashing"
	 dc.b	0

; 
L37A4
         dc.b "Unknown!",0
; 
L37AD
         dc.b " Stored ",0
; 
L37B6
         dc.b " Packed ",0
; 
L37BF
         dc.b "Squeezed",0
; 
L37C8
         dc.b "Crunched",0
;
L37D1
         dc.b " Alf'ed ",0
;
L37DA
         dc.b "Squashed",0
;
;
L37E3
         dc.b $9B
         dc.b "   Filename:     Stowage:  Sectors",$9B
         dc.b "----------------------------------",$9B,0
; 
L382B
         dc.b "----------------------------------",$9B
         dc.b "Total Sector Length (SD) = ",0
; 
; 
L386A
         dc.b $42,$06,$55,$36,$00,$00
; 
L3870
         dc.b $41,$01,$25,$00,$00,$00
; 
L3876
         dc.b $41,$01,$24,$00,$00,$00
; 
; 
L387C
         dc.b <+128>,"Yes"
L387F
         dc.b <+128>,"No!"
; 
; 
; 
L3882
         dc.b $9B,"Insert "
	 dc.b <+128>,"Source"
	 dc.b " disk, press "
	 dc.b <+128>,"Return"
	 dc.b $9B,0
; 
L38A5
         dc.b $9B,"Insert "
	 dc.b	<+128>,"Destination"
	 dc.b " disk, press "
	 dc.b <+128>,"Return"
	 dc.b $9B,0
; 
L38CD
         dc.b $9B
         dc.b "Disk Error Recovery Menu:",$9B
         dc.b "  "
	 dc.b <+128>,"[P]"
	 dc.b " Change Dest. Path/Drive #",$9B
         dc.b "  "
	 dc.b <+128>,"[1-9]"
	 dc.b " Directories",$9B
         dc.b "  "
	 dc.b <+128>,"[ESC]"
	 dc.b " Exit to main menu",$9B
         dc.b "Or press "
	 dc.b <+128>,"Return"
         dc.b " to try again:",0
; 
L3954
         dc.b $9B,"File already exists - Replace?",0
; 
; 
L3974
         dc.b $9B,$9B
         dc.b "Use "
         dc.b $1B,$9E
         dc.b $1B,$9F
         dc.b $1B,$9C
         dc.b $1B,$9D
         dc.b ", "
	 dc.b <+128>,"RETURN"
	 dc.b " - toggle, "
	 dc.b <+128>,"ESC"
	 dc.b " - exit",$9B,0
; 
; 
L39A1
         dc.b " ",$7D
; 
         dc.b "",$1E,$1F,$9B
         dc.b "|Screen Off:Yes  Extract w/Query:No!|",$1E,$1F,$9B
         dc.b "|Disk Swaps:No!  Time/Date Stamp:No!|",$1E,$1F,$9B
         dc.b "|Over-Write:No!  Password Encrpt:No!|",$9B
         dc.b "",$9B
         dc.b $9B
; 
         dc.b "      ",$9B
         dc.b "      |"
	 dc.b <+128>," Unarc     Version 2.6 "
	 dc.b "|",$9B
         dc.b "      | Last Updated May 2010 |",$9B
         dc.b "",$9B
         dc.b "|"
	 dc.b <+128>," [A] "
	 dc.b " Un-Arc/Un-Alf a file         |",$9B
         dc.b "|"

	 dc.b <+128>," [V] "
	 dc.b " View an Arc/Alf file data    |",$9B
         dc.b "|"
	 dc.b <+128>," [P] "
	 dc.b " Change above parameters      |",$9B
         dc.b "|"
	 dc.b <+128>," [D] "
	 dc.b " Delete a file                |",$9B
         dc.b "|"
	 dc.b <+128>," [F] "
	 dc.b " Format a disk                |",$9B
         dc.b "|"
	 dc.b <+128>," [G] "
	 dc.b " Re-boot (ColdStart)          |",$9B
         dc.b "|"
	 dc.b <+128>," [H] "
	 dc.b " Exit to DOS                  |",$9B
         dc.b "|"
	 dc.b <+128>," [1-9] "
	 dc.b " Disk Directories           |",$9B
         dc.b "",$9B
         dc.b $9B
         dc.b "Select >",0
; 
; 
start_unarc:
         TSX 
         STX HOLDSTACK
         JSR L52D9
         LDA #$02
         STA $52
L3C58    LDA #$01
         STA R3196
         LDA IN_BATCH
         BEQ L3C64
         JMP L3E2F
; 
L3C64    LDA #$00
         STA V_ARC
; 
          X_Y  L39A1
; 
         JSR p_print
L3C6F    LDA #$0A
         STA $55
         asl
         STA $54
         LDA #$1E
         JSR A_PUTL
         LDA #$1F
         JSR A_PUTL
L3C80    JSR A_GETKBD
         CMP #$60
         BCC L3C89
L3C87    SBC #$20
L3C89    STA $AF
         CMP #'1'
         BCC L3C99
         CMP #'9'+1
         BCS L3C99
         JSR direct
         JMP L3C6F
; 
L3C99    CMP #'G'
         BNE L3CA0
         JMP $E477
; 
L3CA0    CMP #'H'
         BNE L3CAA
         JSR A_CRLF
         JMP L3DF1
; 
L3CAA    CMP #'P'
         BNE L3CB4
         JSR L3D16
         JMP L3C6F
; 
L3CB4    JMP L3D9E
; 
rever    LDY $8F
         LDX #$0E
         CPY #$03
         BCC L3CC1
         LDX #$13
L3CC1    LDA L3CD0,Y
         TAY 
L3CC5    LDA ($58),Y
         EOR #$80
         STA ($58),Y
         INY 
         DEX 
         BNE L3CC5
         RTS 
; 
L3CD0
         dc.b $2B,$53,$7B,$3B,$63,$8B
; 
L3CD6
         dc.b $36,$5E,$86,$4B,$73
L3CDB    dc.b $9B
; 
L3CDC    dc.b "No!"
L3CDF    dc.b "Yes"
L3CE2    dc.b <internal>,"No!"
L3CE5    dc.b <internal>,"Yes"
; 
L3CE8
         PHA 
         JSR rever
         LDY $8F
         LDA L3CD6,Y
         TAY 
         LDA #$03
         STA $97
         PLA 
         LDX #$00
         CMP #$00
         BEQ L3CFF
         LDX #$03
L3CFF    LDA L3CE2,X
         STA ($58),Y
         LDA L3CDC,X
         STA L39A1,Y
         INX 
         INY 
         DEC $97
         BNE L3CFF
         JSR rever
         JMP bell
; 
L3D16    LDA #$00
         STA $8F
          X_Y  L3974
; 
         JSR p_print
L3D21    JSR rever
L3D24    JSR A_GETKBD
         CMP #$1B
         BNE L3D39
         JSR rever
         LDA #$1C
         JSR A_PUTL
         LDA #$9C
         JSR A_PUTL
         RTS 
; 
L3D39    CMP #'-'
         BEQ L3D67
         CMP #'='
         BEQ L3D70
         CMP #'+'
         BEQ L3D79
         CMP #'*'
         BEQ L3D79
         CMP #$9B
         BNE L3D24
         LDY $8F
         LDA L3D61,Y
         TAY 
         LDA $00,Y
         EOR #$01
         STA $00,Y
         JSR L3CE8
         JMP L3D24
; 
L3D61
         dc.b SCREEN_ON
         dc.b DISK_SWAP
         dc.b OVER_WRITE
         dc.b CW_QUERY
         dc.b TD_STAMP
         dc.b PASSWORD
; 
L3D67
         JSR rever
         JSR L3D95
         JMP L3D21
; 
L3D70    JSR rever
         JSR L3D88
         JMP L3D21
; 
L3D79    JSR rever
         JSR L3D88
         JSR L3D88
         JSR L3D88
         JMP L3D21
; 
L3D88    INC $8F
         LDA $8F
         CMP #$06
         BCC L3D94
         LDA #$00
         STA $8F
L3D94    RTS 
; 
L3D95    DEC $8F
         BPL L3D94
         LDA #$05
         STA $8F
         RTS 
; 
L3D9E    CMP #'A'
         BEQ L3DA8
         CMP #'V'
         BNE L3DB0
         INC V_ARC
L3DA8    LDA $AF
         JSR A_PUTL
         JMP L3DE4
; 
L3DB0    CMP #'F'
         BEQ L3DBE
         CMP #'D'
         BEQ L3DBB
         JMP L3C80
; 
L3DBB    JMP L4D21
; 
L3DBE    JSR A_PUTL
         JSR L5013
         JMP L3C58
; 
;-----------------------
;Puffs pokie noise maker 
;------------------------
bell
         LDA #$00
         STA $D208
         LDA #$25
         STA $D200
         LDY #$B0
L3DD3    LDX #$FF
L3DD5    STX $D40A
         DEX 
         BNE L3DD5
         DEY 
         STY $D201
         CPY #$A0
         BNE L3DD3
         RTS 
; 
L3DE4
          X_Y  L369A
         JSR p_print
         JSR L4C7D
         JMP L3E34
; 
L3DF1    JSR CLOSE1
         JSR CLOSE2
         JSR CLOSE_KBD
         JSR SCREEN_SAVE
         JSR OPEN_E
         JSR SCREEN_LOAD
         LDA #$FF
         STA 764
         LDA R3197
         STA color0
         LDA R3198
         STA COLOR2
         LDX HOLDSTACK
         TXS 
         LDA SPARTADOS?
         BNE L3E1E
         JMP ($0A)
; 
L3E1E    RTS 
; 
OPEN_E   LDA #$0C
         STA $2A
L3E23    LDA #$00
         PHA 
L3E26    LDA #$00
         PHA 
         RTS 
; 
L3E2A    dc.b ".A??",$9B
; 
L3E2F    LDA $CA
         STA ICBLL
L3E34    JSR CLOSE1
         LDY ICBLL
         DEY 
L3E3B    LDA DEST_BUF,Y
         CMP #'.'
         BEQ L3E57
         DEY 
         BNE L3E3B
         LDY ICBLL
         DEY 
         LDX #$00
L3E4B    LDA L3E2A,X
         STA DEST_BUF,Y
         INY 
         INX 
         CPX #$05
         BCC L3E4B
L3E57    LDA #$00
         LDA #$00
         STA $82
         STA $82+1
         STA $D0
         STA $A1
         STA $A1+1
         JSR CIOV_SI
         dc.b DISK1
         dc.b $03
         dc.w DEST_BUF
         dc.w 0
         dc.w 4
; 
         JSR L31FF
         LDA #$01
         STA $C7
         LDA V_ARC
         BEQ L3E85
          X_Y  L37E3
; 
         JSR p_print
         JMP L3E93
; 
L3E85    LDA IN_BATCH
         BNE L3E93
         JSR L496D
         LDA PASSWORD
         BEQ L3E93
         JSR L4CCB
L3E93    LDA #$00
         STA $D0
         STA $95
L3E99    JSR L32C8
         BCC L3EA5
         LDA ARC_VER
         CMP #$0F
         BEQ L3EDE
L3EA5    CMP #$1A
         BEQ L3EDB
         CMP #$F9
         BEQ L3EC7
         CMP #$FA
         BEQ L3EC7
         CMP #$FF
         BEQ L3ED1
L3EB5    INC $95
         LDA $95
         CMP #$07
         BCC L3E99
          X_Y  L3EE2
L3EC1    JSR p_print
         JMP L3227
; 
L3EC7
          X_Y  L3F06
         LDA $95
         BNE L3EB5
         BEQ L3EC1
L3ED1
          X_Y  L3F2C
         LDA $95
         BNE L3EB5
         BEQ L3EC1
L3EDB    JMP L3F46
; 
L3EDE    JMP L3F54
; 
; 
L3EE2
         dc.b $9B,"File not ARC or AlfCrunch format!"
	 dc.b	"ý",$9B,0
; 
L3F06
         dc.b $9B,"Please use DiskComm for this file."
	 dc.b	"ý",$9B,0
; 
L3F2C
         dc.b $9B,"This is a Binary file!"
	 dc.b	"ý",$9B,0
; 
; 
L3F46    JSR L32C8
         STA ARC_VER
         CMP #$1A
         BEQ L3F54
         CMP #$00
         BNE L3F83
L3F54    LDA V_ARC
         BEQ L3F70
          X_Y  L382B
         JSR p_print
         LDA $A1
         STA FR0
         LDA $A1+1
         STA FR0+1
         JSR A_PRCARD
         JSR A_CRLF
         JMP L3227
; 
L3F70
          X_Y  donem
         JSR p_print
         JMP L3227
; 
; 
donem
         dc.b $9B
         dc.b <+128>," Done! "
         dc.b 0
; 
L3F83    CMP #$01
         BNE L3FA6
         LDX #$00
L3F89    JSR L32C8
         STA ARC_NAME,X
         INX 
         CPX #$17
         BCC L3F89
         LDX #$02
         STX ARC_NAME
         INX 
L3F9A    LDA ARC_SIZE,X
         STA ARC_OSIZE,X
         DEX 
         BPL L3F9A
         JMP L3FB3
; 
L3FA6    LDX #$00
L3FA8    JSR L32C8
         STA ARC_NAME,X
         INX 
         CPX #$1B
         BCC L3FA8
L3FB3    LDA ARC_VER
         CMP #$0F
         BEQ L3FBC
         BCS L3FC6
L3FBC    LDY V_ARC
         BNE L3FD3
         TAY 
         LDA L4030,Y
         BNE L4040
L3FC6
          X_Y  L3FEE
         JSR p_print
         JSR L3FD9
         JMP L426E
; 
L3FD3    JSR L3FD9
         JMP L40FF
; 
L3FD9    JSR L3339
         LDY #$02
L3FDE    LDA ARC_OSIZE,Y
         STA $8B,Y
         LDA ARC_SIZE,Y
         STA $99,Y
         DEY 
         BPL L3FDE
         RTS 
; 
; 
L3FEE
         dc.b $9B,"Error: Unknown Crunch type!"
	 dc.b "ý",$9B
         dc.b "Skipping this entry..."
; 
L4022    dc.b $9B,$00
; 
L4024    dc.b $00,$0B,$16
; 
L4027    dc.b "000#:"
L402C    dc.b "0000"
L4030    dc.b 0
; 
L4031    dc.b $30,$09,$12,$1B,$00,$00,$00
         dc.b $24,$36,$00,$00
L403C
         dc.b $00,$00,$00,$2D
; 
L4040
         LDY #$00
L4042    LDA DIR_MASK,Y
         CMP #$9B
         BEQ L404F
         STA WORK_BUF,Y
         INY 
         BNE L4042
L404F    LDX #$00
         TYA 
         CLC 
         ADC # low WORK_BUF
         STA $80
         LDA # high WORK_BUF
         ADC #$00
         STA $80+1
L405D    LDA ARC_NAME,X
L4060    BEQ L4088
         AND #$7F
         CMP #$20
         BEQ L4081
         CMP #'.'     ;$2E 
         BEQ L4081
         CMP #'1'-1   ;$30 
         BCC L407F
         CMP #'9'+1   ;$3A 
         BCC L4081
         CMP #'A'     ;$41 
         BCC L407F
         CMP #$60
         BCC L4081
         SBC #$20    ; make it upper case 
          dc.b $2c  
L407F    LDA #'Q'     ; $51
L4081    STA WORK_BUF,Y
         INX 
         INY 
         BNE L405D
L4088    LDA #$9B
         STA WORK_BUF,Y
         JSR L50DF
         JSR L3FD9
         LDY #$0A
L4095    LDA R318B,Y
         CMP #'?'     ;$3F 
         BEQ L40A1
         CMP R3180,Y
         BNE L40AC
L40A1    DEY 
         BPL L4095
         JSR A_CRLF
         LDY ARC_VER
         BNE L40AF
L40AC    JMP L426E
; 
;
L40AF    LDA L4022,Y
         CLC 
         ADC # low L375D ;--- ?????????????????????
         TAX 
         LDA # high L375D ;-----????????????????????
         ADC #$00
         TAY 
         JSR p_print
         LDA #$20    ; space
         JSR A_PUTL
         LDA $59
         STA $80+1
         LDA $58
         LDX $54
L40CB    CLC 
         ADC #$28
         STA $80
         BCC L40D4
         INC $80+1
L40D4    DEX 
         BNE L40CB
         LDY #$27
L40D9    LDA ($80),Y
         STA L3035,Y
         DEY 
         BPL L40D9
         INY 
         LDX $55
L40E4    LDA WORK_BUF,Y
         CMP #$9B
         BEQ L40FC
         JSR A_PRINT
         CPX #$28
         BCS L40F8
         SEC 
         SBC #$20
         STA L3035,X
L40F8    INX 
         INY 
         BNE L40E4
L40FC    JSR A_CRLF
L40FF    LDA V_ARC
         BEQ L4153
         LDA #$20
         JSR A_PUTL
         JSR A_PUTL
         JSR A_PUTL
         LDA #$00
         STA $A5
         STA $A5+1
L4114    LDY $A5
         LDA $A5+1
         BNE L4121
         LDA ARC_NAME,Y
         BNE L4123
         INC $A5+1
L4121    LDA #$20
L4123
         JSR A_PUTL
         INC $A5
         LDA $A5
         CMP #$0C
         BNE L4114
         LDA #$20
         JSR A_PUTL
         JSR A_PUTL
         LDY ARC_VER
         LDA L4030,Y
         CLC 
         ADC # low L37A4 ;----????????????????
         TAX 
         LDA # high L37A4 ;----????????????????
         ADC #$00
         TAY 
         JSR p_print
         LDA #$20
         JSR A_PUTL
         JSR A_PUTL
         JMP L415A
; 
L4153
          X_Y  L371E
         JSR p_print
L415A
         LDA ARC_OSIZE+2
         STA FR0
         LDA #$00
         STA FR0+1
         JSR IFP
         JSR FMOVE
          X_Y  L386A
         JSR FLD0R
         JSR fmult
         JSR FMOVE
         LDA ARC_OSIZE
         STA FR0
         LDA ARC_OSIZE+1
         STA FR0+1
         JSR IFP
         JSR FADD
         JSR FMOVE
          X_Y  L3876
         JSR FLD0R
         JSR FADD
          X_Y  L3870
         JSR FLD1R
         JSR FDIV
         LDA FR0
         AND #$3F
         TAY 
         LDA #$00
L41A4
         STA $D6,Y
         INY 
         CPY #$04
         BCC L41A4
         JSR FPI
         CLC 
         LDA $A1
         ADC FR0
         STA $A1
         LDA $A1+1
         ADC FR0+1
         STA $A1+1
         JSR A_PRCARD
         LDA V_ARC
         BEQ L41C9
         JSR A_CRLF
         JMP L426E
; 
L41C9
          X_Y  L372B
         JSR p_print
         LDA ARC_OSIZE
         SEC 
         SBC ARC_SIZE
         STA FR0
         LDA ARC_OSIZE+1
         SBC ARC_SIZE+1
         STA FR0+1
         LDA ARC_OSIZE+2
         SBC ARC_SIZE+2
         BEQ L420B
         BCC L41F3
         LDA #$2B
         JSR A_PUTL
         JMP L420B
; 
L41F3    LDA #'-'     ;$2D 
         JSR A_PUTL
         LDA FR0+1
         EOR #$FF
         TAY 
         LDA FR0
         EOR #$FF
         CLC 
         ADC #$01
         STA FR0
         TYA 
         ADC #$00
         STA FR0+1
L420B    JSR A_PRCARD
         JSR A_CRLF
         LDA CW_QUERY
         BNE L4218
         JMP L4284
; 
L4218
          X_Y  L373A
         JSR p_print
         JSR L4D10
L4222    JSR A_GETKBD
         CMP #$9B
         BNE L422B
         LDA #'N'     ;$4E 
L422B    AND #$3F
         CMP #'Y'-64  ;$19 
         BNE L423C
         LDA #'Y'     ;$59 
         JSR A_PUTL
         JSR A_CRLF
         JMP L4284
; 
L423C    CMP #$1B
         BEQ L4256
         CMP #'N'-64  ;$0E 
         BEQ L4266
         CMP #'P'-64  ;$10
         BEQ L4276
         CMP #'1'     ;$31 
         BCC L4222
         CMP #'9'+1   ;$3A 
         BCS L4222
         JSR direct	; Directory
         JMP L4222
; 
L4256    JSR CLOSE1
         JSR CLOSE2
         LDA IN_BATCH
         BNE L4263
         JMP L3C58
; 
L4263    JMP L3DF1
; 
L4266    LDA #'N'     ;$4E 
         JSR A_PUTL
L426B    JSR A_CRLF
L426E    JSR L32B4
         BCC L426E
         JMP L3E93
; 
L4276    LDA #'P'     ;$50 
         JSR A_PUTL
         JSR A_CRLF
         JSR L496D
         JMP L4040
; 
L4284    JSR CLOSE2
         JSR L4E55
         LDA TD_STAMP
         BEQ L42EA
         LDA SPARTADOS?
         BEQ L42EA
         LDA ARC_DATE
         TAX 
         ORA ARC_DATE+1
         BEQ L42EA
         LDY #$19
         LDA #$FF
         STA ($0A),Y
         TXA 
         AND #$1F
         LDY #$13
         STA ($0A),Y
         LDA ARC_DATE+1
         LSR
         LDA ARC_DATE
         ror
         LSR
         LSR
         LSR
         LSR
         INY 
         STA ($0A),Y
         LDA ARC_DATE+1
         LSR
         CLC 
         ADC #$50
         INY 
         STA ($0A),Y
         LDA #$00
         LDY #$18
         STA ($0A),Y
         LDA ARC_TIME
         STA $80
         LDA ARC_TIME+1
         LSR
         ROR $80
         LSR
         ROR $80
         LSR
         ROR $80
         LSR $80
         LSR $80
         LDA $80
         DEY 
         STA ($0A),Y
         LDA ARC_TIME+1
         LSR
         LSR
         LSR
         DEY 
         STA ($0A),Y
L42EA    LDX #DISK2  ;$20 
         LDA #$03
         STA ICCOM,X
         LDA # low WORK_BUF
         STA ICBAL,X
         LDA # high WORK_BUF
         STA ICBAH,X
         LDA #$04
         STA ICAX1,X
         LDA #$00
         STA ICAX2,X
         STA $88
         STA $88+1
         STA $8A
         LDY 764
         CPY #$21
         BNE L431A
         STA R3196
         LDY #$FF
         STY 764
L431A    LDA WORK_BUF
         CMP #'N'     ;$4E 
         BEQ L436E
         CMP #'D'     ;$44 
         BNE L4352
         LDA OVER_WRITE
         BNE L4352
         JSR CIOV
         PHP 
         JSR CLOSE2
         PLP 
         BPL L4336
         JMP L4352
; 
L4336
          X_Y  L3954
         JSR p_print
         JSR L4D10
         JSR L4D5F
         BCC L434B
         JSR CLOSE1
         JMP L3C58
; 
L434B    CMP #$01
         BEQ L4352
         JMP L426B
; 
L4352    LDA #$08
         LDX #DISK2  ;$20 
         STA ICAX1,X
         LDA #$03
         STA ICCOM,X
         JSR CIOV
         BPL L436E
         CPY #$96
         BEQ L437F
         CPY #$AE
         BEQ L437F
         JMP L4390
; 
L436E    LDA $8B+2
         ORA $8B+1
         ORA $8B
         BEQ L4379
         JMP L43ED
; 
L4379    JSR L3438
         JMP L3E93
; 
L437F    JSR CLOSE2
         JSR L4BAB
         BCC L43A6
L4387    JMP L4040
; 
L438A    JSR A_CRLF
         JMP L4387
; 
L4390    STY FR0
         LDA #$00
         STA FR0+1
         JSR CLOSE2
          X_Y  diskerw
         JSR p_print
         JSR A_PRCARD
         JSR A_CRLF
L43A6
          X_Y  L38CD
         JSR p_print
         JSR L4D10
L43B0    JSR A_GETKBD
         CMP #$9B
         BEQ L438A
         AND #$3F
         CMP #$1B
         BNE L43CA
         LDA IN_BATCH
         BEQ L43C7
         JSR A_CRLF
         JMP L3DF1
; 
L43C7    JMP L3C58
; 
L43CA    CMP #'1'     ;$31 
         BCC L43D8
         CMP #'9'+1   ;$3A 
         BCS L43D8
         JSR direct
         JMP L43B0
; 
L43D8    CMP #'P'-64  ;$10 
         BNE L43EA
         LDA #'P'     ;$50 
         JSR A_PUTL
         JSR A_CRLF
         JSR L496D
         JMP L43A6
; 
L43EA    JMP L43B0
;
;
; Un-Crunch
;
 
L43ED    LDA SCREEN_ON
         AND R3196
         BEQ L4401
         LDA WORK_BUF
         CMP #'E'     ;$45 
         BEQ L4401
         JSR L4D16
         JMP L4404
; 
L4401    JSR L4D10
L4404    LDA PASSWORD
         BEQ L440A
         INC $D0
L440A    LDA ARC_VER
         CMP #$02    ; stored 
         BEQ L442D
         CMP #$03    ; packed 
         BEQ L4445
         CMP #$04    ; squeezed 
         BEQ L4427
         CMP #$08    ; Crunched 
         BEQ L4424
         CMP #$09    ; Squashed 
         BEQ L442A
         JMP L4853
; 
L4424    JMP L4638
; 
L4427    JMP L454F
; 
L442A    JMP L511C
; 
L442D    JSR L32C8
         JSR L334B
         BCC L442D
L4435    JMP L3E93
; 
L4438    LDA $0340+DISK2 ;$L0360 
         CMP #$FF
         BEQ L4442
         JSR L33EF
L4442    JMP L3E93
; 
L4445    JSR L32B4
         BCS L4438
         BCC L4456
L444C    STA $8E
         JSR L334B
L4451    JSR L32B4
         BCS L4438
L4456    CMP #$90
         BNE L444C
         JSR L32B4
         BCS L4438
         CMP #$00
         BNE L4467
         LDA #$90
         BNE L444C
L4467    TAX 
         DEX 
L4469    LDA $8E
         STX $9C
         JSR L334B
         BCS L4435
         LDX $9C
         DEX 
         BNE L4469
         BEQ L4451
L4479    JSR L32C8
         STA $8F
         JSR L32C8
         STA $90
         RTS 
; 
L4484    LDA #$07
         STA $91
         JSR L4479
         LDX $8F
         STX $93
         STA $94
         CMP #$02
         BCS L449D
         CMP #$00
         BEQ L44CB
         CPX #$01
         BCC L44CB
L449D
          X_Y  L44A7
         JSR p_print
         JMP L3227
; 
L44A7
         dc.b $9B,"Error: Source file is Corrupted!"
	 dc.b	"ý",$9B,0
; 
; 
L44CB    LDY #$FF
         STY R5153
         STY R5253
         DEY 
         STY R5353   ;--------
         STY R5453
         LDA $93
         ORA $94
         BEQ L44FF
         LDX #$00
L44E2    JSR L32C8
         STA R5153,X
         JSR L32C8
         STA R5353,X ;--------
         JSR L32C8
         STA R5253,X
         JSR L32C8
         STA R5453,X
         INX 
         CPX $93
         BNE L44E2
L44FF    RTS 
; 
L4500    LDA #$00
         STA $95
         STA $96
L4506    INC $91
         LDA $91
         AND #$07
         BNE L4514
         JSR L32C8
         STA $97
          dc.b $2c  
L4514    LSR $97
         LDA $97
         LSR
         LDX $95
         BCS L452A
         LDA R5153,X
         STA $95
         LDY R5353,X ;--------
         BPL L4506
         JMP L4534
; 
L452A    LDA R5253,X
         STA $95
         LDY R5453,X
         BPL L4506
L4534    LDA $95
         EOR #$FF
         BEQ L453C
L453A    CLC 
         RTS 
; 
L453C    CPY #$FE
         BNE L453A
         SEC 
         RTS 
; 
L4542
         LDA $0340+DISK2
         CMP #$FF
         BEQ L454C
         JSR L33EF
L454C    JMP L3E93
; 
L454F    JSR L4484
         JSR L4500
         BCS L4542
L4557    STA $8E
         JSR L334B
L455C    JSR L4500
         BCS L4542
         CMP #$90
         BNE L4557
         JSR L4500
         BCS L4542
         CMP #$00
         BNE L4572
         LDA #$90
         BNE L4557
L4572    TAX 
         DEX 
L4574    LDA $8E
         JSR L334B
         DEX 
         BNE L4574
         BEQ L455C
;
L457E
         dc.b "              "
; 
L458C    LDA $8E
         BNE L45CB
         LDA $A3+1
         CMP $A1+1
         BCC L45A0
         BNE L45A9
         LDA $A3
         CMP $A1
         BEQ L45A0
         BCS L45A9
L45A0    LDA $8F
         CMP $90
         BCC L45F7
         JMP L45D9
; 
L45A9    INC $9C
         LDX $9C
         CPX L4637
         LDA #$FF
         ADC #$00
         STA $A1
         LDA L4629,X
         ADC #$00
         STA $A1+1
         BNE L45D9
L45BF    CPX #$00
         BNE L45E8
         PLA 
         PLA 
         JSR L33EF
         JMP L3E93
; 
L45CB    LDA #$09
         STA $9C
         LDY #$01
         STY $A1+1
         DEY 
         STY $8E
         DEY 
         STY $A1
L45D9    LDX #$00
L45DB    JSR L32B4
         BCS L45BF
         STA L457E,X
         INX 
         CPX $9C
         BCC L45DB
L45E8    LDA #$00
         STA $8F
         TXA 
         asl
         asl
         asl
         SEC 
         SBC $9C
         ADC #$00
         STA $90
L45F7    LDA $8F
         TAX 
         ADC $9C
         STA $8F
         TXA 
         LSR
         LSR
         LSR
         TAY 
         LDA L457E,Y
         STA $A5
         LDA L457E+1,Y
         STA $A5+1
         TXA 
         AND #$07
         BEQ L461E
         TAX 
         LDA L457E+2,Y
L4616    LSR
         ROR $A5+1
         ROR $A5
         DEX 
         BNE L4616
L461E    LDY $9C
         LDA L4629,Y
         AND $A5+1
         STA $A5+1
         RTS 
; 
L4628
         dc.b $00
L4629
         dc.b $01,$03,$07,$0F,$1F,$3F,$7F,$FF
; 
L4631
         dc.b $00,$01,$03,$07,$0F,$1F
; 
L4637    dc.b $0C
; 
L4638    JSR L32B4
         CMP #$0C
         BEQ L4642
         JMP L449D
; 
L4642    LDX #$09
         STX $9C
         LDY #$00
         STY $8E
         STY $A7
         STY $8F
         STY $90
         DEY 
         STY $A1
         LDA L4629,X
         STA $A1+1
         LDA #$0C
         STA L4637
         LDA $C1
         STA $BD
         LDA $C1+1
         STA $BD+1
         INY 
L4666    TYA 
         STA ($BD),Y
         INY 
         BNE L4666
         INY 
         STY $A3+1
         STY $A3
         JSR L458C
         STA $A9+1
         LDA $A5
         STA $A9
         STA $AB
         JSR L4781
         LDA $C3
         STA $C5
         LDA $C3+1
         STA $C5+1
L4687    JSR L458C
         LDX $A5
         BNE L469D
         CMP #$01
         BNE L469D
         STA $A3+1
         STA $8E
         STX $A3
         JSR L458C
         LDX $A5
L469D    STX $AF
         STA $AF+1
         CMP $A3+1
         BCC L46CB
         BNE L46AB
         CPX $A3
         BCC L46CB
L46AB    LDY #$00
         LDA $AB
         STA ($C5),Y
         INC $C5
         BNE L46C3
         INC $C5+1
         LDA $C5+1
         SEC 
         SBC $C3+1
         CMP #$12
         BCC L46C3
         JMP L449D
; 
L46C3    LDX $A9
         STX $A5
         LDA $A9+1
         STA $A5+1
L46CB    CMP #$00
         BEQ L4710
L46CF    CLC 
         TAY 
         TXA 
         ADC $C1
         STA $80
         TYA 
         ADC $C1+1
         STA $80+1
         LDY #$00
         LDA ($80),Y
         STA ($C5),Y
         INC $C5
         BNE L46F3
         INC $C5+1
         LDA $C5+1
         SEC 
         SBC $C3+1
         CMP #$12
         BCC L46F3
         JMP L449D
; 
L46F3    LDA $A5
         asl
         ROL $A5+1
         ADC $BF
         STA $80
         LDA $A5+1
         ADC $BF+1
         STA $80+1
         LDY #$00
         LDA ($80),Y
         STA $A5
         TAX 
         INY 
         LDA ($80),Y
         STA $A5+1
         BNE L46CF
L4710    LDY $A5
         LDA ($C1),Y
         STA $AB
         LDY #$00
         STA ($C5),Y
         INC $C5
         BNE L4720
         INC $C5+1
L4720    LDA $C5
         BNE L4726
         DEC $C5+1
L4726    DEC $C5
         LDY #$00
         LDA ($C5),Y
         JSR L4781
         LDA $C5
         CMP $C3
         BNE L4720
         LDA $C5+1
         CMP $C3+1
         BNE L4720
         LDA $A3
         STA $A5
         asl
         TAX 
         LDA $A3+1
         STA $A5+1
         rol
         CMP #$20
         BCS L4776
         TAY 
         TXA 
         ADC $BF
         STA $80
         TYA 
         ADC $BF+1
         STA $80+1
         LDY #$00
         LDA $A9
         STA ($80),Y
         INY 
         LDA $A9+1
         STA ($80),Y
         LDY $A5
         LDA $C1
         STA $80
         LDA $A5+1
         ADC $C1+1
         STA $80+1
         LDA $AB
         STA ($80),Y
         INC $A3
         BNE L4776
         INC $A3+1
L4776    LDA $AF
         STA $A9
         LDA $AF+1
         STA $A9+1
         JMP L4687
; 
L4781    LDY $A7
         BNE L4794
         CMP #$90
         BNE L478C
         STA $A7
         RTS 
; 
L478C    STA $A8
         JSR L334B
         BCS L47B0
         RTS 
; 
L4794    CMP #$00
         BNE L479F
         STA $A7
         LDA #$90
         JMP L478C
; 
L479F    SEC 
         SBC #$01
         STA $A7
L47A4    LDA $A8
         JSR L334B
         BCS L47B0
         DEC $A7
         BNE L47A4
         RTS 
; 
L47B0    PLA 
         PLA 
         JMP L3E93
; 
L47B5    JSR L334B
         BCS L47B0
         RTS 
; 
L47BB    LDA $8E
         BNE L47CE
         JSR L4811
         JSR L4811
         JSR L4811
         INC $8E
         LDA #$00
         STA $8F
L47CE    LDA L4828+1
         STA $A5
         LDA L4828
         STA $A5+1
         LDX $8F
         BEQ L47E7
         LDA L4828+2
L47DF    asl
         ROL $A5
         ROL $A5+1
         DEX 
         BNE L47DF
L47E7    LDY $9C
         LDX L481A+1,Y
         CPX $8F
         BEQ L47F2
         BCS L47FA
L47F2    JSR L4811
         LDY $9C
         LDX L481A+1,Y
L47FA    LDA $A5+1
L47FC    LSR
         ROR $A5
         DEX 
L4800    BNE L47FC
         STA $A5+1
         JSR L4811
         LDA $8F
         CLC 
         ADC $9C
         AND #$07
         STA $8F
         RTS 
; 
L4811    LDA L4828+1
         STA L4828
         LDA L4828+2
L481A    STA L4828+1
         JSR L32B4
         STA L4828+2
         RTS 
; 
L4824
         dc.b $07,$06,$05,$04
; 
;
L4828    dc.b 0,0,0
; 
; 
L482B    LDA #$09
         STA $9C
         LDY #$00
         STY $A1
         INY 
         STY $AF+1
         INY 
         STY $AF
         STY $A1+1
         RTS 
; 
L483C    LDY #$00
         STA ($C5),Y
         INC $C5
         BNE L4852
         INC $C5+1
         LDA $C5+1
         SEC 
         SBC $C3+1
         CMP #$12
         BCC L4852
         JMP L449D
; 
L4852    RTS 
; 
L4853    LDA $C3
         STA $C5
         LDA $C3+1
         STA $C5+1
         JSR L482B
         LDA #$00
         STA $AF
         STA $AF+1
         STA $8E
         INC $8A
L4868    JSR L47BB
         LDA $A5+1
         CMP #$01
         BNE L4898
         LDX $A5
         BEQ L487F
         CPX #$01
         BNE L489A
         JSR L33EF
L487C    JMP L3E93
; 
L487F    JSR L482B
         JSR L47BB
         LDA $A5+1
         STA $A9+1
         LDA $A5
         STA $A9
         STA $AD
         STA $AE
         JSR L334B
         BCC L4868
         BCS L487C
L4898    LDX $A5
L489A    STX $AB
         STA $AC
         CMP $AF+1
         BCC L48B3
         CPX $AF
         BCC L48B3
         LDA $A9
         STA $A5
         LDA $A9+1
         STA $A5+1
         LDA $AE
         JSR L483C
L48B3    LDA $A5+1
         BEQ L48EC
L48B7    LDA $A5
         asl
         TAX 
         LDA $A5+1
         rol
         TAY 
         TXA 
         CLC 
         ADC $A5
         TAX 
         TYA 
         ADC $A5+1
         TAY 
         CLC 
         TXA 
         ADC $BF
         STA $80
         TYA 
         ADC $BF+1
         STA $80+1
         LDY #$02
         LDA ($80),Y
         JSR L483C
         LDY #$00
         LDA ($80),Y
         STA $A5
         INY 
         LDA ($80),Y
         STA $A5+1
         BNE L48B7
         BEQ L48EC
L48E9    JMP L3E93
; 
L48EC    LDA $A5
         STA $AE
         STA $AD
         JSR L483C
L48F5    LDA $C5
         BNE L48FB
         DEC $C5+1
L48FB    DEC $C5
         LDY #$00
         LDA ($C5),Y
         JSR L334B
         BCS L48E9
         LDA $C5
         CMP $C3
         BNE L48F5
         LDA $C5+1
         CMP $C3+1
         BNE L48F5
         LDA $AF
         asl
         TAX 
         LDA $AF+1
         rol
         TAY 
         CLC 
         TXA 
         ADC $AF
         TAX 
         TYA 
         ADC $AF+1
         TAY 
         CLC 
         TXA 
         ADC $BF
         STA $80
         TYA 
         ADC $BF+1
         STA $80+1
         LDY #$00
         LDA $A9
         STA ($80),Y
         INY 
         LDA $A9+1
         STA ($80),Y
         INY 
         LDA $AD
         STA ($80),Y
         INC $AF
         BNE L4944
         INC $AF+1
L4944    LDA $AB
         STA $A9
         LDA $AC
         STA $A9+1
         LDA $AF+1
         CMP $A1+1
         BCC L4964
         LDA $AF
         CMP $A1
         BCC L4964
         LDA $9C
         CMP #$0C
         BEQ L4964
         INC $9C
         ASL $A1
         ROL $A1+1
L4964    JMP L4868
; 
L4967    dc.b "D"
L4968    dc.b "1:**",$9B
; 
; 
L496D
          X_Y  L36BD
         JSR p_print
         LDA #$40
         STA SHFLOK
         JSR CIOV_SI
         dc.b DISK0
         dc.b 5
         dc.w DIR_MASK
         dc.w 41
         dc.b $0C
         dc.b 0
; 
         BMI L496D
         LDA ICBLL
         CMP #$01
         BEQ L49DC
         CMP #$02
         BNE L49AE
         LDA DIR_MASK
         CMP #'1'     ;$31 
         BCC L49D2
         CMP #'9'+1   ;$3A 
         BCS L49D2
         STA L4968
         LDY #$06
         STY ICBLL
         DEY 
L49A5    LDA L4967,Y
         STA DIR_MASK,Y
         DEY 
         BPL L49A5
L49AE    LDA DIR_MASK
         CMP #'D'     ;$44 
         BEQ L49C1
         CMP #'E'     ;$45 
         BEQ L49C1
         CMP #'P'     ;$50 
         BEQ L49C1
         CMP #'N'     ;$4E 
         BNE L49D2
L49C1    LDA ICBLL
         TAY 
         DEY 
         DEY 
L49C7    LDA DIR_MASK,Y
         JSR L49DF
         BEQ L49EA
         DEY 
         BNE L49C7
L49D2
          X_Y  L36E4
         JSR p_print
         JMP L496D
; 
L49DC    JMP L3C58
; 
L49DF    CMP #':'     ;$3A 
         BEQ L49E9
         CMP #'>'     ;$3E 
         BEQ L49E9
         CMP #'\'     ;$5C 
L49E9    RTS 
; 
L49EA    LDY #$00
L49EC    LDA DIR_MASK,Y
         CMP #$9B
         BEQ L49F6
         INY 
         BNE L49EC
L49F6    DEY 
         BEQ L49E9
         LDA DIR_MASK,Y
         JSR L49DF
         BNE L49F6
         INY 
         STY $9C
         TYA 
         CLC 
         ADC # low DIR_MASK
         STA $80
         LDA # high DIR_MASK
         ADC #$00
         STA $80+1
         LDA DIR_MASK,Y
         CMP #$9B
         BNE L4A1F
         LDA #$2A
         STA DIR_MASK,Y
         STA DIR_MASK+1,Y
L4A1F    JSR L50DF
         LDY $9C
         LDA #$9B
         STA DIR_MASK,Y
         LDY #$0A
L4A2B    LDA R3180,Y
         STA R318B,Y
         DEY 
         BPL L4A2B
         RTS 
; 
direct:    AND #$0F
         ORA #$30
         STA L4B7C+1
         ORA #$80
         STA L4B50
         LDA #'D'     ;$44 
         STA L4B7C
         LDA #':'     ;$3A 
         STA L4B7C+2
         JSR SCREEN_SAVE
          X_Y  L4B31
         JSR p_print
         JSR CIOV_SI
         dc.b DISK0
         dc.b $05
         dc.w L4B7C+3
         dc.w 40
         dc.b $0C
         dc.b 0
         LDX ICBLL
         LDA #'*'     ;$2A 
         STA L4B7C+2,X
         STA L4B7C+4,X
         LDA #'.'     ;$2E 
         STA L4B7C+3,X
         LDA #$9B
         STA L4B7C+5,X
         JSR CLOSE2
         JSR CIOV_SI
         dc.b DISK2
         dc.b 3
         dc.w L4B7C
         dc.w 0
         dc.b 6
         dc.b 128
; 
         JSR L4ADF
         LDA #$03
L4A88
          dc.b $2c  
L4A89
         LDA #$00
         STA $9E
L4A8D
         JSR CIOV_SI
         dc.b DISK2
         dc.b 5
         dc.w L4B7C
         dc.w 40
         dc.b 6
         dc.b 128
; 
         BPL L4AA1
         CPY #$88
         BEQ L4AB8
         JSR L4ADF
L4AA1    LDY #$00
L4AA3    LDA L4B7C,Y
         JSR A_PRINT
         INY 
         CMP #$9B
         BNE L4AA3
         INC $9E
         LDA $9E
         CMP #$16
         BCC L4A8D
         BCS L4AC9
L4AB8
          X_Y  presr
         JSR p_print
         JSR A_GETKBD
L4AC2    JSR CLOSE2
         JSR SCREEN_LOAD
L4AC8    RTS 
; 
L4AC9
          X_Y  L4B0E
         JSR p_print
         JSR A_GETKBD
         CMP #$1B
         BEQ L4AC2
         LDA #$7D
         JSR A_PUTL
         JMP L4A89
; 
L4ADF    CPY #$80
         BCC L4AC8
         PLA 
         PLA 
         JSR CLOSE2
          X_Y  L4AF2
         JSR p_print
         JMP L4AB8
; 
; 
; 
L4AF2
         dc.b $9B,"Disk Directory read error",$9B,0
; 
; 
L4B0E
         dc.b $9B
	 dc.b	<+128>,"[ESC]"
	 dc.b	" to quit, "
	 dc.b	<+128>,"ÛÒÅÔÕÒÎÝ"
	 dc.b	" for more:",0
; 
; 
L4B31
         dc.b $7D
         dc.b "  "
	 dc.b	<+128>,">>> Disk Directory of Drive "
L4B50     dc.b <+128>,"1 <<<"
	  dc.b	$9B

         dc.b "  Enter Pathname or "
	 dc.b	"Return"
	 dc.b 	" for main:",$9B,0
; 
; 
L4B7C
         dc.b "                                               "
; 
; 
L4BAB
         LDY #$00
         LDY #$00
L4BAF    LDA WORK_BUF,Y
         CMP #$9B
         BEQ L4BB9
         INY 
         BNE L4BAF
L4BB9    LDA WORK_BUF,Y
         JSR L49DF
         BEQ L4BC4
         DEY 
         BNE L4BB9
L4BC4    LDA #$9B
         STA ($C3),Y
         DEY 
L4BC9    LDA WORK_BUF,Y
         STA ($C3),Y
         DEY 
         BPL L4BC9
          X_Y  L4C2B
         JSR p_print
         LDY #$00
L4BDA    LDA ($C3),Y
         CMP #$9B
         BEQ L4BE6
         JSR A_PRINT
         INY 
         BNE L4BDA
L4BE6
          X_Y  L4C41
         JSR p_print
         JSR L4D5F
         CMP #$01
         BEQ L4BF6
         CLC 
         RTS 
; 
L4BF6    JSR CLOSE2
         LDA #$22
         LDY SPARTADOS?
         BEQ L4C01
         LDA #$2A
L4C01    STA L4C12
         LDA $C3
         STA L4C13
         LDA $C3+1
         STA L4C13+1
         JSR CIOV_SI
         dc.b DISK2
L4C12    dc.b 40    ;$28
L4C13    dc.w $C3   ;195
         dc.w 0
         dc.w 8
;
         PHP 
         JSR CLOSE2
         PLP 
         BPL L4C29
          X_Y  L4C59
         JSR p_print
         CLC 
         RTS 
; 
L4C29    SEC 
         RTS 
; 
; 
L4C2B
         dc.b $9B,"Error: Subdirectory ",0
; 
L4C41
         dc.b $9B,"Not found. Create one?",0
; 
L4C59
         dc.b $9B,"Create Directory command failed.ý",$9B,0
; 
; 
L4C7D    LDA #$40
         STA SHFLOK
         JSR CIOV_SI
         dc.b DISK0
         dc.b 5
         dc.w DEST_BUF
         dc.w 80
         dc.b $0C
         dc.b 0
; 
         BMI L4C96
         LDA ICBLL,X
         CMP #$03
         BCS L4C9B
L4C96    PLA 
         PLA 
         JMP L3C58
; 
L4C9B    LDA DEST_BUF
         CMP #'D'     ;$44 
         BNE L4CAD
         LDA DEST_BUF+1
         CMP #'1'     ;$31 
         BCC L4CAD
         CMP #':'+1   ;$3B 
         BCC L4CCA
L4CAD    LDY ICBLL
         DEY 
L4CB1    LDA DEST_BUF,Y
         STA DEST_BUF+2,Y
         DEY 
         BPL L4CB1
         LDA #'D'     ;$44 
         STA DEST_BUF
         LDA #':'     ;$3A 
         STA DEST_BUF+1
         INC ICBLL
         INC ICBLL
L4CCA    RTS 
; 
L4CCB
          X_Y  L4FF6
         JSR p_print
         JSR CIOV_SI
         dc.b DISK0
         dc.b 5
         dc.w R316B
         dc.w $15
         dc.w $0C
; 
         BPL L4CF5
L4CDF    LDA #$00
         STA PASSWORD
         LDY L3CDB
         LDX #$00
L4CE8    LDA L3CDC,X
         STA L39A1,Y
         INY 
         INX 
         CPX #$03
         BCC L4CE8
         RTS 
; 
L4CF5    LDY ICBLL
         STY GOT_PW
         DEY 
         BEQ L4CDF
         DEY 
L4CFE    LDA R316B,Y
         AND #$7F
         CMP #$60
         BCC L4D09
         SBC #$20
L4D09    STA R316B,Y
         DEY 
         BPL L4CFE
         RTS 
; 
L4D10
         LDA # low DLIST
         LDX # high DLIST
         BNE L4D1A
L4D16
         LDA # low DLIST2
         LDX # high DLIST2
L4D1A    STA $0230   ;SDLSTL 
         STX $0230+1 ;SDLSTH 
         RTS 
; 
L4D21
          X_Y  L4F96
         JSR p_print
         JSR CLOSE1
         JSR L4C7D
          X_Y  L4FBD
         JSR p_print
         JSR L4D5F
         CMP #$01
         BEQ L4D3F
         JMP L3C58
; 
L4D3F
         JSR CIOV_SI
         dc.b DISK1
         dc.b $21
         dc.w DEST_BUF
         dc.w 0
         dc.w 0
; 
         BPL L4D55
         STY FR0
         LDA #$00
         STA FR0+1
         JSR L321B
L4D55
          X_Y  L4FDE
         JSR p_print
         JMP L3227
; 
L4D5F    JSR A_GETKBD
         CMP #$9B
         BNE L4D68
         LDA #'N'     ;$4E 
L4D68    AND #$1F
         CMP #$1B
         BNE L4D75
         JSR A_CRLF
         LDA #$00
         SEC 
         RTS 
; 
L4D75    CMP #'Y'-64  ;$19 
         BNE L4D85
         LDA #'Y'     ;$59 
         JSR A_PUTL
         JSR A_CRLF
         LDA #$01
         CLC 
         RTS 
; 
L4D85    CMP #'N'-64  ;$0E 
         BNE L4D5F
         LDA #'N'     ;$4E 
         JSR A_PUTL
         JSR A_CRLF
         LDA #$00
         CLC 
         RTS 
; 
CIOV_SI
         PLA 
         STA $1A
         PLA 
         STA $1A+1
         LDY #$01
         LDA ($1A),Y
         TAX 
         INY 
         LDA ($1A),Y
         STA ICCOM,X
         INY 
         LDA ($1A),Y
         STA ICBAL,X
         INY 
         LDA ($1A),Y
         STA ICBAH,X
         INY 
         LDA ($1A),Y
         STA ICBLL,X
         INY 
         LDA ($1A),Y
         STA ICBLH,X
         INY 
         LDA ($1A),Y
         STA ICAX1,X
         INY 
         LDA ($1A),Y
         STA ICAX2,X
         TYA 
         CLC 
         ADC $1A
         TAY 
         LDA #$00
         ADC $1A+1
         PHA 
         TYA 
         PHA 
         JMP CIOV
; 
L4DD9    STX DBUFLO
         STY DBUFHI
         LDA #$0C
         STA DBYTLO
         LDA #$00
         STA DBYTHI
         STA DAUX1
         STA DAUX2
         LDA #$40
         STA DSTATS
         LDA #$4E
         STA DCOMND
         LDA #$31
         STA DDEVIC
         BCC L4E06
         ASL DSTATS
         INC DCOMND
L4E06    JMP SIOV
; 
L4E09    LDA DISK_SWAP
         BEQ L4E2B
         LDA DEST_BUF+1
         CMP #'9'+1   ;$3A 
         BNE L4E16
         LDA #'1'     ;$31 
L4E16    STA $BD
         LDA WORK_BUF+1
         CMP #'9'+1   ;$3A 
         BNE L4E21
         LDA #'1'     ;$31 
L4E21    CMP $BD
         BNE L4E2B
         LDA #$00
         STA SCREEN_ON
         SEC 
         RTS 
; 
L4E2B    CLC 
         RTS 
; 
L4E2D    JSR L4E09
         BCS L4E33
         RTS 
; 
L4E33    LDA $C7
         CMP #$01
         BEQ L4E2B
         LDA SPARTADOS?
         BEQ L4E43
         JSR CLOSE2
         JSR L31FF
L4E43    LDA #$01
         STA $C7
         JSR L4D10
          X_Y  L3882
         JSR p_print
         JSR A_GETKBD
         RTS 
; 
L4E55    JSR L4E09
         BCS L4E5B
         RTS 
; 
L4E5B    LDA $C7
         CMP #$02
         BEQ L4E2B
         LDA #$02
         STA $C7
         JSR L4D10
          X_Y  L38A5
         JSR p_print
         JSR A_GETKBD
         RTS 
; 
SCREEN_SAVE LDA $58
         STA $A5
         LDA $58+1
         STA $A5+1
         LDA $54
         STA $A3
         LDA $55
         STA $A3+1
         LDA #$1F
         STA CRSINH
         JSR A_PUTL
         LDY #$00
         STY CRSINH
         LDA $C3
         STA $80
         LDA $C3+1
         STA $80+1
         LDX #$04
L4E9A    LDA ($A5),Y
         STA ($80),Y
         INY 
         BNE L4E9A
         INC $A5+1
         INC $80+1
         DEX 
         BNE L4E9A
         RTS 
; 
SCREEN_LOAD LDA $58
         STA $A5
         LDA $58+1
         STA $A5+1
         LDA $C3
         STA $80
         LDA $C3+1
         STA $80+1
         STA CRSINH
         LDA #$00
         STA $54
         STA $55
         LDA #$1F
         JSR A_PUTL
         LDA #$1E
         JSR A_PUTL
         LDY #$00
         STY CRSINH
         LDX #$04
L4ED3    LDA ($80),Y
         STA ($A5),Y
         INY 
         BNE L4ED3
         INC $80+1
         INC $A5+1
         DEX 
         BNE L4ED3
         LDA $A3
         STA $54
         LDA $A3+1
         STA $55
         LDA #$1F
         JSR A_PUTL
         LDA #$1E
         JSR A_PUTL
         LDA #$00
         TAY 
         STA ($58),Y
         RTS 
; 
; 
L4EF9
         dc.b $9B,$9B
         dc.b "Which drive to format?",0
; 
; 
L4F12
         dc.b $9B,$9B
         dc.b	<+128>,"[1]"
	 dc.b	" Single or "
	 dc.b	<+128>,"[2]"
	 dc.b	" Double Density?",0
; 
L4F36
         dc.b $9B
         dc.b "Format, Are you sure?",0
; 
L4F4D
         dc.b $9B
         dc.b "Error: Bad Format! Check Disk/Drive"
	 dc.b	"ý",$9B,0
; 
; 
L4F74
         dc.b $9B
         dc.b "Format Completed.  Press "
	 dc.b	<+128>,"RETURN"
	 dc.b	$9B,0
; 
; 
L4F96    dc.b "D"
L4F97    dc.b $9B,$9B
         dc.b "Enter complete filename to delete:",$9B,0
; 
; 
L4FBD
         dc.b $9B,"Delete this file, are you sure?",0
; 
; 
L4FDE
         dc.b $9B,"File has been deleted!",0
; 
L4FF6
         dc.b $9B,"Enter decryption password:",$9B,0
; 
; 
L5013
          X_Y  L4EF9
         JSR p_print
L501A    JSR A_GETKBD
         AND #$7F
         CMP #$1B
         BNE L5024
         RTS 
; 
L5024    CMP #'1'     ;$31 
         BCC L501A
         CMP #'9'+1   ;$3A 
         BCS L501A
         STA R315F+1
         AND #$0F
         STA DUNIT
         ORA #$30
         JSR A_PUTL
         LDA #'D'     ;$44 
         STA R315F
         LDA #':'     ;$3A 
         STA R315F+2
         LDA #$9B
         STA R315F+3
          X_Y  R3153
         CLC 
         JSR L4DD9
         CPY #$8A
         BCS L509F
          X_Y  L4F12
         JSR p_print
L505B    JSR A_GETKBD
         AND #$7F
         CMP #$1B
         BNE L5065
         RTS 
; 
L5065    CMP #'1'     ;$31 
         BEQ L506D
         CMP #'2'     ;$32 
         BNE L505B
L506D    PHA 
         JSR A_PUTL
         JSR A_CRLF
         PLA 
         AND #$01
         BNE L5088
         STA R3159+1
         LDA #$04
         STA R3158
         LDA #$01
         STA R3159
         BNE L5094
L5088    LDA #$80
         STA R3159+1
         asl
         STA R3158
         STA R3159
L5094    SEC 
          X_Y  R3153
         JSR L4DD9
         JSR L50D8
L509F
          X_Y  L4F36
         JSR p_print
         LDA #$FF
         STA 764
         JSR L4D5F
         CMP #$00
         BEQ L50CC
         JSR CLOSE2
         JSR CIOV_SI
         dc.b DISK2
         dc.b $FE
         dc.w R315F
         dc.w 0
         dc.w 0
;  
         BPL L50CD
          X_Y  L4F4D
         JSR p_print
         JSR A_GETKBD
L50CC    RTS 
; 
L50CD
          X_Y  L4F74
         JSR p_print
         JSR A_GETKBD
         RTS 
; 
L50D8    LDA #$FF
         STA $08
         JMP ($0C)
; 
L50DF    LDY #$FF
         LDX #$00
L50E3    INY 
         LDA ($80),Y
         CMP #$9B
         BEQ L510F
         CMP #'*'     ;$2A 
         BNE L50FE
         LDA #'?'     ;$3F 
L50F0    STA R3180,X
         INX 
L50F4    CPX #$0B
         BEQ L510E
         CPX #$08
         BEQ L50E3
         BNE L50F0
L50FE    CMP #'.'    ;$2E 
         BNE L5106
         LDA #$20
         BNE L50F4
L5106    STA R3180,X
         INX 
         CPX #$0B
         BCC L50E3
L510E    RTS 
; 
L510F    CPX #$0B
         BCS L510E
         LDA #$20
         STA R3180,X
         INX 
         JMP L510F
; 
L511C    LDA L51AA
         BEQ L5124
         JMP L51B1
; 
L5124
          X_Y  L512E
         JSR p_print
         JMP L3227
; 
; 
L512E
         dc.b $9B
         dc.b "You need >=128K memory to unsquash!",0
; 
; 
L5153
         PHA 
         JSR $059B
         PLA 
         STA ($80),Y
         TXA 
         INY 
         STA ($80),Y
         JMP $05C2
; 
L5161
         JSR $059B
         INY 
         LDA ($80),Y
         TAX 
         DEY 
         LDA ($80),Y
         JMP $05C2
; 
L516E
         LDA $A5
         asl
         STA $80
         LDA $A5+1
         rol
         ORA #$40
         STA $80+1
         LDA L51AF
         STA $BD
         LDA L51B0
         STA $BD+1
         LDY #$00
         LDA ($BD),Y
         AND $05D8
         ORA $05D9
         STA ($BD),Y
         SEI 
         STY NMIEN
         RTS 
; 
L5195
         LDY #$00
         PHA 
         LDA ($BD),Y
         AND $05DA
         ORA $05DB
         STA ($BD),Y
         LDA #$C0
         STA NMIEN
         CLI 
         PLA 
L51A9    RTS 
; 
L51AA
         dc.b $01
         dc.b $EF
         dc.b $00
         dc.b $FF
         dc.b $10
L51AF    dc.b $01
L51B0    dc.b $D3
; 
; 
L51B1    LDX #$09
         STX $9C
         LDY #$00
         STY $8E
         STY $8F
         STY $90
         DEY 
         STY $A1
         LDA L4629,X
         STA $A1+1
         LDA #$0D
         STA L4637
         LDA $BF
         STA $BD
         LDA $BF+1
         STA $BD+1
         LDY #$00
L51D4    TYA 
         STA ($BD),Y
         INY 
         BNE L51D4
         LDY #$5E
L51DC    LDA L5153,Y
         STA $0580,Y
         DEY 
         BPL L51DC
         LDA #$01
         STA $A3
         STA $A3+1
         JSR L458C
         STA $A9+1
         STA $AC
         LDA $A5
         STA $A9
         STA $AB
         JSR L47B5
         LDA $C1
         STA $C5
         LDA $C1+1
         STA $C5+1
L5203    JSR L458C
         LDX $A5
         BNE L5219
         CMP #$01
         BNE L5219
         STA $A3+1
         STA $8E
         STX $A3
         JSR L458C
         LDX $A5
L5219    STX $AF
         STA $AF+1
         TAY 
         TXA 
         SEC 
         SBC $A3
         TYA 
         SBC $A3+1
         BCC L5234
         LDA $AB
         JSR L5256
         LDA $A9
         STA $A5
         LDA $A9+1
         STA $A5+1
L5234    LDA $A5+1
         BEQ L526F
         LDA $A5
         CLC 
         ADC $BF
         STA $80
         LDA $A5+1
         ADC $BF+1
         STA $80+1
         LDY #$00
         LDA ($80),Y
         JSR L5256
         JSR $058E
         STA $A5
         STX $A5+1
L5253    JMP L5234
; 
L5256    LDY #$00
         STA ($C5),Y
         INC $C5
         BNE L526E
         INC $C5+1
         LDA $C5+1
         SEC 
         SBC $C1+1
         CMP #$23
         BCC L526E
         PLA 
         PLA 
         JMP L449D
; 
L526E    RTS 
; 
L526F    LDA $A5
         CLC 
         ADC $BF
         STA $80
         LDA $A5+1
         ADC $BF+1
         STA $80+1
         LDY #$00
         LDA ($80),Y
         STA $AB
         STY $AC
         JSR L5256
L5287    LDA $C5
         BNE L528D
         DEC $C5+1
L528D    DEC $C5
         LDY #$00
         LDA ($C5),Y
         JSR L47B5
         LDA $C5
         CMP $C1
         BNE L5287
         LDA $C5+1
         CMP $C1+1
         BNE L5287
         LDA $A3
         STA $A5
         LDA $A3+1
         STA $A5+1
         CMP #$20
         BCS L52CE
         LDA $A9
         LDX $A9+1
         JSR $0580
         LDA $A5
         CLC 
         ADC $BF
         STA $80
         LDA $A5+1
         ADC $BF+1
         STA $80+1
         LDY #$00
         LDA $AB
         STA ($80),Y
         INC $A3
         BNE L52CE
         INC $A3+1
L52CE    LDA $AF
         STA $A9
         LDA $AF+1
         STA $A9+1
         JMP L5203
; 
L52D9    LDY #$00
L52DB    LDA HATABS,Y
         CMP #'E'     ;$45 
         BEQ L52E7
         INY 
         INY 
         INY 
         BNE L52DB
L52E7    LDA HATABS+1,Y
         STA FR1
         LDA HATABS+2,Y
         STA FR1+1
         LDY #$00
         LDA (FR1),Y
         STA L3E26+1
         INY 
         LDA (FR1),Y
         STA L3E23+1
         LDY #$06
         LDA (FR1),Y
         STA L31B1+1
         INY 
         LDA (FR1),Y
         STA L31AE+1
         LDA $6A     		;ramtop 
         CMP #$C0		; high byte $c000
         BCS L5344
         LDA $0700
         CMP #'R'		; use to be S
         BEQ L5344
         LDA PORTB
         AND #$02
         BNE L5344
         LDA BASICF
         ORA GINTLK
         BNE L5344
         INC BASICF
         LDA PORTB
         ORA #$02
         STA PORTB
         LDA #$C0	; high byte $c000
         STA $6A     ;ramtop 
         JSR CLOSE0
         JSR CIOV_SI
         dc.b DISK0
         dc.b 3
         dc.w EDEV
         dc.w 0
         dc.w 12
; 
L5344    JSR CLOSE1
         JSR CLOSE2
         JSR CLOSE_KBD
         JSR CIOV_SI
         dc.b KBD
         dc.b 3
         dc.w KDEV
         dc.w 0
         dc.w 4
; 
         LDA $58
         STA L3005
         LDA $58+1
         STA L3005+1
         JSR L305D
         JSR L312A

; LDA f.MEMTOP+1
; SEC
; SBC f.MEMLO+1
; CMP #$68
; BCS L53A1
;  X_Y  L537F
; JSR p_print
; PLA
; PLA
; JMP L3DF1
;
;
L537F
; dc.b $9B,"Error: Not enough free memory!ý",$9B,0
;
;
; 
memok    LDA $0700
         CMP #'R'		;S
         Beq .a
	 cmp #'S'
	 bne L53AA

.a:      INC SPARTADOS?


L53AA    LDY #$00
         LDA ($0A),Y
         CMP #$4C
         BNE noparm
         LDY #$03
         LDA ($0A),Y
         CMP #$4C
         BNE noparm
         LDA $0A
         CLC 
         ADC #$03
         STA L53F2+1
         LDA $0A+1
         ADC #$00
         STA L53F2+2
         JSR L53E4
         BEQ noparm
         LDY #$21
         LDX #$00
L53D2    LDA ($0A),Y
         STA DEST_BUF,X
         CMP #$9B
         BEQ L53F5
         CMP #$20
         BEQ L53F5
         INX 
         INY 
         BNE L53D2

noparm:    RTS 
; 
L53E4    LDY #$0A
         LDA ($0A),Y
         PHA 
         JSR L53F2
         PLA 
         LDY #$0A
         CMP ($0A),Y
         RTS 
; 
L53F2    JMP $FFFF
; 
L53F5    INX 
         STX $CA
         LDY #$0A
         LDA ($0A),Y
         TAY 
         LDA $0A
         CLC 
         ADC #$3F
         STA $97
         LDA $0A+1
         ADC #$00
         STA $98
         LDA ($97),Y
         CMP #$9B
         BEQ noparm
         INY 
         INC IN_BATCH
         LDA ($97),Y
         CMP #$2F
         BNE L5424
         INY 
         LDA ($97),Y
         CMP #$4C
         BNE L5423
         INC V_ARC
         RTS 
; 
L5423    DEY 
L5424    LDX #$00
L5426    LDA ($97),Y
         STA DIR_MASK,X
         CMP #$9B
         BEQ L5439
         CMP #$20
         BEQ L5439
         INX 
         INY 
         BNE L5426
         BEQ noparm
L5439    LDA #$9B
         STA DIR_MASK,X
         CPX #$01
         BNE L5455
         STA DIR_MASK+3
         LDA DIR_MASK
         STA DIR_MASK+1
         LDA #'D'     ;$44 
         STA DIR_MASK
         LDA #':'     ;$3A 
         STA DIR_MASK+2
L5455    STY $A5
         JSR L49EA
         LDY $A5
         LDA ($97),Y
         CMP #$9B
         BNE L5463
L5462    RTS 
; 
L5463    INY 
         LDA ($97),Y
         CMP #'/'     ;$2F 
         BNE L5462
         INY 
L546B    LDA ($97),Y
         CMP #'S'     ;$53 
         BEQ L548E
         CMP #'Q'     ;$51 
         BEQ L5496
         CMP #'T'     ;$54 
         BEQ L549A
         CMP #'P'     ;$50 
         BEQ L54A6
         CMP #'O'     ;$4F 
         BEQ L54A2
         CMP #'X'     ;$58 
         BEQ L549E
         CMP #$20    ; space 
         BEQ L54AA
L5489    LDA #$00
         STA PASSWORD
         RTS 
; 
L548E    LDA #$00
         STA SCREEN_ON
L5492    INY 
         BNE L546B
         RTS 
; 
L5496    INC CW_QUERY
         BNE L5492
L549A    INC TD_STAMP
         BNE L5492
L549E    INC DISK_SWAP
         BNE L5492
L54A2    INC OVER_WRITE
         BNE L5492
L54A6    INC PASSWORD
         BNE L5492
L54AA    INY 
         LDA PASSWORD
         BEQ L5489
         LDX #$00
L54B1    LDA ($97),Y
         AND #$7F
         CMP #$60
         BCC L54BB
         SBC #$20
L54BB    STA R316B,X
         CMP #$1B
         BEQ L54CE
         CMP #$20
         BEQ L54CE
         INY 
         INX 
         CPX #$15
         BCC L54B1
         BCS L5489
L54CE    INX 
         STX GOT_PW
         RTS 
; 
EDEV
         dc.b "E:",$9B
KDEV
         dc.b "K:",$9B
         RTS 
         BRK 
; 
;
DEST_BUF
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0
R30B4    dc.b 0
;
;
WORK_BUF
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
;
;------------------------------
;  Áòã éä Éäåîôéæåòù áì÷áùó    
; ¤±Á æïò áòã áîä áìæ æéìåó    
;------------------------------
;
ARC_ID
         dc.b 0
;
;------------------------------
;  Ôèåóå áòå ôèå ÁÒÃ ãïíðòåóó  
; Ôùðåó                        
;  ª ½ Óõððïòåä âù ôèéó æéìå   
;------------------------------
;
; * $02 = Stored
; * $03 = Packed
;   $04 = Squeeze
; * $08 = Crunch
;   $09 = Squash
;   $0f = Alf'ed
;
;-------------------------------
;
ARC_VER
         dc.b 0
;
;-------------------------------
; Æéìå Îáíå ïæ ãïíðòåóóåä æéìå  
; áì÷áùó ±³ âùôå éåº            
;   §æéìåîáíå®åøô§              
;-------------------------------
;
ARC_NAME
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0
;
;------------------------------
;     Æéìå óéúå ãïíðòåóóåä     
;------------------------------
;
ARC_SIZE
         dc.b 0,0,0,0
;
ARC_DATE
         dc.b 0,0
;
ARC_TIME
         dc.b 0,0
;
;------------------------------
;    ÃÒÃ ãèåãëóõí ïæ æéìå      
;------------------------------
;
ARC_CRC
         dc.w 0
;
;------------------------------
;  Æéìå Óéúå âåæïòå Ãïíðòåóóåä 
;------------------------------
;
ARC_OSIZE
         dc.b 0,0,0,0
;
;-------------------
; Åîä ïæ Áòã èåáäåò 
;-------------------
;
DIR_MASK
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
;
         dc.b 0
R3153    dc.b 0,0,0,0,0
;
R3158    dc.b 0
R3159    dc.b 0
R315A    dc.b 0
R315B    dc.b 0
         dc.b 0
         dc.b 0
         dc.b 0
R315F    dc.b 0
R3160    dc.b 0
R3161    dc.b 0
R3162    dc.b 0
         dc.b 0
         dc.b 0
         dc.b 0
;
R3166
         dc.b 0,0,0,0
;
R316A    dc.b 0
R316B
         dc.b 0,0,0,0,0,0,0
;
DISK_BUF
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0
;
R317D
         dc.b 0
;
R317E
         dc.b 0,0
;
R3180
         dc.b 0,0,0,0,0
;
R3185
         dc.b 0,0,0,0,0,0
R318B
         dc.b 0,0,0,0,0,0,0
;
R3192
         dc.b 0
;
R3193
         dc.b 0,0,0
;
;
DIR_BUFFER
;
R3196    dc.b 0     ; hold the color
R3197    dc.b 0
R3198    dc.b 0
;
win_end:	ds.b	0
;


;
