I am starting to write a assembly program for a mc68hc12. I will be reading a 8 bit signed number into PortA and outputting the results to 7 segment LED's, common anode. I will be using Port P to ouput the segments and PortCan to control the LED's displayed. I assume I need 4 LED's, 1 for the sign and 3 LEDs for the max number of 128. If I hard wired the data in I get something like below. How would I go about pulling the data in from a port and then displaying the number on a set of LED's?
org $1000
ldaa #$ff
staa DDRP
ldaa #$7c
staa DDRCAN
forever ldy #display
next ldaa 0,y
staa PORTP
ldaa PROTCAN
anda #$83
staa PROTCAN
ldaa 1,y
oraa PORTCAN
staa PORTCAN
;a delay subroutine here to would cycle back to forever
display
fcc $30,$40
fcc $6d,$20
fcc $79,$10
fcc $33,$08
fcc $5b,$04
Thanks