chiark / gitweb /
fizzbuzz.s: Add a dummy high length byte.
[zx-fizzbuzz] / fizzbuzz.s
index 8521554d3bcfcc09fc98dd800e2707b4530dc87d..00504d4d78ece0fb92ba170cc6edc54d46da1823 100644 (file)
@@ -57,10 +57,8 @@ nobuzz:      ld      a, e
        jr      nz, prnl
 
        ;; OK, so just print the value.
-       ld      a, (len)
-       ld      b, 0
-       ld      c, a
        ld      hl, buf - 1
+       ld      bc, (len)
        add     hl, bc
        ld      b, c
 
@@ -146,5 +144,5 @@ print:
 
        ;; Initial state.  The buffer notionally continues for another 254
        ;; bytes, but there's no point in including them in the image.
-len:   db      1
+len:   db      1, 0
 buf:   db      1