First develop commit. Adding all existing files.

This commit is contained in:
2014-03-14 20:12:38 +01:00
parent bf68ba4560
commit 73e62547ff
441 changed files with 247478 additions and 2 deletions

20
resources/TOY/sum_1-n.toy Normal file
View File

@@ -0,0 +1,20 @@
program Sum 1-N
// Input: N
// Output: The sum of all integers between 1 and N inclusive
// Remarks: Please note that the highest value of N that can be processed
// without overflow is 00FF.
// -----------------------------------------------------------------------------
// Initialize
10: 7101 R[1] <- 0001
11: 82FF read R[2]
12: 7300 R[3] <- 0000
// Add, decrement, and loop
13: 1332 R[3] <- R[3] + R[2]
14: 2221 R[2] <- R[2] - R[1]
15: D213 if (R[2] > 0) goto 13
// Print the sum
16: 93FF write R[3]
17: 0000 halt