Professional Documents
Culture Documents
Programa Contador Con Tabla
Programa Contador Con Tabla
;
; export symbols
;
XDEF _Startup
ABSENTRY _Startup
;
; variable/data section
;
ORG RAMStart ; Insert your data definition here
ExampleVar: DS.B 1
NUMERO: EQU $90
;
; code section
;
ORG ROMStart
_Startup:
LDHX #RAMEnd+1 ; initialize the stack pointer
TXS
CLI ; enable interrupts
BSR PROG_PORTS
mainLoop:
feed_watchdog
BSR BCD ;Convierte el
numero a 7 segmentos
STA PTCD ;escribe el numero en el
display
LDA RTCCNT
CBEQA #$01,ASE
BRA mainLoop
ASE:
LDA NUMERO
CBEQA #$09,RES
INC NUMERO
CLR RTCCNT
BRA mainLoop
;**************************************************************
;* Interrupt Vectors *
;**************************************************************
ORG $FFFA
DC.W spurious ;
DC.W spurious ; SWI
DC.W _Startup ; Reset