Skip to content

Commit

Permalink
Ajout d'un test pour la validité du mois affiché
Browse files Browse the repository at this point in the history
  • Loading branch information
assinie committed Nov 5, 2024
1 parent a3666a2 commit 745afbc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![build](https://github.com/oric-software/datetime/actions/workflows/main.yml/badge.svg)](https://github.com/orix-software/datetime/actions/workflows/main.yml)
[![build](https://github.com/orix-software/datetime/actions/workflows/main.yml/badge.svg)](https://github.com/orix-software/datetime/actions/workflows/main.yml)

# Description
Utility to display or set the date and time from a DS1501
Expand Down
21 changes: 17 additions & 4 deletions src/main.s
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,26 @@ typedef .struct ds1501
sta buffer+1

lda ds1501::month
; Conversion BCD -> binaire simplifiée
cmp #$10
bcc *+4
sbc #06

; Vérifie que le mois est < 13
cmp #13
bcc month

; Erreur numéro de mois incorrect,
; on affiche la valeur
lda ds1501::month
jsr byte2str
stx buffer+3
sta buffer+4
lda #'?'
sta buffer+5
bne century

month:
asl
asl
tax
Expand All @@ -274,10 +290,7 @@ typedef .struct ds1501
cpy #$02
bne loop_month

; jsr byte2str
; stx buffer+3
; sta buffer+4

century:
lda ds1501::century
jsr byte2str
stx buffer+6+2
Expand Down

0 comments on commit 745afbc

Please sign in to comment.