From bce5e371d6f68c225d703834871d00dc7694270b Mon Sep 17 00:00:00 2001 From: Ben Chong Date: Sat, 1 Jul 2017 19:59:34 -0700 Subject: [PATCH] Optimize ZP usage --- buffer.asm | 7 ++++--- sbcmon.asm | 14 +++++++------- upload.asm | 16 +++++++++------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/buffer.asm b/buffer.asm index 0f26c85..6a1cb4a 100644 --- a/buffer.asm +++ b/buffer.asm @@ -9,9 +9,10 @@ MAXCOUNT = 64 HIWATER = 40 LOWATER = 20 -inptr = $380 ;$f2 -outptr = $381 ;$f3 -charcount = $382 ;$f4 + +inptr = $e7 ;$380 ;$f2 +outptr = $e8 ;$381 ;$f3 +charcount = $e9 ;$382 ;$f4 ;--------------------------------------------------------------------- ; Initialize buffer operations diff --git a/sbcmon.asm b/sbcmon.asm index e76b959..9768244 100755 --- a/sbcmon.asm +++ b/sbcmon.asm @@ -23,13 +23,12 @@ ESC = 27 ; ESC to exit ; as possible. This was needed to debug EhBASIC during the porting process ysav = $e0 ; 1 byte -rowcount = $e1 ; 1 byte -Startaddr = $e2 ; 2 bytes -Startaddr_H = $e3 -Hexdigits = $e4 ; 2 bytes -Hexdigits_H = $e5 -strptr = $e6 -strptrh = $e7 ; temporary string pointer (not preserved across calls) +Startaddr = $e1 ; 2 bytes +Startaddr_H = $e2 +Hexdigits = $e3 ; 2 bytes +Hexdigits_H = $e4 +strptr = $e5 +strptrh = $e6 ; temporary string pointer (not preserved across calls) ; Local Non-Zero Page Variables ; Unchange from Daryl's code except for addition of the interrupt vectors @@ -43,6 +42,7 @@ SPTR = $03e5 ; hold stack pointer PREG = $03e6 ; hold status register (P) irq_vector = $03e8 ; Interrupt vector nmi_vector = $03ea ; NMI vector +rowcount = $03eb ; 1 byte ;realpcl = $03eb ;realpch = $03ec ; diff --git a/upload.asm b/upload.asm index 6c63e44..80334d8 100644 --- a/upload.asm +++ b/upload.asm @@ -6,16 +6,18 @@ ; By Daryl Rictor & Ross Archer Aug 2002 ; -temp = $e8 ; save hex value -chksum = $e9 ; record checksum accumulator -reclen = $ea ; record length in bytes -dlfail = $eb ; flag for upload failure -start_lo = $ec -start_hi = $ed -rectype = $ee +temp = $ea ; save hex value +chksum = $eb ; record checksum accumulator +reclen = $ec ; record length in bytes +start_lo = $ed +start_hi = $ee +rectype = $ef + bytecount_l = $f0 bytecount_h = $f1 +dlfail = $03ec ; flag for upload failure + ; ; ;****************************************************