A Test Program

Now it is the time to make a test program and run it on your own 16-bit processor, CAPC1. The following is the program requirement:
The test program must compute the sum of numerical data (12 bits, for simplicity) entered in the RAM starting from the memory location 100h (,101h,102h,...) by the RAM debug device (with keyboards and displays). The datum [-1 = 16 bit number ffffh] signifies the end of data entry. The sum is stored in the memory at the location 200h and the number of data at the location 201h in RAM. (If you could not come up with a satisfactory design, try to add two numbers, three numbers,..., ten numbers and store the result in RAM location 200h.)

Design a program according to the above requirement and write the program in CAPC1 Machine language. Load it in the RAM starting from the memory location 0h by the RAM debug device. Start CAPC1.

Congratulations ! You have completed your project.

Note: Here is a test program . It has a peculiar (may be undesirable for some software purists ?) characteristic. I call these codes self-modifying codes. They try to compensate lack of indexing mechanism in CAPC1. This program is one of my favorites in CAPC1 computing.