Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 1 addition & 28 deletions library-asm/array.asm
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ LOOP:
exx
pop de ; DE = Max bound Number (i-th dimension)

;call __MUL16_FAST ; HL *= DE
call __FNMUL
jp LOOP

Expand All @@ -99,35 +98,13 @@ ARRAY_SIZE_LOOP:
add hl, de
djnz ARRAY_SIZE_LOOP

;; Even faster
;pop bc

;ld d, h
;ld e, l

;dec c
;jp z, __ARRAY_FIN

;add hl, hl
;dec c
;jp z, __ARRAY_FIN

;add hl, hl
;dec c
;dec c
;jp z, __ARRAY_FIN

;add hl, de
;__ARRAY_FIN:
#endif

pop de
add hl, de ; Adds element start

RET_ADDRESS:
ld de, 0
push de
ret ; HL = (Start of Elements + Offset)
jp 0

;; Performs a faster multiply for little 16bit numbs
LOCAL __FNMUL, __FNMUL2
Expand All @@ -137,10 +114,6 @@ __FNMUL:
or d
jp nz, __MUL16_FAST

or e
ex de, hl
ret z

cp 33
jp nc, __MUL16_FAST

Expand Down
4 changes: 2 additions & 2 deletions tests/functional/27.asm
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,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 "/zbasic/library-asm/alloc.asm"
#line 111 "/zxbasic/library-asm/alloc.asm"
ret z ; NULL
#line 113 "/zbasic/library-asm/alloc.asm"
#line 113 "/zxbasic/library-asm/alloc.asm"
; HL = Pointer to Free block
ld e, (hl)
inc hl
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/28.asm
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,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 "/zbasic/library-asm/alloc.asm"
#line 111 "/zxbasic/library-asm/alloc.asm"
ret z ; NULL
#line 113 "/zbasic/library-asm/alloc.asm"
#line 113 "/zxbasic/library-asm/alloc.asm"
; HL = Pointer to Free block
ld e, (hl)
inc hl
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/29.asm
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,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 "/zbasic/library-asm/alloc.asm"
#line 111 "/zxbasic/library-asm/alloc.asm"
ret z ; NULL
#line 113 "/zbasic/library-asm/alloc.asm"
#line 113 "/zxbasic/library-asm/alloc.asm"
; HL = Pointer to Free block
ld e, (hl)
inc hl
Expand Down
39 changes: 6 additions & 33 deletions tests/functional/46.asm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ __MUL16NOADD:

#line 20 "array.asm"

#line 24 "/zbasic/library-asm/array.asm"
#line 24 "/zxbasic/library-asm/array.asm"

__ARRAY:
PROC
Expand All @@ -120,10 +120,10 @@ __ARRAY:
ld hl, 0 ; BC = Offset "accumulator"

LOOP:
#line 49 "/zbasic/library-asm/array.asm"
#line 49 "/zxbasic/library-asm/array.asm"
pop bc ; Get next index (Ai) from the stack

#line 59 "/zbasic/library-asm/array.asm"
#line 59 "/zxbasic/library-asm/array.asm"

add hl, bc ; Adds current index

Expand All @@ -141,7 +141,6 @@ LOOP:
exx
pop de ; DE = Max bound Number (i-th dimension)

;call __MUL16_FAST ; HL *= DE
call __FNMUL
jp LOOP

Expand All @@ -153,7 +152,7 @@ ARRAY_END:
push de
exx

#line 92 "/zbasic/library-asm/array.asm"
#line 91 "/zxbasic/library-asm/array.asm"
LOCAL ARRAY_SIZE_LOOP

ex de, hl
Expand All @@ -164,35 +163,13 @@ ARRAY_SIZE_LOOP:
add hl, de
djnz ARRAY_SIZE_LOOP

;; Even faster
;pop bc

;ld d, h
;ld e, l

;dec c
;jp z, __ARRAY_FIN

;add hl, hl
;dec c
;jp z, __ARRAY_FIN

;add hl, hl
;dec c
;dec c
;jp z, __ARRAY_FIN

;add hl, de
;__ARRAY_FIN:
#line 123 "/zbasic/library-asm/array.asm"
#line 102 "/zxbasic/library-asm/array.asm"

pop de
add hl, de ; Adds element start

RET_ADDRESS:
ld de, 0
push de
ret ; HL = (Start of Elements + Offset)
jp 0

;; Performs a faster multiply for little 16bit numbs
LOCAL __FNMUL, __FNMUL2
Expand All @@ -202,10 +179,6 @@ __FNMUL:
or d
jp nz, __MUL16_FAST

or e
ex de, hl
ret z

cp 33
jp nc, __MUL16_FAST

Expand Down
39 changes: 6 additions & 33 deletions tests/functional/47.asm
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ __MUL16NOADD:

#line 20 "array.asm"

#line 24 "/zbasic/library-asm/array.asm"
#line 24 "/zxbasic/library-asm/array.asm"

__ARRAY:
PROC
Expand All @@ -147,10 +147,10 @@ __ARRAY:
ld hl, 0 ; BC = Offset "accumulator"

LOOP:
#line 49 "/zbasic/library-asm/array.asm"
#line 49 "/zxbasic/library-asm/array.asm"
pop bc ; Get next index (Ai) from the stack

