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]

poke function ....

Hii all,
Right now, I'm trying to porting 80x86 code to M68K.
In Intel, there is a function: pokeb(base_addr,offset,data)
and using Borland C Compiler will translated like this :

	/* Assembly Routine to do a pokeb                */
	/* bp points at stack                            */
	/* stack + 0xc = data                            */
	/* stack + 0xa = register offset from base addr. */
	/* es - set to be segment value (CS)             */
	/* si - set to be register offset                */
	/* al - data                                     */

	mov ax,[base_addr]
	mov es,ax
	mov al,[bp+0x0C]
	mov si,[bp+0x0A]
	mov es:[si],al

I'm a high level programmer, and I don't really understand 
where this 0x0c and 0x0a come from, and how could in 0x0c
is data, and in 0x0a is register offset??
Can somebody explain step by step what the assembler
trying to do??
Is there anybody M68K programmer know any C function to replace
pokeb, peekb function in M68K??

Email :