CS 208: Computer Organization and Architecture

Function-calling and recursion on the PDP-8/E

Write a function for the PDP8 that uses recursion to compute the Nth Fibonacci number (F0 = 1, F1 = 1, F2 = 2, F3 = 3, F4 = 5, etc.). Your main program will get N from the switch register and call a recursive function with N as its parameter. The recursive function, upon return to the main program, will have left the Nth Fibonacci number in the AC.

This program will require you to implement a rudimentary function-calling mechanism using a stack. I'll give you some suggestions and constraints, so don't start working on this until we talk about it in class.