[Coco] Assembly Code from within a C program.

coco at jechar.ca coco at jechar.ca
Thu Nov 2 15:18:43 EDT 2023


I Tried this code

#include <stdarg.h>
#include <coco.h>

int main(){

asm {
	leax hello,pcr
	ldy #strlen
	lda #1
	os9 I$WritLn
	bcs error
	clrb
error:
	os9 F$Exit
hello:
	fcc 'Hello world!'
	fcb 13
strlen:	equ *-hello
}
return 0;
}

The core code in the asm { } comes from a working OS9 6809 assembly
language program and I named the file hi09a.c

When I try to compile with the command
        cmoc --os9 hi09a.c
I get these errors.
        hi09a.s(73) : ERROR : Bad operand (,pcr)
        hi09a.s:00073  ldy #_strlen,pcr

Why is this not working ?

Charlie


More information about the Coco mailing list