Confusion about using WORD or Byte address in asm("jmp&

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

While using asm("jmp 0x1000"); in Studio6, which address I have to use? Byte address or WORD address?

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

Surely you can just check this:

int main(void) {
	asm("jmp 0x1234" );
}

If I build/run that in the AS6 simulator it arrives at word address 0x91A, byte address 0x91A * 2 = 0x1234.

So what you put in the JMP opcode is the BYTE destination of where you want to get to.

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

Or you could try to compile this

	asm("jmp 0x321");

:twisted: