use of blat instruction

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
markflamer
Junior Member
Posts: 6
Joined: Fri Aug 25, 2017 6:32 pm

use of blat instruction

Post 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!


User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post 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.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post 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
markflamer
Junior Member
Posts: 6
Joined: Fri Aug 25, 2017 6:32 pm

Post by markflamer »

Excellent. Thanks for the examples. These will be very helpful.
Post Reply