Error: illegal opcode jmp for mcu atmega8

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

really?

Is there another way to jump with 3 ticks?

sbic	PINx,SCKA
jmp analog_nextBit
jmp analog_nextBit

I guess this is the same.. but its read in at the wrong time..

nop
sbic	PINx,SCKA
rjmp analog_nextBit
rjmp analog_nextBit

what about


sbic	PINx,SCKA
nop
nop
rjmp analog_nextBit

would that work? I'm so floored by mega8's not supporting jmp that I cant even think straight.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is no need for a jmp on devices with 8k Flash (or less), because rjmp can reach all addresses. But rjmp takes only 2 cycles.

Stefan Ernst

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In this case jumping 3 is intended for timing reasons. Thanx for the explanation. Makes sense..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

But rjmp takes only 2 cycles.

...and 1 word.

"A long time ago, in a galaxy far far away", when Mega8s came out JMP was listed in the Instruction Set Summary, and IIRC Atmel ASM accepted it. There were discussions here on the topic--search them out. I forgot whether the JMP opcode actually worked or not.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

and IIRC Atmel ASM accepted it

This any use to you to over-ride the current behaviour? ;-)

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ah neat thx ;)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.