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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
90 changes: 90 additions & 0 deletions tests/functional/arch/zx81sd/add16.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
org $0000
jp $0100
org $0008
di
halt
org $0010
di
halt
org $0018
di
halt
org $0020
di
halt
org $0028
jp .core.FP_CALC_ENTRY
org $0030
di
halt
org $0038
push af
.core.__RST38_WAIT:
in a, ($AF)
and $7E
jr z, .core.__RST38_WAIT
pop af
ret
org $0066
retn
org 256
.core.__START_PROGRAM:
ld b, 9
ld a, 1
ld c, 0xe7
out (c), a
ld b, 10
ld a, 2
ld c, 0xe7
out (c), a
ld b, 11
ld a, 3
ld c, 0xe7
out (c), a
ld b, 12
ld a, 4
ld c, 0xe7
out (c), a
ld b, 13
ld a, 5
ld c, 0xe7
out (c), a
ld b, 15
ld a, 7
ld c, 0xe7
out (c), a
ld sp, 0x7fff
jp .core.__MAIN_PROGRAM__
.core.ZXBASIC_USER_DATA:
; Defines USER DATA Length in bytes
.core.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_END - .core.ZXBASIC_USER_DATA
.core.__LABEL__.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_LEN
.core.__LABEL__.ZXBASIC_USER_DATA EQU .core.ZXBASIC_USER_DATA
_a:
DEFB 00, 00
_b:
DEFB 00, 00
.core.ZXBASIC_USER_DATA_END:
.core.__MAIN_PROGRAM__:
ld hl, (_a)
ld (_b), hl
ld hl, (_a)
inc hl
ld (_b), hl
ld hl, (_a)
ld (_b), hl
ld hl, (_a)
inc hl
ld (_b), hl
ld de, (_a)
ld hl, (_a)
add hl, de
ld (_b), hl
ld hl, 0
ld b, h
ld c, l
.core.__END_PROGRAM:
di
halt
;; --- end of user code ---
END
10 changes: 10 additions & 0 deletions tests/functional/arch/zx81sd/add16.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
' TEST for ADD16

DIM a as UInteger
DIM b as UInteger

b = a + 0
b = a + 1
b = 0 + a
b = 1 + a
b = a + a
81 changes: 81 additions & 0 deletions tests/functional/arch/zx81sd/add16a.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
org $0000
jp $0100
org $0008
di
halt
org $0010
di
halt
org $0018
di
halt
org $0020
di
halt
org $0028
jp .core.FP_CALC_ENTRY
org $0030
di
halt
org $0038
push af
.core.__RST38_WAIT:
in a, ($AF)
and $7E
jr z, .core.__RST38_WAIT
pop af
ret
org $0066
retn
org 256
.core.__START_PROGRAM:
ld b, 9
ld a, 1
ld c, 0xe7
out (c), a
ld b, 10
ld a, 2
ld c, 0xe7
out (c), a
ld b, 11
ld a, 3
ld c, 0xe7
out (c), a
ld b, 12
ld a, 4
ld c, 0xe7
out (c), a
ld b, 13
ld a, 5
ld c, 0xe7
out (c), a
ld b, 15
ld a, 7
ld c, 0xe7
out (c), a
ld sp, 0x7fff
jp .core.__MAIN_PROGRAM__
.core.ZXBASIC_USER_DATA:
; Defines USER DATA Length in bytes
.core.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_END - .core.ZXBASIC_USER_DATA
.core.__LABEL__.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_LEN
.core.__LABEL__.ZXBASIC_USER_DATA EQU .core.ZXBASIC_USER_DATA
_a:
DEFB 00, 00
.core.ZXBASIC_USER_DATA_END:
.core.__MAIN_PROGRAM__:
ld de, (_a)
ld hl, (_a)
add hl, de
ex de, hl
ld hl, (_a)
add hl, de
ld (_a), hl
ld hl, 0
ld b, h
ld c, l
.core.__END_PROGRAM:
di
halt
;; --- end of user code ---
END
4 changes: 4 additions & 0 deletions tests/functional/arch/zx81sd/add16a.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

