Updated upload script to allow bigger programs
This commit is contained in:
parent
1d0f621243
commit
2beb51427f
27
src/fib.z80
27
src/fib.z80
|
@ -1,8 +1,8 @@
|
||||||
.org $0000
|
.org 0x1500
|
||||||
|
jp main
|
||||||
|
|
||||||
main:
|
main:
|
||||||
init:
|
init:
|
||||||
ld hl, out
|
|
||||||
|
|
||||||
ld a, (amount)
|
ld a, (amount)
|
||||||
ld d, a
|
ld d, a
|
||||||
|
|
||||||
|
@ -14,8 +14,7 @@ init:
|
||||||
loop:
|
loop:
|
||||||
add a, b
|
add a, b
|
||||||
|
|
||||||
ld (hl), a
|
out 0x80, a
|
||||||
inc hl
|
|
||||||
|
|
||||||
ld c, a
|
ld c, a
|
||||||
ld a, b
|
ld a, b
|
||||||
|
@ -24,22 +23,8 @@ loop:
|
||||||
dec d
|
dec d
|
||||||
jp nz, loop
|
jp nz, loop
|
||||||
|
|
||||||
verify_init:
|
|
||||||
ld hl, out
|
|
||||||
|
|
||||||
ld a, (amount)
|
|
||||||
ld d, a
|
|
||||||
|
|
||||||
verify:
|
|
||||||
ld a, (hl)
|
|
||||||
inc hl
|
|
||||||
|
|
||||||
dec d
|
|
||||||
jp nz, verify
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
halt
|
jp 0x0000
|
||||||
|
|
||||||
|
|
||||||
amount:
|
amount:
|
||||||
.db 10
|
.db 10
|
||||||
|
@ -47,5 +32,3 @@ x:
|
||||||
.db 0
|
.db 0
|
||||||
y:
|
y:
|
||||||
.db 1
|
.db 1
|
||||||
|
|
||||||
out .equ $1000
|
|
||||||
|
|
|
@ -29,7 +29,8 @@ def main():
|
||||||
|
|
||||||
path = sys.argv[1]
|
path = sys.argv[1]
|
||||||
size = os.path.getsize(path)
|
size = os.path.getsize(path)
|
||||||
ser.write([size])
|
ser.write([size & 0xFF])
|
||||||
|
ser.write([(size >> 8) & 0xFF])
|
||||||
i = 0
|
i = 0
|
||||||
with open(path, "rb") as f:
|
with open(path, "rb") as f:
|
||||||
for i in progressbar(range(size), "Upload: ", 40):
|
for i in progressbar(range(size), "Upload: ", 40):
|
||||||
|
|
Reference in New Issue
Block a user