Since we do not have native C compilers on the Oric, this forum will be mostly be used by people using CC65 or the OSDK. But any general C related post will be welcome !
ldy #0
lda (sp),y ; address lo
sta tmp0
iny
lda (sp),y ; address hi
sta tmp0+1
...
But for returning data, I thought you had to put the low byte in A and the high byte in X but it looks like it is the reverse.
Or is it that when returning a single byte (a char for example) you need to put it in X ?
@iss :
As the low and high values are inverted on rts assembler routine, can you tell us if it the same way to pass parameters from osdk to ass compared to cc65 to assembler code.
coco.oric as DidierV, CEO Member
Historic owner of Oric, Apple II, Atari ST, Amiga
Passing parameters from C to assembler is the same in OSDK and CC65.
Parameters can be accessed using the stack pointer sp in the same way in OSDK and CC65. Note: sp is NOT the processor's stack pointer (i.e. the one in memory range $100-$1FF)!
The only difference is that in CC65 you have to properly align the 'sp' before returning from the assembler routine.
For this are predefined functions 'incsp1', 'incsp2', 'incsp3'. etc. The number represents the sum of all parameters in bytes.