REM another ADD16 tests
DIM a As Integer
a = a + a + a
88 changes: 88 additions & 0 deletions tests/functional/arch/zx81sd/add16b.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
org $0000
jp $0100
org $0008
di
halt
org $0010
di
halt
org $0018
di
halt
org $0020
di
halt
org $0028
jp .core.FP_CALC_ENTRY
org $0030
di
halt
org $0038
push af
.core.__RST38_WAIT:
in a, ($AF)
and $7E
jr z, .core.__RST38_WAIT
pop af
ret
org $0066
retn
org 256
.core.__START_PROGRAM:
ld b, 9
ld a, 1
ld c, 0xe7
out (c), a
ld b, 10
ld a, 2
ld c, 0xe7
out (c), a
ld b, 11
ld a, 3
ld c, 0xe7
out (c), a
ld b, 12
ld a, 4
ld c, 0xe7
out (c), a
ld b, 13
ld a, 5
ld c, 0xe7
out (c), a
ld b, 15
ld a, 7
ld c, 0xe7
out (c), a
ld sp, 0x7fff
jp .core.__MAIN_PROGRAM__
.core.ZXBASIC_USER_DATA:
; Defines USER DATA Length in bytes
.core.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_END - .core.ZXBASIC_USER_DATA
.core.__LABEL__.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_LEN
.core.__LABEL__.ZXBASIC_USER_DATA EQU .core.ZXBASIC_USER_DATA
_a:
DEFB 00, 00
.core.ZXBASIC_USER_DATA_END:
.core.__MAIN_PROGRAM__:
ld de, (_a)
ld hl, (_a)
add hl, de
push hl
ld hl, (_a)
inc hl
inc hl
ex de, hl
ld hl, (_a)
add hl, de
ex de, hl
pop hl
add hl, de
ld (_a), hl
ld hl, 0
ld b, h
ld c, l
.core.__END_PROGRAM:
di
halt
;; --- end of user code ---
END
4 changes: 4 additions & 0 deletions tests/functional/arch/zx81sd/add16b.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

REM another ADD16 tests
DIM a As Integer
a = a + a + (a + 2 + a)
114 changes: 114 additions & 0 deletions tests/functional/arch/zx81sd/add32.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
org $0000
jp $0100
org $0008
di
halt
org $0010
di
halt
org $0018
di
halt
org $0020
di
halt
org $0028
jp .core.FP_CALC_ENTRY
org $0030
di
halt
org $0038
push af
.core.__RST38_WAIT:
in a, ($AF)
and $7E
jr z, .core.__RST38_WAIT
pop af
ret
org $0066
retn
org 256
.core.__START_PROGRAM:
ld b, 9
ld a, 1
ld c, 0xe7
out (c), a
ld b, 10
ld a, 2
ld c, 0xe7
out (c), a
ld b, 11
ld a, 3
ld c, 0xe7
out (c), a
ld b, 12
ld a, 4
ld c, 0xe7
out (c), a
ld b, 13
ld a, 5
ld c, 0xe7
out (c), a
ld b, 15
ld a, 7
ld c, 0xe7
out (c), a
ld sp, 0x7fff
jp .core.__MAIN_PROGRAM__
.core.ZXBASIC_USER_DATA:
; Defines USER DATA Length in bytes
.core.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_END - .core.ZXBASIC_USER_DATA
.core.__LABEL__.ZXBASIC_USER_DATA_LEN EQU .core.ZXBASIC_USER_DATA_LEN
.core.__LABEL__.ZXBASIC_USER_DATA EQU .core.ZXBASIC_USER_DATA
_a:
DEFB 00, 00, 00, 00
_b:
DEFB 00, 00, 00, 00
.core.ZXBASIC_USER_DATA_END:
.core.__MAIN_PROGRAM__:
ld hl, (_a)
ld de, (_a + 2)
ld (_b), hl
ld (_b + 2), de
ld de, 0
ld hl, 1
ld bc, (_a)
add hl, bc
ex de, hl
ld bc, (_a + 2)
adc hl, bc
ex de, hl
ld (_b), hl
ld (_b + 2), de
ld hl, (_a)
ld de, (_a + 2)
ld (_b), hl
ld (_b + 2), de
ld de, 0
ld hl, 1
ld bc, (_a)
add hl, bc
ex de, hl
ld bc, (_a + 2)
adc hl, bc
ex de, hl
ld (_b), hl
ld (_b + 2), de
ld hl, (_a)
ld de, (_a + 2)
ld bc, (_a)
add hl, bc
ex de, hl
ld bc, (_a + 2)
adc hl, bc
ex de, hl
ld (_b), hl
ld (_b + 2), de
ld hl, 0
ld b, h
ld c, l
.core.__END_PROGRAM:
di
halt
;; --- end of user code ---
END
Loading
Loading