Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

illegal registers?

2006-12-26 by Thomas Keller

Here is an example of code I cannot assemble successfully.  Again, it is 
complaining about illegal register names, etc.:

.include "tn15def.inc"

; Define here the variables
;
.def  temp  =r16

; Define here Reset and interrupt vectors, if any
;
reset:
  rjmp start
  reti      ; Addr $01
  reti      ; Addr $02
  reti      ; Addr $03
  reti      ; Addr $04
  reti      ; Addr $05
  reti      ; Addr $06        Use 'rjmp myVector'
  reti      ; Addr $07        to define a interrupt vector
  reti      ; Addr $08
  reti      ; Addr $09
  reti      ; Addr $0A
  reti      ; Addr $0B        This is just an example
  reti      ; Addr $0C        Not all MCUs have the same
  reti      ; Addr $0D        number of interrupt vectors
  reti      ; Addr $0E
  reti      ; Addr $0F
  reti      ; Addr $10

; Program starts here after Reset
;
start:
  nop       ; Initialize here ports, stack pointer,
  nop       ; cleanup RAM, etc.
  nop       ;
  nop         ;

;
;    this table povides the data for the intesnity curve needed for
;    the beacon simlation.  the data represent the value sin3 * 255 for
;    each angle from 0 through 90  at .9 degree increments

TABLE:.db    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 3, 3, 4, 5, 6, 6, 8
     .db    9, 10, 11, 13, 14, 16, 18, 20, 22, 24, 26, 29, 31, 34, 36, 39
     .db    44, 48, 52, 55, 59, 62, 66, 70, 74, 78, 82, 86, 90, 94, 99
     .db    103, 108, 112, 117, 121, 126, 130, 135, 140, 144, 149, 153
     .db    158, 163, 167, 172, 176, 180, 185, 189, 193, 197, 201, 205, 209
     .db    212, 216, 219, 223, 226, 229, 232, 234, 237, 239, 242, 244, 246
     .db    247, 249, 250, 252, 253, 254, 255, 255, 255
    ;

DELAY:

   ld     r31,    0xff                    ; load 255 into temp register
   out r31,    TCNT1                    ; store in timer/counter 1
   ld     r16,    0xff                    ; store 255 into primary counter
   ld     r17,    0x49                    ; store 73  into secondary 
counter

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.