Now that's really funny. With a slightly trimmed version of 'main.c' ...groepaz wrote:try with -Osir the generated code is large in some cases, but its not *that* bad really
Code: Select all
typedef unsigned char byte;
#define SCREEN_ADDR (0x1E00)
#define COL_ADDR (0x9600)
void main()
{
*((byte *)(SCREEN_ADDR+1)) = 0x01;
*((byte *)(COL_ADDR+1)) = 0x02;
*((byte *)(SCREEN_ADDR+2)) = 0x02;
*((byte *)(COL_ADDR+2)) = 0x03;
loop: goto loop;
}
Code: Select all
;
; File generated by cc65 v 2.13.2
;
.fopt compiler,"cc65 v 2.13.2"
.setcpu "6502"
.smart on
.autoimport on
.case on
.debuginfo off
.importzp sp, sreg, regsave, regbank, tmp1, ptr1, ptr2
.macpack longbranch
.forceimport __STARTUP__
.export _main
; ---------------------------------------------------------------
; void __near__ main (void)
; ---------------------------------------------------------------
.segment "CODE"
.proc _main: near
.segment "CODE"
lda #$01
sta $1E01
lda #$02
sta $9601
sta $1E02
lda #$03
sta $9602
L0017: jmp L0017
.endproc
Maybe I'm just used to a C programming style that doesn't want to miss out on the standard library functions. On non-65xx platforms, that is. Of course C always offers you to create an own library, when the supplied implementation doesn't suit you.