commit 008f56a2104bceae3cecab8bc18d98167f63c141 Author: Nihilazo Date: Wed Dec 9 12:31:45 2020 +0000 initial commit diff --git a/c64.asm b/c64.asm new file mode 100644 index 0000000..abda130 --- /dev/null +++ b/c64.asm @@ -0,0 +1,66 @@ +; c64.asm - Useful dasm macros and definitions for C64 programs +; will likely grow as I do more with the C64. +; you can INCLUDE this file or just copy the parts you want. +; This file is CC0 (Public Domain) + +; KERNAL functions +CHROUT = $FFD2 +ACPTR = $FFA5 +CHKIN = $FFC6 +CHKOUT = $FFC9 +CHRIN = $FFCF +CHROUT = $FFD2 +CIOUT = $FFA8 +CINT = $FF81 +CLALL = $FFE7 +CLOSE = $FFC3 +CLRCHN = $FFCC +GETIN = $FFE4 +IOBASE = $FFF3 +IOINIT = $FF84 +LISTEN = $FFB1 +LOAD = $FFD5 +MEMBOT = $FF9C +MEMTOP = $FF99 +OPEN = $FFC0 +PLOT = $FFF0 +RAMTAS = $FF87 +RDTIM = $FFDE +READST = $FFB7 +RESTOR = $FF8A +SAVE = $FFD8 +SCNKEY = $FF9F +SCREEN = $FFED +SECOND = $FF93 +SETLFS = $FFBA +SETMSG = $FF90 +SETNAM = $FFBD +SETTIM = $FFDB +SETTMO = $FFA2 +STOP = $FFE1 +TALK = $FFB4 +TKSA = $FF96 +UDTIM = $FFEA +UNLSN = $FFAE +UNTLK = $FFAB +VECTOR = $FF8D + +; Macros + MAC BasicUpstart + ; writes a C64 BASIC start script for the address provided as an argument. + ; Usage: + ; org $0801 + ; BasicUpstart init + ; init: + ; [your code here] + dc.w .nextline + dc.w 10 ; Line Number + dc.b $9e ; SYS + dc.b <((({1} / 1000) % 10) + $30) + dc.b <((({1} / 100 ) % 10) + $30) + dc.b <((({1} / 10 ) % 10) + $30) + dc.b <((({1} ) % 10) + $30) ; Address, converted to 4 PETSCII bytes + dc.b 0 +.nextline: + dc.w 0 + ENDM diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..af90112 --- /dev/null +++ b/readme.md @@ -0,0 +1,8 @@ +# dasm-c64 + +macros and definitions for the c64 for the dasm 6502 assembler. + +## Current contents + +* Definitions for all the KERNAL routines so they can be used by name (see https://www.c64-wiki.com/wiki/Kernal) +* BasicUpstart macro: Writes a BASIC start script for the address provided as an argument.