chiark
/
gitweb
/
~mdw
/
zx-fizzbuzz
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0e3fb42
)
fizzbuzz.s: Increment `len' in place rather than via register.
author
Mark Wooding
<mdw@distorted.org.uk>
Sun, 14 Nov 2021 15:46:11 +0000
(15:46 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sun, 14 Nov 2021 15:46:11 +0000
(15:46 +0000)
The Z80 isn't a load/store architecture, even though my RISC-programming
habits lead me to treat it like one.
fizzbuzz.s
patch
|
blob
|
blame
|
history
diff --git
a/fizzbuzz.s
b/fizzbuzz.s
index 6a68e9d940e8c9b046573a07db7304c0e848ae48..76242efd254854ce6a5bcb1cd99a3b2e552027c2 100644
(file)
--- a/
fizzbuzz.s
+++ b/
fizzbuzz.s
@@
-111,10
+111,9
@@
incr: ld a, (hl)
djnz incr
;; Carry out.
djnz incr
;; Carry out.
- ld a, (len)
ld (hl), 1
ld (hl), 1
- inc a
- ld (len), a
+ ld hl, len
+ inc (hl)
jp again
squish:
jp again
squish: