[Icc-mot] Inline asm quirks

Gene Norris genenorris at spotengineering.com
Fri Mar 30 07:18:07 PST 2007


I should correct myself...

_Pointers/Addresses
If I can get this from C code
; 	address = &data[1];
	leay 13,S
	sty 6,S
I would like to see this from assembly
;       asm("leay %&data[1]");
	leay 13,S

_Structures/Unions (not pointers)
Should work as I described before:
;   c = data.c[0];
	movb 6,S,5,S
;   asm("ldab %data.c[0]");
	ldab 6,S

and
;   c = data.c[4];
	movb 10,S,5,S
; asm("ldab %data.c[4]");
	ldab 10,S

Edward is right:
> Edward Karpicz wrote:
>> This your code can't fit single asm line.
>>
>>    "adcb  %data_ptr->uc[0]"   could be something like "adcb  [9,S]"
>>
>> but there's no single line solution for
>>
>>     adcb   %data_ptr->uc[1]
Pointers would be too difficult!

for example %var1[var2]
The programmer would have to take that in steps...


-- 
Gene Norris
Chief Engineer

SPOT Engineering, Inc.
1261 Campground Road
Lancaster, Ohio 43130
740.654.0880
FAX.654.0889

http://www.spotengineering.com/



More information about the Icc-mot mailing list