Skip to content

Commit

Permalink
v3.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jtod committed Jan 10, 2023
1 parent 320bcdd commit 423fb4f
Show file tree
Hide file tree
Showing 15 changed files with 3,978 additions and 3,674 deletions.
4,221 changes: 2,206 additions & 2,015 deletions docs/UserGuide/Sigma16UserGuide.html

Large diffs are not rendered by default.

2,438 changes: 1,318 additions & 1,120 deletions docs/UserGuide/Sigma16UserGuide.org

Large diffs are not rendered by default.

Binary file modified docs/UserGuide/Sigma16UserGuide.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/Standard/Interrupt/TimerInterrupt.asm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ loop
jump loop[R0] ; goto loop

; Mutual exclusion
testset R5,mutex[R0]
tstset R5,mutex[R0]
done
trap R0,R0,R0

Expand Down
133 changes: 77 additions & 56 deletions examples/Standard/Testing/Branch.asm.txt
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
18 changes: 18 additions & 0 deletions examples/Standard/Testing/Logic.asm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,24 @@
logicb R1,12,1,0,nor ; 6006 = 0110 0000 0000 0110
; R1.12 := R1.1 nor R1.0 = 0

lea R1,$0009[R0] ; 0009
lea R2,$0003[R0] ; 0003

logicc R1,1,R2,3,and ; R15=0000 0 and 0 = 0
logicc R1,1,R2,1,and ; R15=0000 0 and 1 = 0
logicc R1,0,R2,3,and ; R15=0000 1 and 0 = 0
logicc R1,0,R2,1,and ; R15=0400 1 and 1 = 1

logicc R1,1,R2,3,or ; R15=0000 0 or 0 = 0
logicc R1,1,R2,1,or ; R15=0400 0 or 1 = 1
logicc R1,0,R2,3,or ; R15=0400 1 or 0 = 1
logicc R1,0,R2,1,or ; R15=0400 1 or 1 = 1

logicc R1,1,R2,3,6 ; R15=0000 0 xor 0 = 0
logicc R1,1,R2,1,6 ; R15=0400 0 xor 1 = 1
logicc R1,0,R2,3,6 ; R15=0400 1 xor 0 = 1
logicc R1,0,R2,1,6 ; R15=0000 1 xor 1 = 0

trap R0,R0,R0 ; terminate

; Define symbolic names for the codes for common logic functions. The
Expand Down
38 changes: 19 additions & 19 deletions examples/Standard/Testing/SaveRestore.asm.txt
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
35 changes: 1 addition & 34 deletions examples/Standard/Testing/Stack.asm.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; Stack: Test the stack instructions: push, pop, top
; Sigma16: https://jtod.github.io/home/Sigma16/ John O'Donnell, 2022
; Sigma16: https://jtod.github.io/home/Sigma16

; R11 = stack base: address of first element in stack
; R12 = stack limit: address of last element in stack
Expand Down Expand Up @@ -127,39 +127,6 @@ test_stack
push R4,R11,R12
push R5,R11,R12


; Wraparound from R15
lea R1,64[R0]
lea R2,65[R0]
lea R3,66[R0]
lea R4,67[R0]
lea R10,68[R0]
lea R11,69[R0]
lea R12,70[R0]
lea R13,71[R0]
lea R14,72[R0]
lea R15,73[R0]
lea R5,area[R0]
save R11,R3,3[R5]
add R1,R0,R0
add R2,R0,R0
add R3,R0,R0
add R4,R0,R0
add R10,R0,R0
add R11,R0,R0
add R12,R0,R0
add R13,R0,R0
add R14,R0,R0
add R15,R0,R0
restore R11,R3,3[R5]


; lea

; load and store



trap R0,R0,R0

StackFirst
Expand Down
112 changes: 0 additions & 112 deletions examples/Standard/Testing/StdJumps.asm.txt

This file was deleted.

Loading

0 comments on commit 423fb4f

Please sign in to comment.