This is the mail archive of the mailing list for the crossgcc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: poke function ....

At 12:03 PM -0400 9/18/98, Art Berggreen wrote:

>Since the m68k is not a segmented memory machine, the pokeb() function
>wouldn't need a base and offset, but in the interest of following the
>same model, an m68k routine could look like:
>/* pokeb(char *base_addr, int offset, char data) */
>	.global 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

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)