annotate lib/alib/datestr.as @ 2852:f2e92661b4c6 lwtools-port

Makefiles: Always use macro for lwar and rm The LWAR macro is new, rm was still used in one place.
author Tormod Volden <debian.tormod@gmail.com>
date Fri, 12 Jul 2013 22:41:18 +0200
parents 03f26e88b809
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2783
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
1 *****************************************
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
2
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
3 * Convert a date to a string. This can be used
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
4 * for converting the system time as well as
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
5 * modify/create dates from files. The date must
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
6 * be 6 bytes -- null pad file dates.
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
7
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
8
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
9 * OTHER MODULES NEEDED: BIN_ASC
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
10
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
11 * ENTRY: X=binary date
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
12 * Y=buffer for ascii
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
13
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
14 * EXIT: all registers preserved (except cc)
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
15
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
16 nam Get ASCII Date
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
17 ttl Assembler Library Module
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
18
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
19
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
20 section .text
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
21
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
22 DATESTR:
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
23 pshs d,x,y,u
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
24 leau delims,pcr
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
25
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
26 loop
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
27 bsr get1 convert a byte
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
28 lda ,u+ get next delimiter
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
29 sta ,y+ add to ascii buffer
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
30 bne loop not end yet
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
31 puls d,x,y,u,pc
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
32
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
33 get1
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
34 ldb ,x+ get next byte to convert
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
35 clra only doing one byte value
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
36 pshs x save ptr to date packet
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
37 leas -8,s buffer for ascii number
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
38 tfr s,x
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
39 lbsr BIN_DEC convert
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
40 ldd ,x get ascii
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
41 tstb 1byte number?
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
42 bne get2 no
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
43 tfr a,b
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
44 lda #'0 leading "0"
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
45
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
46 get2
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
47 std ,y++ to buffer
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
48 leas 8,s
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
49 puls x,pc
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
50
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
51 delims
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
52 fcc '// ::'
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
53 fcb 0
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
54
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
55 endsect
03f26e88b809 Renamed files and setup for lwasm/lwlink work
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
56 t