User Tools

Site Tools


oric:cross_compiling_tools:cc65:main

Intro

CC65 is a cross compiler for 6502 based computers.

It works also with the oric.

How to install

Linux : install cc65 package and cc65-atmos package

Build C function with ca65

.export _print_char
.import popa ; import internal popa primitive
; print_char(char car) when function called, cc65 calls a pusha (8 bits) primitive, which push parameter  car on stack, last parameter push is the first pulled
_print_char:
  jsr popa ; Fetch car value
  sta $bb80 ; put it on the screen
  rts

zero page primitive

These primitives are defined in libsrc/runtine/zeropage.s of cc65

sp:	      	.res   	2      	; Stack pointer
sreg:	      	.res	2      	; Secondary register/high 16 bit for longs
regsave:      	.res	4      	; slot to save/restore (E)AX into
ptr1:	      	.res	2
ptr2:	      	.res	2
ptr3:	      	.res	2
ptr4:	      	.res	2
tmp1:	      	.res	1
tmp2:	      	.res	1
tmp3:	      	.res	1
tmp4:	      	.res	1
regbank:      	.res	6      	; 6 byte register bank
oric/cross_compiling_tools/cc65/main.txt · Last modified: 2019/03/31 04:00 by nekoniaow