view lib/alib/datestr.as @ 3141:717ced83b885

coco3: Build SD card device descriptors for CoCo3FPGA Added "CC3FPGAFLAGS = $(AFLAGS) -DCC3FPGA=1 $(FLAGS)" to "level2/coco3/modules/makefile" for flagging Coco3FPGA specific features in modules sources. Added "llcoco3fpga", "ddsd0_coco3fpga", "sd0_coco3fpga", and "sd1_coco3fpga" to the "coco3/modules/makefile" - RBF section, which also now adds all to the "NITROS9/MODULES/RBF" on all disk images for building new Coco3FPGA disks from NitrOS9. Added new descriptor section to the "level2/coco3/modules/makefile" reflecting the new Coco3FPGA SD card descriptors and their flags.
author Bill Pierce <merlinious999@gmail.com>
date Sat, 04 Feb 2017 11:06:28 +0100
parents 03f26e88b809
children
line wrap: on
line source

*****************************************

* Convert a date to a string. This can be used
* for converting the system time as well as
* modify/create dates from files. The date must
* be 6 bytes -- null pad file dates.


* OTHER MODULES NEEDED: BIN_ASC

* ENTRY: X=binary date
*        Y=buffer for ascii

* EXIT: all registers preserved (except cc)

 nam Get ASCII Date
 ttl Assembler Library Module


 section .text

DATESTR:
 pshs d,x,y,u
 leau delims,pcr

loop
 bsr get1 convert a byte
 lda ,u+ get next delimiter
 sta ,y+ add to ascii buffer
 bne loop not end yet
 puls d,x,y,u,pc

get1
 ldb ,x+ get next byte to convert
 clra only doing one byte value
 pshs x save ptr to date packet
 leas -8,s buffer for ascii number
 tfr s,x
 lbsr BIN_DEC convert
 ldd ,x get ascii
 tstb 1byte number?
 bne get2 no
 tfr a,b
 lda #'0 leading "0"

get2
 std ,y++ to buffer
 leas 8,s
 puls x,pc

delims
 fcc '// ::'
 fcb 0

 endsect
t