;------------------------------------------------------------------------
;		Copyright 2010 Integrated Logic Systems
;                  Source Code is Copyright Stephen J. Carden
;
;
;			Please do not share this source!
;------------------------------------------------------------------------
;                              Version.com
;
;	This is a program to peak a byte and display it to the screen
;		init	2/24/2010	sjc new design
;		added hex delimeter 		2/25/2010	sjc		
;		added new code for registered user 2/26/2010	sjc
;	Updated the screen Print Utility so it will work with the exp-80
; This change will also help "Print P:"		6/19/2010	sjc
;
;
;
;       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;------------------------------------------------------------------------
; 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,"Arc.com     ",$9b
			.endm

;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; File revision history. Version Number in hex
;
file_ver:		equ   $13
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; the Month in dec for the first time this revision 
;was compiled
;
c_month:		equ   10
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; the day in dec for the first time this revision 
;was compiled
c_day:			equ   3
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; the year in dec for the first time this revision 
;was compiled
c_year:			equ   2012
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; 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 our Header control Byte
;$ff =bypass intro
;$15 = Bypass Dos check
r..crl:			equ	$7d
r..crlf:		equ	$9b
r..space:		equ	$20
r..bypassDOS:		equ	$15
r..bypass:		equ	$ff

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    =   $00
;
;
;-------------------------------
;a $00 in the location = no
;a $01 in the location = Yes
;
; these are page 0 address
; that are 1 byte long
; used for tempary holders
;
;-------------------------------
;
SCREEN_ON =  $B1
CW_QUERY =   $A7
CRUNCH_ONLY = $DC
ADD_TO_ARCHIVE = R31C8
DISK_SWAP =  $C2
PASSWORD =   $CE
SPARTADOS? = $CF
IN_BATCH =   $CA
HOLDSTACK =  $CC
;
;-------------------------------
;PAGE 0 addressing
;
; These location are all
; 3 bytes long or 3 intergers
;-------------------------------
FP_SIZE  =   $8A
FILE_TEMP =  $9D
FP_CRUNCH =  FILE_TEMP
FP_STORE =   FP_SIZE
FP_PACK  =   $92
;
;
;-------------------------------
; Page 0 address that are
; 2 bytes long
; Pointer that start with;
;
; XY_ptr
; x= [R]ead [W]rite
; y= [L]ength [B]uffer
;
;
;
;-------------------------------
;
I_CRC    =   $88     ; crc caculation
RB_PTR   =   $A8
RL_PTR   =   $AA
WB_PTR   =   $AC
WL_PTR   =   $AF
W_PTR    =   $80     ; work pointer
LC_PTR   =   $1A     ;ciov pointer

;
KBD      =   $30
;-------------------------------
;
; These are macros to make
; understanding the arc code
; easer.....
;
;-------------------------------

xio:            .macro  ptr,ptr,field,field,ptr,ptr
		JSR CIOV_SI
         	dc.b %1
        	dc.b %2
        	dc.w %3
        	dc.w %4
       		dc.b %5
         	dc.b %6
		.endm

;
;MEM_LOW  =   R4ECD-7885 ; JUST TO TRICK THE MATH




			.include	equates
			.include	globals
			.include	macros

;


		.org	$3000
MEM_LOW:
win_start:
header_info:
			.include	header		; this reads info out of the header and displays to screen
top_menu:

			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			; gonna look for the Start key
			cmp	#consol_start		; comparing to the consol key
			beq	.tellfilehistory		; got the start key now lets print all the compiling info
			lda	consol			; any consol key
			cmp	#consol_any				; CONSOL KEY
			bne	.abort				; YEP!!!  abort screen
			jmp	.gotspacechar

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


.gotspacechar:
			JMP START


;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; 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>,"|Arc compresses one or more 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	" Arc [Destination] [Source] /n",$9b
			dc.b	" Arc Dn:>path>file.arc Dn:>*.* /n",$9b
			dc.b	" /n Options [/ACPQSX] not Required",$9b
			dc.b	" A = Add to the existing source",$9b
			dc.b	"     archive",$9b
			dc.b	" C = Use Crunch only",$9b
			dc.b	" P = Use the fourth parameter as an",$9b
			dc.b	"     encryption password",$9b
			dc.b	" Q = Compact with query",$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
;
echo:
fast_output:		sta	$5a
			lda	sc.redirect
			cmp	#print_p
			beq	go_cio
			lda	$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
;



		.org	$7330
L9200
         ds.b 2810    ;20013
MEMORY_POINTER ;     = R4ECD+20013
         ds.b 769
MEMORY_1 ;           = MEMORY_POINTER+769
         ds.b 1029
MEM_HIGH ds.b 1       ;PAD OUT
;
;
;-----------------------------
;

;
;
f.MEMLOW   dc.w MEM_LOW
f.MEMTOP   dc.w MEM_HIGH
;
;
         RTS
;
D_LIST
         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 D_LIST
; 
D_LIST2
         dc.b $70,$70,$70,$70,$70,$70,$70
         dc.b $70,$70,$70,$70,$70,$70,$70
         dc.b $42
         dc.w L3035
         dc.b $41
         dc.w D_LIST2
; 
L3035
         dc.b   <internal>," "
L3036    dc.b   <internal>,<+128>,"Compacting"
         dc.b   <internal>," "
; 
L3041    dc.b   <internal>,"      "
; 
L3047
         dc.b   <internal>,"                      "
;----------------------------
;this Doubles as a 28 byte
;buffer read from spartados
;----------------------------
;
INIT     LDA $02C5   ; COLOR1
         STA R31BE
         LDA $02C6   ; COLOR2
         STA R31BE+1
         LDA $6A     ;  RAMTOP
         CMP #$C0
         BCS L30A2
         LDA $0700
L3072    CMP #'R'
         BEQ L30A2
         LDA $D301   ;PORT B
         AND #$02
         BNE L30A2
         LDA $03F8   ; BASIC FLAG
         ORA $03FA   ; GTIA FLAG
         BNE L30A2
         INC $03F8   ; BASIC FLAG
         LDA $D301   ;PORT B
         ORA #$02
         STA $D301   ;PORT B
         LDA #$C0
L3092    STA $6A     ;RAMTOP
L3094    JSR CLOSE0
          XIO  DISK0,3,L4FD5,0,12,0
L30A2    JSR CLOSE1
         JSR CLOSE2
         JSR CLOSE_KBD
          XIO  KBD,3,L4FD8,0,4,0
;
L30B6    LDA $58     ; $58 screen ram
         STA L3005
         LDA $58+1   ; screen ram +1
         STA L3005+1
         LDA f.MEMTOP  ;  MEMTOP
         SEC 
         SBC # low MEMORY_1 ;WAS  $FB
         STA RL_PTR
         LDA f.MEMTOP+1 ;MEM TOP+1
         SBC # high MEMORY_1 ;WAS  $9F
         STA RL_PTR+1
         LDA f.MEMTOP+1 ;MEM TOP+1
         SEC 
         SBC f.MEMLOW+1 ; MEMLO+1
         CMP #$FF    ; $74 unknow ?????
;   BCS L3108
         BNE L3108   ; JUST A TEST
         LDX # low L30E6
         LDY # high L30E6
         JSR L3202
         PLA 
         PLA 
         JMP L3C2B
; 
L30E6    dc.b $9B
         dc.b "Error: Not enough free memory!",$FD,$9B,0
; 
L3108    LSR RL_PTR+1
         ROR RL_PTR
L310C    LDA # low MEMORY_1 ;WAS $FB
L310E    STA RB_PTR
L3110    CLC 
L3111    ADC RL_PTR
         STA WB_PTR
L3115    LDA # high MEMORY_1 ;WAS $9F
         STA RB_PTR+1
         ADC RL_PTR+1
L311B    STA WB_PTR+1
         LDA RL_PTR
L311F    STA WL_PTR
L3121    LDA RL_PTR+1
L3123    STA WL_PTR+1
L3125    LDA # low MEM_LOW ; was #$cd
L3127    STA $C5
L3129    LDA # high MEM_LOW ; was #$4e
L312B    STA $C5+1
L312D    LDA # low MEMORY_POINTER ;$9CFA OR $ACFA
         STA R31C1
         LDA # high MEMORY_POINTER ;$9CFA OR $ACFA
         STA R31C1+1
         LDA #$00
         STA IN_BATCH
         STA SCREEN_ON
         STA SCREEN_ON
         STA CW_QUERY
         STA $C2
L3143    STA CRUNCH_ONLY
         STA PASSWORD
         STA SPARTADOS?
         STA $D2+1
         STA ADD_TO_ARCHIVE
         INC SCREEN_ON
         LDA #$FF
         STA $02C5   ; COLOR1
         LDA #$80
         STA $02C6   ; COLOR2
         LDA $0700
         CMP #'R'
         BNE L3163
         INC SPARTADOS?
;----------------------------
; Looking for the real.dos
; Jmp $????
;----------------------------
L3163    LDY #$00
L3165    LDA (comtab),Y
         CMP #$4C    ; jmp
         BNE L3199   ; nope My Dos
;----------------------------
; Looking for the Zcrname
; and if its there we punch
; the jump vector into our
; our code
;----------------------------
L316B    LDY #$03
L316D    LDA (comtab),Y
         CMP #$4C    ; jmp
L3171    BNE L3199   ; go mydos
;
;---------------------------
; Get the bufoff. Need it!
;---------------------------
L3173    LDA comtab
L3175    CLC 
         ADC # low ZCRNAME		;$03
         STA L31AD+1
         LDA comtab+1
L317D    ADC # high ZCRNAME		;$00
         STA L31AD+2
         JSR L319F
         BEQ L3198
;---------------------------
; now we get our Comfnam
; and load it right over
; our init program code!
;---------------------------
         LDY #COMFNAM			;$21
         LDX #$00
L318B    LDA (comtab),Y
         STA DEST_BUF,X
         CMP #$9B    ; C/R
L3192    BEQ L319C   ; found the c/r
         INX 
         INY 
         BNE L318B
L3198    RTS 
; 
L3199    JMP L4F02
; 
L319C    JMP L4F30   ; now do our thing
; 
L319F    LDY #BUFOFF			;$0A
         LDA (comtab),Y
L31A3    PHA 
         JSR L31AD
         PLA 
         LDY #BUFOFF			;$0A
         CMP (comtab),Y
         RTS 
; 
L31AD    JMP $FFFF   ;jmp bufoff
; 
;
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0
         dc.w 0
         dc.b 0
         dc.w 0     ; MEMORY_POINTER
         dc.w 0
         dc.w 0
         dc.w 0
