瀏覽代碼

Set final version of the tests

ApisNecros 1 月之前
父節點
當前提交
c5747fd97e
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      tests/labels.icasm

+ 4 - 3
tests/labels.icasm

@@ -1,13 +1,14 @@
-ld @regA, 0              // jz, seq, lt register
+ld @regA, 0              // jz, seq register
+ld @regB, 0              // storage space
 ld @counter, 10          // loop counter
 ld @lower, 0             // lower number
 ld @higher, 1            // higher number
-ld @regB, 0              // storage space
 Fibonacci:
 add @higher, 0, @regB           // Move higher number to a storage point
 add @higher, @lower, @higher    // Add higher and lower number, and store in higher number slot
+out @higher                     // Output the current highest number
 add @regB, 0, @lower            // Move stored number to lower number slot
 add @counter, -1, @counter      // Subtract 1 from the loop counter
 seq @counter, 0, @regA          // Check if the loop counter is 0
-jz @regA, Fibonacci + 1         // Loop the function if not
+jz @regA, Fibonacci             // Loop the function if not
 hlt                             // Otherwise, exit