| 1 |
|
| 2 |
|
| 3 |
RAM_END .EQU (DOWNLOAD_SIZE-1) |
| 4 |
FLASH_END .EQU<-->(FLASH_START + FLASH_SIZE) |
| 5 |
|
| 6 |
|
| 7 |
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~; |
| 8 |
; Registernames ; |
| 9 |
;__________________________________; |
| 10 |
; |
| 11 |
; with this architecture you can shift the IO register base-address by programming the config register |
| 12 |
; within 64 cycles after reboot. |
| 13 |
; if you don't, you loose some bytes of RAM since the IO registers and RAM share the zero page |
| 14 |
; if you do, you consume some more bytes of FLASH_ROM since you will need extended addressing mode |
| 15 |
; a good compromise is to shift base register address to 0x1000, load 0x1000 to X register and use |
| 16 |
; X-indexed addressing mode. Using Y-indexed addressing for register-IO is no advantage at all, |
| 17 |
; it has both more opcodes and longer execution time addressing mode for register IO |
| 18 |
; |
| 19 |
.IFNCONST REGBASE |
| 20 |
REGBASE .EQU 0 |
| 21 |
.ENDIF |
| 22 |
|
| 23 |
|
| 24 |
PA0 .EQU $01 |
| 25 |
PA1 .EQU $02 |
| 26 |
PA2 .EQU $04 |
| 27 |
PA3 .EQU $08 |
| 28 |
PA4 .EQU $10 |
| 29 |
PA5 .EQU $20 |
| 30 |
PA6 .EQU $40 |
| 31 |
PA7 .EQU $80 |
| 32 |
PA3_4 .EQU $18 |
| 33 |
PA7_5 .EQU $a0 |
| 34 |
|
| 35 |
|
| 36 |
CSSTRH .EQU REGBASE+$5c |
| 37 |
HPRIO .EQU REGBASE+$3c |
| 38 |
|
| 39 |
|
| 40 |
INIT .EQU $103d |
| 41 |
PORTA .EQU REGBASE+$00 |
| 42 |
PORTB .EQU REGBASE+$04 |
| 43 |
PORTC .EQU REGBASE+$03 |
| 44 |
PORTD .EQU REGBASE+$08 |
| 45 |
PORTE .EQU REGBASE+$0a |
| 46 |
DDRC .EQU REGBASE+$07 |
| 47 |
DDRD .EQU REGBASE+$09 |
| 48 |
CFORC .EQU REGBASE+$0b |
| 49 |
OC1M .EQU REGBASE+$0c |
| 50 |
OC1D .EQU REGBASE+$0d |
| 51 |
TCNT .EQU REGBASE+$0e |
| 52 |
|
| 53 |
TIC1 .EQU REGBASE+$10 |
| 54 |
TIC2 .EQU REGBASE+$12 |
| 55 |
TIC3 .EQU REGBASE+$14 |
| 56 |
|
| 57 |
TOC1 .EQU REGBASE+$16 |
| 58 |
TOC2 .EQU REGBASE+$18 |
| 59 |
TOC3 .EQU REGBASE+$1a |
| 60 |
TOC4 .EQU REGBASE+$1c |
| 61 |
TOC5 .EQU REGBASE+$1e |
| 62 |
|
| 63 |
TCTL1 .EQU REGBASE+$20 |
| 64 |
TCTL2 .EQU REGBASE+$21 |
| 65 |
TFLG1 .EQU REGBASE+$23 |
| 66 |
TMSK1 .EQU REGBASE+$22 |
| 67 |
TMSK2 .EQU REGBASE+$24 |
| 68 |
TFLG2 .EQU REGBASE+$25 |
| 69 |
PACTL .EQU REGBASE+$26 |
| 70 |
PACNT .EQU REGBASE+$27 |
| 71 |
|
| 72 |
SPCR .EQU REGBASE+$28 |
| 73 |
BAUD .EQU REGBASE+$2b |
| 74 |
SCCR1 .EQU REGBASE+$2c |
| 75 |
SCCR2 .EQU REGBASE+$2d |
| 76 |
SCSR .EQU REGBASE+$2e |
| 77 |
SCDR .EQU REGBASE+$2f |
| 78 |
|
| 79 |
|
| 80 |
ADCTL .EQU REGBASE+$30 |
| 81 |
ADR1 .EQU ADCTL+1 |
| 82 |
ADR2 .EQU ADCTL+2 |
| 83 |
ADR3 .EQU ADCTL+3 |
| 84 |
ADR4 .EQU ADCTL+4 |
| 85 |
|
| 86 |
BPROT .EQU REGBASE+$35 |
| 87 |
OPTION .EQU REGBASE+$39 |
| 88 |
EEPCTL .EQU REGBASE+$3b |
| 89 |
CONFIG .EQU REGBASE+$3f |
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|