;
;
; 
I_PRINT  STY $C3
         STX $C3+1
         JSR I_PUTL
         LDY $C3
         LDX $C3+1
         RTS 
; 
I_CRLF   LDA #$9B    ; c/r
I_PUTL   PHA 
         JSR L31DD
         PLA 
         RTS 
; 
;-----------------------------
;this is the direct put byte
; e:
; routeen out of the hi-tab
; table at $31a
;
;-----------------------------
;
L31DD    TAY 
L31DE    LDA #$00    ; low byte right out of hi-tab
         PHA 
L31E1    LDA #$00    ; hi byte right out of hi-tab
         PHA 
         TYA 
         LDX #DISK0
         RTS 
; 
I_GETKBD JSR I_GETKEY
         CPY #128
         BCS I_GETKBD
         RTS 
; 
;------------------------------;
;   GET KEY  ROUTEEN           ;
;this routeen get's one key and;
;return it to the accumlator   ;
;------------------------------;
;
I_GETKEY
	 LDX #KBD    ; iocb 3
         LDA #$07    ; Bget
         STA $0342,X
         LDA #$00
         STA $0348,X
         STA $0348+1,X
         JMP $E456
 
L3202    STX $FE
         STY $FE+1
L3206    LDY #$00
         LDA ($FE),Y
         BEQ L321B
L320C    JSR I_PUTL
         CPY #128
         BCS L320C
         INC $FE
         BNE L3206
         INC $FE+1
         BNE L3206
L321B    RTS 
; 
CLOSE0   LDX #DISK0
          dc.b $2c  
CLOSE1   LDX #DISK1
          dc.b $2c  
CLOSE2   LDX #DISK2
          dc.b $2c  
CLOSE_KBD LDX #KBD
          dc.b $2c  
CLOSE4   LDX #DISK4
          dc.b $2c  
CLOSE6   LDX #DISK6
;
L322D
         LDA #$0C    ; close iocb
         STA $0342,X
         JMP $E456
; 
L3235    CPY #128
         BCS L323A
         RTS 
; 
L323A    STY FR0
         LDA #$00
         STA FR0+1
         STX $96
L3242    JSR L4BA3
         LDX $96
         CPX #DISK2
         BEQ L3251
         LDX # low L328F
         LDY # high L328F
         BNE L3255
L3251    LDX # low L32A3
         LDY # high L32A3
L3255    JSR L3202
         JSR L32D5
         PLA 
         PLA 
L325D    JSR CLOSE1
         LDA $0340+DISK2
         CMP #$FF
         BEQ L326D
         JSR L4CC9
         JSR CLOSE2
L326D    JSR CLOSE6
         JSR L4BA3
         JSR I_CRLF
         LDA #$FF
         STA 764     ; raw key press
         LDA IN_BATCH
         BEQ L3282
         JMP L3C2B
; 
L3282    LDX # low L32B8
         LDY # high L32B8
         JSR L3202
         JSR I_GETKBD
         JMP L3A53
; 
L328F    dc.b $9B
         dc.b <+128>,"Disk Read Error"
	 dc.b " #",$FD,0
; 
L32A3
         dc.b $9B
         dc.b <+128>,"Disk Write Error"
         dc.b " #",$FD,0

; 
L32B8    dc.b $9B
         dc.b "Press "
	 dc.b <+128>,"RETURN"
	 dc.b " to continue...",0
; 
L32D5    JSR IFP     ; IFP
         JSR FASC    ; FASC
         LDY #$00
L32DD    LDA (INBUFF),Y
         PHA 
         AND #$7F
         JSR I_PRINT
         INY 
         PLA 
         BPL L32DD
         RTS 
; 
L32EA    LDA $82
         BNE L334B
         ORA $82+1
         BNE L3349
         LDA #$07
         STA $0342+DISK1
         LDA RB_PTR
         STA $0344+DISK1
         STA L334D+1
         LDA RB_PTR+1
         STA $0345+DISK1
         STA L334D+2
         LDA R31C0
         BNE L3343
         JSR L4CA1
         LDX #DISK1
         LDA RL_PTR
         STA $0348,X
         LDA RL_PTR+1
         STA $0348+1,X
         INC R31C5
         JSR $E456
         CPY #128
         BCC L332F
         CPY #136
         BEQ L332C
         JMP L3235
; 
L332C    INC R31C0
L332F    LDA $0348,X
         STA $82
         STA R31C5+1
         LDA $0348+1,X
         STA $82+1
         STA R31C7
         ORA $82
         BNE L3345
L3343    SEC 
         RTS 
; 
L3345    LDA $82
         BNE L334B
L3349    DEC $82+1
L334B    DEC $82
L334D    LDA $FFFF
         INC FP_SIZE
         BNE L335A
         INC FP_SIZE+1
         BNE L335A
         INC FP_SIZE+2
L335A    INC L334D+1
         BNE L3362
         INC L334D+2
L3362    TAX 
         EOR I_CRC
         TAY 
         LDA L3443,Y
         EOR I_CRC+1
         STA I_CRC
         LDA L3543,Y
         STA I_CRC+1
         TXA 
         CLC 
         RTS 
; 
L3375    LDY $D0
L3377    BEQ L3385
         EOR R317D,Y
         INY 
         CPY $D0+1
         BCC L3383
         LDY #1
L3383    STY $D0
L3385    STA $FFFF
         INC L3385+1
         BNE L3390
         INC L3385+2
L3390    LDA $85
         BNE L3396
         DEC $85+1
L3396    DEC $85
         BEQ L339B
         RTS 
; 
L339B    LDA $85+1
         BEQ L33A0
L339F    RTS 
; 
L33A0    STX $C7
         JSR L4CC9
         JSR L3427
         LDA #$0B    ; bput command
         LDX #DISK2
         STA $0342,X
         LDA WB_PTR
         STA $0344,X
         STA L3385+1
         LDA WB_PTR+1
         STA $0344+1,X
         STA L3385+2
         LDA WL_PTR
         STA $0348,X
         STA $85
         LDA WL_PTR+1
         STA $0348+1,X
         STA $85+1
         JSR $E456
         BPL L33D5
         JMP L3235
; 
L33D5    LDX $C7
         JMP L339F
; 
L33DA    LDA L3375+1
         CMP WB_PTR
         BNE L33E8
         LDA L3377
         CMP WB_PTR+1
         BEQ L3426
L33E8    JSR L4CC9
         JSR L3427
         LDA #$0B    ; bput
         LDX #DISK2  ; iocb #2
         STA $0342,X
         LDA WB_PTR
         STA $0344,X
         STA L3385+1
         LDA WB_PTR+1
         STA $0344+1,X
         STA L3385+2
         SEC 
         LDA WL_PTR
         SBC $85
         STA $0348,X
         LDA WL_PTR+1
         SBC $85+1
         STA $0348+1,X
         LDA WL_PTR
         STA $85
         LDA WL_PTR+1
         STA $85+1
         LDX #DISK2
         JSR $E456
         BPL L3426
         JMP L3235
; 
L3426    RTS 
; 
L3427    LDX #DISK2
         LDA $0340,X
         CMP #$FF
         BEQ L3431
         RTS 
; 
L3431    JSR L4CC9
          XIO  DISK2,3,DEST_BUF,0,9,0
;
         JSR L3235
         RTS 
; 
L3443
;
         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
;
L3543
         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
;    512 Bytes.
;
; 
ARCTEMP
         dc.b "ARCTEMP.ARC",$9B
; 
L364F
         dc.b "Error: File cannot be appended.",0
; 
DEST_NAME
         dc.b $7D,$9B
         dc.b "Enter complete destination filename:",$9B,0
;
SOURCE_PATH
         dc.b $9B
         dc.b "Source Filemask (drive # for dir):",$9B,0
;
L36BC
         dc.b $9B
         dc.b <+128>,"Invalid Pathname!"
         dc.b $9B
         dc.b "Examples: D1:TEST.BAS, or D2:DIR>*.*",$9B,0
; 
L36F5
         dc.b $9B
         dc.b <+128>,"[ESC]"
	 dc.b " to quit, "
	 dc.b <+128>,"[P]"
	 dc.b "athname, "
	 dc.b <+128>,"[1-9]"
	 dc.b " dirs",$9B
         dc.b "Crunch ",0
; 
L3724
         dc.b $9B
         dc.b "Insert "
	 dc.b <+128>,"Source"
	 dc.b " disk, press "
	 dc.b <+128>,"Return"
	 dc.b $9B,0
;
L3747
         dc.b $9B
         dc.b "Insert "
	 dc.b <+128>,"Destination"
         dc.b " Disk, press "
	 dc.b <+128>,"Return"
         dc.b $9B,0
;
L376F
         dc.b $9B,$9B
         dc.b "Use "
         dc.b $1B,$9E ;esc left
         dc.b $1B,$9F ;esc right 
         dc.b $1B,$9C ;esc up 
         dc.b $1B,$9D ;esc down 
         dc.b ", "
	 dc.b <+128>,"Return"
         dc.b " - toggle, "
	 dc.b <+128>,"ESC"
         dc.b " - exit",$9B,0
; 
L379C
         dc.b	$20
	 dc.b	$7D
         dc.b "",$1E,$1F,$9B
         dc.b "|Screen Off:Yes  Password Encrpt:No!|",$1E,$1F,$9B
         dc.b "|Disk Swaps:No!  Use Crunch only:No!|",$1E,$1F,$9B
         dc.b "|        Compact w/query:No!        |",$9B
         dc.b "",$9B,$9B
         dc.b "      ",$9B
         dc.b "      |"
;	 dc.b <+128>,"  SuperArc!  Ver. 1.0  "
	 dc.b <+128>," Arc!    Version  2.3  "
	 dc.b "|"
	 dc.b $9B
         dc.b "      |LAST updated 10/03/2012|",$9B
         dc.b "",$9B
         dc.b "| "
	 dc.b <+128>,"[A]"
         dc.b "  ARChive file(s)              |",$9B
         dc.b "| "
	 dc.b <+128>,"[B]"
         dc.b "  Add to an ARChive            |",$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,"Select >"
         dc.b 0
; 
START:    TSX 
         STX HOLDSTACK
         JSR L4ECD
         LDA #$02
         STA $52     ;  LMARGN
L3A53    LDA IN_BATCH
         BEQ L3A5A
         JMP L3C6C
; 
L3A5A    LDX # low L379C
         LDY # high L379C
         JSR L3202
L3A61    LDA #$0A
         STA $55     ; COLCRS
         ASL
         STA $54     ; ROWCRS
         LDA #$1E    ; arrow left
         JSR I_PUTL
         LDA #$1F    ; arrow right
         JSR I_PUTL
         LDA #$00
         STA ADD_TO_ARCHIVE
L3A77    JSR I_GETKBD
         CMP #$60    ; rts
         BCC L3A80
         SBC #$20
L3A80    STA $97
         CMP #'1'
         BCC L3A90
         CMP #'9'+1
         BCS L3A90
         JSR L490D
         JMP L3A61
; 
L3A90    CMP #'G'
         BNE L3A97
         JMP $E477
; 
L3A97    CMP #'H'     ;$48 
         BNE L3AA1
         JSR I_CRLF
         JMP L3C2B
; 
L3AA1    CMP #'P'     ;$50
         BNE L3AAB
         JSR L3B0D
         JMP L3A61
; 
L3AAB    JMP L3BD9
; 
L3AAE    LDY $96
         LDX #14
         CPY #$02
         BCC L3AB8
         LDX #19
L3AB8    LDA L3AC7,Y
         TAY 
L3ABC    LDA ($58),Y
         EOR #$80
         STA ($58),Y
         INY 
         DEX 
         BNE L3ABC
         RTS 
; 
L3AC7
         dc.b 43
         dc.b 83
         dc.b 131
         dc.b 59
         dc.b 99
         dc.b 131
;
L3ACD
         dc.b 54
         dc.b 94
         dc.b 147
         dc.b 75
         dc.b 115
         dc.b 147
;
L3AD3    dc.b "No!"
;
L3AD6    dc.b "Yes"
;
L3AD9    dc.b   <internal>,"No!"
;
L3ADC    dc.b   <internal>,"Yes"
;
L3ADF    PHA 
         JSR L3AAE
         LDY $96
         LDA L3ACD,Y
         TAY 
         LDA #$03
         STA $8D
         PLA 
         LDX #$00
         CMP #$00
         BEQ L3AF6
         LDX #$03
L3AF6    LDA L3AD9,X
         STA ($58),Y
         LDA L3AD3,X
         STA L379C,Y
         INX 
         INY 
         DEC $8D
         BNE L3AF6
         JSR L3AAE
         JMP DINK
; 
L3B0D    LDA #$00
         STA $96
         LDX # low L376F
         LDY # high L376F
         JSR L3202
L3B18    JSR L3AAE
L3B1B    JSR I_GETKBD
         CMP #$1B    ; ESC
         BNE L3B30
         JSR L3AAE
         LDA #$1C    ; arrow up
         JSR I_PUTL
         LDA #$9C    ; esc arrow up
         JSR I_PUTL
         RTS 
; 
L3B30    CMP #'-'     ;  $2D
         BEQ L3B5E
         CMP #'='     ;  $3D
         BEQ L3B67
         CMP #'+'     ;  $2B
         BEQ L3B70
         CMP #'*'     ; $2A
         BEQ L3B70
         CMP #$9B    ; C/R
         BNE L3B1B
         LDY $96
         LDA L3B58,Y
         TAY 
         LDA $00,Y
         EOR #1
         STA $00,Y
         JSR L3ADF
         JMP L3B1B
; 
;
;
L3B58
         dc.b SCREEN_ON
         dc.b DISK_SWAP
         dc.b CW_QUERY
         dc.b PASSWORD
         dc.b CRUNCH_ONLY
         dc.b CW_QUERY
;
;
;
L3B5E    JSR L3AAE
         JSR L3B8C
         JMP L3B18
; 
L3B67    JSR L3AAE
         JSR L3B7F
         JMP L3B18
; 
L3B70    JSR L3AAE
         JSR L3B7F
         JSR L3B7F
         JSR L3B7F
         JMP L3B18
; 
L3B7F    INC $96
         LDA $96
         CMP #$06
         BCC L3B8B
         LDA #$00
         STA $96
L3B8B    RTS 
; 
L3B8C    DEC $96
         BPL L3B8B
         LDA #$05
         STA $96
         RTS 
;
;---------------------------
;  This is Bob Puff's page 0
;  ciov offset loader
;
;  dc.b ? <- ciov chanel
;  dc.b ? <- xio #
;  dc.w ? <- $348,x & $349,x
;  dc.w ? <- $34a,x & $34b,x
;
;---------------------------
CIOV_SI  PLA 
         STA LC_PTR
         PLA 
         STA LC_PTR+1
         LDY #1
         LDA (LC_PTR),Y
         TAX 
         INY 
         LDA (LC_PTR),Y
         STA $0342,X
         INY 
         LDA (LC_PTR),Y
         STA $0344,X
         INY 
         LDA (LC_PTR),Y
         STA $0344+1,X
         INY 
         LDA (LC_PTR),Y
         STA $0348,X
         INY 
         LDA (LC_PTR),Y
         STA $0348+1,X
         INY 
         LDA (LC_PTR),Y
         STA $034A,X
         INY 
         LDA (LC_PTR),Y
         STA $034A+1,X
         TYA 
         CLC 
         ADC LC_PTR
         TAY 
         LDA #$00
         ADC LC_PTR+1
         PHA 
         TYA 
         PHA 
         JMP $E456
; 
L3BD9    CMP #'A'     ;$41
         BEQ L3BE4
         CMP #'B'     ;$42
         BNE L3BEA
         INC ADD_TO_ARCHIVE
L3BE4    JSR I_PUTL
         JMP L3C1E
; 
L3BEA    CMP #'F'     ; $46
         BEQ L3BF8
         CMP #'D'     ; $44
         BEQ L3BF5
         JMP L3A77
; 
L3BF5    JMP L4BD5
; 
L3BF8    JSR I_PUTL
         JSR L4E01
         JMP L3A53
; 
;-----------------------------
; Bob Puffs Pokie noise maker
;-----------------------------
;
DINK     LDA #$00
         STA $D208
         LDA #$25
         STA $D200
         LDY #$B0    ;????? 176
L3C0D    LDX #$FF
L3C0F    STX $D40A
         DEX 
         BNE L3C0F
         DEY 
         STY $D201
         CPY #$A0
         BNE L3C0D
         RTS 
; 
L3C1E    LDX # low DEST_NAME
         LDY # high DEST_NAME
         JSR L3202
         JSR GET_DEST
         JMP L3C71
; 
L3C2B    LDX #DISK1  ; iocb 0
L3C2D    LDA #$0C    ; close it
         STA $0342,X
         JSR $E456
         TXA 
         CLC 
         ADC #$10
         TAX 
         BPL L3C2D
         JSR SCREEN_SAVE
         JSR L3C5C
         JSR SCREEN_LOAD
         LDA R31BE
         STA $02C5   ; COLOR1
         LDA R31BE+1
         STA $02C6   ; COLOR2
         LDX HOLDSTACK
         TXS 
         LDA SPARTADOS?
         BNE L3C5B
         JMP (comtab)   ; and exit out
; 
L3C5B    RTS 
; 
;---------------------------
; jsr open the E: device
; loaded out of hi-tab
;---------------------------
L3C5C    LDA #$0C
         STA $2A
L3C60    LDA #$00    ; low byte
         PHA 
L3C63    LDA #$00    ; hi byte
         PHA 
         RTS 
; 
L3C67    dc.b ".ARC",$9B
; 
L3C6C    LDA $CB
         STA $0348+DISK0
L3C71    JSR CLOSE1
         JSR CLOSE2
         LDY $0348+DISK0
         DEY 
L3C7B    LDA DEST_BUF,Y
         CMP #'.'     ; $2E
         BEQ L3C97
         DEY 
         BPL L3C7B
         LDY $0348+DISK0
         DEY 
         LDX #$00
L3C8B    LDA L3C67,X
         STA DEST_BUF,Y
         INY 
         INX 
         CPX #$05
         BCC L3C8B
L3C97    LDA DEST_BUF,Y
         JSR L4473
         BEQ L3CA2
         DEY 
         BPL L3C97
L3CA2    STY $91
L3CA4    LDA DEST_BUF,Y
         STA WORK_BUF,Y
         DEY 
         BPL L3CA4
         LDY $91
         INY 
         LDX #$00
L3CB2    LDA ARCTEMP,X
         STA WORK_BUF,Y
         INY 
         INX 
         CPX #$0B
         BCC L3CB2
         LDA #$9B    ; c/r
         STA WORK_BUF,Y
         INY 
         LDX $91
         INX 
L3CC7    LDA DEST_BUF,X
         STA WORK_BUF,Y
         INY 
         INX 
         CMP #$9B    ; C/R
         BNE L3CC7
         LDY #1
L3CD5    LDA #$00
         STA R31C0
         STA $D0
L3CDC    STA $82,Y
L3CDF    LDA WL_PTR,Y
L3CE2    STA $85,Y
L3CE5    LDA WB_PTR,Y
         STA L3385+1,Y
         DEY 
         BPL L3CD5
         LDA ADD_TO_ARCHIVE
         BNE L3CF6
         JMP L3DD4
; 
L3CF6
          XIO  DISK1,3,DEST_BUF,0,4,0
         JSR L3235
          XIO  DISK2,3,WORK_BUF,0,8,0
         JSR L3235
         LDA $C2
         STA $9B
         LDA #$00
         STA $C2
L3D1A    JSR L32EA
         BCS L3D69
         STA ARC_ID
         JSR L32EA
         STA ARC_VER
         CMP #$00
         BNE L3D87
         JSR L33DA
         JSR CLOSE2
         JSR CLOSE1
;
          XIO  DISK1,33,DEST_BUF,0,0,0
;
         JSR L3235
         LDY #$00
L3D45    LDA WORK_BUF,Y
         CMP #$9B    ; C/R
         BEQ L3D4F
         INY 
         BNE L3D45
L3D4F    LDA #','     ; $2C
         STA WORK_BUF,Y
;
          XIO  DISK1,32,WORK_BUF,0,0,0
;
         JSR L3235
         LDA $9B
         STA $C2
         JMP L3DE2
; 
L3D69    LDX # low L364F
         LDY # high L364F
         JSR L3202
         JSR CLOSE1
         JSR CLOSE2
;
          XIO  DISK1,33,WORK_BUF,0,0,0
;
         JSR CLOSE1
         JMP L325D
; 
L3D87    LDA ARC_ID
         JSR L3375
         LDA ARC_VER
         JSR L3375
         LDX #$02
L3D95    STX $C3
         JSR L32EA
         LDX $C3
L3D9C    BCS L3D69
         STA ARC_ID,X
         JSR L3375
         INX 
         CPX #29     ;   $1D
         BCC L3D95
         LDY #$02
L3DAB    LDA ARC_SIZE+1,Y
L3DAE    STA FILE_TEMP,Y
         DEY 
         BPL L3DAB
