Page 1 of 1

use of blat instruction

Posted: Sat Sep 01, 2018 3:59 am
by markflamer
What is the proper use of this instruction?

Code: Select all

	ldc r11,0x0
	blat optable
	.section .cp.rodata, "ac", @progbits
optable:
	.short notmain
../src/pipe.s:28: Error: A00050 Instruction 'blat' does not allow a label as an immediate
Trying to build a jump table that jumps to the address in the table "optable" indexed by a register.....

Thanks!

Re: use of blat instruction

Posted: Mon Sep 03, 2018 4:13 pm
by mon2
As a possible workaround, can you try the following?

Code: Select all

   ldc r11,0x0
   bla optable
   .section .cp.rodata, "ac", @progbits
optable:
   .short notmain
Does this work or raise an error? Be sure that the address is 16 bit aligned.

Re: use of blat instruction

Posted: Mon Sep 03, 2018 5:36 pm
by mon2
Also, do study this amazing project which was coded all in assembler for possible assistance:

http://www.xcore.com/viewtopic.php?f=21 ... fbf#p27495

http://www.xcore.com/files/project_builds/isaflop.zip

Code: Select all

http://www.xcore.com/files/project_builds/isaflop.zip

Re: use of blat instruction

Posted: Wed Sep 05, 2018 1:26 am
by markflamer
Excellent. Thanks for the examples. These will be very helpful.