| 1234567891011121314151617181920212223242526272829303132 |
- XDEF Entry
- XREF __SEG_END_SSTACK
- Variables: Section
- VAR_1 dc.b $EC
- Constants: Section
- DDR_S equ $24A
- DDR_T equ $242
- PORT_T equ $240
- PORT_S equ $248
- Code: Section
- Entry:
- BSET DDR_S,#$FF ;set all bits of DDR_S (output)
- BSET DDR_T,#$00 ;clear all bits of DDR_T (input)
- LDAA #$00 ;all 0's (off)
- STAA PORT_S ;turn off all LED's
- LDAA VAR_1 ;read VAR_1 into acc. A
- ANDA #%11011111 ;clear bit 6
- ORAA #%00001000 ;set bit 4
- STAA VAR_1 ;store again into VAR_1
- CheckDIP:
- LDAB PORT_T ;read the DIP switches into acc. B
- ANDB #%00000001 ;mask all but switch bit 0
- BEQ CheckDIP ;check switches in a loop (exit loop if switch bit 0 is set)
- LDAA VAR_1 ;read VAR_1 back into acc. A
- STAA PORT_S ;write acc. A (set to VAR_1) to LED's
|