L3DB4    LDA FILE_TEMP
         BNE L3DC7
         LDA FILE_TEMP+1
         BNE L3DC5
         LDA FILE_TEMP+2
         BNE L3DC3
         JMP L3D1A
; 
L3DC3    DEC FILE_TEMP+2
L3DC5    DEC FILE_TEMP+1
L3DC7    DEC FILE_TEMP
         JSR L32EA
         BCS L3D69
         JSR L3375
         JMP L3DB4
; 
L3DD4
          XIO  DISK2,3,DEST_BUF,0,8,0
;
         JSR L3235
L3DE2    LDA #$02
         STA $C9
         LDA IN_BATCH
         BNE L3E22
         LDA PASSWORD
         BEQ L3DF1
         JSR L4B5E
L3DF1    JSR L4BA3
         JSR L4CA1
         JSR GET_SRC
L3DFA    LDA $0348+DISK0
         CMP #$02
         BCS L3E22
L3E01    LDA #$00
         STA $D0
         LDA #$1A
         JSR L3375
         LDA #$00
         JSR L3375
         JSR L33DA
         JSR CLOSE2
         JSR L3235
         LDA IN_BATCH
         BNE L3E1F
         JMP L3A53
; 
L3E1F    JMP L3C2B
; 
L3E22    LDA #$00
         STA $D0
         STA $D2
         LDA SPARTADOS?
         BNE L3E3D
         LDA $C2
         BNE L3E34
         LDA $D2+1
         BEQ L3E3D
L3E34    JSR L4CC9
         JSR CLOSE2
         JSR L3235
L3E3D    JSR L4CA1
         JSR CLOSE6
;
          XIO  DISK6,3,DIR_MASK,0,6,128
;
         JSR L3235
         JMP L3E68
; 
L3E54    LDA # low DIR_BUFFER
         STA INBUFF
         LDA # high DIR_BUFFER
         STA INBUFF+1
;
          XIO  DISK6,5,DIR_BUFFER,40,6,128
;
         RTS 
; 
L3E68    LDA R31C1
         STA R31C3
         STA W_PTR
         LDA R31C1+1
         STA R31C3+1
         STA W_PTR+1
         LDY #$00
         STY $D2
         TYA 
         STA (W_PTR),Y
L3E7F    JSR L3E54
         BPL L3E8A
L3E84    JSR CLOSE6
         JMP L3ECF
; 
L3E8A    LDA DIR_BUFFER
         CMP #$9B    ; C/R
         BNE L3E9F
         INC $D2
         JSR L3E54
         JSR L3E54
         JSR L3E54
         JMP L3F04
; 
L3E9F    LDA DIR_BUFFER+1
         CMP #'9'+1
         BEQ L3E7F
         BCS L3EAC
         CMP #'1'-1
         BCS L3E84
L3EAC    LDX #$02
         LDY #$00
L3EB0    LDA DIR_BUFFER,X
         STA (W_PTR),Y
         INY 
         INX 
         CPX #13     ; index 13 bytes
         BCC L3EB0
         LDA #$00    ; putting a 0 at the endi of the file name
         STA (W_PTR),Y
         INY 
         STA (W_PTR),Y
         CLC 
         LDA W_PTR
         ADC #12
         STA W_PTR
         BCC L3E7F
         INC W_PTR+1
         BNE L3E7F
L3ECF    LDA R31C1
         STA W_PTR
         LDA R31C1+1
         STA W_PTR+1
         LDY #$00
         LDA (W_PTR),Y
         BNE L3F04
         LDX # low L3EE9
         LDY # high L3EE9
         JSR L3202
         JMP L3DF1
; 
L3EE9
         dc.b $9B,"Error: No file(s) Found!",$9B
         dc.b $00
;
L3F04    LDY #$00
L3F06    LDA DIR_MASK,Y
         CMP #$20    ; SPACE
         BEQ L3F14
         CMP #$9B    ; C/R
         BEQ L3F14
         INY 
         BNE L3F06
L3F14    LDA DIR_MASK,Y
         JSR L4473
         BEQ L3F1F
         DEY 
         BNE L3F14
L3F1F    STY W_PTR
L3F21    LDA DIR_MASK,Y
         STA WORK_BUF,Y
         DEY 
         BPL L3F21
         LDA $D2
         BEQ L3F34
         JMP L3F9D
; 
L3F31    JMP L3DF1
; 
L3F34    LDA $0340+DISK2
         CMP #$FF
         BEQ L3F45
         LDA $C2
         BEQ L3F45
         JSR L4CC9
         JSR CLOSE2
L3F45    LDX W_PTR
         INX 
         LDA R31C3
         STA W_PTR
         LDA R31C3+1
         STA W_PTR+1
         LDY #$00
         STY $A3
         LDA (W_PTR),Y
         BEQ L3F31
L3F5A    LDA (W_PTR),Y
         STA WORK_BUF,X
         CMP #$20    ; SPACE
         BEQ L3F69
         INY 
         INX 
         CPY #$08
         BCC L3F5A
L3F69    LDA #'.'     ; $2E
         STA WORK_BUF,X
         LDY #$08
         INX 
L3F71    LDA (W_PTR),Y
         STA WORK_BUF,X
         INX 
         INY 
         CPY #11
         BCC L3F71
         LDA #$9B    ; c/r
         STA WORK_BUF,X
         LDA W_PTR
         CLC 
         ADC #12
         STA R31C3
         BCC L3F8E
         INC R31C3+1
L3F8E    LDA #$60
         STA $A4
         LDA #$21
         STA $A4+1
         LDA #$11
         STA $A4+2
         JMP L405F
; 
L3F9D    JSR L3E54
         LDA DIR_BUFFER+13
         CMP #'<'     ; looking for <dir>
         BEQ L3F9D
         LDY W_PTR
         LDA DIR_BUFFER+8
         CMP #$20    ; SPACE
         BEQ L3FB3
         JMP L3DF1
; 
L3FB3    INY 
         LDX #$00
L3FB6    LDA DIR_BUFFER,X
         STA WORK_BUF,Y
         CMP #$20    ; SPACE
         BEQ L3FC6
         INY 
         INX 
         CPX #$08
         BCC L3FB6
L3FC6    LDA #'.'     ; $2E
         STA WORK_BUF,Y
         LDX #$09
         INY 
L3FCE    LDA DIR_BUFFER,X
         STA WORK_BUF,Y
         INY 
         INX 
         CPX #$0C
         BCC L3FCE
         LDA #$9B    ; c/r
         STA WORK_BUF,Y
         LDA #23     ; $17
         STA CIX
         JSR AFP     ; ASCII TO FL POINT
         JSR FPI     ; FPI
         LDA FR0
         STA $A4+1
         LDA #20     ;   $14
         STA CIX
         JSR AFP     ; ASCII TO FL POINT
         JSR FPI     ; FPI
         LDA FR0
         ASL
         ASL
         ASL
         ASL
         ASL
         ORA $A4+1
         STA $A4+1
         LDA #$00
         ROL
         STA $A4+2
         LDA #$26    ;  $1A
         STA CIX
         JSR AFP     ; ASCII TO FL POINT
         JSR FPI     ; FPI
         SEC 
         LDA FR0
         SBC #$50
         ASL
         ORA $A4+2
         STA $A4+2
         LDA #32     ; $20
         STA CIX
         JSR AFP     ; ASCII TO FL POINT
         JSR FPI     ; FPI
         LDA #$00
         STA $A4
         LDA FR0
         LDY #$05
L402D    ASL
         ROL $A4
         DEY 
         BNE L402D
         STA $A3
         LDA #29     ; $1D
         STA CIX
         JSR AFP     ; ASCII TO FL POINT
         JSR FPI     ; FPI
         LDA FR0
         CMP #$0C
         BCC L4049
         LDA #$00
         STA FR0
L4049    LDA DIR_BUFFER+34


         CMP #'p'     ; pm in SpartaDos
         BEQ L4053
         LDA #$00
          dc.b $2c  
L4053
         LDA #12
         CLC 
         ADC FR0
         ASL
         ASL
         ASL
         ORA $A4
         STA $A4
L405F    LDY #$00
L4061    LDA DEST_BUF,Y
         CMP WORK_BUF,Y
         BNE L4071
         INY 
         CMP #$9B    ; C/R
         BNE L4061
         JMP L3F04
;
L4071    LDA CW_QUERY
         BNE L408F
         LDA CRUNCH_ONLY
         BNE L407F
         LDX # low ANALYZ
         LDY # high ANALYZ
         BNE L4083
L407F    LDX # low CRUNCH_1
         LDY # high CRUNCH_1
L4083    JSR L3202
         JSR L40EF
         JSR I_CRLF
         JMP L4103
;
L408F    LDX # low L36F5
         LDY # high L36F5
         JSR L3202
         JSR L40EF
         LDA #'?'
         JSR I_PUTL
         JSR L4BA3
L40A1    JSR I_GETKBD
         CMP #$9B    ; C/R
         BEQ L40D6   ; nope skip it
         AND #63     ; upcase
         CMP #'Y'-64  ; .sbyte "Y",yes
         BNE L40B9
         LDA #'Y'     ; yes Include this one
         JSR I_PUTL
         JSR I_CRLF
         JMP L4103
;
L40B9    CMP #$1B    ; ESC
         BEQ L40D3   ; out of here back to the main menu
         CMP #'N'-64  ; .sbyte "N"
         BEQ L40D6
         CMP #'P'-64  ; .sbyte "P", new pathname
         BEQ L40E1
         CMP #'1'
         BCC L40A1
         CMP #'9'+1
         BCS L40A1
         JSR L490D
         JMP L40A1
;
L40D3    JMP L3E01
;
L40D6    LDA #'N'     ;$4E
         JSR I_PUTL
         JSR I_CRLF
         JMP L3F04
;
L40E1    LDA #'P'     ;$50
         JSR I_PUTL
         JSR I_CRLF
         JSR GET_SRC
         JMP L3DFA
;
L40EF    LDY #$00
L40F1    LDA WORK_BUF,Y
         CMP #$20    ; SPACE
         BEQ L4102
         CMP #$9B    ; C/R
         BEQ L4102
         JSR I_PRINT
         INY 
         BNE L40F1
L4102    RTS 
;
L4103    JSR CLOSE1
         LDA CRUNCH_ONLY
         BEQ L4122
         JSR L3427
         LDA #$26    ; note
         LDX #DISK2
         STA $0342,X
         JSR $E456
         LDX #$02
L4119    LDA $034C+DISK2,X
         STA R3192+1,X
         DEX 
L4120    BPL L4119
L4122    LDA $D3
         BEQ L412C
         JSR CLOSE2
         JSR L3235
