annotate lib/alib/ftrans.as @ 3220:9ccec98c9897

Updated IDE Driver makefile so it will have place holders for dsk, dskclean, and dskcopy so that make does not error out when chaining into the driver tree to build disk images where applicable.
author David Ladd <drencor-xeen@users.sourceforge.net>
date Wed, 20 Dec 2017 16:10:50 -0600
parents 03f26e88b809
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2474
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
1 ***************************************
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
2
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
3 * Subroutine to transfer data for one file to another
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
4
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
5 * OTHER MODULES NEEDED: none
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
6
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
7 * ENTRY: A=source path
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
8 * B=destination path
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
9 * Y=number of bytes to transfer
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
10 * X=buffer for this routine
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
11 * U=buffer size
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
12
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
13
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
14 * EXIT: CC carry set if error (from I$Read or I$Write)
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
15 * B error code if any
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
16
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
17 nam File data transfer
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
18 ttl Assembler Library Module
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
19
2782
aaba193af04f Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2474
diff changeset
20 section .data
2474
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
21
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
22 * this sets up a stack frame used for variable references
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
23
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
24 count rmb 2 number of bytes to transfer (2nd Y)
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
25 inpath rmb 1 source file (A)
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
26 Breg rmb 1 copy of B register
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
27 outpath equ Breg dest file
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
28 buffer rmb 2 buffer memory (X)
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
29 rmb 2 copy of Y
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
30 bufsize rmb 2 buffer size (U)
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
31
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
32 endsect
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
33
2782
aaba193af04f Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2474
diff changeset
34 section .text
2474
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
35
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
36 FTRANS:
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
37 pshs a,b,x,y,u
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
38 pshs y
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
39
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
40 loop
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
41 ldy count,s bytes left to send
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
42 beq exit all done?
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
43
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
44 lda inpath,s source file
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
45 ldx buffer,s buffer area
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
46 cmpy bufsize,s is remainder > buffer size
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
47 blo get no, get all of remainder
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
48 ldy bufsize,s use buffer size
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
49
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
50 get
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
51 os9 I$Read get data
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
52 bcs error
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
53 lda outpath,s
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
54 os9 I$Write
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
55 bcs error
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
56
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
57 pshs y number of bytes got/sent
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
58 ldd count+2,s adjust count remaining
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
59 subd ,s++
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
60 std count,s
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
61 bra loop
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
62
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
63 exit
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
64 clra no error
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
65 bra exit2
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
66
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
67 error
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
68 coma signal error
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
69 stb Breg,s set B
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
70
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
71 exit2
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
72 puls y
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
73 puls a,b,x,y,u,pc
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
74
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
75 endsect