Copy disk-cass (cdc)

Zdrojový kód

3      5b00            *s
4      5b00            ;==============================================================;
5      5b00            ;== Verzia 20 == "cdc" Copy disk->cass == 28.07.96 Busy soft ==;
6      5b00            ;==============================================================;
7      5b00            *z!
8      5b00            rom    =    #3c98	Call for switch to BS-ROM
9      5b00            ram    =    #3c9e	Call for switch to DOS-RAM
10     5b00            xrom   =    #3ca0	Call for between-bank calls
11     5b00            tape   =    #3ca2	Make tape as actual device
12     5b00            disk   =    #3ca4	Make disk as actual device
13     5b00            vars   =    23627	Basic system variable
14     5b00            eline  =    23641	Basic system variable
15     5b00            setlcx =    #15		DOS service: set load cursor
16     5b00            getsub =    #16		DOS service: get sub item
17     5b00            sub    =    #ffe0	Buffer for sub item
18     5b00             
19     5b00                   org  #5b00
20     5b00            p
21     5b00 cda43c     run    call disk		Make disk active
22     5b03 cdb016            call #16b0        Clear memory from eline to stkend
23     5b06 24                inc  h
24     5b07 22b25c            ld   (23730),hl   Set ramtop to stkend+256
25     5b0a 01761b            ld   bc,#1b76
26     5b0d 110313            ld   de,#1303
27     5b10 f9                ld   sp,hl
28     5b11 d5                push de
29     5b12 ed733d5c          ld   (#5c3d),sp
30     5b16 c5                push bc
31     5b17 cd6b0d            call #0d6b	Clear screen
32     5b1a 3e02              ld   a,#02	Set active #2 channel
33     5b1c cd0116            call #1601	for print into screen
34     5b1f e7         loop   rst  #20		Go to next character in line
35     5b20 cd821c            call #1c82        Get number from basic line
36     5b23 cd991e            call #1e99        Store number to register BC
37     5b26 cd2f5b            call dtexe	Copy BC-th file from disk to tape
38     5b29 df                rst  #18		Get actual character
39     5b2a fe2c              cp   ','          If it is comma,
40     5b2c 28f1              jr   z,loop	then next number follows
41     5b2e c9                ret		Else return and finish!
42     5b2f             
43     5b2f af         dtexe  xor  a            *** Copy BC-th file ***
44     5b30 328c5c            ld   (23692),a	Disable 'scrool?' message
45     5b33 c5                push bc
46     5b34 cddb5b            call dec		Print number in BC
47     5b37 3e3a              ld   a,':'
48     5b39 d7                rst  #10		Print ':'
49     5b3a c1                pop  bc
50     5b3b c5                push bc
51     5b3c 3e15              ld   a,setlcx	Set load cursor
52     5b3e cde35b            call dos		to BC-th file in directory
53     5b41 c1                pop  bc
54     5b42 3e16              ld   a,getsub	Get sub item
55     5b44 dd21e0ff          ld   ix,sub	[called directory entry]
56     5b48 cde35b            call dos
57     5b4b cae415            jp   z,#15e4      If file does not exist, error
58     5b4e             
59     5b4e ddcb007e          bit  7,(ix+info)	Is here valid file ?
60     5b52 cae734            jp   z,#34e7      If not, error Invalid argument
61     5b55 ddcb006e          bit  5,(ix+info)	Is here a body of file ?
62     5b59 2821              jr   z,netelo	If not, jump
63     5b5b dd7e1a            ld   a,(ix+lenb+2) Is body longer than 65535 ?
64     5b5e ddb61b            or   (ix+lenb+3)
65     5b61 c26c04            jp   nz,#046c     If yes, error Integer out of range
66     5b64             
67     5b64 012000            ld   bc,#20	If body present:
68     5b67 dd7e1c            ld   a,(ix+flag)	Get flagbyte of body
69     5b6a ed5bf8ff          ld   de,(sub+lenb) Get lenght of body
70     5b6e 2ab25c            ld   hl,(23730)	Get begin of free memory
71     5b71 e5                push hl
72     5b72 dde1              pop  ix
73     5b74 09                add  hl,bc	Test free memory
74     5b75 19                add  hl,de	If not enough memory for body,
75     5b76 3869              jr   c,outmem	then error Out of memory
76     5b78 37                scf		Loading body from disk
77     5b79 cd0208            call #0802	(disk is actual device)
78     5b7c             
79     5b7c 11e6ff     netelo ld   de,sub+name	Print filename from header
80     5b7f 010a00            ld   bc,10
81     5b82 cd3c20            call #203c
82     5b85 3a8d5c            ld   a,(23693)	If some color codes in filename,
83     5b88 328f5c            ld   (23695),a	then set permanent colors
84     5b8b ed4bf2ff          ld   bc,(sub+add)	Print address from header
85     5b8f cdd85b            call dvadec
86     5b92 ed4bf8ff          ld   bc,(sub+lenb) Print length of body
87     5b96 cdd85b            call dvadec
88     5b99 3ae0ff     hlava  ld   a,(sub+info) Is here valid header ?
89     5b9c cb67              bit  4,a          (or is it headerless file ?)
90     5b9e 281a              jr   z,telo	If headerless, skip save header
91     5ba0 f5                push af
92     5ba1 dd21e5ff          ld   ix,sub+type	Save header to tape directly
93     5ba5 21801f            ld   hl,#1f80
94     5ba8 111100            ld   de,17
95     5bab af                xor  a
96     5bac cdd004            call #04d0	This one calls save routine
97     5baf cd3f05            call #053f	after tape/disk test
98     5bb2 0680              ld   b,#80
99     5bb4 0b         www    dec  bc		Small pause
100    5bb5 78                ld   a,b		between header and body
101    5bb6 b1                or   c
102    5bb7 20fb              jr   nz,www
103    5bb9 f1                pop  af
104    5bba cb6f       telo   bit  5,a		If is here valid body,
105    5bbc 2811              jr   z,ok
106    5bbe 3afcff            ld   a,(sub+flag)	then save it
107    5bc1 dd2ab25c          ld   ix,(23730)	to tape directly too
108    5bc5 ed5bf8ff          ld   de,(sub+lenb)
109    5bc9 cdcd04            call #04cd
110    5bcc cd3f05            call #053f
111    5bcf 11eb5b     ok     ld   de,saved	Print text "saved"
112    5bd2 010800            ld   bc,kon-saved
113    5bd5 c33c20            jp   #203c
114    5bd8             
115    5bd8 3e3a       dvadec ld   a,':'
116    5bda d7                rst  #10
117    5bdb cd2b2d     dec    call #2d2b	Print decimal number
118    5bde c3e32d            jp   #2de3	from BC register
119    5be1             
120    5be1 cf         outmem rst  #08          Out of memory
121    5be2 03                db   #03
122    5be3             			Calling DOS service
123    5be3 cda03c     dos    call xrom		this is call to another bank
124    5be6 2000              dw   #20		Address of destination
125    5be8 d8                ret  c		If DOS service successed
126    5be9 cf                rst  #08		then return
127    5bea 0c                db   #0c          else error Break - cont repeats
128    5beb             
129    5beb 171b00     saved  db   23,32-5,0
130    5bee 53617665          db   'Saved'
            64          
131    5bf3            kon
132    5bf3            k
133    5bf3            l      =    k-p
134    5bf3             
135    5bf3                   org  #00		Sub item structure
136    0000            info   ds   #01		Information bits
137    0001                   ds   #04		Time & date of file
138    0005            type   ds   #01		|
139    0006            name   ds   #0a		| classic
140    0010            len    ds   #02		| 17-byte
141    0012            add    ds   #02		| tape header
142    0014                   ds   #02		|
143    0016            addb   ds   #02		Address of body
144    0018            lenb   ds   #04		Length of body (32 bit)
145    001c            flag   ds   #01		Flag bits

 add    0012  *  addb   0016  *  dec    5bdb  *  disk   3ca4  *
 dos    5be3  *  dtexe  5b2f  *  dvadec 5bd8  *  eline  5c59  *
 flag   001c  *  getsub 0016  *  hlava  5b99  *  info   0000  *
 k      5bf3  *  kon    5bf3  *  l      00f3  *  len    0010  *
 lenb   0018  *  loop   5b1f  *  name   0006  *  netelo 5b7c  *
 ok     5bcf  *  outmem 5be1  *  p      5b00  *  ram    3c9e  *
 rom    3c98  *  run    5b00  *  saved  5beb  *  setlcx 0015  *
 sub    ffe0  *  tape   3ca2  *  telo   5bba  *  type   0005  *
 vars   5c4b  *  www    5bb4  *  xrom   3ca0  *                

Bytes:243  labels:35  errors:0   




Popis
Utilitka pro kopírování z disku na kazetu. Ovládá se parametry zadávanými z příkazové řádky.

Poznámky
Nic...

Poslal
Busy