L412C    JSR L4CA1
         LDA #$00
         STA I_CRC
         STA I_CRC+1
         STA $82
         STA $82+1
         STA FP_STORE
         STA FP_STORE+1
         STA FP_STORE+2
         STA FP_PACK
         STA FP_PACK+1
         STA FP_PACK+2
         STA R31C0
         STA R31C5
;
          XIO  DISK1,3,WORK_BUF,0,4,0
;
         JSR L3235
         LDA SCREEN_ON
         BEQ L4160
         JSR L4BA9
L4160    LDA PASSWORD
         BEQ L4168
         LDA #$00
         STA $D0
L4168    JMP L41CE
;
L416B    LDA $90
         BEQ L4175
         DEC $90
         LDA $90+1
         CLC 
         RTS 
;
L4175    LDA $8F
         BEQ L4180
         DEC $8F
         LDA $EF
         JMP L4186
;
L4180    JSR L32EA
         BCC L4186
         RTS 
;
L4186    CMP #$90    ; "°"
         BNE L4194
         LDY #$00    ; 00

         STY $90+1
         INC $90
L4190    STA $8D+1
         CLC 
         RTS 
;
L4194    CMP $8D+1
         BNE L4190
L4198    INC $8D
         LDX $8D
         CPX #$FE
         BEQ L41BF
         JSR L32EA
         BCS L41AD
         CMP $8D+1
         BEQ L4198
         STA $EF
         INC $8F
L41AD    LDX $8D
         INX 
         CPX #$03
         BCS L41C0
         LDX #$00    ;$00
         STX $8D
         LDA $8D+1
         LDX #$90
         STX $8D+1
         RTS 
;
L41BF    INX 
L41C0    INC $90
         STX $90+1
         LDX #$00    ;$00 ;???????????
         STX $8D
         LDA #$90    ; ????????
         STA $8D+1
         CLC 
         RTS 
;
L41CE    LDY #$00    ; $00
         STY $8D
         STY $90
         STY $8F
         STY $A2
         STY $D0
         LDA #$90    ;?????????????
         STA $8D+1
         LDA CRUNCH_ONLY
         BEQ L41F3
         LDA SPARTADOS?
         BNE L41E9
         JMP L44E7
;
L41E9    JSR L458B
         LDA PASSWORD
         BEQ L41F2
         INC $D0
L41F2     dc.b $2c  
L41F3    INC $A2
         JSR L46D7
L41F8    JSR L416B
         BCS L420F
         INC FP_PACK
         BNE L4207
         INC FP_PACK+1
         BNE L4207
         INC FP_PACK+2
L4207    STA $97
         JSR L473E
         JMP L41F8
;
L420F    LDA FLPTR
         STA $9B
         LDA FLPTR+1
         STA $9B+1
         JSR L45D0
         JSR L465C
         JSR CLOSE1
         LDX # low STORE_LEN		;print store length
         LDY # high STORE_LEN
         JSR L3202
         LDX #FP_STORE
         LDY #$00
         JSR L439C
         LDX # low PACK_LEN		;print packed length
         LDY # high PACK_LEN
         JSR L3202
         LDX #FP_PACK
         LDY #$00
         JSR L439C
         LDX # low CRUNCH_LEN		;print crunched length
         LDY # high CRUNCH_LEN
         JSR L3202
         LDX #FP_CRUNCH
         LDY #$00
         JSR L439C
         LDX # low L441E		;print bytes
         LDY # high L441E
         JSR L3202
         SEC 
         LDA FP_PACK
         SBC FP_SIZE
         LDA FP_PACK+1
         SBC FP_SIZE+1
         LDA FP_PACK+2
         SBC FP_SIZE+2
         BCC L427C
         LDA FP_STORE
         SBC FILE_TEMP
         LDA FP_STORE+1
         SBC FILE_TEMP+1
         LDA FP_STORE+2
         SBC FILE_TEMP+2
         BCC L4274
L426E    LDA #$08
          dc.b $2c  
L4271    LDA #$03
          dc.b $2c  
L4274    LDA #$02
         STA ARC_VER
         JMP L428D
;
L427C    SEC 
         LDA FP_PACK
         SBC FILE_TEMP
         LDA FP_PACK+1
         SBC FILE_TEMP+1
         LDA FP_PACK+2
         SBC FILE_TEMP+2
         BCS L426E
         BCC L4271
L428D    CMP #$02
         BEQ L429D
         CMP #$03
         BEQ L42A5
;
;------------------------------
; Load vars out of 0 page
; getting a 3 byte interger
;
;------------------------------
;
         LDX # low CRUNCH
         LDA #FP_CRUNCH
         LDY # high CRUNCH
         BNE L42AB
L429D    LDX # low STORE
         LDA #FP_SIZE
         LDY # high STORE
         BNE L42AB
L42A5    LDX # low PACK
         LDA #FP_PACK
         LDY # high PACK
;
L42AB    STX $FE
         STY $FE+1
         TAY 
         LDX #$00
L42B2    LDA $00,Y
         STA ARC_SIZE,X
         INY 
         INX 
         CPX #$03
         BCC L42B2
         JSR L3206
         JSR L447E
         LDA $A2
         BNE L4305
         JSR L33DA
         LDX #DISK2  ; iocb 2
         LDA #$26    ; note
         STA $0342,X
         JSR $E456
         LDY #$02
L42D7    LDA $034C+DISK2,Y ; saving notes
         STA DISK_BUF,Y
         DEY 
         BPL L42D7
         JSR L4596
         LDA ARC_VER
         CMP #$08
         BNE L4305
         JSR L45AB
         LDX #DISK2  ; iocb 2
         LDA #$25    ; Point
         STA $0342,X
         LDY #$02
L42F6    LDA DISK_BUF,Y ; load the point buffer
         STA $034C+DISK2,Y ; store it chanel 2
         DEY 
         BPL L42F6
         JSR $E456
         JMP L3F04
;
L4305    LDA R31C5+1
         STA $82
         LDA R31C7
         STA $82+1
         INC R31C0
         LDA R31C5
         CMP #$01
         BEQ L4330
         LDA #$00
         STA $82
         STA $82+1
         STA R31C0
;
          XIO  DISK1,3,WORK_BUF,0,4,0
;
         JSR L3235
L4330    LDA #$90
         STA $8D+1
         LDX #$00    ;$00
         STX $A2
         STX $D0
         STX $8D
         STX $90
         STX $8F
L4340    LDA ARC_ID,X
         JSR L3375
         INX 
         CPX #29     ; $1D
         BCC L4340
         LDA PASSWORD
         BEQ L4353
         LDA #$01
         STA $D0
L4353    LDA ARC_VER
         CMP #$02
         BEQ L4386
         CMP #$03
         BEQ L4391
         JSR L46D7
L4361    JSR L416B
         BCS L436E
         STA $97
         JSR L473E
         JMP L4361
;
L436E    LDA FLPTR
         STA $9B
         LDA FLPTR+1
         STA $9B+1
         JSR L45D0
         JSR L465C
L437C    LDA CRUNCH_ONLY
         BEQ L4383
         JSR L33DA
L4383    JMP L3F04
;
L4386    JSR L32EA
         BCS L437C
         JSR L3375
         JMP L4386
;
L4391    JSR L416B
         BCS L437C
         JSR L3375
         JMP L4391
;
L439C    STX W_PTR
         STY W_PTR+1
         LDA #$00
         STA FR0+1
         LDY #$02
         LDA (W_PTR),Y
         STA FR0
         JSR IFP
         JSR FMOVE
         LDX # low L43D6
         LDY # high L43D6
         JSR FLD0R   			; $dd89 load  FR0 FROM [Y.X]
         JSR FMULT
         JSR FMOVE
         LDY #$00
         LDA (W_PTR),Y
         STA FR0
         INY 
         LDA (W_PTR),Y
         STA FR0+1
         JSR IFP
         JSR FADD
         JSR FASC
         LDY #$00
         JMP L32DD
;
;  Floating point '65535'
L43D6
         dc.b $42,$06,$55,$36,$00,$00
;
STORE_LEN
         dc.b $9B
         dc.b "  Stored Length:",0
;
PACK_LEN
         dc.b " bytes",$9B
         dc.b "  Packed Length:",0
;
CRUNCH_LEN
         dc.b " bytes",$9B
         dc.b "Crunched Length:",0
;
L441E
         dc.b " bytes",$9B,0
;
CRUNCH
         dc.b <+128>," Crunching! "
	 dc.b $9B,0
;
STORE
         dc.b <+128>," Storing! "
	 dc.b $9B,0
;
PACK
         dc.b <+128>," Packing! "
	 dc.b $9B,0
;
CRUNCH_1
         dc.b $9B
         dc.b <+128>,"Crunching:"
	 dc.b " ",0
;
ANALYZ
         dc.b $9B
         dc.b <+128>,"Analyzing:"
	 dc.b " ",0
;
L4466    dc.b "Bytes saved:",0
;
L4473    CMP #':'     ; $3A
         BEQ L447D
         CMP #'>'     ; $3E
         BEQ L447D
         CMP #'\'     ; $5C
L447D    RTS 
;
L447E    LDA #$1A			; arc type
         STA ARC_ID
         LDA I_CRC
         STA ARC_CRC
         LDA I_CRC+1
         STA ARC_CRC+1
         LDY #$00
         STY ARC_SIZE+3
         STY ARC_OSIZE+3
         LDX #$02
L4497    LDA FP_STORE,X
         STA ARC_OSIZE,X
         DEX 
         BPL L4497
L449F    LDA WORK_BUF,Y
         CMP #$9B    ; C/R
         BEQ L44A9
         INY 
         BNE L449F
L44A9    DEY 
L44AA    LDA WORK_BUF,Y
         JSR L4473
         BEQ L44B5
         DEY 
         BNE L44AA
L44B5    LDX #$00
L44B7    INY 
         LDA WORK_BUF,Y
         STA ARC_NAME,X
         CMP #$9B			; C/R
         BEQ L44CD
         CMP #$20			; SPACE
         BEQ L44CD
         INX 
         CPX #$0D
         BCC L44B7
         BCS L44D7
L44CD    LDA #$00
L44CF    STA ARC_NAME,X
         INX 
         CPX #$0D
         BCC L44CF
L44D7    LDX #$01
L44D9    LDA $A3,X
         STA ARC_TIME,X
         LDA $A4+1,X
         STA ARC_DATE,X
         DEX 
         BPL L44D9
         RTS 
;
L44E7    JSR L458B
         LDA PASSWORD
         BEQ L44F0
         INC $D0
L44F0    JSR L46D7
L44F3    JSR L416B
         BCS L4500
         STA $97
         JSR L473E
         JMP L44F3
