Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,10 @@
BR or BRnzp ; unconditional branch, i.e.
; branch if (result < 0 || result == 0 || result > 0)
; ^ this is always true
BRn ; branch if (result < 0)
BRz ; branch if (result == 0)
BRp ; branch if (result > 0)
; or any combination of these condition codes, e.g.
BRnz ; branch if (result <= 0)

View file

@ -0,0 +1,19 @@
.orig x3000
LD R1, x ; get x
LD R2, y ; get y
NOT R0, R2 ; R0 = ~y
ADD R0, R0, 1 ; R0 = -y
ADD R0, R0, R1 ; R0 = x - y
BRZ BRANCH ; if (x == y) { go to BRANCH }
LEA R0, nottaken
PUTS ; else print "Branch Not Taken!"
BR END
BRANCH
LEA R0, taken
PUTS ; print "Branch Taken!"
END HALT
x .fill 1
y .fill 1
taken .stringz "Branch Taken!"
nottaken .stringz "Branch Not Taken!"
.end