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 .ifndef INCLUDE_SYSTEM
INCLUDE_SYSTEM = 1 INCLUDE_SYSTEM = 1
; reserved RAM addresses ; reserved RAM addresses
; 00-0f - free ; 00-0f - free use (Z0-Z15)
; 10-1f - arguments / return values ; 10-1f - arguments / return values (ARG0-ARG15)
; 20-ff - free ; 20-ff - free
; 0100 - 01FF Stack ; 0100 - 01FF Stack
; 0200,0201 keybuffer write/read pointer ; 0200,0201 keybuffer write/read pointer
; 0202-02ff keybuffer ; 0202-02ff keybuffer
; 0300 lcd character counter ; 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 "io_W65C22.h65"
.include "utility.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 ; Z0 = $0
; a,x,y can also be used ; Z1 = $1
ARG0 = $10 ; Z2 = $2
ARG1 = $11 ; Z3 = $3
ARG2 = $12 ; Z4 = $4
ARG3 = $13 ; Z5 = $5
ARG4 = $14 ; Z6 = $6
ARG5 = $15 ; Z7 = $7
ARG6 = $16 ; Z8 = $8
ARG7 = $17 ; Z9 = $9
ARG8 = $18 ; Z10 = $a
ARG9 = $19 ; Z11 = $b
ARG10 = $1a ; Z12 = $c
ARG11 = $1b ; Z13 = $d
ARG12 = $1c ; Z14 = $e
ARG13 = $1d ; Z15 = $f
ARG14 = $1e ; ; ARGUMENTS
ARG15 = $1f ; ; 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 ; RETURN VALUE
; in a
.segment "VIA1" .segment "VIA1"
; IO1: .res 16 ; IO1: .res 16
IO1 = $6000 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 .zeropage
.org $10 .org $0
.res 16 .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