mirror of
https://github.com/soconnor0919/eceg431.git
synced 2025-12-12 07:04:43 -05:00
project08 template files
This commit is contained in:
28
08/ProgramFlow/FibonacciSeries/FibonacciSeries.tst
Normal file
28
08/ProgramFlow/FibonacciSeries/FibonacciSeries.tst
Normal file
@@ -0,0 +1,28 @@
|
||||
// This file is part of www.nand2tetris.org
|
||||
// and the book "The Elements of Computing Systems"
|
||||
// by Nisan and Schocken, MIT Press.
|
||||
// File name: projects/8/ProgramFlow/FibonacciSeries/FibonacciSeries.tst
|
||||
|
||||
// Tests FibonacciSeries.asm on the CPU emulator.
|
||||
// Before executing the code, initializes the stack pointer
|
||||
// and the base addresses of the local and argument segments,
|
||||
// and sets argument[0] and argument [1].
|
||||
|
||||
load FibonacciSeries.asm,
|
||||
output-file FibonacciSeries.out,
|
||||
compare-to FibonacciSeries.cmp,
|
||||
|
||||
set RAM[0] 256, // SP
|
||||
set RAM[1] 300, // LCL
|
||||
set RAM[2] 400, // ARG
|
||||
set RAM[400] 6, // argument[0], n
|
||||
set RAM[401] 3000, // argument[1], base address of the generated series
|
||||
|
||||
repeat 1100 {
|
||||
ticktock;
|
||||
}
|
||||
|
||||
// Outputs the series of values generated and written by the code.
|
||||
output-list RAM[3000]%D1.6.2 RAM[3001]%D1.6.2 RAM[3002]%D1.6.2
|
||||
RAM[3003]%D1.6.2 RAM[3004]%D1.6.2 RAM[3005]%D1.6.2;
|
||||
output;
|
||||
Reference in New Issue
Block a user