Skip to content

Commit 303247f

Browse files
committed
Update LOAD/SAVE tests
1 parent a68ceb2 commit 303247f

9 files changed

Lines changed: 275 additions & 9 deletions

File tree

tests/functional/code00.asm

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,7 @@ LOAD_CODE:
13831383
; Must skip first 8 bytes used by
13841384
; PRINT routine
13851385
TMP_HEADER EQU HEAD1 + 17 ; Temporary HEADER2 pointer storage
1386-
LD_BYTES EQU 0556h ; ROM Routine LD-BYTES
1386+
#line 34 "/zxbasic/library-asm/load.asm"
13871387
TMP_FLAG EQU 23655 ; Uses BREG as a Temporary FLAG
13881388
pop hl ; Return address
13891389
pop af ; A = 1 => LOAD; A = 0 => VERIFY
@@ -1543,6 +1543,28 @@ LOAD_END:
15431543
pop ix ; Recovers stack frame pointer
15441544
ld hl, (TMP_HEADER) ; Recovers tmp_header pointer
15451545
jp MEM_FREE ; Returns via FREE_MEM, freeing tmp header
1546+
LOCAL LD_BYTES_RET
1547+
LOCAL LD_BYTES_ROM
1548+
LOCAL LD_BYTES_NOINTER
1549+
LD_BYTES_ROM EQU 0562h
1550+
LD_BYTES:
1551+
inc d
1552+
ex af, af'
1553+
dec d
1554+
ld a, r
1555+
push af
1556+
di
1557+
call 0562h
1558+
LD_BYTES_RET:
1559+
; Restores DI / EI state
1560+
ex af, af'
1561+
pop af
1562+
jp po, LD_BYTES_NOINTER
1563+
ei
1564+
LD_BYTES_NOINTER:
1565+
ex af, af'
1566+
ret
1567+
#line 262 "/zxbasic/library-asm/load.asm"
15461568
ENDP
15471569
PRINT_TAPE_MESSAGES:
15481570
PROC

tests/functional/code01.asm

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,7 @@ LOAD_CODE:
13831383
; Must skip first 8 bytes used by
13841384
; PRINT routine
13851385
TMP_HEADER EQU HEAD1 + 17 ; Temporary HEADER2 pointer storage
1386-
LD_BYTES EQU 0556h ; ROM Routine LD-BYTES
1386+
#line 34 "/zxbasic/library-asm/load.asm"
13871387
TMP_FLAG EQU 23655 ; Uses BREG as a Temporary FLAG
13881388
pop hl ; Return address
13891389
pop af ; A = 1 => LOAD; A = 0 => VERIFY
@@ -1543,6 +1543,28 @@ LOAD_END:
15431543
pop ix ; Recovers stack frame pointer
15441544
ld hl, (TMP_HEADER) ; Recovers tmp_header pointer
15451545
jp MEM_FREE ; Returns via FREE_MEM, freeing tmp header
1546+
LOCAL LD_BYTES_RET
1547+
LOCAL LD_BYTES_ROM
1548+
LOCAL LD_BYTES_NOINTER
1549+
LD_BYTES_ROM EQU 0562h
1550+
LD_BYTES:
1551+
inc d
1552+
ex af, af'
1553+
dec d
1554+
ld a, r
1555+
push af
1556+
di
1557+
call 0562h
1558+
LD_BYTES_RET:
1559+
; Restores DI / EI state
1560+
ex af, af'
1561+
pop af
1562+
jp po, LD_BYTES_NOINTER
1563+
ei
1564+
LD_BYTES_NOINTER:
1565+
ex af, af'
1566+
ret
1567+
#line 262 "/zxbasic/library-asm/load.asm"
15461568
ENDP
15471569
PRINT_TAPE_MESSAGES:
15481570
PROC

tests/functional/code02.asm

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,7 @@ LOAD_CODE:
13831383
; Must skip first 8 bytes used by
13841384
; PRINT routine
13851385
TMP_HEADER EQU HEAD1 + 17 ; Temporary HEADER2 pointer storage
1386-
LD_BYTES EQU 0556h ; ROM Routine LD-BYTES
1386+
#line 34 "/zxbasic/library-asm/load.asm"
13871387
TMP_FLAG EQU 23655 ; Uses BREG as a Temporary FLAG
13881388
pop hl ; Return address
13891389
pop af ; A = 1 => LOAD; A = 0 => VERIFY
@@ -1543,6 +1543,28 @@ LOAD_END:
15431543
pop ix ; Recovers stack frame pointer
15441544
ld hl, (TMP_HEADER) ; Recovers tmp_header pointer
15451545
jp MEM_FREE ; Returns via FREE_MEM, freeing tmp header
1546+
LOCAL LD_BYTES_RET
1547+
LOCAL LD_BYTES_ROM
1548+
LOCAL LD_BYTES_NOINTER
1549+
LD_BYTES_ROM EQU 0562h
1550+
LD_BYTES:
1551+
inc d
1552+
ex af, af'
1553+
dec d
1554+
ld a, r
1555+
push af
1556+
di
1557+
call 0562h
1558+
LD_BYTES_RET:
1559+
; Restores DI / EI state
1560+
ex af, af'
1561+
pop af
1562+
jp po, LD_BYTES_NOINTER
1563+
ei
1564+
LD_BYTES_NOINTER:
1565+
ex af, af'
1566+
ret
1567+
#line 262 "/zxbasic/library-asm/load.asm"
15461568
ENDP
15471569
PRINT_TAPE_MESSAGES:
15481570
PROC

