Hi,
I want to call a procedure written in assembly language from C code. In this regard I downloaded the document
www.zilog.com/docs/appnotes/an0333.pdf from Zilog website. On page 5 of this document its mentioned that "The arguments are placed on the stack and their offsets from the Stack Pointer (SP) at the
entry point of an assembly function are:
arga: -3(SP)
argb: -6(SP)
argc: -12(SP)
argd: -15(SP)
arge: -18(SP)
However on page 6 the assemble routine shows that the first argument offset is at 6 and the second argument offset is at 9. i.e.
ld de, (ix+6) ; get first variable and load onto register de
ld hl, (ix+9) ; get second variable and load onto register hl
add hl, de ; add the two values
Shouldn't the first argument offset be at 3 and the second one at 6?
Kindly explain this ambiguity ?.
Regards,
Nick.