poke function ....
Art Berggreen
art@acc.com
Tue Sep 22 08:21:00 GMT 1998
>>same model, an m68k routine could look like:
>>
>>/* pokeb(char *base_addr, int offset, char data) */
>> .global pokeb
>>pokeb:
>> move.l 4(%sp),%a0 /* get base_addr */
>> add.l 8(%sp),%a0 /* add offset */
>> move.b 15(%sp),(%a0) /* move data byte */
>> rts
>>
>>Art
>
>only if sizeof(int) == sizeof(long),
>if sizeof(int) == sizeof(short), then
>it would be
>
> move.l 4(%sp),%a0
> add.w 8(%sp),%a0
> move.b 11(%sp),(%a0)
> rts
True. We always run m68k GCC with the default mode of long ints.
But porting from 80x86 might want short ints. Another good reason
to stick with C.
Art
More information about the crossgcc
mailing list