-
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.
- Loading branch information
Showing
15 changed files
with
3,978 additions
and
3,674 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,88 @@ | ||
; Branch: Test the pc relative branch instructions | ||
; Sigma16: https://jtod.github.io/home/Sigma16 | ||
|
||
lea R5,$00f0 ; 1 (bit 3 = 0, bit 4 = 1) | ||
lea R5,$00f0 ; 1 (bit 3 = 0, bit 4 = 1) | ||
|
||
; br f/b | ||
|
||
brf 3 ; 2 brf constant | ||
add R0,R0,R0 | ||
add R0,R0,R0 | ||
add R0,R0,R0 | ||
add R0,R0,R0 ; 3 | ||
brf a ; 4 brf label | ||
add R0,R0,R0 ; | ||
b add R0,R0,R0 ; 6 | ||
add R0,R0,R0 ; 7 | ||
brf c ; 8 brf | ||
add R0,R0,R0 ; | ||
a brb b ; 5 brb | ||
brf 3 ; 2 brf constant | ||
add R0,R0,R0 | ||
add R0,R0,R0 | ||
add R0,R0,R0 | ||
add R0,R0,R0 ; 3 | ||
brf a ; 4 brf label | ||
add R0,R0,R0 ; | ||
b add R0,R0,R0 ; 6 | ||
add R0,R0,R0 ; 7 | ||
brf c ; 8 brf | ||
add R0,R0,R0 ; | ||
a brb b ; 5 brb | ||
|
||
; br f/b z/nz | ||
c add R0,R0,R0 ; 9 | ||
brfz R5,bad ; 10 brfz don't branch | ||
brfz R0,d ; 11 brfz do branch | ||
add R0,R0,R0 | ||
add R0,R0,R0 | ||
e add R0,R0,R0 ; 14 | ||
brf f ; 15 | ||
add R0,R0,R0 | ||
d brbz R5,bad ; 12 brbz don't branch | ||
brbz R0,e ; 13 brbz do branch | ||
f add R0,R0,R0 ; 16 | ||
brfnz R0,bad ; 17 brfz don't branch | ||
brfnz R5,g ; 18 brfz do branch | ||
add R0,R0,R0 | ||
add R0,R0,R0 | ||
h add R0,R0,R0 ; 21 | ||
brf i ; 22 | ||
add R0,R0,R0 | ||
g brbnz R0,bad ; 19 brbz don't branch | ||
brbnz R5,h ; 20 brbz do branch | ||
c add R0,R0,R0 ; 9 | ||
brfz R5,bad ; 10 brfz don't branch | ||
brfz R0,d ; 11 brfz do branch | ||
add R0,R0,R0 | ||
add R0,R0,R0 | ||
e add R0,R0,R0 ; 14 | ||
brf f ; 15 | ||
add R0,R0,R0 | ||
d brbz R5,bad ; 12 brbz don't branch | ||
brbz R0,e ; 13 brbz do branch | ||
f add R0,R0,R0 ; 16 | ||
brfnz R0,bad ; 17 brfz don't branch | ||
brfnz R5,g ; 18 brfz do branch | ||
add R0,R0,R0 | ||
add R0,R0,R0 | ||
h add R0,R0,R0 ; 21 | ||
brf i ; 22 | ||
add R0,R0,R0 | ||
g brbnz R0,bad ; 19 brbz don't branch | ||
brbnz R5,h ; 20 brbz do branch | ||
|
||
; br f/b c0/c1 | ||
i add R0,R0,R0 ; 23 | ||
brfc0 R5,4,bad ; 24 brfc0 don't branch | ||
brfc0 R5,3,j ; 25 brfc0 do branch | ||
add R0,R0,R0 | ||
add R0,R0,R0 | ||
k add R0,R0,R0 ; 28 | ||
brf l ; 29 | ||
add R0,R0,R0 | ||
j brbc0 R5,4,bad ; 26 brbc0 don't branch | ||
brbc0 R5,3,k ; 27 brbc0 do branch | ||
l add R0,R0,R0 ; 30 | ||
brfc1 R5,3,bad ; 31 brfc1 don't branch | ||
brfc1 R5,4,m ; 32 brfc1 do branch | ||
add R0,R0,R0 | ||
add R0,R0,R0 | ||
n add R0,R0,R0 ; 35 | ||
brf o ; 36 | ||
add R0,R0,R0 | ||
m brbc1 R5,3,bad ; 33 brbc1 don't branch | ||
brbc1 R5,4,n ; 34 brbc1 do branch | ||
i add R0,R0,R0 ; 23 | ||
brfc0 R5,4,bad ; 24 brfc0 don't branch | ||
brfc0 R5,3,j ; 25 brfc0 do branch | ||
add R0,R0,R0 | ||
add R0,R0,R0 | ||
k add R0,R0,R0 ; 28 | ||
brf l ; 29 | ||
add R0,R0,R0 | ||
j brbc0 R5,4,bad ; 26 brbc0 don't branch | ||
brbc0 R5,3,k ; 27 brbc0 do branch | ||
l add R0,R0,R0 ; 30 | ||
brfc1 R5,3,bad ; 31 brfc1 don't branch | ||
brfc1 R5,4,m ; 32 brfc1 do branch | ||
add R0,R0,R0 | ||
add R0,R0,R0 | ||
n add R0,R0,R0 ; 35 | ||
brf o ; 36 | ||
add R0,R0,R0 | ||
m brbc1 R5,3,bad ; 33 brbc1 don't branch | ||
brbc1 R5,4,n ; 34 brbc1 do branch | ||
|
||
o trap R0,R0,R0 ; 37 terminate with success | ||
bad add R0,R0,R0 ; error! should not go here | ||
trap R0,R0,R0 ; terminate with failure | ||
o lea R8,5[R0] ; 37 code | ||
dsptch R8,3,0 ; 38 dispatch 3-bit code | ||
brf bad ; 0 | ||
brf bad ; 1 | ||
brf bad ; 2 | ||
brf bad ; 3 | ||
brf bad ; 4 | ||
brf p ; 39 5 | ||
brf bad ; 6 | ||
brf bad ; 7 | ||
p lea R9,14[R0] ; 40 masked code = 6 | ||
dsptch R9,3,0 ; 41 | ||
brf bad ; 0 | ||
brf bad ; 1 | ||
brf bad ; 2 | ||
brf bad ; 3 | ||
brf bad ; 4 | ||
brf bad ; 5 | ||
brf q ; 42 6 | ||
brf bad ; 7 | ||
|
||
q trap R0,R0,R0 ; 43 terminate with success | ||
bad add R0,R0,R0 ; error! should not go here | ||
trap R0,R0,R0 ; terminate with failure |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
; SaveRestore: test save and restore instructions | ||
; Sigma16: https://jtod.github.io/home/Sigma16/ John O'Donnell, 2022 | ||
; Sigma16: https://jtod.github.io/home/Sigma16 | ||
|
||
lea R13,stack[R0] | ||
lea R1,17[R0] | ||
lea R2,18[R0] | ||
lea R3,19[R0] | ||
lea R4,20[R0] | ||
lea R5,21[R0] | ||
lea R6,22[R0] | ||
lea R7,23[R0] | ||
save R3,R5,6[R13] | ||
add R1,R0,R0 | ||
add R2,R0,R0 | ||
add R3,R0,R0 | ||
add R4,R0,R0 | ||
add R5,R0,R0 | ||
add R6,R0,R0 | ||
add R7,R0,R0 | ||
restore R3,R5,6[R13] | ||
trap R0,R0,R0 | ||
lea R13,stack[R0] | ||
lea R1,17[R0] | ||
lea R2,18[R0] | ||
lea R3,19[R0] | ||
lea R4,20[R0] | ||
lea R5,21[R0] | ||
lea R6,22[R0] | ||
lea R7,23[R0] | ||
save R3,R5,6[R13] | ||
add R1,R0,R0 | ||
add R2,R0,R0 | ||
add R3,R0,R0 | ||
add R4,R0,R0 | ||
add R5,R0,R0 | ||
add R6,R0,R0 | ||
add R7,R0,R0 | ||
restor R3,R5,6[R13] | ||
trap R0,R0,R0 | ||
|
||
stack data 0 |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.