Thank you much for your help
I didn't realize that one can just put
__attribute__((interrupt)), I thought an address was required.
As for inline asm, I can only think the use would be to save on overhead JSR/RTS calls, especially if it's just a few instructions.
Regarding calling asm from C(manual Sections 18.2/18.3), I'm not sure I totally get it since I have thick skull.
Example: Say I want to pass the address to an asm function, would I do:
.c
Code:
extern void MBII_Display(uint16_t *pData);
int main ()
{
const char Data[6] = "Hello";
MBII_Display((uint16_t *)&Data);
...
}
.s
Code:
; MBII_API.s
;
.section code
.extern _Zp ; pseudo zero page registers
.public MBII_Display
MBII_Display:
pha
; store the Data addr at $00C8/$00C9
lda zp:_Zp
sta 0xC8
lda zp:_Zp+1
sta 0xC9
jsr 0xE042 ;display the null terminated chars who's address is at $00C8/$00C9
pla
rts
Thanks!
* UPDATE * - the above is correct. If passing down a byte it will use the accumulator, after that or if passing a 16 bit var, it'll use the _Zp pseudo registers, as per the 6502 guide. This info can be found at
18.3 Calling convention (P.94) (for v.3.6.10)
I haven't written anything huge, only test programs, but find this compiler works very well. Simple VIA(6522) port toggling, and counter IRQs. Sounds via a PSG(AY-3-8910), serial and memory tests all work without a hitch.
Thanks guys for your help!