Hi everyone!
I started programming A8 in the C (CC65).
My idea is doing main programming in C and call assembler subprograms.
It's work fine, but I don' t know how I can make a call the assembler procedure with arguments.
For test, I wrote small code for change border color.
I can't understand why it doesn't works, pls help me..
/*
/ main.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
extern void foo(uint8_t c);
int main() {
foo(10);
while(1){}
return 0;
}
;
; foo.s
;
.importzp sp, sreg, regsave
.export _foo
.segment "CODE"
.proc _foo: near
; get arguments
ldy #$00
lda (sp),y
; set border color
sta 712
.endproc
For building
cl65 -t atari main.c foo.s -o app