├── libsrc ├── cx16 │ ├── cpeeks.s │ ├── status.s │ ├── devnum.s │ ├── conio.s │ ├── _scrsize.s │ ├── joy_stddrv.s │ └── joy_stat_stddrv.s ├── c16 │ ├── get_tv.s │ ├── status.s │ ├── devnum.s │ ├── libref.s │ ├── clrscr.s │ ├── _scrsize.s │ ├── conio.s │ ├── joy_stddrv.s │ ├── joy_stat_stddrv.s │ ├── joy │ │ └── c16-stdjoy.s │ ├── kclose.s │ ├── fast.s │ └── slow.s ├── atari5200 │ ├── cclear.s │ ├── ctype.s │ ├── libref.s │ ├── setcursor.s │ ├── wherex.s │ ├── wherey.s │ ├── cartyear.s │ ├── gotox.s │ ├── gotoy.s │ ├── joy_stat_stddrv.s │ ├── cartname.s │ └── _scrsize.s ├── atari │ ├── mou │ │ ├── atrami.s │ │ └── atrtrk.s │ ├── scrdev.s │ ├── findfreeiocb.s │ ├── mcbdefault.s │ ├── mcbtxtchar-char.s │ ├── cartinit.s │ ├── inviocb.s │ ├── wherex.s │ ├── wherey.s │ ├── sdxtime-bss.s │ ├── mouseref.s │ ├── _sys.s │ ├── gotoy.s │ ├── _scrsize.s │ ├── bordercolor.s │ ├── do_oserr.s │ ├── libref.s │ ├── save_area.inc │ ├── gotox.s │ ├── mouse_stddrv.s │ ├── tgi_stddrv.s │ ├── toascii.s │ ├── exehdr.s │ ├── exetrailer.s │ ├── joy_stddrv.s │ └── targetutil │ │ └── Makefile.inc ├── geos-cbm │ ├── Makefile.inc │ ├── system │ │ ├── tobasic.s │ │ ├── libref.s │ │ ├── setdevice.s │ │ ├── initdoneio.s │ │ └── getserialnumber.s │ ├── disk │ │ ├── exitturbo.s │ │ ├── enterturbo.s │ │ ├── purgeturbo.s │ │ ├── newdisk.s │ │ ├── setgeosdisk.s │ │ ├── dio_qsize.s │ │ ├── dio_qcount.s │ │ └── changediskdevice.s │ ├── graph │ │ └── setnewmode.s │ └── memory │ │ ├── fetchram.s │ │ └── stashram.s ├── geos-apple │ ├── Makefile.inc │ └── disk │ │ ├── enterturbo.s │ │ ├── purgeturbo.s │ │ └── exitturbo.s ├── atmos │ ├── crt0.s │ ├── tapehdr.s │ ├── libref.s │ ├── joy_stddrv.s │ ├── tgi_stddrv.s │ ├── gotox.s │ ├── gotoy.s │ ├── joy_stat_stddrv.s │ ├── tgi_stat_stddrv.s │ ├── wherex.s │ ├── wherey.s │ └── _scrsize.s ├── telestrat │ ├── crt0.s │ ├── libref.s │ ├── wherey.s │ ├── wherex.s │ ├── gotoy.s │ ├── tgi_stat_stddrv.s │ ├── gotox.s │ ├── sysremove.s │ ├── bgcolor.s │ ├── _scrsize.s │ └── textcolor.s ├── apple2 │ ├── tgi │ │ └── a2.hi.fnt │ ├── clrscr.s │ ├── sysrmdir.s │ ├── wherex.s │ ├── tgi_colors.s │ ├── iobuf.s │ ├── dioclose.s │ ├── wherey.s │ ├── libref.s │ ├── _scrsize.s │ ├── tgi_stddrv.s │ ├── filedes.inc │ ├── mouse_stddrv.s │ ├── gotoy.s │ └── joy_stddrv.s ├── common │ ├── _poserror.c │ ├── toascii.s │ ├── strtoimax.s │ ├── strtoumax.s │ ├── errno.s │ ├── tgi_colors.s │ ├── unlink.s │ ├── _oserror.s │ ├── doesclrscr.s │ ├── strcoll.s │ ├── strxfrm.c │ ├── abort.c │ ├── ctime.s │ ├── _afailed.c │ └── _hextab.c ├── c64 │ ├── acc_c128_speed.s │ ├── status.s │ ├── devnum.s │ ├── mcbspritedata.s │ ├── clrscr.s │ ├── conio.s │ ├── _scrsize.s │ ├── tgi_stddrv.s │ ├── joy_stddrv.s │ ├── mouse_stddrv.s │ ├── tgi_stat_stddrv.s │ ├── joy_stat_stddrv.s │ ├── mouse_stat_stddrv.s │ ├── soft80_cpeekrevers.s │ ├── soft80_scrsize.s │ ├── waitvsync.s │ ├── kbrepeat.s │ └── soft80mono_cpeekcolor.s ├── c128 │ ├── status.s │ ├── devnum.s │ ├── clrscr.s │ ├── conio.s │ ├── tgi_stddrv.s │ ├── joy_stddrv.s │ ├── mouse_stddrv.s │ ├── c64mode.s │ ├── tgi_stat_stddrv.s │ ├── joy_stat_stddrv.s │ ├── mouse_stat_stddrv.s │ ├── slow.s │ └── kbrepeat.s ├── pet │ ├── status.s │ ├── devnum.s │ ├── libref.s │ ├── cpeekcolor.s │ ├── conio.s │ ├── joy_stddrv.s │ ├── kreadst.s │ ├── joy_stat_stddrv.s │ ├── kernal.s │ ├── ksetnam.s │ ├── _scrsize.s │ ├── kbsout.s │ ├── kckout.s │ ├── kchkin.s │ └── krdtim.s ├── plus4 │ ├── status.s │ ├── devnum.s │ ├── irq.s │ ├── libref.s │ ├── conio.s │ ├── joy_stddrv.s │ ├── joy_stat_stddrv.s │ ├── waitvsync.s │ ├── kbrepeat.s │ └── fast.s ├── vic20 │ ├── status.s │ ├── devnum.s │ ├── clrscr.s │ ├── conio.s │ ├── _scrsize.s │ ├── libref.s │ ├── joy_stddrv.s │ ├── waitvsync.s │ ├── joy_stat_stddrv.s │ └── kbrepeat.s ├── cbm510 │ ├── devnum.s │ ├── irq.s │ ├── _scrsize.s │ ├── libref.s │ ├── joy_stddrv.s │ ├── kscreen.s │ ├── mouse_stddrv.s │ ├── joy_stat_stddrv.s │ ├── kiobase.s │ ├── mouse_stat_stddrv.s │ ├── krdtim.s │ └── ksettim.s ├── cbm610 │ ├── devnum.s │ ├── irq.s │ ├── cpeekcolor.s │ ├── libref.s │ ├── _scrsize.s │ ├── kscreen.s │ ├── kiobase.s │ ├── krdtim.s │ └── ksettim.s ├── cbm │ ├── clinechars.s │ ├── c_udtim.s │ ├── c_scnkey.s │ ├── c_clall.s │ ├── c_unlsn.s │ ├── c_clrch.s │ ├── c_talk.s │ ├── c_untlk.s │ ├── c_ciout.s │ ├── c_listen.s │ ├── c_tksa.s │ ├── cbm_close.s │ ├── c_second.s │ ├── mcbpointercolor.s │ ├── c_bsout.s │ ├── c_close.s │ ├── c_getin.s │ ├── c_acptr.s │ ├── filetype.s │ ├── wherex.s │ ├── wherey.s │ ├── c_basin.s │ ├── c_readst.s │ ├── gotox.s │ ├── gotoy.s │ ├── c_iobase.s │ └── c_open.s ├── pce │ ├── libref.s │ ├── callptr4.s │ ├── joy_stat_stddrv.s │ └── call.s ├── gamate │ ├── libref.s │ ├── joy_stat_stddrv.s │ ├── _scrsize.s │ ├── wherex.s │ ├── wherey.s │ ├── extzp.s │ └── nmi.s ├── supervision │ ├── libref.s │ └── joy_stat_stddrv.s ├── creativision │ ├── libref.s │ ├── _scrsize.s │ ├── cgetc.s │ ├── joy_stat_stddrv.s │ ├── wherex.s │ └── wherey.s ├── conio │ └── _cursor.s ├── lynx │ ├── libref.s │ ├── tgi_stddrv.s │ ├── tgi_colors.s │ ├── tgi_irq.s │ ├── oserror.s │ ├── joy_stat_stddrv.s │ └── tgi_stat_stddrv.s ├── nes │ ├── libref.s │ ├── tgi_stddrv.s │ ├── tgi_stat_stddrv.s │ ├── joy_stat_stddrv.s │ ├── wherex.s │ ├── wherey.s │ ├── waitvsync.s │ └── irq.s ├── osic1p │ ├── osic1p.inc │ ├── extzp.inc │ ├── revers.s │ ├── wherex.s │ ├── wherey.s │ ├── gotox.s │ └── gotoy.s ├── geos-common │ ├── system │ │ ├── panic.s │ │ ├── firstinit.s │ │ ├── callroutine.s │ │ ├── mainloop.s │ │ ├── tgi_stddrv.s │ │ ├── joy_stddrv.s │ │ ├── enterdesktop.s │ │ └── getrandom.s │ ├── menuicon │ │ ├── redomenu.s │ │ ├── recovermenu.s │ │ ├── gotofirstmenu.s │ │ ├── dopreviousmenu.s │ │ ├── recoverallmenus.s │ │ ├── doicons.s │ │ └── domenu.s │ ├── mousesprite │ │ ├── mouseup.s │ │ ├── mouseoff.s │ │ ├── clearmousemode.s │ │ ├── inittextprompt.s │ │ ├── startmousemode.s │ │ ├── enablsprite.s │ │ └── disablsprite.s │ ├── graph │ │ ├── rectangle.s │ │ ├── setpattern.s │ │ ├── usesystemfont.s │ │ ├── framerectangle.s │ │ ├── invertrectangle.s │ │ ├── imprintrectangle.s │ │ ├── recoverrectangle.s │ │ ├── getcharwidth.s │ │ ├── bitmapup.s │ │ ├── invertline.s │ │ ├── loadcharset.s │ │ ├── recoverline.s │ │ ├── graphicsstring.s │ │ └── putstring.s │ ├── common │ │ ├── memcpy.s │ │ ├── memmove.s │ │ └── abort.c │ ├── runtime │ │ └── call.s │ ├── drivers │ │ └── mouse_stddrv.s │ ├── dlgbox │ │ └── rstrfrmdialogue.s │ ├── disk │ │ ├── gettrse.s │ │ ├── opendisk.s │ │ ├── getdirhead.s │ │ └── putdirhead.s │ ├── memory │ │ ├── copystring.s │ │ ├── doublepop.s │ │ └── initram.s │ └── file │ │ ├── readbyte.s │ │ ├── nextrecord.s │ │ ├── insertrecord.s │ │ ├── pointrecord.s │ │ └── previousrecord.s ├── runtime │ ├── callptr4.s │ ├── jmpvec.s │ ├── incax3.s │ ├── incax5.s │ ├── incax6.s │ ├── incax7.s │ ├── incax8.s │ ├── return0.s │ ├── return1.s │ ├── call.s │ ├── incsp8.s │ ├── shrax1.s │ ├── decax1.s │ ├── decax2.s │ ├── decax3.s │ ├── decax4.s │ ├── decax5.s │ ├── decax6.s │ ├── decax7.s │ ├── decax8.s │ ├── incax2.s │ ├── lne.s │ ├── llt.s │ ├── lge.s │ ├── lle.s │ ├── lult.s │ ├── incsp3.s │ ├── incsp4.s │ ├── incsp5.s │ ├── incsp6.s │ ├── incsp7.s │ ├── lgt.s │ ├── luge.s │ ├── lule.s │ ├── compl.s │ ├── leq.s │ ├── lugt.s │ ├── push1.s │ ├── push2.s │ ├── push3.s │ ├── push4.s │ ├── push5.s │ ├── push6.s │ ├── push7.s │ ├── ldaui.s │ ├── pushc0.s │ ├── pushc1.s │ ├── pushc2.s │ ├── aslax1.s │ ├── incsp1.s │ ├── asrax1.s │ ├── incaxy.s │ ├── shrax2.s │ ├── bpushbsp.s │ ├── aslax2.s │ └── staxsp.s ├── tgi │ ├── tgi_clear.s │ ├── tgi_getxres.s │ ├── tgi_getyres.s │ ├── tgi_free_vectorfont.s │ ├── tgi_getcolorcount.s │ ├── tgi_getpagecount.s │ ├── tgi_getpalette.s │ ├── tgi_getdefpalette.s │ └── tgi_getmaxy.s ├── serial │ └── ser_close.s ├── joystick │ ├── joy_count.s │ └── joy_read.s ├── em │ ├── em_copyfrom.s │ ├── em_copyto.s │ ├── em_pagecount.s │ └── em_map.s ├── mouse │ ├── mouse_getbox.s │ └── mouse_buttons.s └── sim6502 │ └── mainargs.s ├── test ├── .gitignore ├── ref │ ├── yacc.in │ ├── cc65070303.c │ └── minimal.c ├── asm │ ├── 6502x-cpudetect.ref │ ├── 65sc02-cpudetect.ref │ ├── 65c02-cpudetect.ref │ ├── 4510-cpudetect.ref │ ├── huc6280-cpudetect.ref │ ├── 4510-opcodes.ref │ ├── 6502-cpudetect.ref │ ├── 6502-opcodes.ref │ ├── 6502x-opcodes.ref │ ├── 65c02-opcodes.ref │ ├── 65sc02-opcodes.ref │ ├── 65816-cpudetect.ref │ └── huc6280-opcodes.ref ├── err │ ├── void-empty.c │ └── void-size2.c ├── val │ ├── bug735.c │ ├── bug830.c │ ├── bug367.c │ └── jmp-callax.c └── misc │ └── endless.c ├── .gitattributes ├── testcode ├── disasm │ └── .gitignore ├── lib │ ├── .gitignore │ ├── apple2 │ │ ├── werner.s │ │ ├── chips.hgr │ │ ├── girl.dhgr │ │ ├── rose.hgr │ │ ├── mariner.hgr │ │ ├── werner.hgr │ │ ├── winston.hgr │ │ ├── astronaut.hgr │ │ └── macrometer.hgr │ ├── atari │ │ └── multi.xex │ ├── gamate │ │ └── cga2.chr │ ├── getsp.s │ ├── accelerator │ │ ├── c64dtv-test.c │ │ ├── c65-test.c │ │ ├── c64-c128-test.c │ │ ├── c64-c128-scpu-test.c │ │ ├── chameleon-test.c │ │ └── turbomaster-test.c │ └── arg-test.c ├── compiler │ ├── pptest5.c │ ├── pptest4.c │ └── pptest1.c └── grc │ └── vlir.grc ├── doc ├── doc.png └── header.html ├── include ├── _ted.h ├── cbm264.h ├── fcntl.h ├── locale.h ├── plus4.h ├── signal.h ├── stdarg.h ├── vic20.h ├── peekpoke.h ├── sys │ ├── stat.h │ └── types.h └── mouse │ └── mouse-kernel.h ├── src ├── ca65 │ ├── ea.h │ ├── ea65.h │ ├── easw16.h │ ├── enum.h │ └── struct.h ├── ld65 │ ├── o65.h │ ├── error.h │ └── dbgfile.h ├── ar65 │ ├── error.c │ └── error.h ├── cc65 │ ├── loop.c │ ├── loop.h │ ├── coptadd.c │ ├── coptsub.c │ ├── loadexpr.h │ ├── preproc.h │ ├── stackptr.c │ ├── stackptr.h │ ├── testexpr.c │ ├── .lclintrc │ ├── assignment.h │ └── shiftexpr.h ├── cl65 │ └── error.h ├── co65 │ ├── error.c │ ├── error.h │ ├── fileio.c │ ├── fileio.h │ ├── global.c │ ├── global.h │ └── convert.h ├── da65 │ ├── asminc.h │ ├── code.h │ ├── error.h │ ├── global.c │ ├── comments.c │ ├── comments.h │ ├── infofile.h │ ├── opc4510.h │ ├── opc6502.h │ ├── opc65816.h │ ├── opc65c02.h │ ├── opcdesc.h │ ├── opctable.h │ └── opc65sc02.h ├── od65 │ ├── error.h │ └── fileio.h ├── sim65 │ ├── error.c │ ├── error.h │ ├── paravirt.c │ └── paravirt.h ├── common │ ├── inline.h │ ├── fragdefs.h │ ├── optdefs.h │ ├── segnames.c │ ├── segnames.h │ ├── strstack.c │ ├── strstack.h │ ├── va_copy.h │ ├── xmalloc.c │ └── xmalloc.h └── .gitignore ├── asminc ├── stdio.inc ├── opcodes.inc ├── utsname.inc ├── em-kernel.inc ├── joy-kernel.inc ├── ser-kernel.inc ├── c16.inc ├── atari2600.inc ├── get_tv.inc └── module.mac ├── samples ├── geos │ ├── logo.pcx │ ├── getidres.grc │ ├── bitmap-demores.grc │ ├── geosconiores.grc │ ├── yesnores.grc │ ├── hello1res.grc │ ├── hello2res.grc │ ├── fileselres.grc │ ├── geosverres.grc │ ├── rmvprotres.grc │ ├── vector-demores.grc │ └── overlay-demores.grc └── tutorial │ ├── text.s │ └── hello.c ├── .gitignore └── util └── atari └── ataricvt.c /libsrc/cx16/cpeeks.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /test/ref/yacc.in: -------------------------------------------------------------------------------- 1 | x=(e+1)*3/(3+7) 2 | 3 | 4 | -------------------------------------------------------------------------------- /testcode/disasm/.gitignore: -------------------------------------------------------------------------------- 1 | *.s 2 | image.bin 3 | -------------------------------------------------------------------------------- /testcode/lib/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | em-test-* 3 | -------------------------------------------------------------------------------- /libsrc/c16/get_tv.s: -------------------------------------------------------------------------------- 1 | .include "../plus4/get_tv.s" 2 | -------------------------------------------------------------------------------- /libsrc/atari5200/cclear.s: -------------------------------------------------------------------------------- 1 | .include "../atari/cclear.s" 2 | -------------------------------------------------------------------------------- /test/asm/6502x-cpudetect.ref: -------------------------------------------------------------------------------- 1 | CPU_ISET_6502CPU_ISET_6502X -------------------------------------------------------------------------------- /test/asm/65sc02-cpudetect.ref: -------------------------------------------------------------------------------- 1 | |4CPU_ISET_6502CPU_ISET_65SC02 -------------------------------------------------------------------------------- /libsrc/atari/mou/atrami.s: -------------------------------------------------------------------------------- 1 | AMIGA_MOUSE = 1 2 | .include "atrst.s" 3 | -------------------------------------------------------------------------------- /libsrc/atari/mou/atrtrk.s: -------------------------------------------------------------------------------- 1 | TRAK_MOUSE = 1 2 | .include "atrst.s" 3 | -------------------------------------------------------------------------------- /doc/doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/doc/doc.png -------------------------------------------------------------------------------- /libsrc/geos-cbm/Makefile.inc: -------------------------------------------------------------------------------- 1 | CA65FLAGS += -I geos-cbm -I geos-common 2 | -------------------------------------------------------------------------------- /testcode/lib/apple2/werner.s: -------------------------------------------------------------------------------- 1 | .segment "HGR" 2 | .incbin "werner.hgr" 3 | -------------------------------------------------------------------------------- /include/_ted.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/include/_ted.h -------------------------------------------------------------------------------- /libsrc/geos-apple/Makefile.inc: -------------------------------------------------------------------------------- 1 | CA65FLAGS += -I geos-apple -I geos-common 2 | -------------------------------------------------------------------------------- /src/ca65/ea.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/ca65/ea.h -------------------------------------------------------------------------------- /src/ld65/o65.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/ld65/o65.h -------------------------------------------------------------------------------- /test/asm/65c02-cpudetect.ref: -------------------------------------------------------------------------------- 1 | CPU_ISET_6502CPU_ISET_65SC02CPU_ISET_65C02 -------------------------------------------------------------------------------- /asminc/stdio.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/asminc/stdio.inc -------------------------------------------------------------------------------- /include/cbm264.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/include/cbm264.h -------------------------------------------------------------------------------- /include/fcntl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/include/fcntl.h -------------------------------------------------------------------------------- /include/locale.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/include/locale.h -------------------------------------------------------------------------------- /include/plus4.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/include/plus4.h -------------------------------------------------------------------------------- /include/signal.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/include/signal.h -------------------------------------------------------------------------------- /include/stdarg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/include/stdarg.h -------------------------------------------------------------------------------- /include/vic20.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/include/vic20.h -------------------------------------------------------------------------------- /src/ar65/error.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/ar65/error.c -------------------------------------------------------------------------------- /src/ar65/error.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/ar65/error.h -------------------------------------------------------------------------------- /src/ca65/ea65.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/ca65/ea65.h -------------------------------------------------------------------------------- /src/ca65/easw16.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/ca65/easw16.h -------------------------------------------------------------------------------- /src/ca65/enum.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/ca65/enum.h -------------------------------------------------------------------------------- /src/ca65/struct.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/ca65/struct.h -------------------------------------------------------------------------------- /src/cc65/loop.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/cc65/loop.c -------------------------------------------------------------------------------- /src/cc65/loop.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/cc65/loop.h -------------------------------------------------------------------------------- /src/cl65/error.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/cl65/error.h -------------------------------------------------------------------------------- /src/co65/error.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/co65/error.c -------------------------------------------------------------------------------- /src/co65/error.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/co65/error.h -------------------------------------------------------------------------------- /src/co65/fileio.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/co65/fileio.c -------------------------------------------------------------------------------- /src/co65/fileio.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/co65/fileio.h -------------------------------------------------------------------------------- /src/co65/global.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/co65/global.c -------------------------------------------------------------------------------- /src/co65/global.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/co65/global.h -------------------------------------------------------------------------------- /src/da65/asminc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/da65/asminc.h -------------------------------------------------------------------------------- /src/da65/code.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/da65/code.h -------------------------------------------------------------------------------- /src/da65/error.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/da65/error.h -------------------------------------------------------------------------------- /src/da65/global.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/da65/global.c -------------------------------------------------------------------------------- /src/ld65/error.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/ld65/error.h -------------------------------------------------------------------------------- /src/od65/error.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/od65/error.h -------------------------------------------------------------------------------- /src/od65/fileio.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/od65/fileio.h -------------------------------------------------------------------------------- /src/sim65/error.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/sim65/error.c -------------------------------------------------------------------------------- /src/sim65/error.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/sim65/error.h -------------------------------------------------------------------------------- /asminc/opcodes.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/asminc/opcodes.inc -------------------------------------------------------------------------------- /asminc/utsname.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/asminc/utsname.inc -------------------------------------------------------------------------------- /include/peekpoke.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/include/peekpoke.h -------------------------------------------------------------------------------- /include/sys/stat.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/include/sys/stat.h -------------------------------------------------------------------------------- /include/sys/types.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/include/sys/types.h -------------------------------------------------------------------------------- /libsrc/atmos/crt0.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/libsrc/atmos/crt0.s -------------------------------------------------------------------------------- /src/cc65/coptadd.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/cc65/coptadd.c -------------------------------------------------------------------------------- /src/cc65/coptsub.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/cc65/coptsub.c -------------------------------------------------------------------------------- /src/cc65/loadexpr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/cc65/loadexpr.h -------------------------------------------------------------------------------- /src/cc65/preproc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/cc65/preproc.h -------------------------------------------------------------------------------- /src/cc65/stackptr.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/cc65/stackptr.c -------------------------------------------------------------------------------- /src/cc65/stackptr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/cc65/stackptr.h -------------------------------------------------------------------------------- /src/cc65/testexpr.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/cc65/testexpr.c -------------------------------------------------------------------------------- /src/co65/convert.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/co65/convert.h -------------------------------------------------------------------------------- /src/common/inline.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/common/inline.h -------------------------------------------------------------------------------- /src/da65/comments.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/da65/comments.c -------------------------------------------------------------------------------- /src/da65/comments.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/da65/comments.h -------------------------------------------------------------------------------- /src/da65/infofile.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/da65/infofile.h -------------------------------------------------------------------------------- /src/da65/opc4510.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/da65/opc4510.h -------------------------------------------------------------------------------- /src/da65/opc6502.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/da65/opc6502.h -------------------------------------------------------------------------------- /src/da65/opc65816.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/da65/opc65816.h -------------------------------------------------------------------------------- /src/da65/opc65c02.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/da65/opc65c02.h -------------------------------------------------------------------------------- /src/da65/opcdesc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/da65/opcdesc.h -------------------------------------------------------------------------------- /src/da65/opctable.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/da65/opctable.h -------------------------------------------------------------------------------- /src/ld65/dbgfile.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/ld65/dbgfile.h -------------------------------------------------------------------------------- /test/asm/4510-cpudetect.ref: -------------------------------------------------------------------------------- 1 | KCPU_ISET_6502CPU_ISET_65SC02CPU_ISET_65C02CPU_ISET_4510 -------------------------------------------------------------------------------- /asminc/em-kernel.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/asminc/em-kernel.inc -------------------------------------------------------------------------------- /asminc/joy-kernel.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/asminc/joy-kernel.inc -------------------------------------------------------------------------------- /asminc/ser-kernel.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/asminc/ser-kernel.inc -------------------------------------------------------------------------------- /libsrc/atmos/tapehdr.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/libsrc/atmos/tapehdr.s -------------------------------------------------------------------------------- /samples/geos/logo.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/samples/geos/logo.pcx -------------------------------------------------------------------------------- /src/cc65/.lclintrc: -------------------------------------------------------------------------------- 1 | +boolint 2 | -boolops 3 | -retvalint 4 | -retvalother 5 | -I../common 6 | -------------------------------------------------------------------------------- /src/cc65/assignment.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/cc65/assignment.h -------------------------------------------------------------------------------- /src/cc65/shiftexpr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/cc65/shiftexpr.h -------------------------------------------------------------------------------- /src/common/fragdefs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/common/fragdefs.h -------------------------------------------------------------------------------- /src/common/optdefs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/common/optdefs.h -------------------------------------------------------------------------------- /src/common/segnames.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/common/segnames.c -------------------------------------------------------------------------------- /src/common/segnames.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/common/segnames.h -------------------------------------------------------------------------------- /src/common/strstack.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/common/strstack.c -------------------------------------------------------------------------------- /src/common/strstack.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/common/strstack.h -------------------------------------------------------------------------------- /src/common/va_copy.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/common/va_copy.h -------------------------------------------------------------------------------- /src/common/xmalloc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/common/xmalloc.c -------------------------------------------------------------------------------- /src/common/xmalloc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/common/xmalloc.h -------------------------------------------------------------------------------- /src/da65/opc65sc02.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/da65/opc65sc02.h -------------------------------------------------------------------------------- /src/sim65/paravirt.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/sim65/paravirt.c -------------------------------------------------------------------------------- /src/sim65/paravirt.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/src/sim65/paravirt.h -------------------------------------------------------------------------------- /test/asm/huc6280-cpudetect.ref: -------------------------------------------------------------------------------- 1 | CPU_ISET_6502CPU_ISET_65SC02CPU_ISET_65C02CPU_ISET_HUC6280 -------------------------------------------------------------------------------- /test/ref/cc65070303.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/test/ref/cc65070303.c -------------------------------------------------------------------------------- /libsrc/telestrat/crt0.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/libsrc/telestrat/crt0.s -------------------------------------------------------------------------------- /libsrc/apple2/tgi/a2.hi.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/libsrc/apple2/tgi/a2.hi.fnt -------------------------------------------------------------------------------- /libsrc/common/_poserror.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/libsrc/common/_poserror.c -------------------------------------------------------------------------------- /samples/tutorial/text.s: -------------------------------------------------------------------------------- 1 | 2 | .export _text 3 | _text: .asciiz "Hello world!" 4 | 5 | -------------------------------------------------------------------------------- /test/asm/4510-opcodes.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/test/asm/4510-opcodes.ref -------------------------------------------------------------------------------- /test/asm/6502-cpudetect.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/test/asm/6502-cpudetect.ref -------------------------------------------------------------------------------- /test/asm/6502-opcodes.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/test/asm/6502-opcodes.ref -------------------------------------------------------------------------------- /test/asm/6502x-opcodes.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/test/asm/6502x-opcodes.ref -------------------------------------------------------------------------------- /test/asm/65c02-opcodes.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/test/asm/65c02-opcodes.ref -------------------------------------------------------------------------------- /test/asm/65sc02-opcodes.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/test/asm/65sc02-opcodes.ref -------------------------------------------------------------------------------- /include/mouse/mouse-kernel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/include/mouse/mouse-kernel.h -------------------------------------------------------------------------------- /test/asm/65816-cpudetect.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/test/asm/65816-cpudetect.ref -------------------------------------------------------------------------------- /test/asm/huc6280-opcodes.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/test/asm/huc6280-opcodes.ref -------------------------------------------------------------------------------- /testcode/lib/apple2/chips.hgr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/testcode/lib/apple2/chips.hgr -------------------------------------------------------------------------------- /testcode/lib/apple2/girl.dhgr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/testcode/lib/apple2/girl.dhgr -------------------------------------------------------------------------------- /testcode/lib/apple2/rose.hgr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/testcode/lib/apple2/rose.hgr -------------------------------------------------------------------------------- /testcode/lib/atari/multi.xex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/testcode/lib/atari/multi.xex -------------------------------------------------------------------------------- /testcode/lib/gamate/cga2.chr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/testcode/lib/gamate/cga2.chr -------------------------------------------------------------------------------- /testcode/lib/apple2/mariner.hgr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/testcode/lib/apple2/mariner.hgr -------------------------------------------------------------------------------- /testcode/lib/apple2/werner.hgr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/testcode/lib/apple2/werner.hgr -------------------------------------------------------------------------------- /testcode/lib/apple2/winston.hgr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/testcode/lib/apple2/winston.hgr -------------------------------------------------------------------------------- /testcode/lib/apple2/astronaut.hgr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/testcode/lib/apple2/astronaut.hgr -------------------------------------------------------------------------------- /testcode/lib/apple2/macrometer.hgr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRFLEW/cc65/master/testcode/lib/apple2/macrometer.hgr -------------------------------------------------------------------------------- /libsrc/c64/acc_c128_speed.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Marco van den Heuvel, 2018-04-23 3 | ; 4 | 5 | .include "../c128/acc_c128_speed.s" 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | /html/ 3 | /info/ 4 | /lib/ 5 | /libwrk/ 6 | /target/ 7 | /testwrk/ 8 | /wrk/ 9 | /cc65.zip 10 | -------------------------------------------------------------------------------- /libsrc/c128/status.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2012-09-30 3 | ; 4 | 5 | .exportzp ST := $90 ; IEC status byte 6 | -------------------------------------------------------------------------------- /libsrc/c16/status.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2012-09-30 3 | ; 4 | 5 | .exportzp ST := $90 ; IEC status byte 6 | -------------------------------------------------------------------------------- /libsrc/c64/status.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2012-09-30 3 | ; 4 | 5 | .exportzp ST := $90 ; IEC status byte 6 | -------------------------------------------------------------------------------- /libsrc/pet/status.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2012-09-30 3 | ; 4 | 5 | .exportzp ST := $96 ; IEC status byte 6 | -------------------------------------------------------------------------------- /libsrc/plus4/status.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2012-09-30 3 | ; 4 | 5 | .exportzp ST := $90 ; IEC status byte 6 | -------------------------------------------------------------------------------- /libsrc/vic20/status.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2012-09-30 3 | ; 4 | 5 | .exportzp ST := $90 ; IEC status byte 6 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | ipch/ 2 | *.suo 3 | *.sdf 4 | *.opensdf 5 | *.VC.db 6 | *.VC.VC.opendb 7 | *.vcxproj.filters 8 | *.vcxproj.user 9 | -------------------------------------------------------------------------------- /libsrc/atari5200/ctype.s: -------------------------------------------------------------------------------- 1 | ; Character specification table. 2 | ; 3 | ; same as for "atari" target 4 | 5 | .include "../atari/ctype.s" 6 | -------------------------------------------------------------------------------- /libsrc/atari/scrdev.s: -------------------------------------------------------------------------------- 1 | ; Name of the "screen" device 2 | 3 | .export scrdev 4 | 5 | .rodata 6 | 7 | scrdev: .byte "S:", 0 8 | -------------------------------------------------------------------------------- /doc/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /libsrc/c16/devnum.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2010-02-14 3 | ; 4 | 5 | .include "c16.inc" 6 | 7 | .exportzp devnum := DEVNUM 8 | -------------------------------------------------------------------------------- /libsrc/c64/devnum.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2010-02-14 3 | ; 4 | 5 | .include "c64.inc" 6 | 7 | .exportzp devnum := DEVNUM 8 | -------------------------------------------------------------------------------- /libsrc/pet/devnum.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2010-02-14 3 | ; 4 | 5 | .include "pet.inc" 6 | 7 | .exportzp devnum := DEVNUM 8 | -------------------------------------------------------------------------------- /libsrc/c128/devnum.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2010-02-14 3 | ; 4 | 5 | .include "c128.inc" 6 | 7 | .exportzp devnum := DEVNUM 8 | -------------------------------------------------------------------------------- /libsrc/cbm510/devnum.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2010-02-14 3 | ; 4 | 5 | .include "extzp.inc" 6 | 7 | .exportzp devnum := DEVNUM 8 | -------------------------------------------------------------------------------- /libsrc/cbm610/devnum.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2010-02-14 3 | ; 4 | 5 | .include "extzp.inc" 6 | 7 | .exportzp devnum := DEVNUM 8 | -------------------------------------------------------------------------------- /libsrc/cx16/status.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; 2012-09-30, Oliver Schmidt 3 | ; 2019-09-08, Greg King 4 | ; 5 | 6 | .exportzp ST := $90 ; IEC status byte 7 | -------------------------------------------------------------------------------- /libsrc/plus4/devnum.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2010-02-14 3 | ; 4 | 5 | .include "plus4.inc" 6 | 7 | .exportzp devnum := DEVNUM 8 | -------------------------------------------------------------------------------- /libsrc/vic20/devnum.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2010-02-14 3 | ; 4 | 5 | .include "vic20.inc" 6 | 7 | .exportzp devnum := DEVNUM 8 | -------------------------------------------------------------------------------- /testcode/compiler/pptest5.c: -------------------------------------------------------------------------------- 1 | #define t(x,y,z) x ## y ## z 2 | int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), 3 | t(10,,), t(,11,), t(,,12), t(,,) }; 4 | -------------------------------------------------------------------------------- /libsrc/cbm/clinechars.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Chars used by chline () and cvline () 3 | ; 4 | 5 | .exportzp chlinechar = 64 6 | .exportzp cvlinechar = 93 7 | -------------------------------------------------------------------------------- /libsrc/plus4/irq.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; IRQ handling (Plus/4 version) 3 | ; 4 | 5 | .export initirq, doneirq 6 | 7 | initirq: 8 | doneirq: 9 | rts 10 | -------------------------------------------------------------------------------- /samples/geos/getidres.grc: -------------------------------------------------------------------------------- 1 | HEADER APPLICATION "getid" "GetId" "V1.0" { 2 | mode any 3 | dostype USR 4 | author "Maciej Witkowiak" 5 | info "This is an example." 6 | } 7 | -------------------------------------------------------------------------------- /testcode/compiler/pptest4.c: -------------------------------------------------------------------------------- 1 | #define t(x,y,z) x ## y ## z 2 | int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), 3 | t(10,,), t(,11,), t(,,12), t(,,) }; 4 | -------------------------------------------------------------------------------- /libsrc/cbm510/irq.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; IRQ handling (CBM 500 version) 3 | ; 4 | 5 | .export initirq, doneirq 6 | 7 | initirq: 8 | doneirq: 9 | rts 10 | -------------------------------------------------------------------------------- /libsrc/pce/libref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2013-05-31 3 | ; 4 | 5 | .export joy_libref 6 | .import _exit 7 | 8 | joy_libref := _exit 9 | -------------------------------------------------------------------------------- /libsrc/pet/libref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2013-05-31 3 | ; 4 | 5 | .export joy_libref 6 | .import _exit 7 | 8 | joy_libref := _exit 9 | -------------------------------------------------------------------------------- /libsrc/cbm610/irq.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; IRQ handling (CBM 600/700 version) 3 | ; 4 | 5 | .export initirq, doneirq 6 | 7 | initirq: 8 | doneirq: 9 | rts 10 | -------------------------------------------------------------------------------- /libsrc/gamate/libref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2013-05-31 3 | ; 4 | 5 | .export joy_libref 6 | .import _exit 7 | 8 | joy_libref := _exit 9 | -------------------------------------------------------------------------------- /libsrc/atari/findfreeiocb.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Christian Groessler, June-2013 3 | ; 4 | 5 | .include "atari.inc" 6 | .export findfreeiocb 7 | .include "findfreeiocb.inc" 8 | -------------------------------------------------------------------------------- /libsrc/atari5200/libref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Christian Groessler, 2014-05-12 3 | ; 4 | 5 | .export joy_libref 6 | .import _exit 7 | 8 | joy_libref := _exit 9 | -------------------------------------------------------------------------------- /libsrc/c64/mcbspritedata.s: -------------------------------------------------------------------------------- 1 | ; VIC sprite data for the mouse pointer 2 | 3 | .export mcb_spritememory := $0340 4 | .export mcb_spritepointer := $07F8 5 | -------------------------------------------------------------------------------- /libsrc/cx16/devnum.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; 2010-02-14, Oliver Schmidt 3 | ; 2019-09-08, Greg King 4 | ; 5 | 6 | .include "cx16.inc" 7 | 8 | .exportzp devnum := DEVNUM 9 | -------------------------------------------------------------------------------- /libsrc/supervision/libref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2013-05-31 3 | ; 4 | 5 | .export joy_libref 6 | .import _exit 7 | 8 | joy_libref := _exit 9 | -------------------------------------------------------------------------------- /libsrc/telestrat/libref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Jede (jede@oric.org), 2017-10-16 3 | ; 4 | 5 | .export tgi_libref 6 | .import _exit 7 | 8 | tgi_libref := _exit 9 | -------------------------------------------------------------------------------- /libsrc/creativision/libref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2013-05-31 3 | ; 4 | 5 | .export joy_libref 6 | .import _exit 7 | 8 | joy_libref := _exit 9 | -------------------------------------------------------------------------------- /libsrc/apple2/clrscr.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Kevin Ruland 3 | ; 4 | ; void clrscr (void); 5 | ; 6 | 7 | .export _clrscr 8 | .import HOME 9 | 10 | _clrscr := HOME 11 | -------------------------------------------------------------------------------- /asminc/c16.inc: -------------------------------------------------------------------------------- 1 | ; 2 | ; C16 generic definitions. 3 | ; 4 | ; The C16 and Plus/4 are identical, so just include the Plus/4 include file. 5 | 6 | 7 | .include "plus4.inc" 8 | 9 | 10 | -------------------------------------------------------------------------------- /libsrc/cbm/c_udtim.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; 2016-08-07, Greg King 3 | ; 4 | ; void cbm_k_udtim (void); 5 | ; 6 | 7 | .include "cbm.inc" 8 | 9 | .export _cbm_k_udtim := UDTIM 10 | -------------------------------------------------------------------------------- /libsrc/atari/mcbdefault.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; This file defines the default mouse callback 3 | ; 4 | 5 | .import _mouse_pm_callbacks 6 | .export _mouse_def_callbacks 7 | 8 | _mouse_def_callbacks := _mouse_pm_callbacks 9 | -------------------------------------------------------------------------------- /libsrc/atari/mcbtxtchar-char.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Default text mode mouse cursor character 3 | ; 4 | ; Christian Groessler, 11.04.2014 5 | ; 6 | 7 | .export mouse_txt_char : zp = 96 ; 'diamond' screen code 8 | -------------------------------------------------------------------------------- /libsrc/cbm/c_scnkey.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; 2016-08-07, Greg King 3 | ; 4 | ; void cbm_k_scnkey (void); 5 | ; 6 | 7 | .include "cbm.inc" 8 | 9 | .export _cbm_k_scnkey := SCNKEY 10 | -------------------------------------------------------------------------------- /testcode/lib/getsp.s: -------------------------------------------------------------------------------- 1 | 2 | .export _getsp 3 | .importzp sp 4 | 5 | .proc _getsp 6 | 7 | ldx sp+1 8 | lda sp 9 | rts 10 | 11 | .endproc 12 | 13 | -------------------------------------------------------------------------------- /libsrc/cbm/c_clall.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 03.06.1999 3 | ; 4 | ; void cbm_k_clall (void); 5 | ; 6 | 7 | .include "cbm.inc" 8 | 9 | .export _cbm_k_clall := CLALL 10 | -------------------------------------------------------------------------------- /libsrc/cbm/c_unlsn.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 03.06.1999 3 | ; 4 | ; void cbm_k_unlsn (void); 5 | ; 6 | 7 | .include "cbm.inc" 8 | 9 | .export _cbm_k_unlsn := UNLSN 10 | -------------------------------------------------------------------------------- /libsrc/conio/_cursor.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.10.2000 3 | ; 4 | ; Cursor related variables 5 | ; 6 | 7 | .export cursor 8 | 9 | .bss 10 | 11 | cursor: .res 1 12 | 13 | 14 | -------------------------------------------------------------------------------- /libsrc/cx16/conio.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; 2019-09-23, Greg King 3 | ; 4 | ; Low-level stuff for screen output/console input 5 | ; 6 | 7 | .exportzp CURS_X, CURS_Y 8 | 9 | .include "cx16.inc" 10 | -------------------------------------------------------------------------------- /libsrc/pet/cpeekcolor.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; 2017-06-03, Greg King 3 | ; 4 | ; unsigned char cpeekcolor (void); 5 | ; 6 | 7 | .import return1 8 | .export _cpeekcolor := return1 ; always COLOR_WHITE 9 | -------------------------------------------------------------------------------- /libsrc/c16/libref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2013-05-31 3 | ; 4 | 5 | .export em_libref, joy_libref 6 | .import _exit 7 | 8 | em_libref := _exit 9 | joy_libref := _exit 10 | -------------------------------------------------------------------------------- /libsrc/cbm610/cpeekcolor.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; 2017-06-03, Greg King 3 | ; 4 | ; unsigned char cpeekcolor (void); 5 | ; 6 | 7 | .import return1 8 | .export _cpeekcolor := return1 ; always COLOR_WHITE 9 | -------------------------------------------------------------------------------- /libsrc/lynx/libref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2013-05-31 3 | ; 4 | 5 | .export joy_libref, ser_libref 6 | .import _exit 7 | 8 | joy_libref := _exit 9 | ser_libref := _exit 10 | -------------------------------------------------------------------------------- /libsrc/nes/libref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2013-05-31 3 | ; 4 | 5 | .export joy_libref, tgi_libref 6 | .import _exit 7 | 8 | joy_libref := _exit 9 | tgi_libref := _exit 10 | -------------------------------------------------------------------------------- /libsrc/c128/clrscr.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 06.08.1998 3 | ; 4 | ; void clrscr (void); 5 | ; 6 | 7 | .export _clrscr 8 | 9 | .include "cbm_kernal.inc" 10 | 11 | _clrscr = CLRSCR 12 | -------------------------------------------------------------------------------- /libsrc/c16/clrscr.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 06.08.1998 3 | ; 4 | ; void clrscr (void); 5 | ; 6 | 7 | .export _clrscr 8 | 9 | .include "cbm_kernal.inc" 10 | 11 | _clrscr = CLRSCR 12 | -------------------------------------------------------------------------------- /libsrc/c64/clrscr.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 06.08.1998 3 | ; 4 | ; void clrscr (void); 5 | ; 6 | 7 | .export _clrscr 8 | 9 | .include "cbm_kernal.inc" 10 | 11 | _clrscr = CLRSCR 12 | -------------------------------------------------------------------------------- /libsrc/cbm610/libref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2013-05-31 3 | ; 4 | 5 | .export em_libref, ser_libref 6 | .import _exit 7 | 8 | em_libref := _exit 9 | ser_libref := _exit 10 | -------------------------------------------------------------------------------- /libsrc/cx16/_scrsize.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.10.2000 3 | ; 4 | ; Screen size variables 5 | ; 6 | 7 | .export screensize 8 | .import SCREEN 9 | 10 | screensize := SCREEN 11 | -------------------------------------------------------------------------------- /libsrc/plus4/libref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2013-05-31 3 | ; 4 | 5 | .export joy_libref, ser_libref 6 | .import _exit 7 | 8 | joy_libref := _exit 9 | ser_libref := _exit 10 | -------------------------------------------------------------------------------- /libsrc/c64/conio.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 06.08.1998 3 | ; 4 | ; Low level stuff for screen output/console input 5 | ; 6 | 7 | .exportzp CURS_X, CURS_Y 8 | 9 | .include "c64.inc" 10 | 11 | -------------------------------------------------------------------------------- /libsrc/pet/conio.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.11.1998 3 | ; 4 | ; Low level stuff for screen output/console input 5 | ; 6 | 7 | .exportzp CURS_X, CURS_Y 8 | 9 | .include "pet.inc" 10 | 11 | -------------------------------------------------------------------------------- /libsrc/vic20/clrscr.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 06.08.1998 3 | ; 4 | ; void clrscr (void); 5 | ; 6 | 7 | .export _clrscr 8 | 9 | .include "cbm_kernal.inc" 10 | 11 | _clrscr = CLRSCR 12 | -------------------------------------------------------------------------------- /testcode/compiler/pptest1.c: -------------------------------------------------------------------------------- 1 | #define hash_hash # ## # 2 | #define mkstr(a) # a 3 | #define in_between(a) mkstr(a) 4 | #define join(c, d) in_between(c hash_hash d) 5 | 6 | char p[] = join(x, y); // Comment 7 | -------------------------------------------------------------------------------- /asminc/atari2600.inc: -------------------------------------------------------------------------------- 1 | ; Atari 2600 TIA & RIOT read / write registers 2 | ; 3 | ; Florent Flament (contact@florentflament.com), 2017 4 | 5 | ; TIA & RIOT registers mapping 6 | .include "atari2600_tia.inc" 7 | .include "atari2600_riot.inc" 8 | -------------------------------------------------------------------------------- /libsrc/atari/cartinit.s: -------------------------------------------------------------------------------- 1 | ; Cartridge init routine 2 | ; 3 | ; Christian Groessler, 06-Jan-2014 4 | 5 | .ifndef __ATARIXL__ 6 | 7 | .export cartinit 8 | 9 | cartinit: rts 10 | 11 | .endif ; .ifndef __ATARIXL__ 12 | -------------------------------------------------------------------------------- /libsrc/atari/inviocb.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; set EINVAL error code and returns -1 3 | ; 4 | .include "errno.inc" 5 | 6 | .export __inviocb 7 | 8 | __inviocb: 9 | lda # 2 | #include 3 | 4 | extern const char text[]; /* In text.s */ 5 | 6 | int main (void) 7 | { 8 | printf ("%s\n", text); 9 | return EXIT_SUCCESS; 10 | } 11 | 12 | 13 | -------------------------------------------------------------------------------- /libsrc/cbm/c_tksa.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Bas Wassink, 22.05.2018 3 | ; 4 | ; void __fastcall__ cbm_k_tksa (unsigned char addr) 5 | ; 6 | 7 | .include "cbm.inc" 8 | 9 | .export _cbm_k_tksa 10 | 11 | _cbm_k_tksa = TKSA 12 | -------------------------------------------------------------------------------- /libsrc/cbm/cbm_close.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Marc 'BlackJack' Rintsch, 18.03.2001 3 | ; 4 | ; void __fastcall__ cbm_close (unsigned char lfn); 5 | ; 6 | 7 | .import _cbm_k_close 8 | .export _cbm_close 9 | 10 | _cbm_close = _cbm_k_close 11 | -------------------------------------------------------------------------------- /libsrc/geos-cbm/system/tobasic.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void ToBASIC (void); 7 | 8 | .export _ToBASIC 9 | 10 | .include "jumptab.inc" 11 | 12 | _ToBASIC = ToBASIC -------------------------------------------------------------------------------- /libsrc/osic1p/revers.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; 2017-06-26, Greg King 3 | ; 4 | ; unsigned char __fastcall__ revers (unsigned char onoff) 5 | ; 6 | 7 | .import return0 8 | 9 | .export _revers := return0 ; no attribute 10 | -------------------------------------------------------------------------------- /libsrc/runtime/callptr4.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; CC65 runtime: call function via pointer in ptr4 3 | ; 4 | 5 | .export callptr4 6 | .importzp ptr4 7 | 8 | callptr4: 9 | jmp (ptr4) ; jump there 10 | 11 | -------------------------------------------------------------------------------- /test/err/void-empty.c: -------------------------------------------------------------------------------- 1 | /* 2 | !!DESCRIPTION!! Uninitialized void variables 3 | !!ORIGIN!! cc65 regression tests 4 | !!LICENCE!! Public Domain 5 | !!AUTHOR!! Greg King 6 | */ 7 | 8 | void test; 9 | const void list; 10 | -------------------------------------------------------------------------------- /libsrc/geos-apple/disk/enterturbo.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt (ol.sc@web.de) 3 | ; 4 | ; 2012-02-09 5 | 6 | ; void EnterTurbo (void); 7 | 8 | .export _EnterTurbo 9 | .import return0 10 | 11 | _EnterTurbo = return0 12 | -------------------------------------------------------------------------------- /libsrc/geos-apple/disk/purgeturbo.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt (ol.sc@web.de) 3 | ; 4 | ; 2012-02-09 5 | 6 | ; void PurgeTurbo (void); 7 | 8 | .export _PurgeTurbo 9 | .import return0 10 | 11 | _PurgeTurbo = return0 12 | -------------------------------------------------------------------------------- /libsrc/vic20/libref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2013-05-31 3 | ; 4 | 5 | .export joy_libref 6 | .export em_libref 7 | .import _exit 8 | 9 | joy_libref := _exit 10 | em_libref := _exit 11 | -------------------------------------------------------------------------------- /samples/geos/bitmap-demores.grc: -------------------------------------------------------------------------------- 1 | HEADER APPLICATION "Bitmap Demo" "Bitmap Demo" "V1.0" { 2 | author "Oliver Schmidt" 3 | info "This is a minimalistic cc65 GEOSLib bitmap demo program written in C." 4 | date 12 06 10 12 00 5 | } 6 | -------------------------------------------------------------------------------- /samples/geos/geosconiores.grc: -------------------------------------------------------------------------------- 1 | ; this is the resource file for geosconio.c, a GEOS application example 2 | 3 | HEADER APPLICATION "conio" "ConIO" "V0.1" { 4 | dostype USR 5 | author "Maciej Witkowiak" 6 | info "This is an example for a conio app." 7 | } 8 | -------------------------------------------------------------------------------- /libsrc/c64/tgi_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard tgi driver 3 | ; 4 | ; Oliver Schmidt, 2011-05-02 5 | ; 6 | ; const char tgi_stddrv[]; 7 | ; 8 | 9 | .export _tgi_stddrv 10 | 11 | .rodata 12 | 13 | _tgi_stddrv: .asciiz "c64-hi.tgi" 14 | -------------------------------------------------------------------------------- /libsrc/cbm/c_second.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Bas Wassink, 23.05.2018 3 | ; 4 | ; void __fastcall__ cbm_k_second (unsigned char addr) 5 | ; 6 | 7 | .include "cbm.inc" 8 | 9 | .export _cbm_k_second 10 | 11 | _cbm_k_second = SECOND 12 | -------------------------------------------------------------------------------- /libsrc/cbm/mcbpointercolor.s: -------------------------------------------------------------------------------- 1 | ; VIC sprite color for the mouse pointer 2 | 3 | .export _mouse_def_pointercolor 4 | 5 | 6 | .segment "ONCE" 7 | 8 | _mouse_def_pointercolor: 9 | 10 | .byte $01 ; White 11 | -------------------------------------------------------------------------------- /libsrc/geos-common/menuicon/redomenu.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void ReDoMenu (void); 7 | 8 | .export _ReDoMenu 9 | 10 | .include "jumptab.inc" 11 | 12 | _ReDoMenu = ReDoMenu -------------------------------------------------------------------------------- /libsrc/geos-common/mousesprite/mouseup.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void MouseUp (void); 7 | 8 | .export _MouseUp 9 | 10 | .include "jumptab.inc" 11 | 12 | _MouseUp = MouseUp -------------------------------------------------------------------------------- /libsrc/tgi/tgi_clear.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 21.06.2002 3 | ; 4 | ; void tgi_clear (void); 5 | ; /* Clear the drawpage */ 6 | 7 | .include "tgi-kernel.inc" 8 | 9 | _tgi_clear = tgi_clear ; Call the driver 10 | -------------------------------------------------------------------------------- /libsrc/apple2/sysrmdir.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 15.04.2005 3 | ; 4 | ; unsigned char __fastcall__ _sysrmdir (const char* name); 5 | ; 6 | 7 | .export __sysrmdir 8 | .import __sysremove 9 | 10 | __sysrmdir := __sysremove 11 | -------------------------------------------------------------------------------- /libsrc/c128/tgi_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard tgi driver 3 | ; 4 | ; Oliver Schmidt, 2011-05-02 5 | ; 6 | ; const char tgi_stddrv[]; 7 | ; 8 | 9 | .export _tgi_stddrv 10 | 11 | .rodata 12 | 13 | _tgi_stddrv: .asciiz "c128-vdc.tgi" 14 | -------------------------------------------------------------------------------- /libsrc/cbm/c_bsout.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 03.06.1999 3 | ; 4 | ; void __fastcall__ cbm_k_bsout (unsigned char C); 5 | ; 6 | 7 | .include "cbm.inc" 8 | 9 | .export _cbm_k_bsout 10 | 11 | _cbm_k_bsout = BSOUT 12 | -------------------------------------------------------------------------------- /libsrc/common/toascii.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; unsigned char __fastcall__ toascii (unsigned char c); 3 | ; /* Convert a target specific character to ascii */ 4 | ; 5 | 6 | .export _toascii 7 | 8 | _toascii: 9 | ldx #>$0000 10 | rts 11 | -------------------------------------------------------------------------------- /libsrc/geos-common/mousesprite/mouseoff.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void MouseOff (void); 7 | 8 | .export _MouseOff 9 | 10 | .include "jumptab.inc" 11 | 12 | _MouseOff = MouseOff -------------------------------------------------------------------------------- /libsrc/geos-common/system/firstinit.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void FirstInit (void); 7 | 8 | .export _FirstInit 9 | 10 | .include "jumptab.inc" 11 | 12 | _FirstInit = FirstInit -------------------------------------------------------------------------------- /libsrc/nes/tgi_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard tgi driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const char tgi_stddrv[]; 7 | ; 8 | 9 | .export _tgi_stddrv 10 | 11 | .rodata 12 | 13 | _tgi_stddrv: .asciiz "nes-64-56-2.tgi" 14 | -------------------------------------------------------------------------------- /samples/geos/yesnores.grc: -------------------------------------------------------------------------------- 1 | 2 | ; this is the resource file for yesno.c, a GEOS application example 3 | 4 | HEADER APPLICATION "yesno" "YesNo" "V1.0" { 5 | dostype USR 6 | author "Maciej Witkowiak" 7 | info "This is a C prog compiled with cc65 and GEOSLib." 8 | } 9 | -------------------------------------------------------------------------------- /libsrc/atmos/libref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2013-05-31 3 | ; 4 | 5 | .export joy_libref, ser_libref, tgi_libref 6 | .import _exit 7 | 8 | joy_libref := _exit 9 | ser_libref := _exit 10 | tgi_libref := _exit 11 | -------------------------------------------------------------------------------- /libsrc/cbm510/libref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2013-05-31 3 | ; 4 | 5 | .export em_libref, joy_libref, ser_libref 6 | .import _exit 7 | 8 | em_libref := _exit 9 | joy_libref := _exit 10 | ser_libref := _exit 11 | -------------------------------------------------------------------------------- /libsrc/common/strtoimax.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2009-09-17 3 | ; 4 | ; intmax_t __fastcall__ strtoimax (const char* nptr, char** endptr, int base); 5 | ; 6 | 7 | .import _strtol 8 | .export _strtoimax = _strtol 9 | 10 | -------------------------------------------------------------------------------- /libsrc/cx16/joy_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard joystick driver 3 | ; 4 | ; 2019-09-19, Greg King 5 | ; 6 | ; const char joy_stddrv[]; 7 | ; 8 | 9 | .export _joy_stddrv 10 | 11 | .rodata 12 | 13 | _joy_stddrv: .asciiz "cx16-stdjoy.joy" 14 | -------------------------------------------------------------------------------- /libsrc/geos-cbm/disk/exitturbo.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 21.12.99 5 | 6 | ; void ExitTurbo (void); 7 | 8 | .export _ExitTurbo 9 | 10 | .include "jumptab.inc" 11 | 12 | _ExitTurbo = ExitTurbo 13 | -------------------------------------------------------------------------------- /libsrc/lynx/tgi_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard tgi driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const char tgi_stddrv[]; 7 | ; 8 | 9 | .export _tgi_stddrv 10 | 11 | .rodata 12 | 13 | _tgi_stddrv: .asciiz "lynx-160-102-16.tgi" 14 | -------------------------------------------------------------------------------- /libsrc/telestrat/wherex.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; jede jede@oric.org 2017-02-25 3 | ; 4 | .export _wherex 5 | 6 | .importzp sp 7 | 8 | .include "telestrat.inc" 9 | 10 | .proc _wherex 11 | ldx #$00 12 | lda SCRX 13 | rts 14 | .endproc 15 | -------------------------------------------------------------------------------- /samples/geos/hello1res.grc: -------------------------------------------------------------------------------- 1 | 2 | ; this is the resource file for hello1.c, a GEOS application example 3 | 4 | HEADER APPLICATION "hello1" "Hello 1" "V1.0" { 5 | dostype USR 6 | author "Maciej Witkowiak" 7 | info "This is a C prog compiled with cc65 and GEOSLib." 8 | } 9 | -------------------------------------------------------------------------------- /samples/geos/hello2res.grc: -------------------------------------------------------------------------------- 1 | 2 | ; this is the resource file for hello2.c, a GEOS application example 3 | 4 | HEADER APPLICATION "hello2" "Hello 2" "V1.0" { 5 | dostype USR 6 | author "Maciej Witkowiak" 7 | info "This is a C prog compiled with cc65 and GEOSLib." 8 | } 9 | -------------------------------------------------------------------------------- /libsrc/apple2/wherex.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Kevin Ruland 3 | ; 4 | ; unsigned char wherex (void); 5 | ; 6 | 7 | .export _wherex 8 | 9 | .include "apple2.inc" 10 | 11 | _wherex: 12 | lda CH 13 | ldx #$00 14 | rts 15 | -------------------------------------------------------------------------------- /libsrc/atari/wherex.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Carsten Strotmann, 30.12.2002 3 | ; 4 | ; unsigned char wherex (void); 5 | ; 6 | 7 | .export _wherex 8 | .include "atari.inc" 9 | 10 | _wherex: 11 | lda COLCRS 12 | ldx #0 13 | rts 14 | -------------------------------------------------------------------------------- /libsrc/atari/wherey.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Carsten Strotmann, 30.12.2002 3 | ; 4 | ; unsigned char wherey (void); 5 | ; 6 | 7 | .export _wherey 8 | .include "atari.inc" 9 | 10 | _wherey: 11 | lda ROWCRS 12 | ldx #0 13 | rts 14 | -------------------------------------------------------------------------------- /libsrc/atmos/joy_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard joystick driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const char joy_stddrv[]; 7 | ; 8 | 9 | .export _joy_stddrv 10 | 11 | .rodata 12 | 13 | _joy_stddrv: .asciiz "atmos-pase.joy" 14 | -------------------------------------------------------------------------------- /libsrc/atmos/tgi_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard tgi driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const char tgi_stddrv[]; 7 | ; 8 | 9 | .export _tgi_stddrv 10 | 11 | .rodata 12 | 13 | _tgi_stddrv: .asciiz "atmos-240-200-2.tgi" 14 | -------------------------------------------------------------------------------- /libsrc/cbm510/joy_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard joystick driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const char joy_stddrv[]; 7 | ; 8 | 9 | .export _joy_stddrv 10 | 11 | .rodata 12 | 13 | _joy_stddrv: .asciiz "cbm510-std.joy" 14 | -------------------------------------------------------------------------------- /libsrc/common/strtoumax.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2009-09-17 3 | ; 4 | ; uintmax_t __fastcall__ strtoumax (const char* nptr, char** endptr, int base); 5 | ; 6 | 7 | .import _strtoul 8 | .export _strtoumax = _strtoul 9 | 10 | -------------------------------------------------------------------------------- /libsrc/geos-cbm/disk/enterturbo.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 21.12.99 5 | 6 | ; void EnterTurbo (void); 7 | 8 | .export _EnterTurbo 9 | 10 | .include "jumptab.inc" 11 | 12 | _EnterTurbo = EnterTurbo 13 | -------------------------------------------------------------------------------- /libsrc/geos-cbm/disk/purgeturbo.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 21.12.99 5 | 6 | ; void PurgeTurbo (void); 7 | 8 | .export _PurgeTurbo 9 | 10 | .include "jumptab.inc" 11 | 12 | _PurgeTurbo = PurgeTurbo 13 | -------------------------------------------------------------------------------- /libsrc/geos-common/menuicon/recovermenu.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void RecoverMenu (void); 7 | 8 | .export _RecoverMenu 9 | 10 | .include "jumptab.inc" 11 | 12 | _RecoverMenu = RecoverMenu -------------------------------------------------------------------------------- /libsrc/geos-common/system/callroutine.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 21.12.99 5 | 6 | ; void CallRoutine (myRoutine); 7 | 8 | .export _CallRoutine 9 | 10 | .include "jumptab.inc" 11 | 12 | _CallRoutine = CallRoutine -------------------------------------------------------------------------------- /libsrc/telestrat/gotoy.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; jede jede@oric.org 2017-02-25 3 | ; 4 | .export _gotoy 5 | 6 | .import update_adscr 7 | 8 | .include "telestrat.inc" 9 | 10 | .proc _gotoy 11 | sta SCRY 12 | jmp update_adscr 13 | .endproc 14 | -------------------------------------------------------------------------------- /samples/geos/fileselres.grc: -------------------------------------------------------------------------------- 1 | 2 | ; this is the resource file for filesel.c, a GEOS application example 3 | 4 | HEADER APPLICATION "filesel" "FileSel" "V1.0" { 5 | dostype USR 6 | author "Maciej Witkowiak" 7 | info "This is a C prog compiled with cc65 and GEOSLib." 8 | } 9 | -------------------------------------------------------------------------------- /test/err/void-size2.c: -------------------------------------------------------------------------------- 1 | /* 2 | !!DESCRIPTION!! Size of void cast 3 | !!ORIGIN!! cc65 regression tests 4 | !!LICENCE!! Public Domain 5 | !!AUTHOR!! Greg King 6 | */ 7 | 8 | unsigned test (void) 9 | { 10 | return sizeof ((void)12345); 11 | } 12 | -------------------------------------------------------------------------------- /libsrc/apple2/tgi_colors.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Target-specific black & white values for use by the target-shared TGI kernel 3 | ; 4 | 5 | .include "tgi-kernel.inc" 6 | 7 | .export tgi_color_black:zp = $00 8 | .export tgi_color_white:zp = $03 9 | -------------------------------------------------------------------------------- /libsrc/common/errno.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; 2003-08-12, Ullrich von Bassewitz 3 | ; 2015-09-24, Greg King 4 | ; 5 | ; extern int _errno; 6 | ; /* Library errors go here. */ 7 | ; 8 | 9 | .include "errno.inc" 10 | 11 | .bss 12 | 13 | __errno: 14 | .word 0 15 | -------------------------------------------------------------------------------- /libsrc/common/tgi_colors.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Target-specific black & white values for use by the target-shared TGI kernel 3 | ; 4 | 5 | .include "tgi-kernel.inc" 6 | 7 | .export tgi_color_black:zp = $00 8 | .export tgi_color_white:zp = $01 9 | -------------------------------------------------------------------------------- /libsrc/geos-apple/disk/exitturbo.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt (ol.sc@web.de) 3 | ; 4 | ; 2012-02-09 5 | 6 | ; void ExitTurbo (void); 7 | 8 | .export _ExitTurbo 9 | .import return0 10 | 11 | _ExitTurbo = return0 12 | 13 | 14 | -------------------------------------------------------------------------------- /libsrc/geos-cbm/system/libref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2013-05-31 3 | ; 4 | 5 | .export em_libref, joy_libref, tgi_libref 6 | .import _exit 7 | 8 | em_libref := _exit 9 | joy_libref := _exit 10 | tgi_libref := _exit 11 | -------------------------------------------------------------------------------- /libsrc/geos-common/menuicon/gotofirstmenu.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void GotoFirstMenu (void); 7 | 8 | .export _GotoFirstMenu 9 | 10 | .include "jumptab.inc" 11 | 12 | _GotoFirstMenu = GotoFirstMenu -------------------------------------------------------------------------------- /libsrc/geos-common/system/mainloop.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Elysium' Witkowiak 3 | ; 4 | ; 30.10.1999, 10.01.2003 5 | 6 | ; void MainLoop (void); 7 | 8 | .export _MainLoop 9 | 10 | .include "jumptab.inc" 11 | 12 | _MainLoop = MainLoop 13 | -------------------------------------------------------------------------------- /libsrc/lynx/tgi_colors.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Target-specific black & white values for use by the target-shared TGI kernel 3 | ; 4 | 5 | .include "tgi-kernel.inc" 6 | 7 | .export tgi_color_black:zp = $00 8 | .export tgi_color_white:zp = $0F 9 | -------------------------------------------------------------------------------- /samples/geos/geosverres.grc: -------------------------------------------------------------------------------- 1 | 2 | ; this is the resource file for geosver.c, a GEOS application example 3 | 4 | HEADER APPLICATION "geosver" "GEOSver" "V1.0" { 5 | dostype USR 6 | author "Marco van den Heuvel" 7 | info "This is a C prog compiled with cc65 and GEOSLib." 8 | } 9 | -------------------------------------------------------------------------------- /testcode/grc/vlir.grc: -------------------------------------------------------------------------------- 1 | HEADER APPLICATION "test" "TestApp" "V1.0" { 2 | structure VLIR 3 | dostype USR 4 | author "Maciej Witkowiak" 5 | info "This is just an example." 6 | } 7 | 8 | MEMORY { 9 | stacksize 0x0000 10 | overlaysize 0x1000 11 | overlaynums 0 1 2 12 | } 13 | -------------------------------------------------------------------------------- /libsrc/atari5200/setcursor.s: -------------------------------------------------------------------------------- 1 | ; Dummy version, there is no visible cursor in the default CONIO screen 2 | ; 3 | ; 28-May-2014, Christian Groessler 4 | 5 | .export setcursor 6 | 7 | .proc setcursor 8 | 9 | rts 10 | 11 | .endproc 12 | -------------------------------------------------------------------------------- /libsrc/atari5200/wherex.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Carsten Strotmann, 30.12.2002 3 | ; 4 | ; unsigned char wherex (void); 5 | ; 6 | 7 | .export _wherex 8 | .include "atari5200.inc" 9 | 10 | _wherex: 11 | lda COLCRS_5200 12 | ldx #0 13 | rts 14 | -------------------------------------------------------------------------------- /libsrc/atari5200/wherey.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Carsten Strotmann, 30.12.2002 3 | ; 4 | ; unsigned char wherey (void); 5 | ; 6 | 7 | .export _wherey 8 | .include "atari5200.inc" 9 | 10 | _wherey: 11 | lda ROWCRS_5200 12 | ldx #0 13 | rts 14 | -------------------------------------------------------------------------------- /libsrc/c128/joy_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard joystick driver 3 | ; 4 | ; Ullrich von Bassewitz, 2002-12-21 5 | ; 6 | ; const char joy_stddrv[]; 7 | ; 8 | 9 | .export _joy_stddrv 10 | 11 | .rodata 12 | 13 | _joy_stddrv: .asciiz "c128-stdjoy.joy" 14 | 15 | -------------------------------------------------------------------------------- /libsrc/c16/joy_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard joystick driver 3 | ; 4 | ; Ullrich von Bassewitz, 2002-12-21 5 | ; 6 | ; const char joy_stddrv[]; 7 | ; 8 | 9 | .export _joy_stddrv 10 | 11 | .rodata 12 | 13 | _joy_stddrv: .asciiz "c16-stdjoy.joy" 14 | 15 | -------------------------------------------------------------------------------- /libsrc/c64/joy_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard joystick driver 3 | ; 4 | ; Ullrich von Bassewitz, 2002-12-21 5 | ; 6 | ; const char joy_stddrv[]; 7 | ; 8 | 9 | .export _joy_stddrv 10 | 11 | .rodata 12 | 13 | _joy_stddrv: .asciiz "c64-stdjoy.joy" 14 | 15 | -------------------------------------------------------------------------------- /libsrc/c64/mouse_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard mouse driver 3 | ; 4 | ; Ullrich von Bassewitz, 2009-09-11 5 | ; 6 | ; const char mouse_stddrv[]; 7 | ; 8 | 9 | .export _mouse_stddrv 10 | 11 | .rodata 12 | 13 | _mouse_stddrv: .asciiz "c64-1351.mou" 14 | 15 | -------------------------------------------------------------------------------- /libsrc/cx16/joy_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard joystick driver 3 | ; 4 | ; 2019-09-19, Greg King 5 | ; 6 | ; const void joy_static_stddrv[]; 7 | ; 8 | 9 | .import _cx16_stdjoy_joy 10 | .export _joy_static_stddrv := _cx16_stdjoy_joy 11 | -------------------------------------------------------------------------------- /libsrc/geos-common/graph/rectangle.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 29.10.99 5 | 6 | ; void Rectangle (void); 7 | 8 | .export _Rectangle 9 | 10 | .include "jumptab.inc" 11 | 12 | _Rectangle = Rectangle 13 | -------------------------------------------------------------------------------- /libsrc/geos-common/graph/setpattern.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 29.10.99 5 | 6 | ; void SetPattern (char pattern); 7 | 8 | .export _SetPattern 9 | 10 | .include "jumptab.inc" 11 | 12 | _SetPattern = SetPattern 13 | -------------------------------------------------------------------------------- /libsrc/geos-common/graph/usesystemfont.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void UseSystemFont (void); 7 | 8 | .export _UseSystemFont 9 | 10 | .include "jumptab.inc" 11 | 12 | _UseSystemFont = UseSystemFont 13 | -------------------------------------------------------------------------------- /libsrc/geos-common/menuicon/dopreviousmenu.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void DoPreviousMenu (void); 7 | 8 | .export _DoPreviousMenu 9 | 10 | .include "jumptab.inc" 11 | 12 | _DoPreviousMenu = DoPreviousMenu -------------------------------------------------------------------------------- /libsrc/pet/joy_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard joystick driver 3 | ; 4 | ; Ullrich von Bassewitz, 2002-12-21 5 | ; 6 | ; const char joy_stddrv[]; 7 | ; 8 | 9 | .export _joy_stddrv 10 | 11 | .rodata 12 | 13 | _joy_stddrv: .asciiz "pet-stdjoy.joy" 14 | 15 | -------------------------------------------------------------------------------- /samples/geos/rmvprotres.grc: -------------------------------------------------------------------------------- 1 | 2 | ; this is the resource file for rmvprot.c, a GEOS application example 3 | 4 | HEADER APPLICATION "rmvprot" "RmvProt" "V1.0" { 5 | dostype USR 6 | author "Maciej Witkowiak" 7 | info "This will remove the write protection from your bootdisk." 8 | } 9 | -------------------------------------------------------------------------------- /testcode/lib/accelerator/c64dtv-test.c: -------------------------------------------------------------------------------- 1 | /* C64DTV accelerator test code. */ 2 | 3 | #define ACC_DETECT detect_c64dtv 4 | #define ACC_GET_SPEED get_c64dtv_speed 5 | #define ACC_SET_SPEED set_c64dtv_speed 6 | #define ACC_NAME "C64DTV" 7 | 8 | #include "turbo-test.c" 9 | -------------------------------------------------------------------------------- /testcode/lib/accelerator/c65-test.c: -------------------------------------------------------------------------------- 1 | /* C65/C64DX in C64 mode accelerator test code. */ 2 | 3 | #define ACC_DETECT detect_c65 4 | #define ACC_GET_SPEED get_c65_speed 5 | #define ACC_SET_SPEED set_c65_speed 6 | #define ACC_NAME "C65" 7 | 8 | #include "turbo-test.c" 9 | -------------------------------------------------------------------------------- /libsrc/atari5200/cartyear.s: -------------------------------------------------------------------------------- 1 | ; Cartridge copyright year 2 | ; 3 | ; Christian Groessler, 01-Mar-2014 4 | 5 | .export __CART_YEAR__: absolute = 1 6 | 7 | .segment "CARTYEAR" 8 | 9 | .byte '9' + 32,'8' + 32 ; "98", but using playfield 1 10 | -------------------------------------------------------------------------------- /libsrc/atari5200/gotox.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Christian Groessler, 13-Mar-2014 3 | ; 4 | ; void gotox (unsigned char x); 5 | ; 6 | 7 | .include "atari5200.inc" 8 | .export _gotox 9 | 10 | _gotox: 11 | sta COLCRS_5200 ; Set X 12 | rts 13 | -------------------------------------------------------------------------------- /libsrc/atari5200/gotoy.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Christian Groessler, 13-Mar-2014 3 | ; 4 | ; void gotoy (unsigned char y); 5 | ; 6 | 7 | .include "atari5200.inc" 8 | .export _gotoy 9 | 10 | _gotoy: 11 | sta ROWCRS_5200 ; Set Y 12 | rts 13 | -------------------------------------------------------------------------------- /libsrc/geos-cbm/system/setdevice.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 21.12.99 5 | 6 | ; void SetDevice (char newDeviceNumber); 7 | 8 | .export _SetDevice 9 | 10 | .include "jumptab.inc" 11 | 12 | _SetDevice = SetDevice 13 | -------------------------------------------------------------------------------- /libsrc/geos-common/common/memcpy.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; void* __fastcall__ memcpy (void* dest, const void* src, size_t n); 3 | ; 4 | ; Maciej 'YTM/Elysium' Witkowiak, 15.07.2001 5 | ; 6 | 7 | .export _memcpy 8 | .import _MoveData 9 | 10 | _memcpy = _MoveData 11 | -------------------------------------------------------------------------------- /libsrc/geos-common/menuicon/recoverallmenus.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void RecoverAllMenus (void); 7 | 8 | .export _RecoverAllMenus 9 | 10 | .include "jumptab.inc" 11 | 12 | _RecoverAllMenus = RecoverAllMenus -------------------------------------------------------------------------------- /libsrc/geos-common/mousesprite/clearmousemode.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void ClearMouseMode (void); 7 | 8 | .export _ClearMouseMode 9 | 10 | .include "jumptab.inc" 11 | 12 | _ClearMouseMode = ClearMouseMode -------------------------------------------------------------------------------- /libsrc/plus4/joy_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard joystick driver 3 | ; 4 | ; Ullrich von Bassewitz, 2002-12-21 5 | ; 6 | ; const char joy_stddrv[]; 7 | ; 8 | 9 | .export _joy_stddrv 10 | 11 | .rodata 12 | 13 | _joy_stddrv: .asciiz "plus4-stdjoy.joy" 14 | 15 | -------------------------------------------------------------------------------- /libsrc/vic20/joy_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard joystick driver 3 | ; 4 | ; Ullrich von Bassewitz, 2002-12-21 5 | ; 6 | ; const char joy_stddrv[]; 7 | ; 8 | 9 | .export _joy_stddrv 10 | 11 | .rodata 12 | 13 | _joy_stddrv: .asciiz "vic20-stdjoy.joy" 14 | 15 | -------------------------------------------------------------------------------- /samples/geos/vector-demores.grc: -------------------------------------------------------------------------------- 1 | 2 | ; this is the resource file for vector-demo.c, a GEOS application example 3 | 4 | HEADER APPLICATION "vectordemo" "VectorDemo" "V1.0" { 5 | dostype USR 6 | author "Maciej Witkowiak" 7 | info "This is a C prog compiled with cc65 and GEOSLib." 8 | } 9 | -------------------------------------------------------------------------------- /testcode/lib/accelerator/c64-c128-test.c: -------------------------------------------------------------------------------- 1 | /* C128 in C64 mode accelerator test code. */ 2 | 3 | #define ACC_DETECT detect_c128 4 | #define ACC_GET_SPEED get_c128_speed 5 | #define ACC_SET_SPEED set_c128_speed 6 | #define ACC_NAME "C128 CPU" 7 | 8 | #include "turbo-test.c" 9 | -------------------------------------------------------------------------------- /libsrc/c128/mouse_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard mouse driver 3 | ; 4 | ; Ullrich von Bassewitz, 2009-09-11 5 | ; 6 | ; const char mouse_stddrv[]; 7 | ; 8 | 9 | .export _mouse_stddrv 10 | 11 | .rodata 12 | 13 | _mouse_stddrv: .asciiz "c128-1351.mou" 14 | 15 | 16 | -------------------------------------------------------------------------------- /libsrc/geos-common/common/memmove.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; void* __fastcall__ memmove (void* dest, const void* src, size_t n); 3 | ; 4 | ; Maciej 'YTM/Elysium' Witkowiak, 15.07.2001 5 | ; 6 | 7 | .export _memmove 8 | .import _MoveData 9 | 10 | _memmove = _MoveData 11 | -------------------------------------------------------------------------------- /libsrc/geos-common/mousesprite/inittextprompt.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 21.12.99 5 | 6 | ; void InitTextPrompt (char height); 7 | 8 | .export _InitTextPrompt 9 | 10 | .include "jumptab.inc" 11 | 12 | _InitTextPrompt = InitTextPrompt -------------------------------------------------------------------------------- /libsrc/geos-common/runtime/call.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Elysium' Witkowiak 3 | ; 23.12.2002 4 | ; 5 | ; CC65 runtime: call function via pointer in ax 6 | ; 7 | 8 | .export callax 9 | 10 | .include "jumptab.inc" 11 | 12 | callax = CallRoutine 13 | -------------------------------------------------------------------------------- /libsrc/geos-common/system/tgi_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard tgi driver 3 | ; 4 | ; Oliver Schmidt, 2011-05-02 5 | ; 6 | ; const char tgi_stddrv[]; 7 | ; 8 | 9 | .export _tgi_stddrv 10 | 11 | .rodata 12 | 13 | _tgi_stddrv: 14 | .asciiz "geos-tgi.tgi" 15 | -------------------------------------------------------------------------------- /libsrc/runtime/jmpvec.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2002-12-26 3 | ; 4 | ; CC65 runtime: Jump vector that resides in the data segment so its address 5 | ; may be patched at runtime. 6 | ; 7 | 8 | .export jmpvec 9 | 10 | .data 11 | 12 | jmpvec: jmp $FFFF 13 | 14 | 15 | -------------------------------------------------------------------------------- /libsrc/serial/ser_close.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-08-22 3 | ; 4 | ; unsigned char ser_close (void); 5 | ; /* "Close" the port. Clear buffers and and disable interrupts. */ 6 | 7 | 8 | .include "ser-kernel.inc" 9 | 10 | _ser_close = ser_close 11 | -------------------------------------------------------------------------------- /test/val/bug735.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | unsigned char failures = 0; 4 | 5 | int main(void) 6 | { 7 | int i; 8 | 9 | i = 0; 10 | if ((i > 1) && (i < 3)) { 11 | failures++; 12 | } 13 | 14 | printf("failures: %u\n", failures); 15 | return failures; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /test/val/bug830.c: -------------------------------------------------------------------------------- 1 | #include "unittest.h" 2 | 3 | char test[1]; 4 | char *dst = &test[0]; 5 | 6 | TEST 7 | { 8 | char src = 0; 9 | *dst = (src == 0) ? 42 : src; 10 | 11 | ASSERT_AreEqual(42, *dst, "%u", "Incorrect ternary expression evaluation!"); 12 | } 13 | ENDTEST 14 | -------------------------------------------------------------------------------- /libsrc/apple2/iobuf.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 10.9.2009 3 | ; 4 | ; Default ProDOS 8 I/O buffer management 5 | ; 6 | 7 | .export iobuf_alloc, iobuf_free 8 | .import _posix_memalign, _free 9 | 10 | iobuf_alloc := _posix_memalign 11 | iobuf_free := _free 12 | -------------------------------------------------------------------------------- /libsrc/cbm/c_close.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 03.06.1999 3 | ; 4 | ; void __fastcall__ cbm_k_close (unsigned char FN); 5 | ; 6 | 7 | .include "cbm.inc" 8 | 9 | .export _cbm_k_close 10 | 11 | _cbm_k_close: 12 | clc 13 | jmp CLOSE 14 | -------------------------------------------------------------------------------- /libsrc/geos-common/drivers/mouse_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard mouse driver 3 | ; 4 | ; 2010-01-25, Greg King 5 | ; 6 | ; const char mouse_stddrv[]; 7 | ; 8 | 9 | .export _mouse_stddrv 10 | 11 | .rodata 12 | 13 | _mouse_stddrv: 14 | .asciiz "geos-stdmou.mou" 15 | -------------------------------------------------------------------------------- /testcode/lib/accelerator/c64-c128-scpu-test.c: -------------------------------------------------------------------------------- 1 | /* C64/C128 SuperCPU accelerator test code. */ 2 | 3 | #define ACC_DETECT detect_scpu 4 | #define ACC_GET_SPEED get_scpu_speed 5 | #define ACC_SET_SPEED set_scpu_speed 6 | #define ACC_NAME "SuperCPU" 7 | 8 | #include "turbo-test.c" 9 | -------------------------------------------------------------------------------- /libsrc/atari/sdxtime-bss.s: -------------------------------------------------------------------------------- 1 | ; .bss variable used by SpartaDOS-X implementations of 2 | ; gettime.s and settime.s 3 | 4 | .export sdxtry 5 | 6 | .bss 7 | 8 | sdxtry: .res 1 ; limit of unsuccessful tries to call GETTD/SETTD 9 | ; (see settime.s) 10 | -------------------------------------------------------------------------------- /libsrc/common/unlink.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-06-12 3 | ; 4 | ; int __fastcall__ unlink (const char* name); 5 | ; 6 | 7 | .export _unlink 8 | .import _remove 9 | 10 | ; unlink is just an alias for remove 11 | 12 | _unlink = _remove 13 | 14 | -------------------------------------------------------------------------------- /libsrc/geos-common/dlgbox/rstrfrmdialogue.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 25.12.99 5 | 6 | ; char RstrFrmDialogue (void); 7 | 8 | .export _RstrFrmDialogue 9 | 10 | .include "jumptab.inc" 11 | 12 | _RstrFrmDialogue = RstrFrmDialogue 13 | -------------------------------------------------------------------------------- /libsrc/lynx/tgi_irq.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2018-02-02 3 | ; 4 | 5 | .export tgi_libref 6 | .interruptor tgi_irq ; Export as IRQ handler 7 | 8 | .data 9 | 10 | tgi_libref: 11 | tgi_irq: .byte $60, $00, $00 ; RTS plus two dummy bytes 12 | -------------------------------------------------------------------------------- /libsrc/apple2/dioclose.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 24.03.2005 3 | ; 4 | ; unsigned char __fastcall__ dio_close (dhandle_t handle); 5 | ; 6 | 7 | .export _dio_close 8 | .import dioepilog 9 | 10 | _dio_close: 11 | lda #$00 12 | jmp dioepilog 13 | -------------------------------------------------------------------------------- /libsrc/cbm/c_getin.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2012-07-01 3 | ; 4 | ; unsigned char cbm_k_getin (void); 5 | ; 6 | 7 | .include "cbm.inc" 8 | 9 | .export _cbm_k_getin 10 | 11 | _cbm_k_getin: 12 | jsr GETIN 13 | ldx #0 14 | rts 15 | -------------------------------------------------------------------------------- /libsrc/common/_oserror.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 16.05.2000 3 | ; 4 | ; extern unsigned char _oserror; 5 | ; /* Operating system specific errors from the low level functions */ 6 | 7 | 8 | .export __oserror 9 | 10 | .bss 11 | 12 | __oserror: 13 | .res 1 14 | 15 | -------------------------------------------------------------------------------- /libsrc/geos-common/graph/framerectangle.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 29.10.99 5 | 6 | ; void FrameRectangle (char pattern); 7 | 8 | .export _FrameRectangle 9 | 10 | .include "jumptab.inc" 11 | 12 | _FrameRectangle = FrameRectangle 13 | -------------------------------------------------------------------------------- /libsrc/geos-common/graph/invertrectangle.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 29.10.99 5 | 6 | ; void InvertRectangle (void); 7 | 8 | .export _InvertRectangle 9 | 10 | .include "jumptab.inc" 11 | 12 | _InvertRectangle = InvertRectangle 13 | 14 | -------------------------------------------------------------------------------- /libsrc/runtime/incax3.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 05.08.1998 3 | ; 4 | ; CC65 runtime: Increment ax by 3 5 | ; 6 | 7 | .export incax3 8 | .import incaxy 9 | 10 | .proc incax3 11 | 12 | ldy #3 13 | jmp incaxy 14 | 15 | .endproc 16 | 17 | -------------------------------------------------------------------------------- /libsrc/runtime/incax5.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 05.08.1998 3 | ; 4 | ; CC65 runtime: Increment ax by 5 5 | ; 6 | 7 | .export incax5 8 | .import incaxy 9 | 10 | .proc incax5 11 | 12 | ldy #5 13 | jmp incaxy 14 | 15 | .endproc 16 | 17 | -------------------------------------------------------------------------------- /libsrc/runtime/incax6.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 05.08.1998 3 | ; 4 | ; CC65 runtime: Increment ax by 6 5 | ; 6 | 7 | .export incax6 8 | .import incaxy 9 | 10 | .proc incax6 11 | 12 | ldy #6 13 | jmp incaxy 14 | 15 | .endproc 16 | 17 | -------------------------------------------------------------------------------- /libsrc/runtime/incax7.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 05.08.1998 3 | ; 4 | ; CC65 runtime: Increment ax by 7 5 | ; 6 | 7 | .export incax7 8 | .import incaxy 9 | 10 | .proc incax7 11 | 12 | ldy #7 13 | jmp incaxy 14 | 15 | .endproc 16 | 17 | -------------------------------------------------------------------------------- /libsrc/runtime/incax8.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 05.08.1998 3 | ; 4 | ; CC65 runtime: Increment ax by 8 5 | ; 6 | 7 | .export incax8 8 | .import incaxy 9 | 10 | .proc incax8 11 | 12 | ldy #8 13 | jmp incaxy 14 | 15 | .endproc 16 | 17 | -------------------------------------------------------------------------------- /test/val/bug367.c: -------------------------------------------------------------------------------- 1 | #include "unittest.h" 2 | 3 | TEST 4 | { 5 | unsigned int y=192; 6 | unsigned int d=y&0xFFF8; 7 | unsigned int e=d*32+d*8; 8 | unsigned int f=d*40; 9 | 10 | ASSERT_AreEqual(f, e, "%u", "Multiplication results differ (should be 7680)!"); 11 | } 12 | ENDTEST 13 | -------------------------------------------------------------------------------- /libsrc/atari/mouseref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Christian Groessler, 2014-04-22 3 | ; 4 | 5 | .export mouse_libref 6 | 7 | .ifdef __ATARIXL__ 8 | .import set_VTIMR2_handler 9 | mouse_libref := set_VTIMR2_handler 10 | .else 11 | .import _exit 12 | mouse_libref := _exit 13 | .endif 14 | -------------------------------------------------------------------------------- /libsrc/cbm/c_acptr.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 03.06.1999 3 | ; 4 | ; unsigned char cbm_k_acptr (void); 5 | ; 6 | 7 | .include "cbm.inc" 8 | 9 | .export _cbm_k_acptr 10 | 11 | 12 | _cbm_k_acptr: 13 | jsr ACPTR 14 | ldx #0 15 | rts 16 | -------------------------------------------------------------------------------- /libsrc/cbm/filetype.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2012-07-15 3 | ; 4 | ; Default file type used when creating new files 5 | ; 6 | 7 | .export __filetype 8 | 9 | 10 | .data 11 | 12 | __filetype: 13 | .byte 's' ; Create sequential files by default 14 | 15 | 16 | -------------------------------------------------------------------------------- /libsrc/creativision/_scrsize.s: -------------------------------------------------------------------------------- 1 | ;* 2 | ;** _scrsize.s 3 | ;* 4 | 5 | .export screensize 6 | 7 | .include "creativision.inc" 8 | 9 | .proc screensize 10 | 11 | ldx #SCREEN_COLS 12 | ldy #SCREEN_ROWS 13 | rts 14 | 15 | .endproc 16 | -------------------------------------------------------------------------------- /libsrc/geos-common/system/joy_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard joystick driver 3 | ; 4 | ; Ullrich von Bassewitz, 2002-12-21 5 | ; 6 | ; const char joy_stddrv[]; 7 | ; 8 | 9 | .export _joy_stddrv 10 | 11 | .rodata 12 | 13 | _joy_stddrv: 14 | .asciiz "geos-stdjoy.joy" 15 | 16 | -------------------------------------------------------------------------------- /libsrc/lynx/oserror.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Karri Kaksonen, 2010 3 | ; 4 | ; int __fastcall__ _osmaperrno (unsigned char oserror); 5 | ; /* Map a system specific error into a system independent code */ 6 | ; 7 | 8 | .include "errno.inc" 9 | 10 | .code 11 | 12 | __osmaperrno: 13 | rts 14 | 15 | -------------------------------------------------------------------------------- /libsrc/pet/kreadst.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 19.11.2002 3 | ; 4 | ; READST replacement function for the PETs 5 | ; 6 | 7 | .export READST 8 | .importzp ST 9 | 10 | 11 | .proc READST 12 | 13 | lda ST 14 | rts 15 | 16 | .endproc 17 | 18 | 19 | -------------------------------------------------------------------------------- /libsrc/runtime/return0.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 25.10.2000 3 | ; 4 | ; CC65 runtime: Return 0 in a/x 5 | ; 6 | 7 | .export return0 8 | 9 | .proc return0 10 | 11 | lda #0 12 | tax 13 | rts 14 | 15 | .endproc 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /testcode/lib/accelerator/chameleon-test.c: -------------------------------------------------------------------------------- 1 | /* C64 Chameleon accelerator test code. */ 2 | 3 | #define ACC_DETECT detect_chameleon 4 | #define ACC_GET_SPEED get_chameleon_speed 5 | #define ACC_SET_SPEED set_chameleon_speed 6 | #define ACC_NAME "Chameleon cartridge" 7 | 8 | #include "turbo-test.c" 9 | -------------------------------------------------------------------------------- /libsrc/apple2/wherey.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Kevin Ruland 3 | ; 4 | ; unsigned char wherey (void); 5 | ; 6 | 7 | .export _wherey 8 | 9 | .include "apple2.inc" 10 | 11 | _wherey: 12 | lda CV 13 | sec 14 | sbc WNDTOP 15 | ldx #$00 16 | rts 17 | -------------------------------------------------------------------------------- /libsrc/atari/_sys.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Christian Groessler, 17-Sep-2013 3 | ; 4 | ; Override _sys() function for Atari targets: 5 | ; 'atari' gets the regular function 6 | ; 'atarixl' doesn't support the _sys() function 7 | ; 8 | 9 | .ifndef __ATARIXL__ 10 | 11 | .include "../common/_sys.s" 12 | 13 | .endif 14 | -------------------------------------------------------------------------------- /libsrc/c64/tgi_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard tgi driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void tgi_static_stddrv[]; 7 | ; 8 | 9 | .export _tgi_static_stddrv 10 | .import _c64_hi_tgi 11 | 12 | .rodata 13 | 14 | _tgi_static_stddrv := _c64_hi_tgi 15 | -------------------------------------------------------------------------------- /libsrc/cbm510/kscreen.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-12-19 3 | ; 4 | ; SCREEN kernal call 5 | ; 6 | 7 | .export SCREEN 8 | 9 | 10 | .proc SCREEN 11 | 12 | ldx #40 ; Columns 13 | ldy #25 ; Lines 14 | rts 15 | 16 | .endproc 17 | -------------------------------------------------------------------------------- /libsrc/cbm610/kscreen.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-12-19 3 | ; 4 | ; SCREEN kernal call 5 | ; 6 | 7 | .export SCREEN 8 | 9 | 10 | .proc SCREEN 11 | 12 | ldx #80 ; Columns 13 | ldy #25 ; Lines 14 | rts 15 | 16 | .endproc 17 | -------------------------------------------------------------------------------- /libsrc/creativision/cgetc.s: -------------------------------------------------------------------------------- 1 | ;* cgetc 2 | 3 | .export _cgetc 4 | .include "creativision.inc" 5 | 6 | _cgetc: 7 | lda #$80 8 | 9 | L1: bit ZP_KEYBOARD 10 | bpl L1 11 | 12 | lda ZP_KEYBOARD 13 | and #$7F 14 | rts 15 | -------------------------------------------------------------------------------- /libsrc/geos-common/mousesprite/startmousemode.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void StartMouseMode (void); 7 | 8 | .export _StartMouseMode 9 | 10 | .include "jumptab.inc" 11 | 12 | _StartMouseMode: 13 | clc 14 | jmp StartMouseMode -------------------------------------------------------------------------------- /libsrc/geos-common/system/enterdesktop.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Elysium' Witkowiak 3 | ; 4 | ; 30.10.99, 17.04.2003 5 | 6 | ; void EnterDeskTop (void); 7 | 8 | .import _exit 9 | .export _EnterDeskTop 10 | 11 | _EnterDeskTop: 12 | lda #0 13 | tax 14 | jmp _exit 15 | -------------------------------------------------------------------------------- /libsrc/runtime/return1.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 25.10.2000 3 | ; 4 | ; CC65 runtime: Return 1 in a/x 5 | ; 6 | 7 | .export return1 8 | 9 | .proc return1 10 | 11 | ldx #0 12 | lda #1 13 | rts 14 | 15 | .endproc 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /libsrc/atari5200/joy_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard joystick driver 3 | ; 4 | ; Christian Groessler, 2014-05-12 5 | ; 6 | ; const void joy_static_stddrv[]; 7 | ; 8 | 9 | .export _joy_static_stddrv 10 | .import _atr5200std_joy 11 | 12 | _joy_static_stddrv := _atr5200std_joy 13 | -------------------------------------------------------------------------------- /libsrc/c128/c64mode.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-02-13 3 | ; 4 | ; void c64mode (void); 5 | ; /* Switch the C128 into C64 mode. Note: This function will not return! */ 6 | ; 7 | 8 | .export _c64mode 9 | .import C64MODE 10 | 11 | _c64mode = C64MODE 12 | 13 | -------------------------------------------------------------------------------- /libsrc/c128/tgi_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard tgi driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void tgi_static_stddrv[]; 7 | ; 8 | 9 | .export _tgi_static_stddrv 10 | .import _c128_vdc_tgi 11 | 12 | .rodata 13 | 14 | _tgi_static_stddrv := _c128_vdc_tgi 15 | -------------------------------------------------------------------------------- /libsrc/cbm/wherex.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 06.08.1998 3 | ; 4 | ; unsigned char wherex (void); 5 | ; 6 | 7 | .export _wherex 8 | .import CURS_X: zp 9 | 10 | 11 | .proc _wherex 12 | lda CURS_X 13 | ldx #$00 14 | rts 15 | .endproc 16 | 17 | -------------------------------------------------------------------------------- /libsrc/cbm/wherey.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 06.08.1998 3 | ; 4 | ; unsigned char wherey (void); 5 | ; 6 | 7 | .export _wherey 8 | .import CURS_Y: zp 9 | 10 | 11 | .proc _wherey 12 | lda CURS_Y 13 | ldx #$00 14 | rts 15 | .endproc 16 | 17 | -------------------------------------------------------------------------------- /libsrc/cbm510/mouse_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard mouse driver 3 | ; 4 | ; 2009-09-11, Ullrich von Bassewitz 5 | ; 2013-06-25, Greg King 6 | ; 7 | ; const char mouse_stddrv[]; 8 | ; 9 | 10 | .export _mouse_stddrv 11 | 12 | .rodata 13 | 14 | _mouse_stddrv: .asciiz "cbm510-joy.mou" 15 | 16 | 17 | -------------------------------------------------------------------------------- /libsrc/common/doesclrscr.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Christian Groessler, June-2016 3 | ; 4 | ; unsigned char doesclrscr(void); 5 | ; 6 | ; returns 0/1 if after program termination the screen isn't/is cleared 7 | ; 8 | 9 | .export _doesclrscrafterexit 10 | .import return0 11 | 12 | _doesclrscrafterexit = return0 13 | -------------------------------------------------------------------------------- /libsrc/joystick/joy_count.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2002-12-20 3 | ; 4 | ; unsigned char joy_count (void); 5 | ; /* Return the number of joysticks supported by the driver */ 6 | ; 7 | 8 | .include "joy-kernel.inc" 9 | 10 | _joy_count = joy_count ; Use driver entry 11 | -------------------------------------------------------------------------------- /libsrc/joystick/joy_read.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2002-12-20 3 | ; 4 | ; unsigned char __fastcall__ joy_read (unsigned char joystick); 5 | ; /* Read a particular joystick */ 6 | ; 7 | 8 | .include "joy-kernel.inc" 9 | 10 | _joy_read = joy_read ; Use driver entry 11 | -------------------------------------------------------------------------------- /libsrc/pce/callptr4.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; CC65 runtime: call function via pointer in ptr4 3 | ; 4 | ; 2018-02-28, Greg King 5 | ; 6 | 7 | .export callptr4 8 | .importzp ptr4 9 | 10 | callptr4: 11 | 12 | ; The PC-Engine puts the zero-page at $2000. 13 | 14 | jmp (ptr4 + $2000) 15 | -------------------------------------------------------------------------------- /libsrc/vic20/waitvsync.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Written by Groepaz 3 | ; 4 | ; void waitvsync (void); 5 | ; 6 | 7 | .export _waitvsync 8 | 9 | .include "vic20.inc" 10 | 11 | _waitvsync: 12 | @l2: 13 | lda VIC_HLINE 14 | bne @l2 15 | rts 16 | 17 | -------------------------------------------------------------------------------- /test/misc/endless.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | int main(void) 6 | { 7 | printf("entering endless loop\n"); 8 | for(;;) { 9 | ; 10 | } 11 | printf("error: should not come here\n"); 12 | return EXIT_SUCCESS; /* test verifies failure, not success */ 13 | } 14 | -------------------------------------------------------------------------------- /libsrc/geos-common/graph/imprintrectangle.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 21.12.99 5 | 6 | ; void ImprintRectangle (void); 7 | 8 | .export _ImprintRectangle 9 | 10 | .include "jumptab.inc" 11 | 12 | _ImprintRectangle = ImprintRectangle 13 | 14 | -------------------------------------------------------------------------------- /libsrc/geos-common/graph/recoverrectangle.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 29.10.99 5 | 6 | ; void RecoverRectangle (void); 7 | 8 | .export _RecoverRectangle 9 | 10 | .include "jumptab.inc" 11 | 12 | _RecoverRectangle = RecoverRectangle 13 | 14 | -------------------------------------------------------------------------------- /libsrc/geos-common/system/getrandom.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Elysium' Witkowiak 3 | ; 4 | ; 30.10.1999, 2.1.2003 5 | 6 | ; char GetRandom (void); 7 | 8 | .export _GetRandom 9 | 10 | .include "jumptab.inc" 11 | 12 | _GetRandom: 13 | jsr GetRandom 14 | ldx #0 15 | rts 16 | -------------------------------------------------------------------------------- /libsrc/nes/tgi_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard tgi driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void tgi_static_stddrv[]; 7 | ; 8 | 9 | .export _tgi_static_stddrv 10 | .import _nes_64_56_2_tgi 11 | 12 | .rodata 13 | 14 | _tgi_static_stddrv := _nes_64_56_2_tgi 15 | -------------------------------------------------------------------------------- /libsrc/runtime/call.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 06.08.1998 3 | ; 4 | ; CC65 runtime: call function via pointer in ax 5 | ; 6 | 7 | .export callax 8 | .importzp ptr1 9 | 10 | callax: sta ptr1 11 | stx ptr1+1 12 | jmp (ptr1) ; jump there 13 | 14 | -------------------------------------------------------------------------------- /libsrc/runtime/incsp8.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 25.10.2000 3 | ; 4 | ; CC65 runtime: Increment the stackpointer by 8 5 | ; 6 | 7 | .export incsp8 8 | .import addysp 9 | 10 | .proc incsp8 11 | 12 | ldy #8 13 | jmp addysp 14 | 15 | .endproc 16 | 17 | 18 | -------------------------------------------------------------------------------- /testcode/lib/accelerator/turbomaster-test.c: -------------------------------------------------------------------------------- 1 | /* C64 Turbo Master accelerator test code. */ 2 | 3 | #define ACC_DETECT detect_turbomaster 4 | #define ACC_GET_SPEED get_turbomaster_speed 5 | #define ACC_SET_SPEED set_turbomaster_speed 6 | #define ACC_NAME "Turbo Master cartridge" 7 | 8 | #include "turbo-test.c" 9 | -------------------------------------------------------------------------------- /libsrc/atari/gotoy.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Christian Groessler, 19-Feb-2000 3 | ; 4 | ; void gotoy (unsigned char y); 5 | ; 6 | 7 | .include "atari.inc" 8 | .export _gotoy 9 | .import setcursor 10 | 11 | _gotoy: 12 | sta ROWCRS ; Set Y 13 | jmp setcursor 14 | -------------------------------------------------------------------------------- /libsrc/atmos/gotox.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-04-13 3 | ; 4 | ; void gotox (unsigned char x); 5 | ; 6 | 7 | .export _gotox 8 | 9 | .include "atmos.inc" 10 | 11 | .proc _gotox 12 | 13 | sta CURS_X ; Set X 14 | rts 15 | 16 | .endproc 17 | 18 | 19 | -------------------------------------------------------------------------------- /libsrc/atmos/gotoy.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-04-13 3 | ; 4 | ; void gotoy (unsigned char y); 5 | ; 6 | 7 | .export _gotoy 8 | 9 | .include "atmos.inc" 10 | 11 | .proc _gotoy 12 | 13 | sta CURS_Y ; Set Y 14 | rts 15 | 16 | .endproc 17 | 18 | 19 | -------------------------------------------------------------------------------- /libsrc/atmos/joy_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard joystick driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void joy_static_stddrv[]; 7 | ; 8 | 9 | .export _joy_static_stddrv 10 | .import _atmos_pase_joy 11 | 12 | .rodata 13 | 14 | _joy_static_stddrv := _atmos_pase_joy 15 | -------------------------------------------------------------------------------- /libsrc/c128/joy_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard joystick driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void joy_static_stddrv[]; 7 | ; 8 | 9 | .export _joy_static_stddrv 10 | .import _c128_stdjoy_joy 11 | 12 | .rodata 13 | 14 | _joy_static_stddrv := _c128_stdjoy_joy 15 | -------------------------------------------------------------------------------- /libsrc/c16/joy_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard joystick driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void joy_static_stddrv[]; 7 | ; 8 | 9 | .export _joy_static_stddrv 10 | .import _c16_stdjoy_joy 11 | 12 | .rodata 13 | 14 | _joy_static_stddrv := _c16_stdjoy_joy 15 | -------------------------------------------------------------------------------- /libsrc/c64/joy_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard joystick driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void joy_static_stddrv[]; 7 | ; 8 | 9 | .export _joy_static_stddrv 10 | .import _c64_stdjoy_joy 11 | 12 | .rodata 13 | 14 | _joy_static_stddrv := _c64_stdjoy_joy 15 | -------------------------------------------------------------------------------- /libsrc/c64/mouse_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard mouse driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void mouse_static_stddrv[]; 7 | ; 8 | 9 | .export _mouse_static_stddrv 10 | .import _c64_1351_mou 11 | 12 | .rodata 13 | 14 | _mouse_static_stddrv := _c64_1351_mou 15 | -------------------------------------------------------------------------------- /libsrc/cbm510/joy_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard joystick driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void joy_static_stddrv[]; 7 | ; 8 | 9 | .export _joy_static_stddrv 10 | .import _cbm510_std_joy 11 | 12 | .rodata 13 | 14 | _joy_static_stddrv := _cbm510_std_joy 15 | -------------------------------------------------------------------------------- /libsrc/cbm510/kiobase.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-12-19 3 | ; 4 | ; IOBASE kernal call 5 | ; 6 | 7 | .export IOBASE 8 | .import cia : zeropage 9 | 10 | 11 | 12 | .proc IOBASE 13 | 14 | ldx cia 15 | ldy cia+1 16 | rts 17 | 18 | .endproc 19 | 20 | -------------------------------------------------------------------------------- /libsrc/cbm610/kiobase.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-12-19 3 | ; 4 | ; IOBASE kernal call 5 | ; 6 | 7 | .export IOBASE 8 | .import cia : zeropage 9 | 10 | 11 | 12 | .proc IOBASE 13 | 14 | ldx cia 15 | ldy cia+1 16 | rts 17 | 18 | .endproc 19 | 20 | -------------------------------------------------------------------------------- /libsrc/geos-common/common/abort.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** abort.c 3 | ** 4 | ** Maciej 'YTM/Elysium' Witkowiak 15.7.2001 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | void abort (void) 11 | { 12 | ExitTurbo(); 13 | DlgBoxOk(CBOLDON "ABNORMAL PROGRAM", "TERMINATION." CPLAINTEXT); 14 | exit(3); 15 | } 16 | -------------------------------------------------------------------------------- /libsrc/lynx/joy_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard joystick driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void joy_static_stddrv[]; 7 | ; 8 | 9 | .export _joy_static_stddrv 10 | .import _lynx_stdjoy_joy 11 | 12 | .rodata 13 | 14 | _joy_static_stddrv := _lynx_stdjoy_joy 15 | -------------------------------------------------------------------------------- /libsrc/nes/joy_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard joystick driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void joy_static_stddrv[]; 7 | ; 8 | 9 | .export _joy_static_stddrv 10 | .import _nes_stdjoy_joy 11 | 12 | .rodata 13 | 14 | _joy_static_stddrv := _nes_stdjoy_joy 15 | -------------------------------------------------------------------------------- /libsrc/pet/joy_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard joystick driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void joy_static_stddrv[]; 7 | ; 8 | 9 | .export _joy_static_stddrv 10 | .import _pet_stdjoy_joy 11 | 12 | .rodata 13 | 14 | _joy_static_stddrv := _pet_stdjoy_joy 15 | -------------------------------------------------------------------------------- /libsrc/atmos/tgi_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard tgi driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void tgi_static_stddrv[]; 7 | ; 8 | 9 | .export _tgi_static_stddrv 10 | .import _atmos_240_200_2_tgi 11 | 12 | .rodata 13 | 14 | _tgi_static_stddrv := _atmos_240_200_2_tgi 15 | -------------------------------------------------------------------------------- /libsrc/atmos/wherex.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-04-13 3 | ; 4 | ; unsigned char wherex (void); 5 | ; 6 | 7 | .export _wherex 8 | 9 | .include "atmos.inc" 10 | 11 | .proc _wherex 12 | 13 | ldx #$00 14 | lda CURS_X 15 | rts 16 | 17 | .endproc 18 | 19 | -------------------------------------------------------------------------------- /libsrc/c128/mouse_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard mouse driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void mouse_static_stddrv[]; 7 | ; 8 | 9 | .export _mouse_static_stddrv 10 | .import _c128_1351_mou 11 | 12 | .rodata 13 | 14 | _mouse_static_stddrv := _c128_1351_mou 15 | -------------------------------------------------------------------------------- /libsrc/creativision/joy_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard joystick driver 3 | ; 4 | ; Christian Groessler, 2017-02-06 5 | ; 6 | ; const void joy_static_stddrv[]; 7 | ; 8 | 9 | .export _joy_static_stddrv 10 | .import _creativisionstd_joy 11 | 12 | _joy_static_stddrv := _creativisionstd_joy 13 | -------------------------------------------------------------------------------- /libsrc/em/em_copyfrom.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2002-11-29 3 | ; 4 | ; void __fastcall__ em_copyfrom (const struct em_copy* copy_data); 5 | ; /* Copy from extended into linear memory */ 6 | 7 | 8 | .include "em-kernel.inc" 9 | 10 | _em_copyfrom = emd_copyfrom ; Use driver entry 11 | 12 | -------------------------------------------------------------------------------- /libsrc/em/em_copyto.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2002-11-29 3 | ; 4 | ; void __fastcall__ em_copyto (const struct em_copy* copy_data); 5 | ; /* Copy from linear into extended memory */ 6 | 7 | 8 | .include "em-kernel.inc" 9 | 10 | _em_copyto = emd_copyto ; Use driver entry 11 | 12 | -------------------------------------------------------------------------------- /libsrc/lynx/tgi_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard tgi driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void tgi_static_stddrv[]; 7 | ; 8 | 9 | .export _tgi_static_stddrv 10 | .import _lynx_160_102_16_tgi 11 | 12 | .rodata 13 | 14 | _tgi_static_stddrv := _lynx_160_102_16_tgi 15 | -------------------------------------------------------------------------------- /libsrc/nes/wherex.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-05-02 3 | ; 4 | ; unsigned char wherex (void); 5 | ; 6 | 7 | .export _wherex 8 | 9 | .include "nes.inc" 10 | 11 | .proc _wherex 12 | 13 | lda CURS_X 14 | ldx #$00 15 | rts 16 | 17 | .endproc 18 | 19 | 20 | -------------------------------------------------------------------------------- /libsrc/nes/wherey.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-05-02 3 | ; 4 | ; unsigned char wherey (void); 5 | ; 6 | 7 | .export _wherey 8 | 9 | .include "nes.inc" 10 | 11 | .proc _wherey 12 | 13 | lda CURS_Y 14 | ldx #$00 15 | rts 16 | 17 | .endproc 18 | 19 | 20 | -------------------------------------------------------------------------------- /libsrc/osic1p/wherex.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 06.08.1998 3 | ; Copied from cbm/wherex.s 4 | 5 | ; unsigned char wherex (void); 6 | ; 7 | .export _wherex 8 | .include "extzp.inc" 9 | 10 | .proc _wherex 11 | lda CURS_X 12 | ldx #$00 13 | rts 14 | .endproc 15 | -------------------------------------------------------------------------------- /libsrc/osic1p/wherey.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 06.08.1998 3 | ; Copied from cbm/wherey.s 4 | ; 5 | ; unsigned char wherey (void); 6 | ; 7 | .export _wherey 8 | .include "extzp.inc" 9 | 10 | .proc _wherey 11 | lda CURS_Y 12 | ldx #$00 13 | rts 14 | .endproc 15 | -------------------------------------------------------------------------------- /libsrc/pce/joy_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard joystick driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void joy_static_stddrv[]; 7 | ; 8 | 9 | .export _joy_static_stddrv 10 | 11 | .import _pce_stdjoy_joy 12 | 13 | _joy_static_stddrv := _pce_stdjoy_joy 14 | -------------------------------------------------------------------------------- /libsrc/plus4/joy_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard joystick driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void joy_static_stddrv[]; 7 | ; 8 | 9 | .export _joy_static_stddrv 10 | .import _plus4_stdjoy_joy 11 | 12 | .rodata 13 | 14 | _joy_static_stddrv := _plus4_stdjoy_joy 15 | -------------------------------------------------------------------------------- /libsrc/runtime/shrax1.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 06.08.1998 3 | ; 4 | ; CC65 runtime: Scale the primary register 5 | ; 6 | 7 | .export shrax1 8 | .importzp tmp1 9 | 10 | shrax1: stx tmp1 11 | lsr tmp1 12 | ror a 13 | ldx tmp1 14 | rts 15 | 16 | -------------------------------------------------------------------------------- /libsrc/vic20/joy_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard joystick driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void joy_static_stddrv[]; 7 | ; 8 | 9 | .export _joy_static_stddrv 10 | .import _vic20_stdjoy_joy 11 | 12 | .rodata 13 | 14 | _joy_static_stddrv := _vic20_stdjoy_joy 15 | -------------------------------------------------------------------------------- /libsrc/atmos/wherey.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-04-13 3 | ; 4 | ; unsigned char wherey (void); 5 | ; 6 | 7 | .export _wherey 8 | 9 | .include "atmos.inc" 10 | 11 | .proc _wherey 12 | 13 | ldx #$00 14 | lda CURS_Y 15 | rts 16 | 17 | .endproc 18 | 19 | 20 | -------------------------------------------------------------------------------- /libsrc/c16/joy/c16-stdjoy.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Standard joystick driver for the C16. May be used multiple times when linked 3 | ; to the statically application. 4 | ; 5 | ; Ullrich von Bassewitz, 2002-12-21 6 | ; 7 | 8 | .define MODULE_LABEL _c16_stdjoy_joy 9 | 10 | .include "../../plus4/joy/plus4-stdjoy.s" 11 | -------------------------------------------------------------------------------- /libsrc/cbm/c_basin.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 03.06.1999 3 | ; 4 | ; unsigned char cbm_k_basin (void); 5 | ; 6 | 7 | .include "cbm.inc" 8 | 9 | .export _cbm_k_basin 10 | 11 | 12 | _cbm_k_basin: 13 | jsr BASIN 14 | ldx #0 ; Clear high byte 15 | rts 16 | -------------------------------------------------------------------------------- /libsrc/common/strcoll.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 11.12.1998 3 | ; 4 | ; int strcoll (const char* s1, const char* s2); 5 | ; 6 | ; Since we don't have locales, this function is equivalent to strcmp. 7 | ; 8 | 9 | .export _strcoll 10 | .import _strcmp 11 | 12 | _strcoll = _strcmp 13 | 14 | -------------------------------------------------------------------------------- /libsrc/common/strxfrm.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** strxfrm.c 3 | ** 4 | ** Ullrich von Bassewitz, 11.12.1998 5 | */ 6 | 7 | 8 | 9 | #include 10 | 11 | 12 | 13 | size_t __fastcall__ strxfrm (char* dest, const char* src, size_t count) 14 | { 15 | strncpy (dest, src, count); 16 | return strlen (src); 17 | } 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /libsrc/creativision/wherex.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-05-02 3 | ; 4 | ; unsigned char wherex (void); 5 | ; 6 | 7 | .export _wherex 8 | .include "creativision.inc" 9 | 10 | .proc _wherex 11 | 12 | lda CURSOR_X 13 | ldx #$00 14 | rts 15 | 16 | .endproc 17 | -------------------------------------------------------------------------------- /libsrc/creativision/wherey.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-05-02 3 | ; 4 | ; unsigned char wherey (void); 5 | ; 6 | 7 | .export _wherey 8 | .include "creativision.inc" 9 | 10 | .proc _wherey 11 | 12 | lda CURSOR_Y 13 | ldx #$00 14 | rts 15 | 16 | .endproc 17 | -------------------------------------------------------------------------------- /libsrc/gamate/joy_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard joystick driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void joy_static_stddrv[]; 7 | ; 8 | 9 | .export _joy_static_stddrv 10 | .import _gamate_stdjoy_joy 11 | 12 | _joy_static_stddrv := _gamate_stdjoy_joy 13 | -------------------------------------------------------------------------------- /libsrc/runtime/decax1.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 29.12.1999 3 | ; 4 | ; CC65 runtime: Decrement ax by 1 5 | ; 6 | 7 | .export decax1 8 | 9 | .macpack generic 10 | 11 | .proc decax1 12 | 13 | sub #1 14 | bcs @L9 15 | dex 16 | @L9: rts 17 | 18 | .endproc 19 | -------------------------------------------------------------------------------- /libsrc/runtime/decax2.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 29.12.1999 3 | ; 4 | ; CC65 runtime: Decrement ax by 2 5 | ; 6 | 7 | .export decax2 8 | 9 | .macpack generic 10 | 11 | .proc decax2 12 | 13 | sub #2 14 | bcs @L9 15 | dex 16 | @L9: rts 17 | 18 | .endproc 19 | -------------------------------------------------------------------------------- /libsrc/runtime/decax3.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.03.2001 3 | ; 4 | ; CC65 runtime: Decrement ax by 3 5 | ; 6 | 7 | .export decax3 8 | 9 | .macpack generic 10 | 11 | .proc decax3 12 | 13 | sub #3 14 | bcs @L9 15 | dex 16 | @L9: rts 17 | 18 | .endproc 19 | -------------------------------------------------------------------------------- /libsrc/runtime/decax4.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.03.2001 3 | ; 4 | ; CC65 runtime: Decrement ax by 4 5 | ; 6 | 7 | .export decax4 8 | 9 | .macpack generic 10 | 11 | .proc decax4 12 | 13 | sub #4 14 | bcs @L9 15 | dex 16 | @L9: rts 17 | 18 | .endproc 19 | -------------------------------------------------------------------------------- /libsrc/runtime/decax5.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.03.2001 3 | ; 4 | ; CC65 runtime: Decrement ax by 5 5 | ; 6 | 7 | .export decax5 8 | 9 | .macpack generic 10 | 11 | .proc decax5 12 | 13 | sub #5 14 | bcs @L9 15 | dex 16 | @L9: rts 17 | 18 | .endproc 19 | -------------------------------------------------------------------------------- /libsrc/runtime/decax6.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.03.2001 3 | ; 4 | ; CC65 runtime: Decrement ax by 6 5 | ; 6 | 7 | .export decax6 8 | 9 | .macpack generic 10 | 11 | .proc decax6 12 | 13 | sub #6 14 | bcs @L9 15 | dex 16 | @L9: rts 17 | 18 | .endproc 19 | -------------------------------------------------------------------------------- /libsrc/runtime/decax7.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.03.2001 3 | ; 4 | ; CC65 runtime: Decrement ax by 7 5 | ; 6 | 7 | .export decax7 8 | 9 | .macpack generic 10 | 11 | .proc decax7 12 | 13 | sub #7 14 | bcs @L9 15 | dex 16 | @L9: rts 17 | 18 | .endproc 19 | -------------------------------------------------------------------------------- /libsrc/runtime/decax8.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.03.2001 3 | ; 4 | ; CC65 runtime: Decrement ax by 8 5 | ; 6 | 7 | .export decax8 8 | 9 | .macpack generic 10 | 11 | .proc decax8 12 | 13 | sub #8 14 | bcs @L9 15 | dex 16 | @L9: rts 17 | 18 | .endproc 19 | -------------------------------------------------------------------------------- /libsrc/runtime/incax2.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 05.08.1998 3 | ; 4 | ; CC65 runtime: Increment ax by 2 5 | ; 6 | 7 | .export incax2 8 | 9 | .macpack generic 10 | 11 | .proc incax2 12 | 13 | add #2 14 | bcc @L9 15 | inx 16 | @L9: rts 17 | 18 | .endproc 19 | -------------------------------------------------------------------------------- /libsrc/runtime/lne.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 05.08.1998 3 | ; 4 | ; CC65 runtime: long not equal 5 | ; 6 | 7 | .export tosneeax 8 | .import toslcmp, boolne 9 | 10 | tosneeax: 11 | jsr toslcmp ; Set flags 12 | jmp boolne ; Convert to boolean 13 | 14 | 15 | -------------------------------------------------------------------------------- /asminc/get_tv.inc: -------------------------------------------------------------------------------- 1 | ; 2 | ; get_tv.inc 3 | ; 4 | ; Ullrich von Bassewitz, 2004-10-15 5 | ; 6 | ; Defines for the get_tv function. 7 | 8 | 9 | 10 | ; Error codes returned by all functions 11 | .enum TV 12 | NTSC 13 | PAL 14 | OTHER 15 | .endenum 16 | 17 | 18 | ; get_tv function 19 | 20 | .global _get_tv 21 | 22 | 23 | -------------------------------------------------------------------------------- /libsrc/cbm/c_readst.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 03.06.1999 3 | ; 4 | ; unsigned char cbm_k_readst (void); 5 | ; 6 | 7 | .include "cbm.inc" 8 | 9 | .export _cbm_k_readst 10 | 11 | 12 | _cbm_k_readst: 13 | jsr READST 14 | ldx #0 ; Clear high byte 15 | rts 16 | -------------------------------------------------------------------------------- /libsrc/cbm/gotox.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 07.08.1998 3 | ; 4 | ; void gotox (unsigned char x); 5 | ; 6 | 7 | .export _gotox 8 | .import plot 9 | .importzp CURS_X 10 | 11 | _gotox: sta CURS_X ; Set new position 12 | jmp plot ; And activate it 13 | 14 | -------------------------------------------------------------------------------- /libsrc/cbm510/mouse_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard mouse driver 3 | ; 4 | ; 2012-11-01, Oliver Schmidt 5 | ; 2013-08-06, Greg King 6 | ; 7 | ; const void mouse_static_stddrv[]; 8 | ; 9 | 10 | .export _mouse_static_stddrv 11 | .import _cbm510_joy_mou 12 | 13 | _mouse_static_stddrv := _cbm510_joy_mou 14 | -------------------------------------------------------------------------------- /libsrc/em/em_pagecount.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2002-11-29 3 | ; 4 | ; unsigned em_pagecount (void); 5 | ; /* Return the total number of 256 byte pages available in extended memory. */ 6 | 7 | 8 | .include "em-kernel.inc" 9 | 10 | _em_pagecount = emd_pagecount ; Use driver entry 11 | 12 | -------------------------------------------------------------------------------- /libsrc/geos-cbm/disk/newdisk.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Elysium' Witkowiak 3 | ; 4 | ; 21.12.1999, 2.1.2003 5 | 6 | ; char NewDisk (void); 7 | 8 | .export _NewDisk 9 | .import setoserror 10 | 11 | .include "jumptab.inc" 12 | 13 | _NewDisk: 14 | jsr NewDisk 15 | jmp setoserror 16 | -------------------------------------------------------------------------------- /libsrc/geos-common/graph/getcharwidth.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Elysium' Witkowiak 3 | ; 4 | ; 21.12.1999, 2.1.2003 5 | 6 | ; char GetCharWidth (char character); 7 | 8 | .export _GetCharWidth 9 | 10 | .include "jumptab.inc" 11 | 12 | _GetCharWidth: 13 | jsr GetCharWidth 14 | ldx #0 15 | rts 16 | -------------------------------------------------------------------------------- /libsrc/runtime/llt.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 07.08.1998 3 | ; 4 | ; CC65 runtime: Compare < for long ints 5 | ; 6 | 7 | .export toslteax 8 | .import toslcmp, boollt 9 | 10 | toslteax: 11 | jsr toslcmp ; Set the flags 12 | jmp boollt ; Convert to boolean 13 | -------------------------------------------------------------------------------- /libsrc/apple2/libref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2013-05-31 3 | ; 4 | 5 | .export em_libref, joy_libref, mouse_libref, ser_libref, tgi_libref 6 | .import _exit 7 | 8 | em_libref := _exit 9 | joy_libref := _exit 10 | mouse_libref := _exit 11 | ser_libref := _exit 12 | tgi_libref := _exit 13 | -------------------------------------------------------------------------------- /libsrc/atari/_scrsize.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.10.2000 3 | ; 4 | ; Screen size variables 5 | ; 6 | 7 | .export screensize 8 | .include "atari.inc" 9 | 10 | .proc screensize 11 | 12 | ldx RMARGN 13 | inx 14 | ldy #24 15 | rts 16 | 17 | .endproc 18 | 19 | 20 | -------------------------------------------------------------------------------- /libsrc/c16/kclose.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-12-21 3 | ; 4 | ; CLOSE replacement function 5 | ; 6 | 7 | .export CLOSE 8 | 9 | .proc CLOSE 10 | clc ; Force C64 compatible behaviour 11 | jmp $FFC3 ; Call the ROM routine 12 | .endproc 13 | 14 | 15 | -------------------------------------------------------------------------------- /libsrc/c64/soft80_cpeekrevers.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; 2017-12-28, Groepaz 3 | ; 4 | ; unsigned char cpeekrevers (void); 5 | ; 6 | 7 | .import soft80_cpeekchar 8 | 9 | .export soft80_cpeekrevers 10 | 11 | soft80_cpeekrevers: 12 | jsr soft80_cpeekchar 13 | txa 14 | ldx #0 15 | rts 16 | -------------------------------------------------------------------------------- /libsrc/cbm/gotoy.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 0.08.1998 3 | ; 4 | ; void gotoy (unsigned char y); 5 | ; 6 | 7 | .export _gotoy 8 | .import plot 9 | .importzp CURS_Y 10 | 11 | _gotoy: sta CURS_Y ; Set the new position 12 | jmp plot ; And activate it 13 | 14 | -------------------------------------------------------------------------------- /libsrc/geos-common/graph/bitmapup.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 21.12.99 5 | 6 | ; void BitmapUp (struct iconpic *myGfx); 7 | 8 | .import BitmapRegs 9 | .export _BitmapUp 10 | 11 | .include "jumptab.inc" 12 | 13 | _BitmapUp: 14 | jsr BitmapRegs 15 | jmp BitmapUp 16 | -------------------------------------------------------------------------------- /libsrc/runtime/lge.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 07.08.1998 3 | ; 4 | ; CC65 runtime: Compare >= for long ints 5 | ; 6 | 7 | .export tosgeeax 8 | .import toslcmp, boolge 9 | 10 | tosgeeax: 11 | jsr toslcmp ; Set the flags 12 | jmp boolge ; Convert to boolean 13 | 14 | -------------------------------------------------------------------------------- /libsrc/runtime/lle.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 07.08.1998 3 | ; 4 | ; CC65 runtime: Compare <= for long ints 5 | ; 6 | 7 | .export tosleeax 8 | .import toslcmp, boolle 9 | 10 | tosleeax: 11 | jsr toslcmp ; Set the flags 12 | jmp boolle ; Convert to boolean 13 | 14 | -------------------------------------------------------------------------------- /libsrc/runtime/lult.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 10.12.1998 3 | ; 4 | ; CC65 runtime: Compare < for long unsigneds 5 | ; 6 | 7 | .export tosulteax 8 | .import toslcmp, boolult 9 | 10 | tosulteax: 11 | jsr toslcmp ; Set the flags 12 | jmp boolult ; Convert to boolean 13 | -------------------------------------------------------------------------------- /asminc/module.mac: -------------------------------------------------------------------------------- 1 | .ifndef DYN_DRV 2 | DYN_DRV = 1 3 | .endif 4 | 5 | .macro module_header module_label 6 | .if DYN_DRV 7 | .segment "HEADER" 8 | .else 9 | .data 10 | .export module_label 11 | module_label: 12 | .endif 13 | .endmacro 14 | -------------------------------------------------------------------------------- /libsrc/gamate/_scrsize.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Screen size variables 3 | ; 4 | .include "gamate.inc" 5 | 6 | .export screensize 7 | screensize: 8 | ldx xsize 9 | ldy ysize 10 | rts 11 | 12 | .rodata 13 | .export xsize, ysize 14 | 15 | xsize: .byte charsperline 16 | ysize: .byte screenrows 17 | -------------------------------------------------------------------------------- /libsrc/geos-cbm/disk/setgeosdisk.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Elysium' Witkowiak 3 | ; 4 | ; 21.12.1999, 2.1.2003 5 | 6 | ; char SetGEOSDisk (void); 7 | 8 | .export _SetGEOSDisk 9 | .import setoserror 10 | 11 | .include "jumptab.inc" 12 | 13 | _SetGEOSDisk: 14 | jsr SetGEOSDisk 15 | jmp setoserror 16 | -------------------------------------------------------------------------------- /libsrc/geos-cbm/system/initdoneio.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void InitForIO (void); 7 | ; void DoneWithIO (void); 8 | 9 | .export _InitForIO, _DoneWithIO 10 | 11 | .include "jumptab.inc" 12 | 13 | _InitForIO = InitForIO 14 | 15 | _DoneWithIO = DoneWithIO -------------------------------------------------------------------------------- /libsrc/geos-common/disk/gettrse.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 29.1.00 5 | 6 | .export gettrse 7 | .importzp ptr4 8 | 9 | gettrse: 10 | sta ptr4 11 | stx ptr4+1 12 | ldy #1 13 | lda (ptr4),y 14 | tax 15 | dey 16 | lda (ptr4),y 17 | rts 18 | -------------------------------------------------------------------------------- /libsrc/geos-common/mousesprite/enablsprite.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void EnablSprite (char spritenum); 7 | 8 | .export _EnablSprite 9 | 10 | .include "jumptab.inc" 11 | .include "geossym.inc" 12 | 13 | _EnablSprite: 14 | sta r3L 15 | jmp EnablSprite -------------------------------------------------------------------------------- /libsrc/runtime/incsp3.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 25.10.2000 3 | ; 4 | ; CC65 runtime: Increment the stackpointer by 3 5 | ; 6 | 7 | .export incsp3 8 | .import addysp 9 | 10 | .proc incsp3 11 | 12 | ldy #3 13 | jmp addysp 14 | 15 | .endproc 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /libsrc/runtime/incsp4.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 25.10.2000 3 | ; 4 | ; CC65 runtime: Increment the stackpointer by 4 5 | ; 6 | 7 | .export incsp4 8 | .import addysp 9 | 10 | .proc incsp4 11 | 12 | ldy #4 13 | jmp addysp 14 | 15 | .endproc 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /libsrc/runtime/incsp5.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 25.10.2000 3 | ; 4 | ; CC65 runtime: Increment the stackpointer by 5 5 | ; 6 | 7 | .export incsp5 8 | .import addysp 9 | 10 | .proc incsp5 11 | 12 | ldy #5 13 | jmp addysp 14 | 15 | .endproc 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /libsrc/runtime/incsp6.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 25.10.2000 3 | ; 4 | ; CC65 runtime: Increment the stackpointer by 6 5 | ; 6 | 7 | .export incsp6 8 | .import addysp 9 | 10 | .proc incsp6 11 | 12 | ldy #6 13 | jmp addysp 14 | 15 | .endproc 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /libsrc/runtime/incsp7.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 25.10.2000 3 | ; 4 | ; CC65 runtime: Increment the stackpointer by 7 5 | ; 6 | 7 | .export incsp7 8 | .import addysp 9 | 10 | .proc incsp7 11 | 12 | ldy #7 13 | jmp addysp 14 | 15 | .endproc 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /libsrc/runtime/lgt.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 07.08.1998 3 | ; 4 | ; CC65 runtime: Compare > for long ints 5 | ; 6 | 7 | .export tosgteax 8 | .import toslcmp, boolgt 9 | 10 | tosgteax: 11 | jsr toslcmp ; Set the flags 12 | jmp boolgt ; Convert to boolean 13 | 14 | 15 | -------------------------------------------------------------------------------- /libsrc/supervision/joy_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard joystick driver 3 | ; 4 | ; Oliver Schmidt, 2012-11-01 5 | ; 6 | ; const void joy_static_stddrv[]; 7 | ; 8 | 9 | .export _joy_static_stddrv 10 | .import _supervision_stdjoy_joy 11 | 12 | _joy_static_stddrv := _supervision_stdjoy_joy 13 | -------------------------------------------------------------------------------- /libsrc/telestrat/tgi_stat_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Address of the static standard tgi driver 3 | ; 4 | ; Jede (jede@oric.org), 2017-10-15 5 | ; 6 | ; const void tgi_static_stddrv[]; 7 | ; 8 | 9 | .export _tgi_static_stddrv 10 | .import _telestrat_240_200_2_tgi 11 | 12 | .rodata 13 | 14 | _tgi_static_stddrv := _telestrat_240_200_2_tgi 15 | -------------------------------------------------------------------------------- /libsrc/tgi/tgi_getxres.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 21.06.2002 3 | ; 4 | ; unsigned tgi_getxres (void); 5 | ; /* Return the resolution in X direction */ 6 | 7 | 8 | .include "tgi-kernel.inc" 9 | 10 | .proc _tgi_getxres 11 | 12 | lda _tgi_xres 13 | ldx _tgi_xres+1 14 | rts 15 | 16 | .endproc 17 | -------------------------------------------------------------------------------- /libsrc/tgi/tgi_getyres.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 21.06.2002 3 | ; 4 | ; unsigned tgi_getyres (void); 5 | ; /* Return the resolution in Y direction */ 6 | 7 | 8 | .include "tgi-kernel.inc" 9 | 10 | .proc _tgi_getyres 11 | 12 | lda _tgi_yres 13 | ldx _tgi_yres+1 14 | rts 15 | 16 | .endproc 17 | -------------------------------------------------------------------------------- /libsrc/atari/bordercolor.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Christian Groessler, 02-Apr-2019 3 | ; 4 | 5 | .export _bordercolor 6 | 7 | .include "atari.inc" 8 | 9 | 10 | _bordercolor: 11 | ldx COLOR4 ; get old value 12 | sta COLOR4 ; set new value 13 | txa 14 | ldx #0 ; fix X 15 | rts 16 | -------------------------------------------------------------------------------- /libsrc/atari/do_oserr.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; __do_oserror updates __oserror and errno. Do a JMP here right after 3 | ; calling CIOV. It will return with AX set to -1 ($FFFF). It expects the CIO 4 | ; status in Y. 5 | ; 6 | .include "errno.inc" 7 | 8 | .export __do_oserror 9 | 10 | __do_oserror: 11 | tya 12 | jmp __mappederrno 13 | -------------------------------------------------------------------------------- /libsrc/c64/soft80_scrsize.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Groepaz/Hitmen, 12.10.2015 3 | ; 4 | ; lowlevel screensize function for the soft80 implementation 5 | ; 6 | 7 | .export soft80_screensize 8 | 9 | .include "soft80.inc" 10 | 11 | soft80_screensize: 12 | ldy #screenrows 13 | ldx #charsperline 14 | rts 15 | -------------------------------------------------------------------------------- /libsrc/geos-cbm/disk/dio_qsize.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2012-10-23 3 | ; 4 | ; unsigned __fastcall__ dio_query_sectsize (dhandle_t handle); 5 | ; 6 | 7 | .export _dio_query_sectsize 8 | .import __oserror 9 | 10 | _dio_query_sectsize: 11 | lda #<256 12 | ldx #>256 13 | sta __oserror 14 | rts 15 | -------------------------------------------------------------------------------- /libsrc/geos-common/mousesprite/disablsprite.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void DisablSprite (char spritenum); 7 | 8 | .export _DisablSprite 9 | 10 | .include "jumptab.inc" 11 | .include "geossym.inc" 12 | 13 | _DisablSprite: 14 | sta r3L 15 | jmp DisablSprite -------------------------------------------------------------------------------- /libsrc/runtime/luge.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 10.12.1998 3 | ; 4 | ; CC65 runtime: Compare >= for long unsigneds 5 | ; 6 | 7 | .export tosugeeax 8 | .import toslcmp, booluge 9 | 10 | tosugeeax: 11 | jsr toslcmp ; Set the flags 12 | jmp booluge ; Convert to boolean 13 | 14 | -------------------------------------------------------------------------------- /libsrc/runtime/lule.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 10.12.1998 3 | ; 4 | ; CC65 runtime: Compare <= for long unsigneds 5 | ; 6 | 7 | .export tosuleeax 8 | .import toslcmp, boolule 9 | 10 | tosuleeax: 11 | jsr toslcmp ; Set the flags 12 | jmp boolule ; Convert to boolean 13 | 14 | -------------------------------------------------------------------------------- /libsrc/telestrat/gotox.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; jede jede@oric.org 2017-02-25 3 | ; 4 | .export _gotox 5 | .import OLD_CHARCOLOR, OLD_BGCOLOR 6 | 7 | .include "telestrat.inc" 8 | 9 | .proc _gotox 10 | sta SCRX 11 | 12 | lda #$FF 13 | sta OLD_CHARCOLOR 14 | sta OLD_BGCOLOR 15 | rts 16 | .endproc 17 | -------------------------------------------------------------------------------- /libsrc/apple2/_scrsize.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.10.2000 3 | ; 4 | ; Screen size variables 5 | ; 6 | 7 | .export screensize 8 | 9 | .include "apple2.inc" 10 | 11 | screensize: 12 | ldx WNDWDTH 13 | lda WNDBTM 14 | sec 15 | sbc WNDTOP 16 | tay 17 | rts 18 | -------------------------------------------------------------------------------- /libsrc/cbm/c_iobase.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 03.06.1999 3 | ; 4 | ; unsigned cbm_k_iobase (void); 5 | ; 6 | 7 | .include "cbm.inc" 8 | 9 | .export _cbm_k_iobase 10 | 11 | _cbm_k_iobase: 12 | jsr IOBASE 13 | txa 14 | pha 15 | tya 16 | tax 17 | pla 18 | rts 19 | -------------------------------------------------------------------------------- /libsrc/geos-common/memory/copystring.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 22.12.99 5 | 6 | ; void CopyString (char *dest, char* source); 7 | 8 | .import DoubleSPop 9 | .export _CopyString 10 | 11 | .include "jumptab.inc" 12 | 13 | _CopyString: 14 | jsr DoubleSPop 15 | jmp CopyString 16 | -------------------------------------------------------------------------------- /libsrc/geos-common/memory/doublepop.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 31.12.99 5 | 6 | .import popax 7 | .export DoublePop 8 | 9 | .include "geossym.inc" 10 | 11 | DoublePop: 12 | sta r0L 13 | stx r0H 14 | jsr popax 15 | sta r1L 16 | stx r1H 17 | rts 18 | -------------------------------------------------------------------------------- /libsrc/geos-common/memory/initram.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void InitRam (struct inittab*); 7 | 8 | .export _InitRam 9 | 10 | .include "jumptab.inc" 11 | .include "geossym.inc" 12 | 13 | _InitRam: 14 | sta r0L 15 | stx r0H 16 | jmp InitRam 17 | -------------------------------------------------------------------------------- /libsrc/pet/kernal.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 19.11.2002 3 | ; 4 | ; PET kernal functions 5 | ; 6 | 7 | .include "cbm_kernal.inc" 8 | 9 | .export CLRCH 10 | .export BASIN 11 | .export STOP 12 | .export GETIN 13 | .export CLALL 14 | .export UDTIM 15 | -------------------------------------------------------------------------------- /libsrc/runtime/compl.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 06.08.1998 3 | ; 4 | ; CC65 runtime: integer complement 5 | ; 6 | 7 | .export complax 8 | 9 | complax: 10 | eor #$FF ; Not A 11 | pha 12 | txa 13 | eor #$FF ; Not X 14 | tax 15 | pla 16 | rts 17 | 18 | -------------------------------------------------------------------------------- /libsrc/runtime/leq.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 05.08.1998 3 | ; 4 | ; CC65 runtime: long equal 5 | ; 6 | 7 | .export toseqeax 8 | .import toslcmp, booleq 9 | 10 | toseqeax: 11 | jsr toslcmp ; Set flags 12 | jmp booleq ; Convert to boolean 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /libsrc/runtime/lugt.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 10.12.1998 3 | ; 4 | ; CC65 runtime: Compare > for long unsigneds 5 | ; 6 | 7 | .export tosugteax 8 | .import toslcmp, boolugt 9 | 10 | tosugteax: 11 | jsr toslcmp ; Set the flags 12 | jmp boolugt ; Convert to boolean 13 | 14 | 15 | -------------------------------------------------------------------------------- /samples/geos/overlay-demores.grc: -------------------------------------------------------------------------------- 1 | HEADER APPLICATION "Overlay Demo" "Overlay Demo" "V1.0" { 2 | author "Oliver Schmidt" 3 | info "This is a minimalistic cc65 GEOSLib overlay demo program written in C." 4 | date 12 01 01 12 00 5 | structure VLIR 6 | } 7 | 8 | MEMORY { 9 | overlaysize 0x1000 10 | overlaynums 0 1 2 3 11 | } 12 | -------------------------------------------------------------------------------- /libsrc/common/abort.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** abort.c 3 | ** 4 | ** Ullrich von Bassewitz, 02.06.1998 5 | */ 6 | 7 | 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | 14 | 15 | void abort (void) 16 | { 17 | raise (SIGABRT); 18 | fputs ("ABNORMAL PROGRAM TERMINATION\n", stderr); 19 | exit (3); 20 | } 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /libsrc/geos-common/menuicon/doicons.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void DoIcons (struct icontab *myicons); 7 | 8 | .export _DoIcons 9 | 10 | .include "jumptab.inc" 11 | .include "geossym.inc" 12 | 13 | _DoIcons: 14 | sta r0L 15 | stx r0H 16 | jmp DoIcons -------------------------------------------------------------------------------- /libsrc/nes/waitvsync.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Written by Groepaz 3 | ; Cleanup by Ullrich von Bassewitz 4 | ; 5 | ; void waitvsync(void); 6 | ; 7 | 8 | .export _waitvsync 9 | 10 | .include "nes.inc" 11 | 12 | .proc _waitvsync 13 | 14 | wait: lda PPU_STATUS 15 | bpl wait 16 | rts 17 | 18 | .endproc 19 | -------------------------------------------------------------------------------- /libsrc/tgi/tgi_free_vectorfont.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2009-11-01 3 | ; 4 | ; void tgi_free_vectorfont (const tgi_vectorfont* font); 5 | ; /* Free a vector font that was previously loaded into memory. */ 6 | ; 7 | ; This function is identical to free(void*) 8 | ; 9 | 10 | .import _free 11 | .export _tgi_free_vectorfont := _free 12 | 13 | -------------------------------------------------------------------------------- /libsrc/tgi/tgi_getcolorcount.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 22.06.2002 3 | ; 4 | ; unsigned char tgi_getcolorcount (void); 5 | ; /* Get the number of available colors */ 6 | 7 | .include "tgi-kernel.inc" 8 | 9 | .proc _tgi_getcolorcount 10 | 11 | lda _tgi_colorcount 12 | ldx #0 13 | rts 14 | 15 | .endproc 16 | -------------------------------------------------------------------------------- /libsrc/apple2/tgi_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard tgi driver 3 | ; 4 | ; Oliver Schmidt, 2011-05-02 5 | ; 6 | ; const char tgi_stddrv[]; 7 | ; 8 | 9 | .export _tgi_stddrv 10 | 11 | .rodata 12 | 13 | _tgi_stddrv: 14 | .ifdef __APPLE2ENH__ 15 | .asciiz "A2E.HI.TGI" 16 | .else 17 | .asciiz "A2.HI.TGI" 18 | .endif 19 | -------------------------------------------------------------------------------- /libsrc/c64/waitvsync.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Written by Groepaz 3 | ; 4 | ; void waitvsync (void); 5 | ; 6 | 7 | .export _waitvsync 8 | 9 | .include "c64.inc" 10 | 11 | _waitvsync: 12 | @l1: 13 | bit VIC_CTRL1 14 | bpl @l1 15 | @l2: 16 | bit VIC_CTRL1 17 | bmi @l2 18 | rts 19 | -------------------------------------------------------------------------------- /libsrc/mouse/mouse_getbox.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2009-09-26 3 | ; 4 | ; void __fastcall__ mouse_getbox (struct mouse_box* box); 5 | ; /* Get the current bounding box for the mouse pointer movement. */ 6 | ; 7 | ; 8 | 9 | .include "mouse-kernel.inc" 10 | 11 | _mouse_getbox := mouse_getbox ; Call driver directly 12 | 13 | 14 | -------------------------------------------------------------------------------- /libsrc/pet/ksetnam.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 19.11.2002 3 | ; 4 | ; SETNAM replacement function for the PETs 5 | ; 6 | 7 | .export SETNAM 8 | 9 | .include "pet.inc" 10 | 11 | 12 | .proc SETNAM 13 | 14 | sta FNLEN 15 | stx FNADR 16 | sty FNADR+1 17 | rts 18 | 19 | .endproc 20 | 21 | -------------------------------------------------------------------------------- /libsrc/plus4/waitvsync.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Written by Groepaz 3 | ; 4 | ; void waitvsync (void); 5 | ; 6 | 7 | .export _waitvsync 8 | 9 | .include "plus4.inc" 10 | 11 | _waitvsync: 12 | @l1: 13 | lda TED_VLINEHI 14 | and #$01 15 | ora TED_VLINELO 16 | bne @l1 17 | rts 18 | -------------------------------------------------------------------------------- /libsrc/telestrat/sysremove.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Jede, 10.11.2017 3 | ; 4 | ; unsigned char __fastcall__ _sysremove (const char* name); 5 | ; 6 | 7 | .export __sysremove 8 | 9 | 10 | .include "zeropage.inc" 11 | .include "telestrat.inc" 12 | 13 | __sysremove: 14 | ; Push name 15 | BRK_TELEMON(XRM) 16 | rts 17 | -------------------------------------------------------------------------------- /test/ref/minimal.c: -------------------------------------------------------------------------------- 1 | /* 2 | !!DESCRIPTION!! minimal Program, checks if the Compiler and testsuite framework works 3 | !!ORIGIN!! testsuite 4 | !!LICENCE!! Public Domain 5 | !!AUTHOR!! Groepaz/Hitmen 6 | */ 7 | 8 | #include 9 | 10 | int main(void) 11 | { 12 | #if 1 13 | printf("it works :)\n"); 14 | #endif 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /libsrc/atari/libref.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2013-05-31 3 | ; 4 | 5 | .export em_libref, joy_libref, tgi_libref 6 | .import _exit 7 | 8 | em_libref := _exit 9 | joy_libref := _exit 10 | .ifdef __ATARIXL__ 11 | .import CIO_handler 12 | tgi_libref := CIO_handler 13 | .else 14 | tgi_libref := _exit 15 | .endif 16 | -------------------------------------------------------------------------------- /libsrc/atari/save_area.inc: -------------------------------------------------------------------------------- 1 | ; 2 | ; Atari XL, shared data between 2nd load chunk and main chunk, header file 3 | ; 4 | ; Contains old values of modified system variables and ports. 5 | ; 6 | ; Christian Groessler, chris@groessler.org, 2013 7 | ; 8 | 9 | .import SAVMSC_save 10 | .import MEMTOP_save 11 | .import APPMHI_save 12 | .import RAMTOP_save 13 | .import PORTB_save 14 | -------------------------------------------------------------------------------- /libsrc/atari5200/cartname.s: -------------------------------------------------------------------------------- 1 | ; default cartridge name 2 | ; 3 | ; Christian Groessler, 01-Mar-2014 4 | 5 | .export __CART_NAME__: absolute = 1 6 | 7 | .macpack atari 8 | 9 | .segment "CARTNAME" 10 | 11 | scrcode " cc" 12 | .byte '6' + 32, '5' + 32 ; use playfield 1 13 | scrcode " compiled" 14 | -------------------------------------------------------------------------------- /libsrc/atmos/_scrsize.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; 2003-04-13, Ullrich von Bassewitz 3 | ; 2013-07-16, Greg King 4 | ; 5 | ; Screen size variables 6 | ; 7 | 8 | .export screensize 9 | .include "atmos.inc" 10 | 11 | .proc screensize 12 | 13 | ldx #SCREEN_XSIZE 14 | ldy #SCREEN_YSIZE 15 | rts 16 | 17 | .endproc 18 | 19 | 20 | -------------------------------------------------------------------------------- /libsrc/cbm/c_open.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 03.06.1999 3 | ; 4 | ; unsigned char cbm_k_open (void); 5 | ; 6 | 7 | .include "cbm.inc" 8 | 9 | .export _cbm_k_open 10 | 11 | 12 | _cbm_k_open: 13 | jsr OPEN 14 | ldx #0 ; Clear high byte 15 | bcs @NotOk 16 | txa 17 | @NotOk: rts 18 | -------------------------------------------------------------------------------- /libsrc/geos-cbm/disk/dio_qcount.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2012-10-23 3 | ; 4 | ; unsigned __fastcall__ dio_query_sectcount (dhandle_t handle); 5 | ; 6 | 7 | .export _dio_query_sectcount 8 | .import __oserror 9 | 10 | _dio_query_sectcount: 11 | lda #0 12 | sta __oserror 13 | lda #<683 14 | ldx #>683 15 | rts 16 | -------------------------------------------------------------------------------- /libsrc/geos-common/file/readbyte.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Elysium' Witkowiak 3 | ; 4 | ; 25.12.1999, 2.1.2003 5 | 6 | ; char ReadByte (void); 7 | 8 | .import __oserror 9 | .export _ReadByte 10 | 11 | .include "jumptab.inc" 12 | 13 | _ReadByte: 14 | jsr ReadByte 15 | stx __oserror 16 | ldx #0 17 | rts 18 | -------------------------------------------------------------------------------- /libsrc/geos-common/graph/invertline.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 29.10.99 5 | 6 | ; void InvertLine (char y, int xstart, int xend); 7 | 8 | .import HLineRegs 9 | .export _InvertLine 10 | 11 | .include "jumptab.inc" 12 | 13 | _InvertLine: 14 | jsr HLineRegs 15 | jmp InvertLine 16 | -------------------------------------------------------------------------------- /libsrc/geos-common/menuicon/domenu.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void DoMenu (struct menu *mymenu); 7 | 8 | .export _DoMenu 9 | 10 | .include "jumptab.inc" 11 | .include "geossym.inc" 12 | 13 | _DoMenu: 14 | sta r0L 15 | stx r0H 16 | lda #0 17 | jmp DoMenu -------------------------------------------------------------------------------- /libsrc/runtime/push1.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.10.2000 3 | ; 4 | ; CC65 runtime: Push (int)1 onto the stack 5 | ; 6 | 7 | .export push1 8 | .import pusha0 9 | 10 | ; Beware: The optimizer knows about this function! 11 | 12 | .proc push1 13 | 14 | lda #1 15 | jmp pusha0 16 | 17 | .endproc 18 | 19 | 20 | -------------------------------------------------------------------------------- /libsrc/runtime/push2.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.10.2000 3 | ; 4 | ; CC65 runtime: Push (int)2 onto the stack 5 | ; 6 | 7 | .export push2 8 | .import pusha0 9 | 10 | ; Beware: The optimizer knows about this function! 11 | 12 | .proc push2 13 | 14 | lda #2 15 | jmp pusha0 16 | 17 | .endproc 18 | 19 | 20 | -------------------------------------------------------------------------------- /libsrc/runtime/push3.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.10.2000 3 | ; 4 | ; CC65 runtime: Push (int)3 onto the stack 5 | ; 6 | 7 | .export push3 8 | .import pusha0 9 | 10 | ; Beware: The optimizer knows about this function! 11 | 12 | .proc push3 13 | 14 | lda #3 15 | jmp pusha0 16 | 17 | .endproc 18 | 19 | 20 | -------------------------------------------------------------------------------- /libsrc/runtime/push4.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.10.2000 3 | ; 4 | ; CC65 runtime: Push (int)4 onto the stack 5 | ; 6 | 7 | .export push4 8 | .import pusha0 9 | 10 | ; Beware: The optimizer knows about this function! 11 | 12 | .proc push4 13 | 14 | lda #4 15 | jmp pusha0 16 | 17 | .endproc 18 | 19 | 20 | -------------------------------------------------------------------------------- /libsrc/runtime/push5.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.10.2000 3 | ; 4 | ; CC65 runtime: Push (int)5 onto the stack 5 | ; 6 | 7 | .export push5 8 | .import pusha0 9 | 10 | ; Beware: The optimizer knows about this function! 11 | 12 | .proc push5 13 | 14 | lda #5 15 | jmp pusha0 16 | 17 | .endproc 18 | 19 | 20 | -------------------------------------------------------------------------------- /libsrc/runtime/push6.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.10.2000 3 | ; 4 | ; CC65 runtime: Push (int)6 onto the stack 5 | ; 6 | 7 | .export push6 8 | .import pusha0 9 | 10 | ; Beware: The optimizer knows about this function! 11 | 12 | .proc push6 13 | 14 | lda #6 15 | jmp pusha0 16 | 17 | .endproc 18 | 19 | 20 | -------------------------------------------------------------------------------- /libsrc/runtime/push7.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.10.2000 3 | ; 4 | ; CC65 runtime: Push (int)7 onto the stack 5 | ; 6 | 7 | .export push7 8 | .import pusha0 9 | 10 | ; Beware: The optimizer knows about this function! 11 | 12 | .proc push7 13 | 14 | lda #7 15 | jmp pusha0 16 | 17 | .endproc 18 | 19 | 20 | -------------------------------------------------------------------------------- /libsrc/telestrat/bgcolor.s: -------------------------------------------------------------------------------- 1 | ; 2019-07-02, Jede (jede@oric.org) 2 | ; 3 | 4 | .export _bgcolor 5 | .import BGCOLOR 6 | 7 | .include "telestrat.inc" 8 | 9 | .proc _bgcolor 10 | ldx BGCOLOR ; Get previous color 11 | sta BGCOLOR 12 | txa ; Return previous color 13 | rts 14 | .endproc 15 | -------------------------------------------------------------------------------- /libsrc/tgi/tgi_getpagecount.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 23.06.2002 3 | ; 4 | ; unsigned tgi_getpagecount (void); 5 | ; /* Returns the number of screen pages available. */ 6 | ; 7 | 8 | .include "tgi-kernel.inc" 9 | 10 | .proc _tgi_getpagecount 11 | 12 | lda _tgi_pagecount 13 | ldx #0 14 | rts 15 | 16 | .endproc 17 | -------------------------------------------------------------------------------- /util/atari/ataricvt.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main (void) 4 | { 5 | int C; 6 | while ((C = getchar ()) != EOF) { 7 | if (C == 0x9B) { 8 | putchar ('\n'); 9 | } else if (C == 0x7F) { 10 | putchar ('\t'); 11 | } else { 12 | putchar (C); 13 | } 14 | } 15 | return 0; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /libsrc/atari/gotox.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Christian Groessler, 19-Feb-2000 3 | ; 4 | ; void gotox (unsigned char x); 5 | ; 6 | 7 | .include "atari.inc" 8 | .export _gotox 9 | .import setcursor 10 | 11 | _gotox: 12 | sta COLCRS ; Set X 13 | lda #0 14 | sta COLCRS+1 15 | jmp setcursor 16 | -------------------------------------------------------------------------------- /libsrc/c128/slow.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-02-13 3 | ; 4 | ; void slow (void); 5 | ; /* Switch the CPU into 1MHz mode. */ 6 | ; */ 7 | ; 8 | 9 | .export _slow 10 | 11 | .include "c128.inc" 12 | 13 | 14 | .proc _slow 15 | 16 | lda #$00 17 | sta VIC_CLK_128 18 | rts 19 | 20 | .endproc 21 | 22 | 23 | -------------------------------------------------------------------------------- /libsrc/gamate/wherex.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-05-02 3 | ; 4 | ; unsigned char wherex (void); 5 | ; 6 | 7 | .export _wherex 8 | 9 | .include "gamate.inc" 10 | .include "extzp.inc" 11 | 12 | .proc _wherex 13 | 14 | lda CURS_X 15 | ldx #$00 16 | rts 17 | 18 | .endproc 19 | 20 | 21 | -------------------------------------------------------------------------------- /libsrc/gamate/wherey.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-05-02 3 | ; 4 | ; unsigned char wherey (void); 5 | ; 6 | 7 | .export _wherey 8 | 9 | .include "gamate.inc" 10 | .include "extzp.inc" 11 | 12 | .proc _wherey 13 | 14 | lda CURS_Y 15 | ldx #$00 16 | rts 17 | 18 | .endproc 19 | 20 | 21 | -------------------------------------------------------------------------------- /libsrc/geos-common/graph/loadcharset.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 21.12.99 5 | 6 | ; void LoadCharSet (struct fontdesc *myFont); 7 | 8 | .export _LoadCharSet 9 | 10 | .include "jumptab.inc" 11 | .include "geossym.inc" 12 | 13 | _LoadCharSet: 14 | sta r0L 15 | stx r0H 16 | jmp LoadCharSet 17 | -------------------------------------------------------------------------------- /libsrc/runtime/ldaui.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 31.08.1998 3 | ; 4 | ; CC65 runtime: Load a unsigned indirect from address in ax 5 | ; 6 | 7 | .export ldauidx 8 | .importzp ptr1 9 | 10 | .proc ldauidx 11 | sta ptr1 12 | stx ptr1+1 13 | ldx #0 14 | lda (ptr1),y 15 | rts 16 | .endproc 17 | -------------------------------------------------------------------------------- /libsrc/runtime/pushc0.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.10.2000 3 | ; 4 | ; CC65 runtime: Push (char)0 onto the stack 5 | ; 6 | 7 | .export pushc0 8 | .import pusha 9 | 10 | ; Beware: The optimizer knows about this function! 11 | 12 | .proc pushc0 13 | 14 | lda #0 15 | jmp pusha 16 | 17 | .endproc 18 | 19 | 20 | -------------------------------------------------------------------------------- /libsrc/runtime/pushc1.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.10.2000 3 | ; 4 | ; CC65 runtime: Push (char)1 onto the stack 5 | ; 6 | 7 | .export pushc1 8 | .import pusha 9 | 10 | ; Beware: The optimizer knows about this function! 11 | 12 | .proc pushc1 13 | 14 | lda #1 15 | jmp pusha 16 | 17 | .endproc 18 | 19 | 20 | -------------------------------------------------------------------------------- /libsrc/runtime/pushc2.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.10.2000 3 | ; 4 | ; CC65 runtime: Push (char)2 onto the stack 5 | ; 6 | 7 | .export pushc2 8 | .import pusha 9 | 10 | ; Beware: The optimizer knows about this function! 11 | 12 | .proc pushc2 13 | 14 | lda #2 15 | jmp pusha 16 | 17 | .endproc 18 | 19 | 20 | -------------------------------------------------------------------------------- /libsrc/atari/mouse_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard mouse driver 3 | ; 4 | ; Christian Groessler, 2014-01-02 5 | ; 6 | ; const char mouse_stddrv[]; 7 | ; 8 | 9 | .export _mouse_stddrv 10 | 11 | .rodata 12 | 13 | _mouse_stddrv: 14 | .ifdef __ATARIXL__ 15 | .asciiz "ATRXST.MOU" 16 | .else 17 | .asciiz "ATRST.MOU" 18 | .endif 19 | -------------------------------------------------------------------------------- /libsrc/atari/tgi_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard tgi driver 3 | ; 4 | ; Oliver Schmidt, 2011-05-02 5 | ; 6 | ; const char tgi_stddrv[]; 7 | ; 8 | 9 | .export _tgi_stddrv 10 | 11 | .rodata 12 | 13 | _tgi_stddrv: 14 | .ifdef __ATARIXL__ 15 | .asciiz "atrx8.tgi" 16 | .else 17 | .asciiz "atr8.tgi" 18 | .endif 19 | -------------------------------------------------------------------------------- /libsrc/atari/toascii.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; unsigned char __fastcall__ toascii (unsigned char c); 3 | ; /* Convert a target specific character to ascii */ 4 | ; 5 | 6 | .export _toascii 7 | 8 | .proc _toascii 9 | 10 | ; Clear the inverse video bit 11 | and #$7F 12 | 13 | ; X must be zero on return 14 | ldx #0 15 | 16 | ; Done! 17 | rts 18 | 19 | .endproc 20 | -------------------------------------------------------------------------------- /libsrc/cbm510/krdtim.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-12-19 3 | ; 4 | ; RDTIM kernal call 5 | ; 6 | 7 | .export RDTIM 8 | .import time : zeropage 9 | 10 | 11 | .proc RDTIM 12 | 13 | sei 14 | lda time+0 15 | ldx time+1 16 | ldy time+2 17 | cli 18 | rts 19 | 20 | .endproc 21 | 22 | -------------------------------------------------------------------------------- /libsrc/cbm510/ksettim.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-12-19 3 | ; 4 | ; SETTIM kernal call 5 | ; 6 | 7 | .export SETTIM 8 | .import time : zeropage 9 | 10 | 11 | .proc SETTIM 12 | 13 | sei 14 | sta time+0 15 | stx time+1 16 | sty time+2 17 | cli 18 | rts 19 | 20 | .endproc 21 | 22 | -------------------------------------------------------------------------------- /libsrc/cbm610/krdtim.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-12-19 3 | ; 4 | ; RDTIM kernal call 5 | ; 6 | 7 | .export RDTIM 8 | .import time : zeropage 9 | 10 | 11 | .proc RDTIM 12 | 13 | sei 14 | lda time+0 15 | ldx time+1 16 | ldy time+2 17 | cli 18 | rts 19 | 20 | .endproc 21 | 22 | -------------------------------------------------------------------------------- /libsrc/cbm610/ksettim.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-12-19 3 | ; 4 | ; SETTIM kernal call 5 | ; 6 | 7 | .export SETTIM 8 | .import time : zeropage 9 | 10 | 11 | .proc SETTIM 12 | 13 | sei 14 | sta time+0 15 | stx time+1 16 | sty time+2 17 | cli 18 | rts 19 | 20 | .endproc 21 | 22 | -------------------------------------------------------------------------------- /libsrc/gamate/extzp.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Groepaz/Hitmen, 2015-11-27 3 | ; 4 | ; zeropage locations for exclusive use by the library 5 | ; 6 | 7 | .include "extzp.inc" 8 | 9 | .segment "EXTZP" : zeropage 10 | 11 | CURS_X: .res 1 12 | CURS_Y: .res 1 13 | CHARCOLOR: .res 1 14 | RVS: .res 1 15 | BGCOLOR: .res 1 16 | tickcount: .res 4 17 | -------------------------------------------------------------------------------- /libsrc/geos-common/disk/opendisk.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Elysium' Witkowiak 3 | ; 4 | ; 21.12.1999, 2.1.2003 5 | 6 | ; char OpenDisk (void); 7 | 8 | .import setoserror 9 | .export _OpenDisk 10 | 11 | .include "jumptab.inc" 12 | .include "diskdrv.inc" 13 | 14 | _OpenDisk: 15 | jsr OpenDisk 16 | jmp setoserror 17 | -------------------------------------------------------------------------------- /libsrc/geos-common/graph/recoverline.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 29.10.99 5 | 6 | ; void RecoverLine (char y, int xstart, int xend); 7 | 8 | .import HLineRegs 9 | .export _RecoverLine 10 | 11 | .include "jumptab.inc" 12 | 13 | _RecoverLine: 14 | jsr HLineRegs 15 | jmp RecoverLine 16 | 17 | -------------------------------------------------------------------------------- /libsrc/runtime/aslax1.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 06.08.1998 3 | ; 4 | ; CC65 runtime: Scale the primary register 5 | ; 6 | 7 | .export aslax1, shlax1 8 | .importzp tmp1 9 | 10 | aslax1: 11 | shlax1: stx tmp1 12 | asl A 13 | rol tmp1 14 | ldx tmp1 15 | rts 16 | 17 | 18 | -------------------------------------------------------------------------------- /libsrc/runtime/incsp1.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 25.10.2000 3 | ; 4 | ; CC65 runtime: Increment the stackpointer by 1 5 | ; 6 | 7 | .export incsp1 8 | .importzp sp 9 | 10 | .proc incsp1 11 | 12 | inc sp 13 | bne @L1 14 | inc sp+1 15 | @L1: rts 16 | 17 | .endproc 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /libsrc/telestrat/_scrsize.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; 2003-04-13, Ullrich von Bassewitz 3 | ; 2013-07-16, Greg King 4 | ; 5 | ; Screen size variables 6 | ; 7 | 8 | .export screensize 9 | .include "telestrat.inc" 10 | 11 | .proc screensize 12 | 13 | ldx #SCREEN_XSIZE 14 | ldy #SCREEN_YSIZE 15 | rts 16 | 17 | .endproc 18 | 19 | 20 | -------------------------------------------------------------------------------- /libsrc/telestrat/textcolor.s: -------------------------------------------------------------------------------- 1 | ; 2019-07-02, Jede (jede@oric.org) 2 | ; 3 | 4 | .export _textcolor 5 | .import CHARCOLOR 6 | .include "telestrat.inc" 7 | 8 | .proc _textcolor 9 | ldx CHARCOLOR ; Get previous color 10 | sta CHARCOLOR 11 | txa ; Return previous color 12 | rts 13 | .endproc 14 | -------------------------------------------------------------------------------- /libsrc/tgi/tgi_getpalette.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 23.06.2002 3 | ; 4 | ; const unsigned char* tgi_getpalette (void); 5 | ; /* Return the current palette. Will return NULL for drivers that do not 6 | ; ** support palettes. 7 | ; */ 8 | ; 9 | 10 | .include "tgi-kernel.inc" 11 | 12 | _tgi_getpalette = tgi_getpalette ; Call the driver 13 | -------------------------------------------------------------------------------- /libsrc/apple2/filedes.inc: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 30.12.2004 3 | ; 4 | ; File descriptor management for the POSIX I/O routines 5 | ; 6 | 7 | .struct FD 8 | REF_NUM .byte 9 | FLAGS .byte 10 | BUFFER .addr 11 | .endstruct 12 | 13 | .global fdtab 14 | .global getfd 15 | 16 | MAX_FDS = 8 17 | -------------------------------------------------------------------------------- /libsrc/atari/exehdr.s: -------------------------------------------------------------------------------- 1 | ; This file defines the EXE header and main chunk load header for Atari executables 2 | 3 | .export __EXEHDR__: absolute = 1 4 | .import __MAIN_START__, __BSS_LOAD__ 5 | 6 | .segment "EXEHDR" 7 | .word $FFFF 8 | 9 | .segment "MAINHDR" 10 | .word __MAIN_START__ 11 | .word __BSS_LOAD__ - 1 12 | -------------------------------------------------------------------------------- /libsrc/common/ctime.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 12.11.2002 3 | ; 4 | ; char* __fastcall__ ctime (time_t* timep); 5 | ; 6 | 7 | .export _ctime 8 | .import _localtime, _asctime 9 | 10 | 11 | .proc _ctime 12 | 13 | ; return asctime (localtime (timep)); 14 | 15 | jsr _localtime 16 | jmp _asctime 17 | 18 | .endproc 19 | 20 | -------------------------------------------------------------------------------- /libsrc/gamate/nmi.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; NMI handling (Gamate version) 3 | ; 4 | .export NMIStub 5 | 6 | .segment "ONCE" 7 | 8 | NMIStub: 9 | ; A is saved by the BIOS 10 | ;pha 11 | ;txa 12 | ;pha 13 | ;tya 14 | ;pha 15 | 16 | ;pla 17 | ;tay 18 | ;pla 19 | ;tax 20 | ;pla 21 | rts 22 | -------------------------------------------------------------------------------- /libsrc/geos-common/disk/getdirhead.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Elysium' Witkowiak 3 | ; 4 | ; 21.12.1999, 2.1.2003 5 | 6 | ; char GetDirHead (void); 7 | 8 | .import setoserror 9 | .export _GetDirHead 10 | 11 | .include "jumptab.inc" 12 | .include "diskdrv.inc" 13 | 14 | _GetDirHead: 15 | jsr GetDirHead 16 | jmp setoserror 17 | -------------------------------------------------------------------------------- /libsrc/geos-common/file/nextrecord.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Elysium' Witkowiak 3 | ; 4 | ; 25.12.1999, 2.1.2003 5 | 6 | ; char NextRecord (void); 7 | 8 | .import setoserror 9 | .export _NextRecord 10 | 11 | .include "jumptab.inc" 12 | .include "diskdrv.inc" 13 | 14 | _NextRecord: 15 | jsr NextRecord 16 | jmp setoserror 17 | -------------------------------------------------------------------------------- /libsrc/pet/_scrsize.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 26.10.2000 3 | ; 4 | ; Screen size variables 5 | ; 6 | 7 | .export screensize 8 | 9 | .include "pet.inc" 10 | 11 | .proc screensize 12 | 13 | ldx SCR_LINELEN 14 | inx ; Variable is one less 15 | ldy #25 16 | rts 17 | 18 | .endproc 19 | 20 | -------------------------------------------------------------------------------- /libsrc/runtime/asrax1.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 06.08.1998 3 | ; 4 | ; CC65 runtime: Scale the primary register 5 | ; 6 | 7 | .export asrax1 8 | .importzp tmp1 9 | 10 | asrax1: stx tmp1 11 | cpx #$80 ; Put bit 7 into carry 12 | ror tmp1 13 | ror a 14 | ldx tmp1 15 | rts 16 | 17 | -------------------------------------------------------------------------------- /libsrc/runtime/incaxy.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 05.08.1998 3 | ; 4 | ; CC65 runtime: Increment ax by value in y 5 | ; 6 | 7 | .export incaxy, incax4 8 | .importzp tmp1 9 | .macpack generic 10 | 11 | incax4: ldy #4 12 | incaxy: sty tmp1 13 | add tmp1 14 | bcc @L9 15 | inx 16 | @L9: rts 17 | 18 | -------------------------------------------------------------------------------- /libsrc/runtime/shrax2.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 06.08.1998 3 | ; 4 | ; CC65 runtime: Scale the primary register by 4 5 | ; 6 | 7 | .export shrax2 8 | .importzp tmp1 9 | 10 | shrax2: stx tmp1 11 | lsr tmp1 12 | ror a 13 | lsr tmp1 14 | ror a 15 | ldx tmp1 16 | rts 17 | 18 | 19 | -------------------------------------------------------------------------------- /libsrc/tgi/tgi_getdefpalette.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 23.06.2002 3 | ; 4 | ; const unsigned char* tgi_getdefpalette (void); 5 | ; /* Return the default palette. Will return NULL for drivers that do not 6 | ; ** support palettes. 7 | ; */ 8 | ; 9 | 10 | .include "tgi-kernel.inc" 11 | 12 | _tgi_getdefpalette = tgi_getdefpalette ; Call the driver 13 | -------------------------------------------------------------------------------- /test/val/jmp-callax.c: -------------------------------------------------------------------------------- 1 | static unsigned char val; 2 | 3 | static void foo(void) { 4 | val = 5; 5 | } 6 | 7 | static void wrap(void) { 8 | 9 | asm("lda #<%v", foo); 10 | asm("ldx #>%v", foo); 11 | asm("jmp callax"); 12 | 13 | } 14 | 15 | int main(void) { 16 | 17 | val = 0; 18 | wrap(); 19 | 20 | return val == 5 ? 0 : 1; 21 | } 22 | -------------------------------------------------------------------------------- /testcode/lib/arg-test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main (int argc, char* argv[]) 5 | { 6 | int I; 7 | 8 | printf ("argc: %d\n", argc); 9 | for (I = 0; I < argc; ++I) { 10 | printf ("argv[%2d]: \"%s\"\n", I, argv[I]); 11 | } 12 | 13 | printf ("\n"); 14 | getchar (); 15 | return EXIT_SUCCESS; 16 | } 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /libsrc/apple2/mouse_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard mouse driver 3 | ; 4 | ; Ullrich von Bassewitz, 2009-09-11 5 | ; 6 | ; const char mouse_stddrv[]; 7 | ; 8 | 9 | .export _mouse_stddrv 10 | 11 | .rodata 12 | 13 | _mouse_stddrv: 14 | .ifdef __APPLE2ENH__ 15 | .asciiz "A2E.STDMOU.MOU" 16 | .else 17 | .asciiz "A2.STDMOU.MOU" 18 | .endif 19 | -------------------------------------------------------------------------------- /libsrc/atari/exetrailer.s: -------------------------------------------------------------------------------- 1 | ; This file defines the EXE file "trailer" which sets the entry point 2 | 3 | .export __AUTOSTART__: absolute = 1 4 | .import start 5 | 6 | .include "atari.inc" 7 | 8 | .segment "AUTOSTRT" 9 | .word RUNAD ; defined in atari.inc 10 | .word RUNAD+1 11 | .word start 12 | 13 | -------------------------------------------------------------------------------- /libsrc/c128/kbrepeat.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; unsigned char __fastcall__ kbrepeat (unsigned char mode); 3 | ; 4 | 5 | .export _kbrepeat 6 | 7 | .include "c128.inc" 8 | 9 | _kbrepeat: 10 | ldx KBDREPEAT ; get old value 11 | sta KBDREPEAT ; store new value 12 | txa ; return old value 13 | ldx #0 14 | rts 15 | -------------------------------------------------------------------------------- /libsrc/c64/kbrepeat.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; unsigned char __fastcall__ kbrepeat (unsigned char mode); 3 | ; 4 | 5 | .export _kbrepeat 6 | 7 | .include "c64.inc" 8 | 9 | _kbrepeat: 10 | ldx KBDREPEAT ; get old value 11 | sta KBDREPEAT ; store new value 12 | txa ; return old value 13 | ldx #0 14 | rts 15 | -------------------------------------------------------------------------------- /libsrc/c64/soft80mono_cpeekcolor.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; 2017-12-27, Groepaz 3 | ; 4 | ; unsigned char cpeekcolor (void); 5 | ; 6 | 7 | .export soft80mono_cpeekcolor 8 | 9 | .include "c64.inc" 10 | .include "soft80.inc" 11 | 12 | .segment "CODE" 13 | 14 | soft80mono_cpeekcolor: 15 | lda CHARCOLOR 16 | ldx #0 17 | rts 18 | -------------------------------------------------------------------------------- /libsrc/common/_afailed.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** _afailed.c 3 | ** 4 | ** 1998-06-06, Ullrich von Bassewitz 5 | ** 2015-03-13, Greg King 6 | */ 7 | 8 | 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | void __fastcall__ _afailed (char* file, unsigned line) 16 | { 17 | fprintf (stderr, "ASSERTION FAILED IN %s(%u)\n", file, line); 18 | exit (2); 19 | } 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /libsrc/common/_hextab.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Ullrich von Bassewitz, 11.08.1998 3 | ** 4 | ** Hex conversion table. Must be in C since the compiler will convert 5 | ** to the correct character set for the target platform. 6 | */ 7 | 8 | 9 | 10 | const unsigned char _hextab [16] = { 11 | '0', '1', '2', '3', '4', '5', '6', '7', 12 | '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /libsrc/geos-cbm/graph/setnewmode.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Scott Hutter 3 | ; 4 | ; 18.12.18 5 | 6 | ; void SetNewMode(void); 7 | 8 | .export _SetNewMode 9 | 10 | .include "jumptab.inc" 11 | .include "geossym.inc" 12 | 13 | _SetNewMode: 14 | lda graphMode 15 | eor #$80 16 | sta graphMode 17 | jmp SetNewMode 18 | 19 | -------------------------------------------------------------------------------- /libsrc/geos-cbm/system/getserialnumber.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; int GetSerialNumber (void); 7 | 8 | .export _GetSerialNumber 9 | 10 | .include "jumptab.inc" 11 | .include "geossym.inc" 12 | 13 | _GetSerialNumber: 14 | jsr GetSerialNumber 15 | lda r0L 16 | ldx r0H 17 | rts 18 | -------------------------------------------------------------------------------- /libsrc/geos-common/disk/putdirhead.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Elysium' Witkowiak 3 | ; 4 | ; 21.12.99, 2.1.2003 5 | 6 | ; char PutDirHead (void); 7 | 8 | .import setoserror 9 | .export _PutDirHead 10 | 11 | .include "jumptab.inc" 12 | .include "diskdrv.inc" 13 | 14 | _PutDirHead: 15 | jsr PutDirHead 16 | jmp setoserror 17 | -------------------------------------------------------------------------------- /libsrc/geos-common/graph/graphicsstring.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 25.12.99 5 | 6 | ; void GraphicsString (char *myString); 7 | 8 | .export _GraphicsString 9 | 10 | .include "jumptab.inc" 11 | .include "geossym.inc" 12 | 13 | _GraphicsString: 14 | sta r0L 15 | stx r0H 16 | jmp GraphicsString 17 | -------------------------------------------------------------------------------- /libsrc/pce/call.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; CC65 runtime: call function via pointer in ax 3 | ; 4 | ; 1998-08-06, Ullrich von Bassewitz 5 | ; 2018-02-28, Greg King 6 | ; 7 | 8 | .export callax 9 | .importzp ptr1 10 | 11 | callax: sta ptr1 12 | stx ptr1+1 13 | 14 | ; The PC-Engine puts the zero-page at $2000. 15 | 16 | jmp (ptr1 + $2000) ; go there 17 | -------------------------------------------------------------------------------- /libsrc/pet/kbsout.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 19.11.2002 3 | ; 4 | ; BSOUT replacement function for the PETs 5 | ; 6 | 7 | .export BSOUT 8 | .import checkst 9 | 10 | 11 | .proc BSOUT 12 | 13 | jsr $FFD2 ; Call kernal function 14 | jmp checkst ; Check status, return carry on error 15 | 16 | .endproc 17 | 18 | -------------------------------------------------------------------------------- /libsrc/pet/kckout.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 19.11.2002 3 | ; 4 | ; CKOUT replacement function for the PETs 5 | ; 6 | 7 | .export CKOUT 8 | .import checkst 9 | 10 | 11 | .proc CKOUT 12 | 13 | jsr $FFC9 ; Call kernal function 14 | jmp checkst ; Check status, return carry on error 15 | 16 | .endproc 17 | 18 | -------------------------------------------------------------------------------- /libsrc/runtime/bpushbsp.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 31.08.1998 3 | ; 4 | ; CC65 runtime: Load a from stack slot and push as byte 5 | ; 6 | 7 | .export bpushbsp, bpushbysp 8 | .import pusha 9 | .importzp sp 10 | 11 | bpushbsp: 12 | ldy #0 13 | bpushbysp: 14 | lda (sp),y 15 | jmp pusha 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /libsrc/sim6502/mainargs.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Oliver Schmidt, 2013-05-16 3 | ; 4 | 5 | .constructor initmainargs, 24 6 | .import __argc, __argv, args 7 | 8 | .segment "ONCE" 9 | 10 | initmainargs: 11 | lda #<__argv 12 | ldx #>__argv 13 | jsr args 14 | sta __argc 15 | stx __argc+1 16 | rts 17 | -------------------------------------------------------------------------------- /libsrc/apple2/gotoy.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 06.08.1998 3 | ; 4 | ; void __fastcall__ gotoy (unsigned char y); 5 | ; 6 | 7 | .export _gotoy 8 | .import VTABZ 9 | 10 | .include "apple2.inc" 11 | 12 | _gotoy: 13 | clc 14 | adc WNDTOP 15 | sta CV ; Store Y 16 | jmp VTABZ 17 | 18 | 19 | -------------------------------------------------------------------------------- /libsrc/apple2/joy_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard joystick driver 3 | ; 4 | ; Ullrich von Bassewitz, 2002-12-21 5 | ; 6 | ; const char joy_stddrv[]; 7 | ; 8 | 9 | .export _joy_stddrv 10 | 11 | .rodata 12 | 13 | _joy_stddrv: 14 | .ifdef __APPLE2ENH__ 15 | .asciiz "A2E.STDJOY.JOY" 16 | .else 17 | .asciiz "A2.STDJOY.JOY" 18 | .endif 19 | 20 | -------------------------------------------------------------------------------- /libsrc/atari/joy_stddrv.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Name of the standard joystick driver 3 | ; 4 | ; Ullrich von Bassewitz, 2002-12-21 5 | ; 6 | ; const char joy_stddrv[]; 7 | ; 8 | 9 | .export _joy_stddrv 10 | 11 | .rodata 12 | 13 | _joy_stddrv: 14 | .ifdef __ATARIXL__ 15 | .asciiz "atrxstd.joy" 16 | .else 17 | .asciiz "atrstd.joy" 18 | .endif 19 | -------------------------------------------------------------------------------- /libsrc/atari/targetutil/Makefile.inc: -------------------------------------------------------------------------------- 1 | DEPS += ../libwrk/$(TARGET)/w2cas.d 2 | 3 | ../libwrk/$(TARGET)/w2cas.o: $(SRCDIR)/targetutil/w2cas.c | ../libwrk/$(TARGET) 4 | $(COMPILE_recipe) 5 | 6 | ../target/$(TARGET)/util/w2cas.com: ../libwrk/$(TARGET)/w2cas.o ../lib/$(TARGET).lib | ../target/$(TARGET)/util 7 | $(LD65) -o $@ -t $(TARGET) $^ 8 | 9 | $(TARGET): ../target/$(TARGET)/util/w2cas.com 10 | -------------------------------------------------------------------------------- /libsrc/geos-cbm/disk/changediskdevice.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Elysium' Witkowiak 3 | ; 4 | ; 21.12.1999, 2.1.2003 5 | 6 | ; char ChangeDiskDevice (char newDriveNumber); 7 | 8 | .export _ChangeDiskDevice 9 | .import setoserror 10 | 11 | .include "jumptab.inc" 12 | 13 | _ChangeDiskDevice: 14 | jsr ChangeDiskDevice 15 | jmp setoserror 16 | -------------------------------------------------------------------------------- /libsrc/geos-common/file/insertrecord.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Elysium' Witkowiak 3 | ; 4 | ; 25.12.1999, 2.1.2003 5 | 6 | ; char InsertRecord (void); 7 | 8 | .import setoserror 9 | .export _InsertRecord 10 | 11 | .include "jumptab.inc" 12 | .include "diskdrv.inc" 13 | 14 | _InsertRecord: 15 | jsr InsertRecord 16 | jmp setoserror 17 | -------------------------------------------------------------------------------- /libsrc/mouse/mouse_buttons.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2003-12-30 3 | ; 4 | ; unsigned char mouse_buttons (void); 5 | ; /* Return a bit mask encoding the states of the mouse buttons. Use the 6 | ; ** MOUSE_BTN_XXX flags to decode a specific button. 7 | ; */ 8 | ; 9 | 10 | .include "mouse-kernel.inc" 11 | 12 | _mouse_buttons = mouse_buttons ; Call driver directly 13 | -------------------------------------------------------------------------------- /libsrc/osic1p/gotox.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; copied from CBM implementation 3 | ; originally by: 4 | ; Ullrich von Bassewitz, 07.08.1998 5 | ; 6 | ; void gotox (unsigned char x); 7 | ; 8 | .export _gotox 9 | .import plot 10 | .include "extzp.inc" 11 | 12 | _gotox: sta CURS_X ; Set new position 13 | jmp plot ; And activate it 14 | -------------------------------------------------------------------------------- /libsrc/osic1p/gotoy.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; copied from CBM implementation 3 | ; originally by: 4 | ; Ullrich von Bassewitz, 0.08.1998 5 | ; 6 | ; void gotoy (unsigned char y); 7 | ; 8 | .export _gotoy 9 | .import plot 10 | .include "extzp.inc" 11 | 12 | _gotoy: sta CURS_Y ; Set the new position 13 | jmp plot ; And activate it 14 | -------------------------------------------------------------------------------- /libsrc/pet/kchkin.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 19.11.2002 3 | ; 4 | ; CHKIN replacement function for the PETs 5 | ; 6 | 7 | .export CHKIN 8 | .import checkst 9 | 10 | 11 | .proc CHKIN 12 | 13 | jsr $FFC6 ; Call kernal function 14 | jmp checkst ; Check status, return carry on error 15 | 16 | .endproc 17 | 18 | 19 | -------------------------------------------------------------------------------- /libsrc/pet/krdtim.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 19.11.2002 3 | ; 4 | ; RDTIM replacement function for the PETs 5 | ; 6 | 7 | .export RDTIM 8 | 9 | .include "pet.inc" 10 | 11 | 12 | .proc RDTIM 13 | 14 | sei 15 | lda TIME+2 16 | ldx TIME+1 17 | ldy TIME 18 | cli 19 | rts 20 | 21 | .endproc 22 | 23 | -------------------------------------------------------------------------------- /libsrc/plus4/kbrepeat.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; unsigned char __fastcall__ kbrepeat (unsigned char mode); 3 | ; 4 | 5 | .export _kbrepeat 6 | 7 | .include "plus4.inc" 8 | 9 | _kbrepeat: 10 | ldx KBDREPEAT ; get old value 11 | sta KBDREPEAT ; store new value 12 | txa ; return old value 13 | ldx #0 14 | rts 15 | -------------------------------------------------------------------------------- /libsrc/vic20/kbrepeat.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; unsigned char __fastcall__ kbrepeat (unsigned char mode); 3 | ; 4 | 5 | .export _kbrepeat 6 | 7 | .include "vic20.inc" 8 | 9 | _kbrepeat: 10 | ldx KBDREPEAT ; get old value 11 | sta KBDREPEAT ; store new value 12 | txa ; return old value 13 | ldx #0 14 | rts 15 | -------------------------------------------------------------------------------- /libsrc/atari5200/_scrsize.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Christian Groessler, 02-Apr-2019 3 | ; 4 | ; Screen size variables 5 | ; 6 | 7 | .export screensize 8 | .importzp screen_width, screen_height 9 | .include "atari.inc" 10 | 11 | .proc screensize 12 | 13 | ldx #screen_width 14 | ldy #screen_height 15 | rts 16 | 17 | .endproc 18 | 19 | 20 | -------------------------------------------------------------------------------- /libsrc/geos-cbm/memory/fetchram.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 21.12.99 5 | 6 | ; void FetchRAM (char REUBank, int length, char *from, char *dest); 7 | 8 | .import REURegs 9 | .export _FetchRAM 10 | 11 | .include "jumptab.inc" 12 | .include "geossym.inc" 13 | 14 | _FetchRAM: 15 | jsr REURegs 16 | jmp FetchRAM 17 | -------------------------------------------------------------------------------- /libsrc/geos-cbm/memory/stashram.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 21.12.99 5 | 6 | ; void StashRAM (char REUBank, int length, char *dest, char *from); 7 | 8 | .import REURegs 9 | .export _StashRAM 10 | 11 | .include "jumptab.inc" 12 | .include "geossym.inc" 13 | 14 | _StashRAM: 15 | jsr REURegs 16 | jmp StashRAM 17 | -------------------------------------------------------------------------------- /libsrc/geos-common/graph/putstring.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Alliance' Witkowiak 3 | ; 4 | ; 30.10.99 5 | 6 | ; void PutString (char *mytxt, char y, int x); 7 | 8 | .import popax, popa 9 | .import getintcharint 10 | .export _PutString 11 | 12 | .include "jumptab.inc" 13 | 14 | _PutString: 15 | jsr getintcharint 16 | jmp PutString 17 | -------------------------------------------------------------------------------- /libsrc/nes/irq.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; IRQ handling (NES version) 3 | ; 4 | 5 | .export initirq, doneirq 6 | 7 | ; ------------------------------------------------------------------------ 8 | 9 | .segment "ONCE" 10 | 11 | initirq: 12 | rts 13 | 14 | ; ------------------------------------------------------------------------ 15 | 16 | .code 17 | 18 | doneirq: 19 | rts 20 | -------------------------------------------------------------------------------- /libsrc/runtime/aslax2.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 06.08.1998 3 | ; 4 | ; CC65 runtime: Scale the primary register by 4 5 | ; 6 | 7 | .export aslax2, shlax2 8 | .importzp tmp1 9 | 10 | aslax2: 11 | shlax2: stx tmp1 12 | asl a 13 | rol tmp1 14 | asl a 15 | rol tmp1 16 | ldx tmp1 17 | rts 18 | 19 | -------------------------------------------------------------------------------- /libsrc/runtime/staxsp.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 31.08.1998 3 | ; 4 | ; CC65 runtime: Store ax at (sp),y 5 | ; 6 | 7 | .export staxysp, stax0sp 8 | .importzp sp 9 | 10 | stax0sp: 11 | ldy #0 12 | staxysp: 13 | sta (sp),y 14 | iny 15 | pha 16 | txa 17 | sta (sp),y 18 | pla 19 | rts 20 | 21 | -------------------------------------------------------------------------------- /libsrc/tgi/tgi_getmaxy.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 21.06.2002 3 | ; 4 | ; unsigned tgi_getmaxy (void); 5 | ; /* Return the maximum y coordinate. The resolution in y direction is 6 | ; ** getmaxy() + 1 7 | ; */ 8 | 9 | .include "tgi-kernel.inc" 10 | 11 | .proc _tgi_getmaxy 12 | 13 | lda _tgi_ymax 14 | ldx _tgi_ymax+1 15 | rts 16 | 17 | .endproc 18 | -------------------------------------------------------------------------------- /libsrc/c16/fast.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Marco van den Heuvel, 2018-03-20 3 | ; 4 | ; void fast (void); 5 | ; /* Switch the CPU into double clock mode. */ 6 | ; 7 | 8 | .export _fast 9 | 10 | .include "plus4.inc" 11 | 12 | 13 | .proc _fast 14 | 15 | lda TED_CLK 16 | and #%11111101 17 | sta TED_CLK 18 | rts 19 | 20 | .endproc 21 | 22 | 23 | -------------------------------------------------------------------------------- /libsrc/c16/slow.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Marco van den Heuvel, 2018-03-28 3 | ; 4 | ; void slow (void); 5 | ; /* Switch the CPU into single clock mode. */ 6 | ; 7 | 8 | .export _slow 9 | 10 | .include "plus4.inc" 11 | 12 | 13 | .proc _slow 14 | 15 | lda TED_CLK 16 | ora #%00000010 17 | sta TED_CLK 18 | rts 19 | 20 | .endproc 21 | 22 | 23 | -------------------------------------------------------------------------------- /libsrc/em/em_map.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Ullrich von Bassewitz, 2002-11-29 3 | ; 4 | ; void* __fastcall__ em_map (unsigned page); 5 | ; /* Unmap the current page from memory and map a new one. The function returns 6 | ; ** a pointer to the location of the page in memory. 7 | ; */ 8 | 9 | 10 | .include "em-kernel.inc" 11 | 12 | _em_map = emd_map ; Use driver entry 13 | 14 | -------------------------------------------------------------------------------- /libsrc/geos-common/file/pointrecord.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Elysium' Witkowiak 3 | ; 4 | ; 25.12.1999, 2.1.2003 5 | 6 | ; char PointRecord (char recordNum); 7 | 8 | .import setoserror 9 | .export _PointRecord 10 | 11 | .include "jumptab.inc" 12 | .include "diskdrv.inc" 13 | 14 | _PointRecord: 15 | jsr PointRecord 16 | jmp setoserror 17 | -------------------------------------------------------------------------------- /libsrc/geos-common/file/previousrecord.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Maciej 'YTM/Elysium' Witkowiak 3 | ; 4 | ; 25.12.1999, 2.1.2003 5 | 6 | ; char PreviousRecord (void); 7 | 8 | .import setoserror 9 | .export _PreviousRecord 10 | 11 | .include "jumptab.inc" 12 | .include "diskdrv.inc" 13 | 14 | _PreviousRecord: 15 | jsr PreviousRecord 16 | jmp setoserror 17 | -------------------------------------------------------------------------------- /libsrc/plus4/fast.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; Marco van den Heuvel, 2018-03-20 3 | ; 4 | ; void fast (void); 5 | ; /* Switch the CPU into double clock mode. */ 6 | ; 7 | 8 | .export _fast 9 | 10 | .include "plus4.inc" 11 | 12 | 13 | .proc _fast 14 | 15 | lda TED_CLK 16 | and #%11111101 17 | sta TED_CLK 18 | rts 19 | 20 | .endproc 21 | 22 | 23 | --------------------------------------------------------------------------------