;
L4500    LDA FLPTR
         STA $9B
         LDA FLPTR+1
         STA $9B+1
         JSR L45D0
         JSR L465C
         LDX # low L4466
         LDY # high L4466
         JSR L3202
         SEC 
         LDA FP_STORE
         SBC FILE_TEMP
         STA FP_PACK
         LDA FP_STORE+1
         SBC FILE_TEMP+1
L4520    STA FP_PACK+1
         LDA FP_STORE+2
         SBC FILE_TEMP+2
         STA FP_PACK+2
         BCS L4548
         LDA #'-'			; $2D
         JSR I_PUTL
         CLC 
         LDA FP_PACK
         EOR #$FF
         ADC #$01
         STA FP_PACK
         LDA FP_PACK+1
         EOR #$FF
         ADC #$00
         STA FP_PACK+1
         LDA FP_PACK+2
         EOR #$FF
         ADC #$00
         STA FP_PACK+2
L4548    LDX # high L9200
         LDY # low L9200
         JSR L439C
         JSR I_CRLF
         LDY #$00
         STY $D0
         LDA #$08
         STA ARC_VER
         JSR L447E
         LDX #$02
L4560    LDA FILE_TEMP,X
         STA ARC_SIZE,X
         DEX 
         BPL L4560
         JSR L33DA
         JSR CLOSE2
         JSR L3235
;
          XIO  DISK2,3,DEST_BUF,0,12,0
;
         JSR L4596
         JSR L45AB
         JSR CLOSE2
         JSR L3235
         JMP L3F04
;
L458B    LDX #$1C
L458D    LDA #$1A
         JSR L3375
         DEX 
         BPL L458D
         RTS 
;
L4596    LDX #DISK2			; iocb 2
         LDA #$25			; point
         STA $0342,X
         LDY #$02
L459F    LDA R3192+1,Y			; loading point buffer
         STA $034C+DISK2,Y
         DEY 
         BPL L459F
         JMP $E456
;
L45AB    LDY #$00
L45AD    LDA ARC_ID,Y
         JSR L45B9
         INY 
         CPY #29			;  $1D
         BCC L45AD
         RTS 
;
L45B9    STY W_PTR
         LDX #DISK2			; iocb 2
         LDY #$0B			; bput
         STY $0342+DISK2		; odd off setting
         LDY #$00
         STY $0348+DISK2
         STY $0349+DISK2
         JSR $E456
         LDY W_PTR			; getting our y reg back
         RTS 
;
L45D0    LDA $96
         LSR
         LSR
         LSR
         TAX 
         LDA $9B+1
         STA L46C2+1,X
         LDA #$00
         STA L46C4,X
         LDA $96
         AND #$07
         TAY 
         BEQ L45FA
         LDA #$00
L45E9    ASL $9B
         ROL L46C2+1,X
         ROL
         DEY 
         BNE L45E9
         STA L46C4,X
         LDA $96
         AND #$07
         TAY 
L45FA    LDA L46C2,X
         AND L46CE,Y
         ORA $9B
         STA L46C2,X
         LDA $96
         CLC 
         ADC $F0
         STA $96
         LDA $F0
         ASL
         ASL
         ASL
         CMP $96
         BNE L4618
         JSR L4694
L4618    LDA $95
         BEQ L4632
         LDA $96
         BEQ L4623
         JSR L4694
L4623    LDA #$09
         STA $F0
         LDY #$01
         STY INBUFF
         DEY 
         STY $95
         DEY 
         STY CIX     ; CIX
         RTS 
;
L4632    LDA $9A
         CMP INBUFF
         BNE L463E
         LDA $99
         CMP CIX     ; CIX
         BEQ L4650
L463E    BCC L4650
         INC $F0
         LDA $F0
         CMP #$0C
         BCC L4651
         LDA #$00
         STA CIX     ; CIX
         LDA #$10
         STA INBUFF
L4650    RTS 
;
L4651    TAY 
         LDA #$FF
         STA CIX     ; CIX
         LDA L46C6,Y
         STA INBUFF
         RTS 
;
L465C    LDA $96
         CLC 
         ADC #$07
         LSR
         LSR
         LSR
         STA $98
         CLC 
         ADC FILE_TEMP
         STA FILE_TEMP
         BCC L4673
         INC FILE_TEMP+1
         BNE L4673
         INC FILE_TEMP+2
L4673    LDA $98
         CLC 
         ADC $F6
         STA $F6
         BCC L467E
         INC $F7
L467E    LDA $96
         BEQ L4693
         LDA $A2
         BNE L4693
         LDX #$00
L4688    LDA L46C2,X
         JSR L3375
         INX 
         CPX $98
         BCC L4688
L4693    RTS 
;
L4694    LDX $A2
         BNE L46A3
L4698    LDA L46C2,X
         JSR L3375
         INX 
         CPX $F0
         BCC L4698
L46A3    LDA #$00
         STA $96
         LDA FILE_TEMP
         CLC 
         ADC $F0
         STA FILE_TEMP
         BCC L46B6
         INC FILE_TEMP+1
         BNE L46B6
         INC FILE_TEMP+2
L46B6    CLC 
         LDA $F6
         ADC $F0
         STA $F6
         BCC L46C1
         INC $F7
L46C1    RTS 
;
L46C2    dc.b 0,0
;
L46C4    dc.b 0,0
L46C6    dc.b 0,0,0,0,0,0,0,0
;
L46CE
         dc.b $00,$01,$03,$07,$0F,$1F,$3F,$7F,$FF
;
;
L46D7    LDA #$00
         STA $96
         STA $95
         STA $F9
         STA $F7
         STA INBUFF+1
         STA $F5
         STA FILE_TEMP+1
         STA FILE_TEMP+2
         LDA #$01
         STA $F8
         STA $F6
         STA FILE_TEMP
         STA $99
         STA $9A
         STA $F1
         STA INBUFF
         LDA #$FF
         STA CIX     ; CIX
         LDA #$09
         STA $F0
         LDA $A2
         BNE L470A
         LDA #$0C
         JSR L3375
L470A    JSR L470E
         RTS 
;
L470E    LDY #$02
         LDA $C5
         STA W_PTR
         LDA $C5+1
         STA W_PTR+1
         LDX #$8B    ;?????????
         LDA #$14    ;?????????
         STA $98
L471E    LDA #$00
         STA (W_PTR),Y
         CLC 
         LDA W_PTR
         ADC #$04
         STA W_PTR
         BCC L472D
         INC W_PTR+1
L472D    DEX 
         BNE L471E
         DEC $98
         BNE L471E
         RTS 
;
L4735    STA FLPTR
         LDA #$00
         STA FLPTR+1
         STA $F1
         RTS 
;
L473E    LDY $F1
         BNE L4735
         INC $F8
         BNE L4748
         INC $F9
L4748    STY $FA+1
         ASL
         ROL $FA+1
         ASL
         ROL $FA+1
         ASL
         ROL $FA+1
         ASL
         ROL $FA+1
         EOR FLPTR
         STA $FA
         TAY 
         LDA $FA+1
         EOR FLPTR+1
         STA $FA+1
         STA W_PTR+1
         TYA 
         ASL
         ROL W_PTR+1
         ASL
         ROL W_PTR+1
         CLC 
         ADC $C5
         STA W_PTR
         LDA W_PTR+1
         ADC $C5+1
         STA W_PTR+1
         LDY #$02
         LDA (W_PTR),Y
         BNE L477E
         JMP L4802
;
L477E    AND #$0F
         CMP FLPTR+1
         BNE L4792
         DEY 
         LDA (W_PTR),Y
         CMP FLPTR
         BNE L4792
         DEY 
         LDA (W_PTR),Y
         CMP $97
         BEQ L47F2
L4792    LDA $FA
         ORA $FA+1
         BNE L479E
         STA $A0+1
         LDA #$04
         BNE L47B1
L479E    SEC 
         LDA #$8B    ; ???????
         SBC $FA
         TAX 
         LDA #$13    ; ???????
         SBC $FA+1
         STA $A0+1
         TXA 
         ASL
         ROL $A0+1
         ASL
         ROL $A0+1
L47B1    STA $A0
L47B3    LDA W_PTR
         SEC 
         SBC $A0
         STA W_PTR
         LDA W_PTR+1
         SBC $A0+1
         STA W_PTR+1
         BCC L47CC
         CMP $C5+1
         BNE L47CA
         LDA W_PTR
         CMP $C5
L47CA    BCS L47D8
L47CC    LDA W_PTR
         ADC #$2C
         STA W_PTR
         LDA W_PTR+1
         ADC #$4E
         STA W_PTR+1
L47D8    LDY #$02
         LDA (W_PTR),Y
         BEQ L4802
         AND #$0F
         CMP FLPTR+1
         BNE L47B3
         DEY 
         LDA (W_PTR),Y
         CMP FLPTR
         BNE L47B3
         DEY 
         LDA (W_PTR),Y
         CMP $97
         BNE L47B3
L47F2    LDY #$02
         LDA (W_PTR),Y
         LSR
         LSR
         LSR
         LSR
         STA FLPTR+1
         INY 
         LDA (W_PTR),Y
         STA FLPTR
         RTS 
;
L4802    LDA FLPTR
         STA $9B
         LDA FLPTR+1
         STA $9B+1
         JSR L45D0
         LDX $9A
         CPX #$10
         BCS L483E
         LDY #$03
         LDA $99
         STA (W_PTR),Y
         DEY 
         TXA 
         ASL
         ASL
         ASL
         ASL
         ORA FLPTR+1
         STA (W_PTR),Y
         INC $99
         BNE L4829
         INC $9A
L4829    DEY 
         LDA FLPTR
         STA (W_PTR),Y
         DEY 
         LDA $97
         STA (W_PTR),Y
         STA FLPTR
         STY FLPTR+1
         LDA $F9
         CMP #$08
         BCS L484D
         RTS 
;
L483E    LDA #$00
         STA FLPTR+1
         LDA $97
         STA FLPTR
         LDA $F9
         CMP #$08
         BCS L484D
         RTS 
;
L484D    LDA #$00
         STA $F8
         STA $F9
         LDA INBUFF+1
         ORA $F5
         BEQ L4884
         SEC 
         LDA $F6
         SBC INBUFF+1
         STA $98
         LDA $F7
         SBC $F5
         ORA $98
         BEQ L488C
         BCC L488C
         JSR L470E
         LDY #$01
         STY $99
         STY $9A
         STY $95
         STY $9B+1
         DEY 
         STY $9B
         STY INBUFF+1
         STY $F5
         JSR L45D0
         JMP L488C
;
L4884    LDA $F6
         STA INBUFF+1
         LDA $F7
         STA $F5
