Rename GET.TIME to DATE, single line

This commit is contained in:
Joshua Bell 2017-12-07 20:49:53 -08:00
parent 82a8ade241
commit b204ea7f2f
2 changed files with 27 additions and 49 deletions

View File

@ -4,8 +4,8 @@ CAFLAGS = --target apple2enh --list-bytes 0
CCFLAGS = --config apple2-asm.cfg
TARGETS = prodos.mod.BIN ns.clock.system.SYS cricket.system.SYS \
test.BIN get.time.BIN \
set.time.BIN set.date.BIN
test.BIN \
date.BIN set.time.BIN set.date.BIN
# For timestamps
MM = $(shell date "+%m")

View File

@ -1,31 +1,13 @@
.setcpu "6502"
.org $2000
.include "apple2.inc"
.include "common.inc"
start:
PRODOS_CALL MLI_GET_TIME, 0
jsr zstrout
HIASCIIZ "Time: "
lda TIMELO+1 ; hour
jsr cout_number
lda #HI(':') ; ':'
jsr COUT
lda TIMELO ; minute
jsr cout_number
jsr CROUT
jsr zstrout
HIASCIIZ "Date: "
;; Date
lda DATELO+1 ; month
ror a
@ -39,25 +21,45 @@ start:
and #%00001111
jsr cout_number
lda #(HI '/') ; /
lda #HI('/') ; /
jsr COUT
pla ; day
and #%00011111
jsr cout_number
lda #(HI '/') ; /
lda #HI('/') ; /
jsr COUT
pla ; year
jsr cout_number
lda #HI(' ')
jsr COUT
jsr COUT
;; Time
lda TIMELO+1 ; hour
jsr cout_number
lda #HI(':') ; ':'
jsr COUT
lda TIMELO ; minute
jsr cout_number
jsr CROUT
rts
pm_flag:
.byte 0
;;; ------------------------------------------------------------
.proc cout_number
ldx #(HI '0')
ldx #HI('0')
cmp #10 ; >= 10?
bcc tens
@ -72,31 +74,7 @@ tens: pha
jsr COUT
units: pla
ora #(HI '0')
ora #HI('0')
jsr COUT
rts
.endproc
.proc zstrout
ptr := $A5
pla ; read address from stack
sta ptr
pla
sta ptr+1
bne skip ; always (since data not on ZP)
next: jsr COUT
skip: inc ptr
bne :+
inc ptr+1
: ldy #0
lda (ptr),y
bne next
lda ptr+1 ; restore address to stack
pha
lda ptr
pha
rts
.endproc