poke function ....
ralph muha
rmuha@minimal.com
Mon Sep 21 18:10:00 GMT 1998
At 1:25 PM -0400 9/21/98, Dony wrote:
>If it is the case, the assembler pokeb suppose to be like this :
>
> move.l 4(%sp),%a0 /* get base_addr */
> swap %a0 /* exchange 16 bit halves, so that
>later on */
> /* address will be base_addr+offset */
> add.l 8(%sp),%a0 /* add offset */
> move.b 15(%sp),(%a0) /* move data byte */
> rts
nope, you don't need to swap anything.
and if you really need the separate address
and offset, just include it in the C code:
pokeb(char *base, int offset, char data)
{
base[offset] = data;
}
better yet, use gcc's -S flag and you can look at the
assembly language output of the compiler
r
More information about the crossgcc
mailing list