L488C    LDA #$00
         STA $F6
         STA $F7
         RTS 
;
GET_SRC
;
         LDX # low SOURCE_PATH
         LDY # high SOURCE_PATH
         JSR L3202
         LDA #$40
         STA $02BE   ;  SHFLOK
;
          XIO  DISK0,5,DIR_MASK,41,12,0
;
;
         BMI GET_SRC
         LDA DIR_MASK
         CMP #$9B    ; C/R
         BEQ L4906
         CMP #'D'     ;    $44
         BEQ L48C5
         CMP #'1'
         BCC L48CC
         CMP #':'     ;
         BCS L48CC
         JSR L490D
         JMP GET_SRC
;
L48C5    LDA DIR_MASK+1
         CMP #':'+1
         BCC L48E9
L48CC    LDY $0348+DISK0
         DEY 
L48D0    LDA DIR_MASK,Y
         STA DIR_MASK+2,Y
         DEY 
         BPL L48D0
         LDA #'D'
         STA DIR_MASK
         LDA #':'     ; $3A
         STA DIR_MASK+1
         INC $0348+DISK0 ; iocb 2
         INC $0348+DISK0 ; iocb 2
L48E9    LDA $0348+DISK0 ; iocb 2
         TAY 
         DEY 
         DEY 
L48EF    LDA DIR_MASK,Y
         JSR L4473
         BEQ L4906
         DEY 
         BNE L48EF
         BEQ L48FC
L48FC    LDX # low L36BC
         LDY # high L36BC
         JSR L3202
         JMP GET_SRC
;
L4906    LDA DIR_MASK+1
         STA WORK_BUF+1
         RTS 
;
L490D    AND #$0F			; converting .sbyte to byte
         ORA #$30
         STA L4A63+1			; goint to store 1 to 9 in here
         ORA #$80
         STA L4A37
         LDA #'D'
         STA L4A63
         LDA #':'
         STA L4A63+2
         LDA $D3
         BEQ L4930
         JSR L4CC9
         JSR CLOSE2
         JSR L3235
L4930    JSR SCREEN_SAVE
L4933    LDX # low L4A18
         LDY # high L4A18
         JSR L3202
;
          XIO  DISK0,5,L4A63+3,40,12,0
;
         BMI L4933
         LDX $0348+DISK0		; iobc 0 lenget
         LDA #'*'			; "*"
         STA L4A63+2,X
         STA L4A63+4,X
         LDA #'.'			; "."
         STA L4A63+3,X
         LDA #$9B			; c/r
         STA L4A63+5,X
         JSR CLOSE4
;
          XIO  DISK4,3,L4A63,0,6,128
;
         JSR L49C6
         LDA #$03
L496F     dc.b $2c  
L4970    LDA #$00
         STA $98
L4974
          XIO  DISK4,5,L4A63,40,6,128
;
         BPL L4988
         CPY #136			; end of dir
         BEQ L499F
         JSR L49C6
L4988    LDY #$00
L498A    LDA L4A63,Y
         JSR I_PRINT			; echo to the screen
         INY 
         CMP #$9B			; C/R
         BNE L498A
         INC $98
         LDA $98
         CMP #22
         BCC L4974
         BCS L49B0
L499F    LDX # low L32B8
         LDY # high L32B8
         JSR L3202
         JSR I_GETKBD
L49A9    JSR CLOSE4
         JSR SCREEN_LOAD
L49AF    RTS 
;
L49B0    LDX # low L49F5
         LDY # high L49F5
         JSR L3202
         JSR I_GETKBD
         CMP #$1B    ; ESC
         BEQ L49A9
         LDA #$7D
         JSR I_PUTL  ; clear the screen
         JMP L4970
;
L49C6    CPY #$80
         BCC L49AF
         PLA 
         PLA 
         JSR CLOSE4
         LDX # low L49D9
         LDY # high L49D9
         JSR L3202
         JMP L499F
;
L49D9
         dc.b $9B,"Disk Directory read error",$9B,0
;
L49F5
         dc.b $9B
         dc.b <+128>,"[ESC]"
         dc.b " to quit, "
         dc.b <+128>,"[Return]"
         dc.b " for more:",0
;
L4A18
         dc.b $7D
         dc.b "  "
         dc.b <+128>,">>> Disk Directory of Drive "
L4A37    dc.b <+128>,"1"
         dc.b <+128>," <<<"
	 dc.b $9B
         dc.b "  Enter Pathname or "
         dc.b <+128>,"Return"
	 dc.b " for main:",$9B,0
;
L4A63
         dc.b "                                         " ; 41 bytes
         dc.b "      " ; 6 bytes
;
GET_DEST LDA #$40
         STA $02BE   ;  SHFLOK
;
          XIO  DISK0,5,DEST_BUF,80,12,0
;
         BMI L4AAB
         LDA $0348,X
         CMP #$03
         BCS L4AB0
L4AAB    PLA 
         PLA 
         JMP L3A53
;
L4AB0
         LDA DEST_BUF
         CMP #'D'     ; $44
         BNE L4AC5
         LDA DEST_BUF+1
         CMP #'1'
         BCC L4AC5
         CMP #':'+1   ;  $3B
         BCC L4AE2
L4AC5    LDY $0348+DISK0
         DEY 
L4AC9    LDA DEST_BUF,Y
         STA DEST_BUF+2,Y
         DEY 
         BPL L4AC9
         LDA #'D'     ;  $44
         STA DEST_BUF
         LDA #':'     ;$3A
         STA DEST_BUF+1
         INC $0348+DISK0
         INC $0348+DISK0
L4AE2    RTS 
;
;----------------------------
;screen save
;----------------------------
SCREEN_SAVE LDA $54  ; ROWCRS
         STA $99
         LDA $55     ; COLCRS
         STA $9A
         LDA #$1F    ; ''
         STA $02F0   ; CURSOR OFF
         JSR I_PUTL
         JSR L4B50
         LDX #$04
         LDY #$00
         STY $02F0   ; CURSOR ON
L4AFD    LDA ($9B),Y
         STA (W_PTR),Y
         INY 
         BNE L4AFD
         INC $9B+1
         INC W_PTR+1
         DEX 
         BNE L4AFD
         RTS 
;
;-----------------------------
;screen load
;
;-----------------------------
;
SCREEN_LOAD JSR L4B50
         LDY #$00
         STY $54     ; ROWCRS
         STY $55     ; COLCRS
         INY 
         STY $02F0   ; CURSOR OFF
         LDA #$1F    ; arrow left
         JSR I_PUTL
         LDA #$1E    ; arrow right
         JSR I_PUTL
         DEC $02F0   ; CURSOR ON
         LDX #$04
         LDY #$00
L4B2A    LDA (W_PTR),Y
         STA ($9B),Y
         INY 
         BNE L4B2A
         INC W_PTR+1
         INC $9B+1
         DEX 
         BNE L4B2A
         LDA $99
         STA $54     ; ROWCRS
         LDA $9A
         STA $55     ; COLCRS
         LDA #$1F    ; arrow left
         JSR I_PUTL
         LDA #$1E    ; arrow right
         JSR I_PUTL
         LDA #$00
         TAY 
         STA ($58),Y
         RTS 
;
L4B50    LDX #$01
L4B52    LDA $58,X
         STA $9B,X
         LDA $C5,X
         STA W_PTR,X
         DEX 
         BPL L4B52
         RTS 
;
L4B5E    LDX # low L4DE4
         LDY # high L4DE4
         JSR L3202
;
          XIO  DISK0,5,R317E,21,12,0
;
         BPL L4B88
L4B72    LDA #$00
         STA PASSWORD
         LDY L3ACD+5 ; L3AD2
         LDX #$00
L4B7B    LDA L3AD3,X
         STA L379C,Y
         INY 
         INX 
         CPX #$03
         BCC L4B7B
         RTS 
;
L4B88    LDY $0348+DISK0 ; iocb buffer
         STY $D1
         DEY 
         BEQ L4B72
         DEY 
L4B91    LDA R317E,Y
         AND #$7F
         CMP #$60    ; rts
         BCC L4B9C
         SBC #$20
L4B9C    STA R317E,Y
         DEY 
         BPL L4B91
         RTS 
;
L4BA3    LDA # low D_LIST
         LDX # high D_LIST
         BNE L4BCE
L4BA9    LDY #27     ; $1B
         LDA #$00
L4BAD    STA L3041,Y ; UPDATE DLIST
         DEY 
         BPL L4BAD
         INY 
L4BB4    LDA WORK_BUF,Y
         CMP #$20    ; SPACE
         BEQ L4BCA
         CMP #$9B    ; C/R
         BEQ L4BCA
         SEC 
         SBC #$20
         STA L3041,Y ; UPDATE DLIST
         INY 
         CPY #28
         BCC L4BB4
L4BCA    LDA # low D_LIST2
         LDX # high D_LIST2
L4BCE    STA $0230
         STX $0231
         RTS 
;
L4BD5    LDX # low L4D84
         LDY # high L4D84
         JSR L3202
         JSR CLOSE1
         JSR GET_DEST
         LDX # low L4DAB
         LDY # high L4DAB
         JSR L3202
         JSR L4C13
         CMP #$01
         BEQ L4BF3
         JMP L3A53
;
L4BF3
          XIO  DISK1,33,DEST_BUF,0,0,0
;
         BPL L4C09
         STY FR0
         LDA #$00
         STA FR0+1
         JSR L3251
L4C09    LDX # low L4DCC
         LDY # high L4DCC
         JSR L3202
         JMP L325D
;
L4C13    JSR I_GETKBD
         CMP #$9B    ; C/R
         BNE L4C1C
         LDA #'N'     ; $4E
L4C1C    AND #$1F
         CMP #$1B    ; ESC
         BNE L4C29
         JSR I_CRLF
         LDA #$00
         SEC 
         RTS 
;
L4C29    CMP #'Y'-64  ; .sbyte "."
         BNE L4C39
         LDA #'Y'
         JSR I_PUTL
         JSR I_CRLF
         LDA #$01
         CLC 
         RTS 
;
L4C39    CMP #'N'-64  ; .sbyte "0"
         BNE L4C13
         LDA #'N'     ; $4E
         JSR I_PUTL
         JSR I_CRLF
         LDA #$00
         CLC 
         RTS 
;
L4C49    STX $0304
         STY $0304+1
         LDA #$0C
L4C51    STA $0308
         STA $0306
         LDA #$00
         STA $0308+1
         STA $030A
         STA $030A+1
         LDA #$40
         STA $0303
         LDA #'N'     ; returns drive config  or $4e
         STA $0302
         LDA #$31
         STA $0300
         BCC L4C79
         ASL $0303
         INC $0302   ; now sents the config