tests/functional/load02.asm

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ LOAD_CODE:
13881388
; Must skip first 8 bytes used by
13891389
; PRINT routine
13901390
TMP_HEADER EQU HEAD1 + 17 ; Temporary HEADER2 pointer storage
1391-
LD_BYTES EQU 0556h ; ROM Routine LD-BYTES
1391+
#line 34 "/zxbasic/library-asm/load.asm"
13921392
TMP_FLAG EQU 23655 ; Uses BREG as a Temporary FLAG
13931393
pop hl ; Return address
13941394
pop af ; A = 1 => LOAD; A = 0 => VERIFY
@@ -1548,6 +1548,28 @@ LOAD_END:
15481548
pop ix ; Recovers stack frame pointer
15491549
ld hl, (TMP_HEADER) ; Recovers tmp_header pointer
15501550
jp MEM_FREE ; Returns via FREE_MEM, freeing tmp header
1551+
LOCAL LD_BYTES_RET
1552+
LOCAL LD_BYTES_ROM
1553+
LOCAL LD_BYTES_NOINTER
1554+
LD_BYTES_ROM EQU 0562h
1555+
LD_BYTES:
1556+
inc d
1557+
ex af, af'
1558+
dec d
1559+
ld a, r
1560+
push af
1561+
di
1562+
call 0562h
1563+
LD_BYTES_RET:
1564+
; Restores DI / EI state
1565+
ex af, af'
1566+
pop af
1567+
jp po, LD_BYTES_NOINTER
1568+
ei
1569+
LD_BYTES_NOINTER:
1570+
ex af, af'
1571+
ret
1572+
#line 262 "/zxbasic/library-asm/load.asm"
15511573
ENDP
15521574
PRINT_TAPE_MESSAGES:
15531575
PROC

tests/functional/load03.asm

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@ LOAD_CODE:
13871387
; Must skip first 8 bytes used by
13881388
; PRINT routine
13891389
TMP_HEADER EQU HEAD1 + 17 ; Temporary HEADER2 pointer storage
1390-
LD_BYTES EQU 0556h ; ROM Routine LD-BYTES
1390+
#line 34 "/zxbasic/library-asm/load.asm"
13911391
TMP_FLAG EQU 23655 ; Uses BREG as a Temporary FLAG
13921392
pop hl ; Return address
13931393
pop af ; A = 1 => LOAD; A = 0 => VERIFY
@@ -1547,6 +1547,28 @@ LOAD_END:
15471547
pop ix ; Recovers stack frame pointer
15481548
ld hl, (TMP_HEADER) ; Recovers tmp_header pointer
15491549
jp MEM_FREE ; Returns via FREE_MEM, freeing tmp header
1550+
LOCAL LD_BYTES_RET
1551+
LOCAL LD_BYTES_ROM
1552+
LOCAL LD_BYTES_NOINTER
1553+
LD_BYTES_ROM EQU 0562h
1554+
LD_BYTES:
1555+
inc d
1556+
ex af, af'
1557+
dec d
1558+
ld a, r
1559+
push af
1560+
di
1561+
call 0562h
1562+
LD_BYTES_RET:
1563+
; Restores DI / EI state
1564+
ex af, af'
1565+
pop af
1566+
jp po, LD_BYTES_NOINTER
1567+
ei
1568+
LD_BYTES_NOINTER:
1569+
ex af, af'
1570+
ret
1571+
#line 262 "/zxbasic/library-asm/load.asm"
15501572
ENDP
15511573
PRINT_TAPE_MESSAGES:
15521574
PROC

