2474
|
1 *****************************************
|
|
2
|
|
3 * Convert a date to a string. This can be used
|
|
4 * for converting the system time as well as
|
|
5 * modify/create dates from files. The date must
|
|
6 * be 6 bytes -- null pad file dates.
|
|
7
|
|
8
|
|
9 * OTHER MODULES NEEDED: BIN_ASC
|
|
10
|
|
11 * ENTRY: X=binary date
|
|
12 * Y=buffer for ascii
|
|
13
|
|
14 * EXIT: all registers preserved (except cc)
|
|
15
|
|
16 nam Get ASCII Date
|
|
17 ttl Assembler Library Module
|
|
18
|
|
19
|
|
20 psect DATESTR,0,0,0,0,0
|
|
21
|
|
22 DATESTR:
|
|
23 pshs d,x,y,u
|
|
24 leau delims,pcr
|
|
25
|
|
26 loop
|
|
27 bsr get1 convert a byte
|
|
28 lda ,u+ get next delimiter
|
|
29 sta ,y+ add to ascii buffer
|
|
30 bne loop not end yet
|
|
31 puls d,x,y,u,pc
|
|
32
|
|
33 get1
|
|
34 ldb ,x+ get next byte to convert
|
|
35 clra only doing one byte value
|
|
36 pshs x save ptr to date packet
|
|
37 leas -8,s buffer for ascii number
|
|
38 tfr s,x
|
|
39 lbsr BIN_DEC convert
|
|
40 ldd ,x get ascii
|
|
41 tstb 1byte number?
|
|
42 bne get2 no
|
|
43 tfr a,b
|
|
44 lda #'0 leading "0"
|
|
45
|
|
46 get2
|
|
47 std ,y++ to buffer
|
|
48 leas 8,s
|
|
49 puls x,pc
|
|
50
|
|
51 delims
|
|
52 fcc '// ::'
|
|
53 fcb 0
|
|
54
|
|
55 endsect
|
|
56 t
|