#line 59 "/zbasic/library-asm/array.asm"
#line 59 "/zxbasic/library-asm/array.asm"

add hl, bc ; Adds current index

Expand All @@ -168,7 +168,6 @@ LOOP:
exx
pop de ; DE = Max bound Number (i-th dimension)

;call __MUL16_FAST ; HL *= DE
call __FNMUL
jp LOOP

Expand All @@ -180,7 +179,7 @@ ARRAY_END:
push de
exx

#line 92 "/zbasic/library-asm/array.asm"
#line 91 "/zxbasic/library-asm/array.asm"
LOCAL ARRAY_SIZE_LOOP

ex de, hl
Expand All @@ -191,35 +190,13 @@ ARRAY_SIZE_LOOP:
add hl, de
djnz ARRAY_SIZE_LOOP

;; Even faster
;pop bc

;ld d, h
;ld e, l

;dec c
;jp z, __ARRAY_FIN

;add hl, hl
;dec c
;jp z, __ARRAY_FIN

;add hl, hl
;dec c
;dec c
;jp z, __ARRAY_FIN

;add hl, de
;__ARRAY_FIN:
#line 123 "/zbasic/library-asm/array.asm"
#line 102 "/zxbasic/library-asm/array.asm"

pop de
add hl, de ; Adds element start

RET_ADDRESS:
ld de, 0
push de
ret ; HL = (Start of Elements + Offset)
jp 0

;; Performs a faster multiply for little 16bit numbs
LOCAL __FNMUL, __FNMUL2
Expand All @@ -229,10 +206,6 @@ __FNMUL:
or d
jp nz, __MUL16_FAST

or e
ex de, hl
ret z

cp 33
jp nc, __MUL16_FAST

Expand Down
4 changes: 2 additions & 2 deletions tests/functional/48.asm
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,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 "/zbasic/library-asm/alloc.asm"
#line 111 "/zxbasic/library-asm/alloc.asm"
ret z ; NULL
#line 113 "/zbasic/library-asm/alloc.asm"
#line 113 "/zxbasic/library-asm/alloc.asm"
; HL = Pointer to Free block
ld e, (hl)
inc hl
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/49.asm
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,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 "/zbasic/library-asm/alloc.asm"
#line 111 "/zxbasic/library-asm/alloc.asm"
ret z ; NULL
#line 113 "/zbasic/library-asm/alloc.asm"
#line 113 "/zxbasic/library-asm/alloc.asm"
; HL = Pointer to Free block
ld e, (hl)
inc hl
Expand Down
39 changes: 6 additions & 33 deletions tests/functional/55.asm
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ __MUL16NOADD:

#line 20 "array.asm"

#line 24 "/zbasic/library-asm/array.asm"
#line 24 "/zxbasic/library-asm/array.asm"

__ARRAY:
PROC
Expand All @@ -115,10 +115,10 @@ __ARRAY:
ld hl, 0 ; BC = Offset "accumulator"

LOOP:
#line 49 "/zbasic/library-asm/array.asm"
#line 49 "/zxbasic/library-asm/array.asm"
pop bc ; Get next index (Ai) from the stack

#line 59 "/zbasic/library-asm/array.asm"
#line 59 "/zxbasic/library-asm/array.asm"

add hl, bc ; Adds current index

Expand All @@ -136,7 +136,6 @@ LOOP:
exx
pop de ; DE = Max bound Number (i-th dimension)

;call __MUL16_FAST ; HL *= DE
call __FNMUL
jp LOOP

Expand All @@ -148,7 +147,7 @@ ARRAY_END:
push de
exx

#line 92 "/zbasic/library-asm/array.asm"
#line 91 "/zxbasic/library-asm/array.asm"
LOCAL ARRAY_SIZE_LOOP

ex de, hl
Expand All @@ -159,35 +158,13 @@ ARRAY_SIZE_LOOP:
add hl, de
djnz ARRAY_SIZE_LOOP

;; Even faster
;pop bc

;ld d, h
;ld e, l

;dec c
;jp z, __ARRAY_FIN

;add hl, hl
;dec c
;jp z, __ARRAY_FIN

;add hl, hl
;dec c
;dec c
;jp z, __ARRAY_FIN

;add hl, de
;__ARRAY_FIN:
#line 123 "/zbasic/library-asm/array.asm"
#line 102 "/zxbasic/library-asm/array.asm"

pop de
add hl, de ; Adds element start

RET_ADDRESS:
ld de, 0
push de
ret ; HL = (Start of Elements + Offset)
jp 0

;; Performs a faster multiply for little 16bit numbs
LOCAL __FNMUL, __FNMUL2
Expand All @@ -197,10 +174,6 @@ __FNMUL:
or d
jp nz, __MUL16_FAST

or e
ex de, hl
ret z

cp 33
jp nc, __MUL16_FAST

Expand Down
4 changes: 2 additions & 2 deletions tests/functional/addstr.asm
Original file line number Diff line number Diff line change
Expand Up @@ -576,9 +576,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 "/zbasic/library-asm/alloc.asm"
#line 111 "/zxbasic/library-asm/alloc.asm"
ret z ; NULL
#line 113 "/zbasic/library-asm/alloc.asm"
#line 113 "/zxbasic/library-asm/alloc.asm"
; HL = Pointer to Free block
ld e, (hl)
inc hl
Expand Down
Loading