tests/functional/save.asm

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ SAVE_CODE:
386386
LOCAL ROM_SAVE
387387
LOCAL __ERR_EMPTY
388388
LOCAL SAVE_STOP
389-
ROM_SAVE EQU 0970h
389+
#line 21 "/zxbasic/library-asm/save.asm"
390390
MEMBOT EQU 23698 ; Use the CALC mem to store header
391391
pop hl ; Return address
392392
pop bc ; data length in bytes
@@ -448,6 +448,45 @@ SAVE_CONT:
448448
SAVE_STOP:
449449
pop ix
450450
jp __STOP
451+
LOCAL CHAN_OPEN
452+
LOCAL PO_MSG
453+
LOCAL WAIT_KEY
454+
LOCAL SA_BYTES
455+
CHAN_OPEN EQU 1601h
456+
PO_MSG EQU 0C0Ah
457+
WAIT_KEY EQU 15D4h
458+
SA_BYTES EQU 04C6h
459+
ROM_SAVE:
460+
push hl
461+
ld a, 0FDh
462+
call CHAN_OPEN
463+
xor a
464+
ld de, 09A1h
465+
call PO_MSG
466+
set 5, (iy + 02h)
467+
call WAIT_KEY
468+
push ix
469+
ld de, 0011h
470+
ld a, r
471+
push af
472+
xor a
473+
call SA_BYTES
474+
pop ix
475+
ld b, 32h
476+
LOCAL SA_1_SEC
477+
SA_1_SEC:
478+
halt
479+
djnz SA_1_SEC
480+
ld e, (ix + 0Bh)
481+
ld d, (ix + 0Ch)
482+
ld a, 0FFh
483+
pop ix
484+
call SA_BYTES
485+
pop af
486+
ret po
487+
ei
488+
ret
489+
#line 144 "/zxbasic/library-asm/save.asm"
451490
ENDP
452491
#line 33 "save.bas"
453492
ZXBASIC_USER_DATA:

tests/functional/save01.asm

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ SAVE_CODE:
390390
LOCAL ROM_SAVE
391391
LOCAL __ERR_EMPTY
392392
LOCAL SAVE_STOP
393-
ROM_SAVE EQU 0970h
393+
#line 21 "/zxbasic/library-asm/save.asm"
394394
MEMBOT EQU 23698 ; Use the CALC mem to store header
395395
pop hl ; Return address
396396
pop bc ; data length in bytes
@@ -452,6 +452,45 @@ SAVE_CONT:
452452
SAVE_STOP:
453453
pop ix
454454
jp __STOP
455+
LOCAL CHAN_OPEN
456+
LOCAL PO_MSG
457+
LOCAL WAIT_KEY
458+
LOCAL SA_BYTES
459+
CHAN_OPEN EQU 1601h
460+
PO_MSG EQU 0C0Ah
461+
WAIT_KEY EQU 15D4h
462+
SA_BYTES EQU 04C6h
463+
ROM_SAVE:
464+
push hl
465+
ld a, 0FDh
466+
call CHAN_OPEN
467+
xor a
468+
ld de, 09A1h
469+
call PO_MSG
470+
set 5, (iy + 02h)
471+
call WAIT_KEY
472+
push ix
473+
ld de, 0011h
474+
ld a, r
475+
push af
476+
xor a
477+
call SA_BYTES
478+
pop ix
479+
ld b, 32h
480+
LOCAL SA_1_SEC
481+
SA_1_SEC:
482+
halt
483+
djnz SA_1_SEC
484+
ld e, (ix + 0Bh)
485+
ld d, (ix + 0Ch)
486+
ld a, 0FFh
487+
pop ix
488+
call SA_BYTES
489+
pop af
490+
ret po
491+
ei
492+
ret
493+
#line 144 "/zxbasic/library-asm/save.asm"
455494
ENDP
456495
#line 37 "save01.bas"
457496
ZXBASIC_USER_DATA:

tests/functional/save02.asm

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ SAVE_CODE:
387387
LOCAL ROM_SAVE
388388
LOCAL __ERR_EMPTY
389389
LOCAL SAVE_STOP
390-
ROM_SAVE EQU 0970h
390+
#line 21 "/zxbasic/library-asm/save.asm"
391391
MEMBOT EQU 23698 ; Use the CALC mem to store header
392392
pop hl ; Return address
393393
pop bc ; data length in bytes
@@ -449,6 +449,45 @@ SAVE_CONT:
449449
SAVE_STOP:
450450
pop ix
451451
jp __STOP
452+
LOCAL CHAN_OPEN
453+
LOCAL PO_MSG
454+
LOCAL WAIT_KEY
455+
LOCAL SA_BYTES
456+
CHAN_OPEN EQU 1601h
457+
PO_MSG EQU 0C0Ah
458+
WAIT_KEY EQU 15D4h
459+
SA_BYTES EQU 04C6h
460+
ROM_SAVE:
461+
push hl
462+
ld a, 0FDh
463+
call CHAN_OPEN
464+
xor a
465+
ld de, 09A1h
466+
call PO_MSG
467+
set 5, (iy + 02h)
468+
call WAIT_KEY
469+
push ix
470+
ld de, 0011h
471+
ld a, r
472+
push af
473+
xor a
474+
call SA_BYTES
475+
pop ix
476+
ld b, 32h
477+
LOCAL SA_1_SEC
478+
SA_1_SEC:
479+
halt
480+
djnz SA_1_SEC
481+
ld e, (ix + 0Bh)
482+
ld d, (ix + 0Ch)
483+
ld a, 0FFh
484+
pop ix
485+
call SA_BYTES
486+
pop af
487+
ret po
488+
ei
489+
ret
490+
#line 144 "/zxbasic/library-asm/save.asm"
452491
ENDP
453492
#line 34 "save02.bas"
454493
ZXBASIC_USER_DATA:

0 commit comments

Comments
 (0)