Added "popptr1" which is of common use to save some bytes.

This commit is contained in:
IrgendwerA8
2018-05-20 15:30:18 +02:00
parent 3a6430b13d
commit c95ed4b8b5
35 changed files with 113 additions and 151 deletions

View File

@@ -7,7 +7,7 @@
.export _adler32
.import incsp2, incsp4, popax, popeax
.import incsp2, incsp4, popptr1, popeax
.importzp sreg, ptr1, ptr2, tmp1
BASE = 65521 ; largest prime smaller than 65536
@@ -20,9 +20,7 @@ _adler32:
@L1: sta ptr2
stx ptr2+1
; ptr1 = buf
jsr popax
sta ptr1
stx ptr1+1
jsr popptr1
; if (buf == NULL) return 1L;
ora ptr1+1
beq @L0

View File

@@ -7,7 +7,7 @@
.export _crc32
.import compleax, incsp2, incsp4, popax, popeax
.import compleax, incsp2, incsp4, popptr1, popeax
.importzp sreg, ptr1, ptr2, tmp1, tmp2
POLYNOMIAL = $EDB88320
@@ -67,9 +67,7 @@ _crc32:
@L1: sta ptr2
stx ptr2+1
; ptr1 = buf
jsr popax
sta ptr1
stx ptr1+1
jsr popptr1
; if (buf == NULL) return 0;
ora ptr1+1
beq @L0