L4C79    JSR $E459
         RTS 
;
L4C7D    LDA DISK_SWAP
         BEQ L4C9F
         LDA DEST_BUF+1
         CMP #'9'+1
         BNE L4C8A
         LDA #'1'     ; "1"
L4C8A    STA $C3
         LDA WORK_BUF+1
         CMP #'9'+1
         BNE L4C95
         LDA #'1'     ; "1"
L4C95    CMP $C3
         BNE L4C9F
         LDA #$00
         STA SCREEN_ON
         SEC 
         RTS 
;
L4C9F    CLC 
         RTS 
;
L4CA1    JSR L4C7D
         BCS L4CA7
         RTS 
;
L4CA7    LDA $C9
         CMP #$01
         BEQ L4C9F
         LDA SPARTADOS?
         BEQ L4CB7
         JSR CLOSE2
         JSR L3235
L4CB7    LDA #$01
         STA $C9
         JSR L4BA3
         LDX # low L3724
         LDY # high L3724
         JSR L3202
         JSR I_GETKBD
         RTS 
;
L4CC9    JSR L4C7D
         BCS L4CCF
         RTS 
;
L4CCF    LDA $C9
         CMP #$02
         BEQ L4C9F
         LDA #$02
         STA $C9
         JSR L4BA3
         LDX # low L3747
         LDY # high L3747
         JSR L3202
         JSR I_GETKBD
         RTS 
;
L4CE7
         dc.b $9B,$9B
         dc.b "Which drive to format?",0
;
L4D00
         dc.b $9B,$9B
         dc.b <+128>,"[1]"
	 dc.b " Single or "
         dc.b <+128>,"[2]"
	 dc.b " Double Density?",0
;
L4D24    dc.b $9B,"Format, Are you sure?",0
;
L4D3B
         dc.b $9B
         dc.b "Error: Bad Format! Check Disk/Drive",253,$9B,0
;
L4D62    dc.b $9B,"Format Completed.  Press "
         dc.b <+128>,"Return"
	 dc.b $9B,0
;
L4D84
         dc.b "D"
L4D85    dc.b $9B,$9B
         dc.b "Enter complete filename to delete:",$9B,0
;
L4DAB    dc.b $9B,"Delete this file, are you sure?",0
;
L4DCC    dc.b $9B,"File has been deleted!",0
;
L4DE4    dc.b $9B,"Enter encryption password:",$9B,0
;
;
L4E01    LDX # low L4CE7
         LDY # high L4CE7
         JSR L3202
L4E08    JSR I_GETKBD
         AND #$7F
         CMP #$1B    ; ESC
         BNE L4E12
         RTS 
;
L4E12    CMP #'1'
         BCC L4E08
         CMP #'9'+1
         BCS L4E08
         STA DISK_BUF+1
         AND #$0F
         STA $0301
         ORA #$30
         JSR I_PUTL
         LDA #'D'
         STA DISK_BUF
         LDA #':'
         STA DISK_BUF+2
         LDA #$9B    ; c/r
         STA DISK_BUF+3
         LDX # low R3166
         LDY # high R3166
L4E3A    CLC 
         JSR L4C49
         CPY #138    ;     $8A
         BCS L4E8D
         LDX # low L4D00
         LDY # high L4D00
         JSR L3202
L4E49    JSR I_GETKBD
         AND #$7F
         CMP #$1B    ; ESC
         BNE L4E53
         RTS 
;
L4E53    CMP #'1'     ;"1"
         BEQ L4E5B
         CMP #'2'     ; "2"
         BNE L4E49
L4E5B    PHA 
         JSR I_PUTL
         JSR I_CRLF
         PLA 
         AND #$01
         BNE L4E76
         STA R316B+2
         LDA #$04
         STA R316B
         LDA #$01
         STA R316B+1
         BNE L4E82
L4E76    LDA #$80    ;
         STA R316B+2
         ASL
         STA R316B
         STA R316B+1
L4E82    SEC 
         LDX # low R3166
         LDY # high R3166
         JSR L4C49
         JSR L4EC6
L4E8D    LDX # low L4D24
         LDY # high L4D24
         JSR L3202
         LDA #$FF
         STA $02FC   ; CH #764
         JSR L4C13
         CMP #$00
         BEQ L4EBA
         JSR CLOSE2
;
          XIO  DISK2,254,DISK_BUF,0,0,0
;
         BPL L4EBB
         LDX # low L4D3B
         LDY # high L4D3B
         JSR L3202
         JSR I_GETKBD
L4EBA    RTS 
;
L4EBB    LDX # low L4D62
         LDY # high L4D62
         JSR L3202
         JSR I_GETKBD
         RTS 
;
L4EC6    LDA #$FF
         STA $08     ; WARMST
         JMP ($0C)
;
L4ECD    LDY #$00
L4ECF    LDA $031A,Y
         CMP #'E'
         BEQ L4EDB
         INY 
         INY 
         INY 
         BNE L4ECF
L4EDB    LDA $031A+1,Y
         STA LC_PTR
         LDA $031A+2,Y
         STA LC_PTR+1
         LDY #$00
         LDA (LC_PTR),Y
         STA L3C63+1
         INY 
         LDA (LC_PTR),Y
         STA L3C60+1
         LDY #$06
         LDA (LC_PTR),Y
         STA L31E1+1 ; get key vector
         INY 
         LDA (LC_PTR),Y
         STA L31DE+1
         JMP INIT
;
L4F02    LDY #$00
L4F04    LDX #$00
L4F06    LDA $1B00,Y
         CMP L4F26,X
         BEQ L4F1D
L4F0E    CPX #$00
         BEQ L4F17
         DEY 
         DEX 
         JMP L4F0E
;
L4F17    INY 
         CPY #$FF
         BCC L4F04
         RTS 
;
L4F1D    INY 
         INX 
         CPX #$07
         BCC L4F06
         STX $D3
         RTS 
;
L4F26    dc.b "D1:AUTORU"
;
L4F2F    RTS 
L4F30    INX 
         STX $CB
         JSR L31AD
         BEQ L4F2F
         LDY #COMFNAM			;$21
         INC IN_BATCH
         LDX #$00
L4F3E    LDA (comtab),Y
         STA DIR_MASK,X
         CMP #$9B    ; C/R
         BEQ L4F4D
         INX 
         INY 
         BNE L4F3E
         BEQ L4F2F
;-----------------------------
; comtab+10 holds the buffer
; points to 
; 'filename dx:>filename.ext'
;-----------------------------
L4F4D    LDY #BUFOFF			;$0A
         LDA (comtab),Y
         TAY 
         LDA comtab
         CLC 
         ADC # low LBUF		;63     ; comtab+63 lbuf
         STA W_PTR
         LDA comtab+1
         ADC # high LBUF		;0
         STA W_PTR+1
         LDA (W_PTR),Y
         CMP #$9B    ; C/R
         BEQ L4F2F
         INY 
         LDA (W_PTR),Y
         CMP #'/'
         BNE L4F2F
         INY 
L4F6D    LDA (W_PTR),Y
         CMP #'S'
         BEQ L4F90
         CMP #'Q'
         BEQ L4F98
         CMP #'C'
         BEQ L4F9C
         CMP #'P'
         BEQ L4FA9
         CMP #'A'
         BEQ L4FA0
         CMP #'X'
         BEQ L4FA5
         CMP #' '	; SPACE
         BEQ L4FAD
L4F8B    LDA #$00
         STA PASSWORD
         RTS 
;
L4F90    LDA #$00
         STA SCREEN_ON
L4F94    INY 
         BNE L4F6D
         RTS 
;
L4F98    INC CW_QUERY
         BNE L4F94
L4F9C    INC CRUNCH_ONLY
         BNE L4F94
L4FA0    INC ADD_TO_ARCHIVE
         BNE L4F94
L4FA5    INC DISK_SWAP
         BNE L4F94
L4FA9    INC PASSWORD
         BNE L4F94
L4FAD    INY 
         LDA PASSWORD
         BEQ L4F8B
         LDX #$00
L4FB4    LDA (W_PTR),Y
         AND #$7F
         CMP #$60    ; rts
         BCC L4FBE
         SBC #$20
L4FBE    STA R317E,X
         CMP #$1B    ; ESC
         BEQ L4FD1
         CMP #$20    ; SPACE
         BEQ L4FD1
         INY 
         INX 
         CPX #21     ;$15
         BCC L4FB4
         BCS L4F8B
L4FD1    INX 
         STX $D1
         RTS 
;
L4FD5:
         dc.b "E:",$9B
L4FD8:
         dc.b "K:",$9B
         RTS 
;
         dc.b 0

;
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,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 Identifery always
; $1A for arc and alf files
;------------------------------
;
ARC_ID
         dc.b 0
;
;------------------------------
;  These are the ARC compress
; Types
;  * = Supported by this file
;------------------------------
;
; * $02 = Stored
; * $03 = Packed
;   $04 = Squeeze
; * $08 = Crunch
;   $09 = Squash
;   $0f = Alf'ed
;
;-------------------------------
;
ARC_VER
         dc.b 0
;
;-------------------------------
; File Name of compressed file
; always 13 bytes
;   'filename.ext'
;-------------------------------
;
ARC_NAME
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0
;
;------------------------------
;     File size compressed
;------------------------------
;
ARC_SIZE
         dc.b 0,0,0,0
;
ARC_DATE
         dc.b 0,0
;
ARC_TIME
         dc.b 0,0
;
;------------------------------
;    CRC checksum of file
;------------------------------
;
ARC_CRC
         dc.w 0
;
;------------------------------
;  File Size before Compressed
;------------------------------
;
ARC_OSIZE
         dc.b 0,0,0,0
;
;-------------------
; End of Arc Header
;-------------------
;
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,0,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0
;
R3166
         dc.b 0,0,0,0,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,0,0,0,0,0,0
         dc.b 0,0,0,0,0,0,0,0
         dc.b 0,0,0,0
;
R3192
         dc.b 0
;
R3193
         dc.b 0,0,0
;
;------------------------------
;SpartaDos dir
; 'filename com 11111 11-25-90 12:00a'
; 'dirname     <dir>  11-25-90 12:00a'
; ' 65535 Free Sectors'
;
;
DIR_BUFFER
         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
;
R31BE    dc.b 0,0   ; hold the color
;
R31C0    dc.b 0
;
R31C1    dc.w 0     ; memory pointer
;
R31C3    dc.w 0
;
R31C5    dc.w 0
;
R31C7    dc.b 0
;
R31C8    dc.b 0
;
win_end:	ds.b 0
;
