From 4de9a5199ceb6cc3cebb7d50813f483efa228f6b Mon Sep 17 00:00:00 2001 From: Jose Rodriguez Date: Fri, 7 Jun 2019 21:40:57 +0200 Subject: [PATCH 1/3] Add extra array-runtime check --- tests/runtime/arrcheck1.bas | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/runtime/arrcheck1.bas diff --git a/tests/runtime/arrcheck1.bas b/tests/runtime/arrcheck1.bas new file mode 100644 index 000000000..970521db0 --- /dev/null +++ b/tests/runtime/arrcheck1.bas @@ -0,0 +1,24 @@ + +DIM a(23, 31) as Uinteger +DIM p as UInteger = @a(0, 0) +DIM i as Uinteger +DIM j as UInteger +DIM m as UInteger +CLS + +FOR i = 0 TO 23 + FOR j = 0 TO 31 + LET m = i * 32 + j + LET a(i, j) = m + PRINT AT 0, 0; i; " "; j; " "; " " + IF PEEK(UInteger, p) <> m THEN + PRINT INK 2; FLASH 1; " ERROR " + PRINT "Expected "; m; ", got "; PEEK(Uinteger, p); ", read: "; a(i, j) + STOP + END IF + LET p = p + 2 + NEXT j +NEXT i + +PRINT INK 4; FLASH 1; " OK " + From 741bcfbfcd67a4d06436d72fbf4aacec31649ed9 Mon Sep 17 00:00:00 2001 From: Jose Rodriguez Date: Fri, 7 Jun 2019 21:41:08 +0200 Subject: [PATCH 2/3] Fix array address computing Array address calculation was wrong. Also do some little optimization. Test updated to reflect this change. --- library-asm/array.asm | 20 ++++++++--------- tests/functional/46.asm | 23 +++++++++---------- tests/functional/47.asm | 17 +++++++------- tests/functional/55.asm | 23 +++++++++---------- tests/functional/aloadstr1.asm | 27 +++++++++++----------- tests/functional/array03.asm | 23 +++++++++---------- tests/functional/array06.asm | 23 +++++++++---------- tests/functional/array07.asm | 27 +++++++++++----------- tests/functional/array08.asm | 27 +++++++++++----------- tests/functional/array09.asm | 27 +++++++++++----------- tests/functional/array10.asm | 23 +++++++++---------- tests/functional/array12.asm | 27 +++++++++++----------- tests/functional/arrbase1.asm | 27 +++++++++++----------- tests/functional/arrcheck.asm | 17 +++++++------- tests/functional/astore16.asm | 27 +++++++++++----------- tests/functional/let_array_substr.asm | 27 +++++++++++----------- tests/functional/let_array_substr1.asm | 27 +++++++++++----------- tests/functional/let_array_substr5.asm | 27 +++++++++++----------- tests/functional/ltee10.asm | 23 +++++++++---------- tests/functional/ltee6.asm | 27 +++++++++++----------- tests/functional/ltee7.asm | 27 +++++++++++----------- tests/functional/opt2_snake_es.asm | 23 +++++++++---------- tests/functional/opt3_OPT27wws2.asm | 17 +++++++------- tests/functional/opt3_data2.asm | 31 +++++++++++++------------- tests/functional/read9.asm | 31 +++++++++++++------------- 25 files changed, 297 insertions(+), 321 deletions(-) diff --git a/library-asm/array.asm b/library-asm/array.asm index 8563e8ae3..4a1292a09 100644 --- a/library-asm/array.asm +++ b/library-asm/array.asm @@ -40,7 +40,7 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: #ifdef __CHECK_ARRAY_BOUNDARY__ @@ -75,26 +75,24 @@ LOOP: call __FNMUL jp LOOP - + ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx #ifdef __BIG_ARRAY__ - pop de + ld d, 0 + ld e, a call __FNMUL #else LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c -ARRAY_SIZE_LOOP: + ld b, a +ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP @@ -111,8 +109,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST diff --git a/tests/functional/46.asm b/tests/functional/46.asm index 961e5d961..05724b6f4 100644 --- a/tests/functional/46.asm +++ b/tests/functional/46.asm @@ -97,7 +97,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -117,13 +117,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -145,25 +145,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -176,8 +173,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST diff --git a/tests/functional/47.asm b/tests/functional/47.asm index f534c48a2..edae8af24 100644 --- a/tests/functional/47.asm +++ b/tests/functional/47.asm @@ -144,7 +144,7 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: #line 49 "/zxbasic/library-asm/array.asm" @@ -172,25 +172,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -203,8 +200,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST diff --git a/tests/functional/55.asm b/tests/functional/55.asm index fcbe9aaf0..1898eea77 100644 --- a/tests/functional/55.asm +++ b/tests/functional/55.asm @@ -92,7 +92,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -112,13 +112,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -140,25 +140,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -171,8 +168,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST diff --git a/tests/functional/aloadstr1.asm b/tests/functional/aloadstr1.asm index 76449c9bc..5550d35df 100644 --- a/tests/functional/aloadstr1.asm +++ b/tests/functional/aloadstr1.asm @@ -95,7 +95,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -115,13 +115,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -143,25 +143,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -174,8 +171,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST @@ -470,9 +469,9 @@ __MEM_START: __MEM_LOOP: ; Loads lengh at (HL, HL+). If Lenght >= BC, jump to __MEM_DONE ld a, h ; HL = NULL (No memory available?) or l -#line 111 "/zxbasic/library-asm/alloc.asm" +#line 111 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ret z ; NULL -#line 113 "/zxbasic/library-asm/alloc.asm" +#line 113 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ; HL = Pointer to Free block ld e, (hl) inc hl diff --git a/tests/functional/array03.asm b/tests/functional/array03.asm index b7f6634ae..2eb13a8d0 100644 --- a/tests/functional/array03.asm +++ b/tests/functional/array03.asm @@ -90,7 +90,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -110,13 +110,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -138,25 +138,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -169,8 +166,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST diff --git a/tests/functional/array06.asm b/tests/functional/array06.asm index c08c3faa3..b097df71b 100644 --- a/tests/functional/array06.asm +++ b/tests/functional/array06.asm @@ -90,7 +90,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -110,13 +110,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -138,25 +138,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -169,8 +166,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST diff --git a/tests/functional/array07.asm b/tests/functional/array07.asm index 789dfaf85..de7b8d919 100644 --- a/tests/functional/array07.asm +++ b/tests/functional/array07.asm @@ -113,7 +113,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -133,13 +133,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -161,25 +161,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -192,8 +189,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST @@ -765,9 +764,9 @@ __MEM_START: __MEM_LOOP: ; Loads lengh at (HL, HL+). If Lenght >= BC, jump to __MEM_DONE ld a, h ; HL = NULL (No memory available?) or l -#line 111 "/zxbasic/library-asm/alloc.asm" +#line 111 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ret z ; NULL -#line 113 "/zxbasic/library-asm/alloc.asm" +#line 113 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ; HL = Pointer to Free block ld e, (hl) inc hl diff --git a/tests/functional/array08.asm b/tests/functional/array08.asm index 22cc477dc..f7d3ee833 100644 --- a/tests/functional/array08.asm +++ b/tests/functional/array08.asm @@ -91,7 +91,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -111,13 +111,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -139,25 +139,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -170,8 +167,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST @@ -551,9 +550,9 @@ __MEM_START: __MEM_LOOP: ; Loads lengh at (HL, HL+). If Lenght >= BC, jump to __MEM_DONE ld a, h ; HL = NULL (No memory available?) or l -#line 111 "/zxbasic/library-asm/alloc.asm" +#line 111 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ret z ; NULL -#line 113 "/zxbasic/library-asm/alloc.asm" +#line 113 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ; HL = Pointer to Free block ld e, (hl) inc hl diff --git a/tests/functional/array09.asm b/tests/functional/array09.asm index df200eafc..c6c5088fc 100644 --- a/tests/functional/array09.asm +++ b/tests/functional/array09.asm @@ -91,7 +91,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -111,13 +111,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -139,25 +139,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -170,8 +167,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST @@ -551,9 +550,9 @@ __MEM_START: __MEM_LOOP: ; Loads lengh at (HL, HL+). If Lenght >= BC, jump to __MEM_DONE ld a, h ; HL = NULL (No memory available?) or l -#line 111 "/zxbasic/library-asm/alloc.asm" +#line 111 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ret z ; NULL -#line 113 "/zxbasic/library-asm/alloc.asm" +#line 113 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ; HL = Pointer to Free block ld e, (hl) inc hl diff --git a/tests/functional/array10.asm b/tests/functional/array10.asm index 1c0a1cbfc..92626984c 100644 --- a/tests/functional/array10.asm +++ b/tests/functional/array10.asm @@ -123,7 +123,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -143,13 +143,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -171,25 +171,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -202,8 +199,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST diff --git a/tests/functional/array12.asm b/tests/functional/array12.asm index e9d1286a2..eb8235b0b 100644 --- a/tests/functional/array12.asm +++ b/tests/functional/array12.asm @@ -93,7 +93,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -113,13 +113,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -141,25 +141,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -172,8 +169,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST @@ -553,9 +552,9 @@ __MEM_START: __MEM_LOOP: ; Loads lengh at (HL, HL+). If Lenght >= BC, jump to __MEM_DONE ld a, h ; HL = NULL (No memory available?) or l -#line 111 "/zxbasic/library-asm/alloc.asm" +#line 111 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ret z ; NULL -#line 113 "/zxbasic/library-asm/alloc.asm" +#line 113 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ; HL = Pointer to Free block ld e, (hl) inc hl diff --git a/tests/functional/arrbase1.asm b/tests/functional/arrbase1.asm index 4330d2404..fe42e63a9 100644 --- a/tests/functional/arrbase1.asm +++ b/tests/functional/arrbase1.asm @@ -115,7 +115,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -135,13 +135,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -163,25 +163,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -194,8 +191,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST @@ -514,9 +513,9 @@ __MEM_START: __MEM_LOOP: ; Loads lengh at (HL, HL+). If Lenght >= BC, jump to __MEM_DONE ld a, h ; HL = NULL (No memory available?) or l -#line 111 "/zxbasic/library-asm/alloc.asm" +#line 111 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ret z ; NULL -#line 113 "/zxbasic/library-asm/alloc.asm" +#line 113 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ; HL = Pointer to Free block ld e, (hl) inc hl diff --git a/tests/functional/arrcheck.asm b/tests/functional/arrcheck.asm index c53fed74d..6bbcf25bb 100644 --- a/tests/functional/arrcheck.asm +++ b/tests/functional/arrcheck.asm @@ -172,7 +172,7 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: @@ -209,25 +209,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -240,8 +237,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST diff --git a/tests/functional/astore16.asm b/tests/functional/astore16.asm index 413a4164e..da985ceb4 100644 --- a/tests/functional/astore16.asm +++ b/tests/functional/astore16.asm @@ -117,7 +117,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -137,13 +137,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -165,25 +165,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -196,8 +193,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST @@ -603,7 +602,7 @@ BRIGHT_TMP: -#line 4 "/zxbasic/library-asm/copy_attr.asm" +#line 4 "/home/boriel/src/zxbasic/zxbasic/library-asm/copy_attr.asm" @@ -662,7 +661,7 @@ TABLE: and (hl) ; OVER 2 MODE or (hl) ; OVER 3 MODE -#line 65 "/zxbasic/library-asm/copy_attr.asm" +#line 65 "/home/boriel/src/zxbasic/zxbasic/library-asm/copy_attr.asm" __REFRESH_TMP: ld a, (hl) diff --git a/tests/functional/let_array_substr.asm b/tests/functional/let_array_substr.asm index ee2fee0cc..981e46d99 100644 --- a/tests/functional/let_array_substr.asm +++ b/tests/functional/let_array_substr.asm @@ -128,7 +128,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -148,13 +148,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -176,25 +176,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -207,8 +204,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST @@ -856,9 +855,9 @@ __MEM_START: __MEM_LOOP: ; Loads lengh at (HL, HL+). If Lenght >= BC, jump to __MEM_DONE ld a, h ; HL = NULL (No memory available?) or l -#line 111 "/zxbasic/library-asm/alloc.asm" +#line 111 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ret z ; NULL -#line 113 "/zxbasic/library-asm/alloc.asm" +#line 113 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ; HL = Pointer to Free block ld e, (hl) inc hl diff --git a/tests/functional/let_array_substr1.asm b/tests/functional/let_array_substr1.asm index c889bc5e8..da6f95994 100644 --- a/tests/functional/let_array_substr1.asm +++ b/tests/functional/let_array_substr1.asm @@ -128,7 +128,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -148,13 +148,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -176,25 +176,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -207,8 +204,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST @@ -856,9 +855,9 @@ __MEM_START: __MEM_LOOP: ; Loads lengh at (HL, HL+). If Lenght >= BC, jump to __MEM_DONE ld a, h ; HL = NULL (No memory available?) or l -#line 111 "/zxbasic/library-asm/alloc.asm" +#line 111 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ret z ; NULL -#line 113 "/zxbasic/library-asm/alloc.asm" +#line 113 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ; HL = Pointer to Free block ld e, (hl) inc hl diff --git a/tests/functional/let_array_substr5.asm b/tests/functional/let_array_substr5.asm index 880f3e1cf..d0b507400 100644 --- a/tests/functional/let_array_substr5.asm +++ b/tests/functional/let_array_substr5.asm @@ -128,7 +128,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -148,13 +148,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -176,25 +176,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -207,8 +204,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST @@ -856,9 +855,9 @@ __MEM_START: __MEM_LOOP: ; Loads lengh at (HL, HL+). If Lenght >= BC, jump to __MEM_DONE ld a, h ; HL = NULL (No memory available?) or l -#line 111 "/zxbasic/library-asm/alloc.asm" +#line 111 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ret z ; NULL -#line 113 "/zxbasic/library-asm/alloc.asm" +#line 113 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ; HL = Pointer to Free block ld e, (hl) inc hl diff --git a/tests/functional/ltee10.asm b/tests/functional/ltee10.asm index 76d6da264..7c9e50d32 100644 --- a/tests/functional/ltee10.asm +++ b/tests/functional/ltee10.asm @@ -112,7 +112,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -132,13 +132,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -160,25 +160,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -191,8 +188,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST diff --git a/tests/functional/ltee6.asm b/tests/functional/ltee6.asm index 8317454e2..73ee43ce3 100644 --- a/tests/functional/ltee6.asm +++ b/tests/functional/ltee6.asm @@ -101,7 +101,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -121,13 +121,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -149,25 +149,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -180,8 +177,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST @@ -561,9 +560,9 @@ __MEM_START: __MEM_LOOP: ; Loads lengh at (HL, HL+). If Lenght >= BC, jump to __MEM_DONE ld a, h ; HL = NULL (No memory available?) or l -#line 111 "/zxbasic/library-asm/alloc.asm" +#line 111 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ret z ; NULL -#line 113 "/zxbasic/library-asm/alloc.asm" +#line 113 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ; HL = Pointer to Free block ld e, (hl) inc hl diff --git a/tests/functional/ltee7.asm b/tests/functional/ltee7.asm index 6c5456622..45cfe3371 100644 --- a/tests/functional/ltee7.asm +++ b/tests/functional/ltee7.asm @@ -139,7 +139,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -159,13 +159,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -187,25 +187,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -218,8 +215,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST @@ -862,9 +861,9 @@ __MEM_START: __MEM_LOOP: ; Loads lengh at (HL, HL+). If Lenght >= BC, jump to __MEM_DONE ld a, h ; HL = NULL (No memory available?) or l -#line 111 "/zxbasic/library-asm/alloc.asm" +#line 111 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ret z ; NULL -#line 113 "/zxbasic/library-asm/alloc.asm" +#line 113 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ; HL = Pointer to Free block ld e, (hl) inc hl diff --git a/tests/functional/opt2_snake_es.asm b/tests/functional/opt2_snake_es.asm index 5cded10f4..757caaaee 100644 --- a/tests/functional/opt2_snake_es.asm +++ b/tests/functional/opt2_snake_es.asm @@ -98,7 +98,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -118,13 +118,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -146,25 +146,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -177,8 +174,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST diff --git a/tests/functional/opt3_OPT27wws2.asm b/tests/functional/opt3_OPT27wws2.asm index 36790f92d..4951d696c 100644 --- a/tests/functional/opt3_OPT27wws2.asm +++ b/tests/functional/opt3_OPT27wws2.asm @@ -119,7 +119,7 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: #line 49 "/zxbasic/library-asm/array.asm" @@ -147,25 +147,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -178,8 +175,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST diff --git a/tests/functional/opt3_data2.asm b/tests/functional/opt3_data2.asm index 0635a3802..da32dbb26 100644 --- a/tests/functional/opt3_data2.asm +++ b/tests/functional/opt3_data2.asm @@ -165,7 +165,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -185,13 +185,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -213,25 +213,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -244,8 +241,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST @@ -705,7 +704,7 @@ BRIGHT_TMP: -#line 4 "/zxbasic/library-asm/copy_attr.asm" +#line 4 "/home/boriel/src/zxbasic/zxbasic/library-asm/copy_attr.asm" @@ -764,7 +763,7 @@ TABLE: and (hl) ; OVER 2 MODE or (hl) ; OVER 3 MODE -#line 65 "/zxbasic/library-asm/copy_attr.asm" +#line 65 "/home/boriel/src/zxbasic/zxbasic/library-asm/copy_attr.asm" __REFRESH_TMP: ld a, (hl) @@ -1919,9 +1918,9 @@ __MEM_START: __MEM_LOOP: ; Loads lengh at (HL, HL+). If Lenght >= BC, jump to __MEM_DONE ld a, h ; HL = NULL (No memory available?) or l -#line 111 "/zxbasic/library-asm/alloc.asm" +#line 111 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ret z ; NULL -#line 113 "/zxbasic/library-asm/alloc.asm" +#line 113 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ; HL = Pointer to Free block ld e, (hl) inc hl diff --git a/tests/functional/read9.asm b/tests/functional/read9.asm index ce52492de..afb9d67fa 100644 --- a/tests/functional/read9.asm +++ b/tests/functional/read9.asm @@ -184,7 +184,7 @@ __MUL16NOADD: #line 20 "array.asm" -#line 24 "/zxbasic/library-asm/array.asm" +#line 24 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" __ARRAY: PROC @@ -204,13 +204,13 @@ __ARRAY: inc hl ; Ready exx - ld hl, 0 ; BC = Offset "accumulator" + ld hl, 0 ; HL = Offset "accumulator" LOOP: -#line 49 "/zxbasic/library-asm/array.asm" +#line 49 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop bc ; Get next index (Ai) from the stack -#line 59 "/zxbasic/library-asm/array.asm" +#line 59 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" add hl, bc ; Adds current index @@ -232,25 +232,22 @@ LOOP: jp LOOP ARRAY_END: - ld e, (hl) + ld a, (hl) inc hl - ld d, c ; C = 0 => DE = E = Element size push hl - push de exx -#line 91 "/zxbasic/library-asm/array.asm" +#line 90 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" LOCAL ARRAY_SIZE_LOOP ex de, hl ld hl, 0 - pop bc - ld b, c + ld b, a ARRAY_SIZE_LOOP: add hl, de djnz ARRAY_SIZE_LOOP -#line 102 "/zxbasic/library-asm/array.asm" +#line 100 "/home/boriel/src/zxbasic/zxbasic/library-asm/array.asm" pop de add hl, de ; Adds element start @@ -263,8 +260,10 @@ RET_ADDRESS: __FNMUL: xor a - or d + or h jp nz, __MUL16_FAST + or l + ret z cp 33 jp nc, __MUL16_FAST @@ -806,7 +805,7 @@ BRIGHT_TMP: -#line 4 "/zxbasic/library-asm/copy_attr.asm" +#line 4 "/home/boriel/src/zxbasic/zxbasic/library-asm/copy_attr.asm" @@ -865,7 +864,7 @@ TABLE: and (hl) ; OVER 2 MODE or (hl) ; OVER 3 MODE -#line 65 "/zxbasic/library-asm/copy_attr.asm" +#line 65 "/home/boriel/src/zxbasic/zxbasic/library-asm/copy_attr.asm" __REFRESH_TMP: ld a, (hl) @@ -2145,9 +2144,9 @@ __MEM_START: __MEM_LOOP: ; Loads lengh at (HL, HL+). If Lenght >= BC, jump to __MEM_DONE ld a, h ; HL = NULL (No memory available?) or l -#line 111 "/zxbasic/library-asm/alloc.asm" +#line 111 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ret z ; NULL -#line 113 "/zxbasic/library-asm/alloc.asm" +#line 113 "/home/boriel/src/zxbasic/zxbasic/library-asm/alloc.asm" ; HL = Pointer to Free block ld e, (hl) inc hl From 935485eee8dd5db131b730474a0484a948644346 Mon Sep 17 00:00:00 2001 From: Jose Rodriguez Date: Fri, 7 Jun 2019 21:56:03 +0200 Subject: [PATCH 3/3] Dropped support for py2x Support for python 2.7.x and PyPy2.x dropped. From now on zxbasic will require Py3 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 25707ddd7..6870ee2bf 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py36,pypy,flake8 +envlist = py36,flake8 [testenv] setenv = LANG=en_US.UTF-8