Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- * filename: lab2base.asm
- * System Addresses
- RAM equ $0000
- REG equ $1000 ;power up register base address
- STACK equ $7FFF ;put stack at top of ram
- EEPROM equ $8000 ;for 32K EEPROM
- INCLUDE "hc11.inc"
- * Operational Constants
- LF equ $A
- SP equ $20
- org RAM
- * System Variables
- ; none
- ********************************** Program *******************************
- org EEPROM
- start:
- sei ;this is where the RESET vector points
- *NOTE- These instructions must be executed within 64 E-cycles of reset.
- ldaa #%0001000 ;define system options
- staa option
- lds #STACK ;initialize stack pointer
- ldaa #%00000000 ;setup tmsk2
- staa tmsk2
- ldaa #%00000000 ;initialize pactl
- staa pactl
- clr sccr1
- ldaa #%00001100 ;setup serial port
- staa sccr2
- ldaa #%00000010 ;initialize PORTD
- staa ddrd
- ldaa #%00110000 ;baud=9600 w/8MHz crystal
- staa baud
- cli ;enable interrupts
- begin
- ldaa #LF ;print new line
- bsr SendChar
- ldaa #'O' ;print "0"
- bsr SendChar
- ldaa #'K' ;print "K"
- bsr SendChar
- ldaa #LF ;print new line
- bsr SendChar
- loop:
- largeNum RMW 1
- smallNum RMB 1
- ldd #$1A82
- ldaa #$1C
- std largeNum
- sta smallNum
- loop0: dec largeNum
- loop1: dec smallNum
- bne loop1
- bne loop0
- ldd #$1645
- std cleanUpMem
- loop2: dec cleanUpMem
- bne loop2
- nop
- bra loop
- SendChar
- tst scsr
- bpl SendChar
- staa scdr
- rts
- org $FFD6
- * Interrupt and reset vectors.
- SCI_VECT FDB start
- SPI_VECT FDB start
- PAI_VECT FDB start
- PAO_VECT FDB start
- TOF_VECT FDB start
- TOC5_VECT FDB start
- TOC4_VECT FDB start
- TOC3_VECT FDB start
- TOC2_VECT FDB start
- TOC1_VECT FDB start
- TIC3_VECT FDB start
- TIC2_VECT FDB start
- TIC1_VECT FDB start
- RTI_VECT FDB start
- IRQ_VECT FDB start
- XIRQ_VECT FDB start
- SWI_VECT FDB start
- TRAP_VECT FDB start
- COP_FAIL_VECT FDB start
- COP_CMF_VECT FDB start
- RESET_VECT FDB start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement