mirror of
https://github.com/byteworksinc/ORCALib.git
synced 2025-02-07 04:30:31 +00:00
Fix asctime() to properly print years 1000 through 9999.
Also, use a leading space rather than a leading 0 in days 1 through 9. This fixes the libca11.c test case.
This commit is contained in:
parent
73f04eaab4
commit
a77e44d7b5
27
time.asm
27
time.asm
@ -137,7 +137,10 @@ tm_wday equ 12
|
||||
ldy #tm_mday convert the day to a string
|
||||
lda [timeptr],Y
|
||||
jsr mkstr
|
||||
sta str+8
|
||||
bit #$00CF check for leading '0'
|
||||
bne lb1
|
||||
and #$FFEF convert leading '0' to ' '
|
||||
lb1 sta str+8
|
||||
ldy #tm_hour convert the hour to a string
|
||||
lda [timeptr],Y
|
||||
jsr mkstr
|
||||
@ -151,17 +154,21 @@ tm_wday equ 12
|
||||
jsr mkstr
|
||||
sta str+17
|
||||
ldy #tm_year convert the year to a string
|
||||
lda #'91'
|
||||
sta str+20
|
||||
lda [timeptr],Y
|
||||
cmp #100
|
||||
blt lb1
|
||||
ldx #'02'
|
||||
stx str+20
|
||||
sec
|
||||
sbc #100
|
||||
lb1 jsr mkstr
|
||||
ldy #19
|
||||
sec
|
||||
yr1 iny
|
||||
sbc #100
|
||||
bpl yr1
|
||||
clc
|
||||
yr2 dey
|
||||
adc #100
|
||||
bmi yr2
|
||||
jsr mkstr
|
||||
sta str+22
|
||||
tya
|
||||
jsr mkstr
|
||||
sta str+20
|
||||
lla timeptr,str
|
||||
|
||||
plb
|
||||
|
Loading…
x
Reference in New Issue
Block a user