Skip to content

Commit e1615f1

Browse files
committed
refact: use #include [arch:zx48k] for common SGN libs
1 parent 1b28973 commit e1615f1

17 files changed

Lines changed: 168 additions & 107 deletions

File tree

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,8 @@
1-
; Returns SGN (SIGN) for 32, 16 and 8 bits signed integers, Fixed and FLOAT
2-
3-
push namespace core
4-
5-
PROC
6-
LOCAL __ENDSGN
7-
8-
__SGNF:
9-
or b
10-
or c
11-
or d
12-
or e
13-
ret z
14-
ld a, e
15-
jr __ENDSGN
16-
17-
__SGNF16:
18-
__SGNI32:
19-
ld a, h
20-
or l
21-
or e
22-
or d
23-
ret z
24-
25-
ld a, d
26-
jr __ENDSGN
27-
28-
__SGNI16:
29-
ld a, h
30-
or l
31-
ret z
32-
ld a, h
33-
34-
__ENDSGN:
35-
or a
36-
ld a, 1
37-
ret p
38-
neg
39-
ret
40-
41-
ENDP
42-
43-
pop namespace
44-
1+
' ----------------------------------------------------------------
2+
' This file is released under the MIT License
3+
'
4+
' Copyleft (k) 2008
5+
' by Jose Rodriguez-Rosa (a.k.a. Boriel) <https://www.boriel.com>
6+
' ----------------------------------------------------------------
7+
8+
#include once [arch:zx48k] <sgn.asm>
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
#include once <sgn.asm>
1+
' ----------------------------------------------------------------
2+
' This file is released under the MIT License
3+
'
4+
' Copyleft (k) 2008
5+
' by Jose Rodriguez-Rosa (a.k.a. Boriel) <https://www.boriel.com>
6+
' ----------------------------------------------------------------
27

8+
#include once [arch:zx48k] <sgnf.asm>
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
#include once <sgn.asm>
1+
' ----------------------------------------------------------------
2+
' This file is released under the MIT License
3+
'
4+
' Copyleft (k) 2008
5+
' by Jose Rodriguez-Rosa (a.k.a. Boriel) <https://www.boriel.com>
6+
' ----------------------------------------------------------------
27

8+
#include once [arch:zx48k] <sgnf16.asm>
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
#include once <sgn.asm>
1+
' ----------------------------------------------------------------
2+
' This file is released under the MIT License
3+
'
4+
' Copyleft (k) 2008
5+
' by Jose Rodriguez-Rosa (a.k.a. Boriel) <https://www.boriel.com>
6+
' ----------------------------------------------------------------
27

8+
#include once [arch:zx48k] <sgni16.asm>
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
#include once <sgn.asm>
1+
' ----------------------------------------------------------------
2+
' This file is released under the MIT License
3+
'
4+
' Copyleft (k) 2008
5+
' by Jose Rodriguez-Rosa (a.k.a. Boriel) <https://www.boriel.com>
6+
' ----------------------------------------------------------------
27

8+
#include once [arch:zx48k] <sgni32.asm>
Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
; Returns SGN (SIGN) for 8 bits signed integer
2-
3-
push namespace core
4-
5-
__SGNI8:
6-
or a
7-
ret z
8-
ld a, 1
9-
ret p
10-
neg
11-
ret
12-
13-
pop namespace
14-
1+
' ----------------------------------------------------------------
2+
' This file is released under the MIT License
3+
'
4+
' Copyleft (k) 2008
5+
' by Jose Rodriguez-Rosa (a.k.a. Boriel) <https://www.boriel.com>
6+
' ----------------------------------------------------------------
7+
8+
#include once [arch:zx48k] <sgni8.asm>
Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
; Returns SGN (SIGN) for 16 bits unsigned integer
2-
3-
push namespace core
4-
5-
__SGNU16:
6-
ld a, h
7-
or l
8-
ret z
9-
ld a, 1
10-
ret
11-
12-
pop namespace
13-
1+
' ----------------------------------------------------------------
2+
' This file is released under the MIT License
3+
'
4+
' Copyleft (k) 2008
5+
' by Jose Rodriguez-Rosa (a.k.a. Boriel) <https://www.boriel.com>
6+
' ----------------------------------------------------------------
7+
8+
#include once [arch:zx48k] <sgnu16.asm>
Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
; Returns SGN (SIGN) for 32 bits unsigned integer
2-
3-
push namespace core
4-
5-
__SGNU32:
6-
ld a, h
7-
or l
8-
or d
9-
or e
10-
ret z
11-
12-
ld a, 1
13-
ret
14-
15-
pop namespace
16-
1+
' ----------------------------------------------------------------
2+
' This file is released under the MIT License
3+
'
4+
' Copyleft (k) 2008
5+
' by Jose Rodriguez-Rosa (a.k.a. Boriel) <https://www.boriel.com>
6+
' ----------------------------------------------------------------
7+
8+
#include once [arch:zx48k] <sgnu32.asm>
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
; Returns SGN (SIGN) for 8 bits unsigned integera
2-
3-
push namespace core
4-
5-
__SGNU8:
6-
or a
7-
ret z
8-
ld a, 1
9-
ret
10-
11-
pop namespace
12-
1+
' ----------------------------------------------------------------
2+
' This file is released under the MIT License
3+
'
4+
' Copyleft (k) 2008
5+
' by Jose Rodriguez-Rosa (a.k.a. Boriel) <https://www.boriel.com>
6+
' ----------------------------------------------------------------
7+
8+
#include once [arch:zx48k] <sgnu8.asm>

tests/functional/arch/zxnext/sgnf.asm

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,21 @@ _y:
3838
ret
3939
;; --- end of user code ---
4040
#line 1 "/zxbasic/src/lib/arch/zxnext/runtime/sgnf.asm"
41+
' ----------------------------------------------------------------
42+
' This file is released under the MIT License
43+
'
44+
' Copyleft (k) 2008
45+
' by Jose Rodriguez-Rosa (a.k.a. Boriel) <https://www.boriel.com>
46+
' ----------------------------------------------------------------
47+
#line 1 "/zxbasic/src/lib/arch/zx48k/runtime/sgnf.asm"
4148
#line 1 "/zxbasic/src/lib/arch/zxnext/runtime/sgn.asm"
49+
' ----------------------------------------------------------------
50+
' This file is released under the MIT License
51+
'
52+
' Copyleft (k) 2008
53+
' by Jose Rodriguez-Rosa (a.k.a. Boriel) <https://www.boriel.com>
54+
' ----------------------------------------------------------------
55+
#line 1 "/zxbasic/src/lib/arch/zx48k/runtime/sgn.asm"
4256
; Returns SGN (SIGN) for 32, 16 and 8 bits signed integers, Fixed and FLOAT
4357
push namespace core
4458
PROC
@@ -73,6 +87,8 @@ __ENDSGN:
7387
ret
7488
ENDP
7589
pop namespace
76-
#line 2 "/zxbasic/src/lib/arch/zxnext/runtime/sgnf.asm"
90+
#line 9 "/zxbasic/src/lib/arch/zxnext/runtime/sgn.asm"
91+
#line 2 "/zxbasic/src/lib/arch/zx48k/runtime/sgnf.asm"
92+
#line 9 "/zxbasic/src/lib/arch/zxnext/runtime/sgnf.asm"
7793
#line 18 "arch/zxnext/sgnf.bas"
7894
END

0 commit comments

Comments
 (0)