Skip to content

Commit

Permalink
Towards #20, control 7-SEG LED groups
Browse files Browse the repository at this point in the history
  • Loading branch information
TG9541 committed Apr 14, 2017
1 parent d65c4bc commit ba2de2e
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions forth.asm
Original file line number Diff line number Diff line change
Expand Up @@ -4959,10 +4959,14 @@ EMIT7S:
CP A,#' '
JRNE 1$

LDW Y,#LED7FIRST ; DROP DOLIT LED7FIRST
CALLR XGRPADD
EXGW X,Y
; CALL YSTOR
; LDW Y,#LED7FIRST ; DROP DOLIT LED7FIRST
LDW (X),Y
DoLitC (LED7LAST-LED7FIRST+1)
JP ERASE
;DoLitC (LED7LAST-LED7FIRST+1)
DoLitC HAS_LED7LEN
JP ERASE

1$: CP A,#'.'
JREQ E7DOT
Expand Down Expand Up @@ -4998,6 +5002,15 @@ E7DOT:
E7END:
JP DROP

; Helper routine for calculating LED group start adress
XGRPADD:
EXGW X,Y
LD A,LED7GROUP
LD XL,A
LD A,#HAS_LED7LEN
MUL X,A
ADDW X,#LED7FIRST
RET

; P7S ( c -- )
; Insert 7-seg pattern at left side of LED display buffer, rotate buffer left
Expand All @@ -5008,14 +5021,7 @@ E7END:
.ascii "P7S"
PUT7S:
.if gt,(HAS_LED7SEG-1)
EXGW X,Y
LD A,LED7GROUP

LD XL,A
LD A,#HAS_LED7LEN
MUL X,A
ADDW X,#LED7FIRST

CALLR XGRPADD
DEC A
PUSH A
1$: LD A,(1,X)
Expand Down

0 comments on commit ba2de2e

Please sign in to comment.