[Coco] inline asm in C

Retro Canada retrocanada76 at gmail.com
Thu Nov 1 14:02:15 EDT 2012


Hi,

What is the best way to put your embedded asm code to work with your C
local variables ?

I'm using global variables to do so, but I wonder if there is a better
way like this:

unsigned ASM1;
unsigned ASM2;

main()
{
  char *work_buf;
 unsigned start, fil_size;
...

ASM1 = work_buf + start;
ASM2 = fil_size - start;
#asm
 pshs a,x,y
 ldx ASM1
 ldy ASM2
_MOVE
 lda 1,x
 sta ,x+
 leay -1,y
 bne _MOVE
 puls a,x,y
#endasm

}

Thxs,

-- 
Panasonic FSA1-WSX
Commodore 64
Commodore 64C
Commodore 128
Apple //c
TRS-Color Computer 3
TI-99/4A
..and more coming!



More information about the Coco mailing list