aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2025-01-15 22:53:16 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2025-01-15 22:53:16 +0100
commite1de44339093a3d47b0257aded13de405a3e861c (patch)
tree91aae24d2394375cfc4f2de5fe0bb0fa93559544
parent81c528cc554d0b2f97f3c477a0a5d6678587c2d2 (diff)
downloadaoc2023.nes-e1de44339093a3d47b0257aded13de405a3e861c.tar.gz
aoc2023.nes-e1de44339093a3d47b0257aded13de405a3e861c.zip
vendor: Minor updates so 'nasm' is happy
See the 'nasm' utility in https://github.com/mssola/tools.nes. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
-rw-r--r--vendor/bcd16.s19
m---------vendor/list.nes0
2 files changed, 8 insertions, 11 deletions
diff --git a/vendor/bcd16.s b/vendor/bcd16.s
index 7839eaf..e660db4 100644
--- a/vendor/bcd16.s
+++ b/vendor/bcd16.s
@@ -10,16 +10,13 @@
;
; @mssola: The memory addresses being used here have been modified so they don't
; clash with my programs (from $0x to $8x).
-
-.p02
+; @mssola: Remove stuff that was not needed for NES/Famicom development.
+; @mssola: Rename 'b' to 'lowByte' so it conforms to what 'nasm' expect.
;; Define so you can better manage code that you want included whenever this
;; feature has been included.
BCD16_SUPPORT = 1
-.exportzp bcdNum, bcdResult
-.export bcdConvert
-
; bcdConvert
;
; Given a number in bcdNum (16-bit), converts it to 5 decimal digits
@@ -63,13 +60,13 @@ BCD_BITS = 19
; out, the byte is complete and should be copied to result.
; (This behavior is called a "ring counter".)
; Overwritten.
-; b
+; lowByte
; Low byte of the result of trial subtraction.
; Overwritten.
bcdNum = $80
bcdResult = $82
curDigit = $87
-b = $82
+lowByte = $82
;
; Completes within 670 cycles.
@@ -82,18 +79,18 @@ bcdConvert:
ldy #BCD_BITS - 5
@loop:
- ; Trial subtract this bit to A:b
+ ; Trial subtract this bit to A:lowByte
sec
lda bcdNum
sbc bcdTableLo,y
- sta b
+ sta lowByte
lda bcdNum+1
sbc bcdTableHi,y
- ; If A:b > bcdNum then bcdNum = A:b
+ ; If A:lowByte > bcdNum then bcdNum = A:lowByte
bcc @trial_lower
sta bcdNum+1
- lda b
+ lda lowByte
sta bcdNum
@trial_lower:
diff --git a/vendor/list.nes b/vendor/list.nes
-Subproject 9e22faffffa20aa256a05468157404006e2e4d1
+Subproject 23fda2e0742a9a87fc499816a0872926a1fb570