我想一个接一个地在七段显示器上显示两个符号。 但是使用以下代码,第一个符号无法查看,因为第二个符号会立即覆盖它。
如何在覆盖之前将第一个符号显示一段时间?
array: EQU $420
ledValues: EQU $410
ORG $400
varB: DC.W 2
index: DC.B 0
varN: DC.B 4
ORG ledValues
DC.B $5F, $06 , $3B, $2F, $66, $6D, $7D, $07, $7F, $6F
ORG $1000
DC.B 0
ORG $4000
Start:
LDD #$2000
STD $0002
LDS #$2000
ANDCC #$BF
Loop:
LDD varB
ADDD #1
LDX #10
IDIV
STD varB
LDAA index
LDY #array
STAB a, y
INCA
STAA index
CMPA varN
BEQ FinishGenerating
BRA Loop
FinishGenerating:
LDAA #0
STAA index
ShowElement:
LDAA index
LDY #array
LDAB a, y
LDY #ledValues
LDAA b,y
STAA $0000
InterruptCheck:
LDAA $1000
CMPB #1
BNE InterruptCheck
LDAB #10
STAB $1000
INC index
LDAB varN
CMPB index
BEQ FinishGenerating
BRA ShowElement
Finish:
BRA Finish
Interrupt:
LDAB #1
STAB $1000
RTI
ORG $FFF4
DC.W Interrupt
ORG $FFFE
DC.W Start