首先我想证明这不是作业http://computer.atlas4e.com/
我真的需要通过解释来理解这一点,因为我正在尝试自己了解计算机的基本知识,感谢您的帮助
`Prime Number List Program
Write a main program that generates a list of prime numbers. The program should use the PrimeTest subroutine to test whether each of the numbers 2, 3, 4, 5, 6…, 255 & 256 is a prime. Each number that is found to be a prime should be added to a list in memory. The list of primes should be stored in consecutive memory locations. Use a location named StartPrimeList to point to the start address of the prime number list. Use a pointer called PrimeListPtr to point to the (current) end of the list, PrimeListPtr will be incremented every time a prime number is appended to the list.
Use a location named PrN to store the number that you are checking. Start by storing a 2 in PrN. In a loop, you should call PrimeTest to determine whether PrN is a prime. If PrN is a prime, then append it to the list. Then add 1 to PrN and jump back to the start of the loop to test the next value of PrN.`
The output of the program should appear starting at location StartPrimeList as follows:-
Address Contents
[StartPrimeList] 2
[StartPrimeList+1] 3
[StartPrimeList+2] 5
[StartPrimeList+3] 7
…
…
[StartPrimeList+?] Largest Prime <= 256
(251 - 54th prime number starting from 2 <=256)
(257 - 55th prime number >256)
`
Mark Allocations for Program 2
• A program header in the program listing explaining how the program works.
• Sensible/Relevant program comments on sections of assembler language.
• Relevant labelling of loops and data items. [4]
• Program runs successfully on xComputer and produces correct output for given input.
`