Added verify
This commit is contained in:
parent
2bdc9a5581
commit
1d0f621243
|
@ -1,3 +1,2 @@
|
|||
set makeprg=./tools/build.sh
|
||||
map <silent> <F10> :Start ./tools/upload_stm32.sh<cr>
|
||||
map <silent> <F20> :Start python.exe rootfs$(pwd)/tools/upload_z80.py rootfs$(pwd)/build/fib.z80<cr>
|
||||
set makeprg=./build.sh
|
||||
map <silent> <F10> :Start python.exe rootfs$(pwd)/upload.py rootfs$(pwd)/.build/fib.bin<cr>
|
||||
|
|
19
src/fib.z80
19
src/fib.z80
|
@ -1,11 +1,10 @@
|
|||
.org $0000
|
||||
main:
|
||||
init:
|
||||
ld hl, out+7
|
||||
ld hl, out
|
||||
|
||||
ld a, (amount)
|
||||
ld d, a
|
||||
dec d
|
||||
|
||||
ld a, (y)
|
||||
ld b, a
|
||||
|
@ -25,6 +24,19 @@ loop:
|
|||
dec d
|
||||
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:
|
||||
halt
|
||||
|
||||
|
@ -35,4 +47,5 @@ x:
|
|||
.db 0
|
||||
y:
|
||||
.db 1
|
||||
out:
|
||||
|
||||
out .equ $1000
|
||||
|
|
|
@ -16,8 +16,8 @@ def progressbar(it, prefix="", size=60, file=sys.stdout):
|
|||
file.flush()
|
||||
|
||||
def main():
|
||||
if len(sys.argv) == 3:
|
||||
ser = serial.Serial(sys.argv[1], timeout=1, write_timeout=1)
|
||||
if len(sys.argv) == 2:
|
||||
ser = serial.Serial("COM3", timeout=1, write_timeout=1)
|
||||
if ser.is_open:
|
||||
# Clear out any existing input
|
||||
ser.write(b'\n')
|
||||
|
@ -27,7 +27,7 @@ def main():
|
|||
ser.write(b'#u\n')
|
||||
print(ser.readline())
|
||||
|
||||
path = sys.argv[2]
|
||||
path = sys.argv[1]
|
||||
size = os.path.getsize(path)
|
||||
ser.write([size])
|
||||
i = 0
|
||||
|
|
Reference in New Issue
Block a user