Implement hex_set_24

This commit is contained in:
Byron Lathi
2022-03-12 21:55:17 -06:00
parent 226a2972cc
commit 1a9290b97b
2 changed files with 11 additions and 5 deletions

View File

@@ -3,10 +3,8 @@
#include "sevenseg.h"
int main() {
//hex_enable(0xff);
hex_set_8(0xb5, 0);
hex_set_8(0x00, 1);
hex_set_8(0xb0, 2);
hex_enable(0x3f);
hex_set_24(0xabcdef);
while(1);
return 0;
}

View File

@@ -1,5 +1,7 @@
.include "io.inc65"
.importzp sp, sreg
.export _hex_set_8
.export _hex_set_16
.export _hex_set_24
@@ -34,8 +36,14 @@ _hex_set_16:
lda #$0
rts
; @in A/X/sreg: val
; @out A: 0 for success, 1 for failure
; Sets the 3 pairs of hex digits for a 24 bit value
_hex_set_24:
lda #$1
sta SEVEN_SEG
stx SEVEN_SEG+1
lda sreg
sta SEVEN_SEG+2
rts
; @in A: mask