-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from tomhea/dev
refine extensive tests
- Loading branch information
Showing
104 changed files
with
2,966 additions
and
1,053 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
startup | ||
|
||
rep(256, i) test_add i&0xf, i>>4 | ||
|
||
loop | ||
|
||
|
||
hex.init | ||
|
||
|
||
def test_add a, b @ c0_1st, c1_1st, print_1st, c0_2nd, c1_2nd, print_2nd, ah_1st, bh, ah_2nd, end { | ||
hex.add.clear_carry | ||
hex.add ah_1st, bh | ||
hex.add.clear_carry c0_1st, c1_1st | ||
c0_1st: | ||
output '0' | ||
;print_1st | ||
c1_1st: | ||
output '1' | ||
print_1st: | ||
hex.print_as_digit ah_1st, 0 | ||
output '-' | ||
|
||
hex.add.not_carry | ||
hex.add ah_2nd, bh | ||
hex.add.clear_carry c0_2nd, c1_2nd | ||
c0_2nd: | ||
output '0' | ||
;print_2nd | ||
c1_2nd: | ||
output '1' | ||
print_2nd: | ||
hex.print_as_digit ah_2nd, 0 | ||
output '\n' | ||
;end | ||
|
||
ah_1st: hex a | ||
ah_2nd: hex a | ||
bh: hex b | ||
end: | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
startup | ||
|
||
ADD_N = 0x0000ffff800040a73dd06622dc0594c9e1b9b001 | ||
rep(100, i) test_add_n 4, (ADD_N>>((i%10)*4)&0xf), (ADD_N>>((i/10))*4&0xf) | ||
|
||
loop | ||
|
||
|
||
hex.init | ||
|
||
|
||
def test_add_n n, a, b @ lt, eq, gt, ah, bh, ch, end { | ||
hex.add n, ah, bh | ||
hex.cmp n, ah, ch, lt, eq, gt | ||
|
||
lt: | ||
output '<' | ||
;end | ||
eq: | ||
output '=' | ||
;end | ||
gt: | ||
output '>' | ||
;end | ||
|
||
ah: hex.vec n, a | ||
bh: hex.vec n, b | ||
ch: hex.vec n, a+b | ||
end: | ||
output '\n' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
startup | ||
|
||
rep(256, i) test_and i&0xf, i>>4 | ||
|
||
loop | ||
|
||
|
||
hex.init | ||
|
||
|
||
def test_and a, b @ ah, ah_copy, bh, end { | ||
hex.and ah, bh | ||
hex.and bh, ah_copy | ||
hex.print_as_digit ah, 0 | ||
hex.print_as_digit bh, 0 | ||
output '\n' | ||
;end | ||
|
||
ah: hex a | ||
ah_copy: hex a | ||
bh: hex b | ||
end: | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
startup | ||
|
||
AND_N = 0x0000ffff8000b32cccc69dea2047c8e0ae1e5299 | ||
rep(100, i) test_and_n 4, (AND_N>>((i%10)*4)&0xf), (AND_N>>((i/10))*4&0xf) | ||
|
||
loop | ||
|
||
|
||
hex.init | ||
|
||
|
||
def test_and_n n, a, b @ lt, eq, gt, ah, bh, ch, end { | ||
hex.and n, ah, bh | ||
hex.cmp n, ah, ch, lt, eq, gt | ||
|
||
lt: | ||
output '<' | ||
;end | ||
eq: | ||
output '=' | ||
;end | ||
gt: | ||
output '>' | ||
;end | ||
|
||
ah: hex.vec n, a | ||
bh: hex.vec n, b | ||
ch: hex.vec n, a&b | ||
end: | ||
output '\n' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
startup | ||
|
||
rep(256, i) test_cmp i&0xf, i>>4 | ||
|
||
loop | ||
|
||
|
||
hex.init | ||
|
||
|
||
def test_cmp a, b @ lt, eq, gt, ah, bh, end { | ||
hex.cmp ah, bh, lt, eq, gt | ||
|
||
lt: | ||
output '<' | ||
;end | ||
eq: | ||
output '=' | ||
;end | ||
gt: | ||
output '>' | ||
;end | ||
ah: hex a | ||
bh: hex b | ||
end: | ||
output '\n' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
startup | ||
|
||
CMP_N = 0x012345 | (0x123456 << 32) | (0x333333 << 64) | (0x654321 << 96) | ||
rep(16, i) test_cmp_n 8, (CMP_N >> ((i&3)*32)) & ((1<<32)-1), (CMP_N >> ((i>>2)*32)) & ((1<<32)-1) | ||
|
||
loop | ||
|
||
|
||
hex.init | ||
|
||
|
||
def test_cmp_n n, a, b @ lt, eq, gt, ah, bh, end { | ||
hex.cmp n, ah, bh, lt, eq, gt | ||
|
||
lt: | ||
output '<' | ||
;end | ||
eq: | ||
output '=' | ||
;end | ||
gt: | ||
output '>' | ||
;end | ||
ah: hex.vec n, a | ||
bh: hex.vec n, b | ||
end: | ||
output '\n' | ||
} |
Oops, something went wrong.