use res for ARGX

This commit is contained in:
Matthias@Dell 2023-12-27 16:55:56 +01:00
parent fc0dba6c9c
commit 4d5edeecfe
2 changed files with 80 additions and 27 deletions

View File

@ -8,43 +8,57 @@
.ifndef INCLUDE_SYSTEM
INCLUDE_SYSTEM = 1
; reserved RAM addresses
; 00-0f - free
; 10-1f - arguments / return values
; 00-0f - free use (Z0-Z15)
; 10-1f - arguments / return values (ARG0-ARG15)
; 20-ff - free
; 0100 - 01FF Stack
; 0200,0201 keybuffer write/read pointer
; 0202-02ff keybuffer
; 0300 lcd character counter
; 0400, 0401, 0402 dht status, dht bit, dht_bit_rot
; 0403 value offset
; 0405-04a0 rh high/low, temp high/low, checksum
.include "io_W65C22.h65"
.include "utility.h65"
.importzp Z0,Z1,Z2,Z3,Z4,Z5,Z6,Z7,Z8,Z9,Z10,Z11,Z12,Z13,Z14,Z15
.importzp ARG0,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8,ARG9,ARG10,ARG11,ARG12,ARG13,ARG14,ARG15
; ARGUMENTS
; a,x,y can also be used
ARG0 = $10
ARG1 = $11
ARG2 = $12
ARG3 = $13
ARG4 = $14
ARG5 = $15
ARG6 = $16
ARG7 = $17
ARG8 = $18
ARG9 = $19
ARG10 = $1a
ARG11 = $1b
ARG12 = $1c
ARG13 = $1d
ARG14 = $1e
ARG15 = $1f
; Z0 = $0
; Z1 = $1
; Z2 = $2
; Z3 = $3
; Z4 = $4
; Z5 = $5
; Z6 = $6
; Z7 = $7
; Z8 = $8
; Z9 = $9
; Z10 = $a
; Z11 = $b
; Z12 = $c
; Z13 = $d
; Z14 = $e
; Z15 = $f
; ; ARGUMENTS
; ; a,x,y can also be used
; ARG0 = $10
; ARG1 = $11
; ARG2 = $12
; ARG3 = $13
; ARG4 = $14
; ARG5 = $15
; ARG6 = $16
; ARG7 = $17
; ARG8 = $18
; ARG9 = $19
; ARG10 = $1a
; ARG11 = $1b
; ARG12 = $1c
; ARG13 = $1d
; ARG14 = $1e
; ARG15 = $1f
; RETURN VALUE
; in a
.segment "VIA1"
; IO1: .res 16
IO1 = $6000

View File

@ -1,3 +1,42 @@
; .include "system.h65"
.exportzp Z0,Z1,Z2,Z3,Z4,Z5,Z6,Z7,Z8,Z9,Z10,Z11,Z12,Z13,Z14,Z15
.exportzp ARG0,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8,ARG9,ARG10,ARG11,ARG12,ARG13,ARG14,ARG15
.zeropage
.org $10
.res 16
.org $0
.assert * = $0, error, "Code not at 0"
Z0: .res 1
Z1: .res 1
Z2: .res 1
Z3: .res 1
Z4: .res 1
Z5: .res 1
Z6: .res 1
Z7: .res 1
Z8: .res 1
Z9: .res 1
Z10: .res 1
Z11: .res 1
Z12: .res 1
Z13: .res 1
Z14: .res 1
Z15: .res 1
; ARGUMENTS
; a,x,y can also be used
.assert * = $10, error, "Code not at 10"
ARG0: .res 1
ARG1: .res 1
ARG2: .res 1
ARG3: .res 1
ARG4: .res 1
ARG5: .res 1
ARG6: .res 1
ARG7: .res 1
ARG8: .res 1
ARG9: .res 1
ARG10: .res 1
ARG11: .res 1
ARG12: .res 1
ARG13: .res 1
ARG14: .res 1
ARG15: .res 1