Computer Systems COMP1071
LMC programming assignment
Description of the task
Create an LMC program that accepts as input a positive integer n, outputs all the positive integer
divisors of n in increasing order, and then halts.
The outputted sequence should not contain any integers that are not divisors of n, and each divisor
of n should be outputted exactly once.
Recall that an integer k is called a divisor of n, if there is an integer m, such that n = m ∙ k.
Some examples of possible inputs to the program and the corresponding outputs:
60 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60
81 1, 3, 9, 27, 81
210 1, 2, 3, 5, 6, 7, 10, 14, 15, 21, 30, 35, 42, 70, 105, 210
997 1, 997
Your program will be marked for automatically.
Marks for correctness and robustness will be awarded by checking the output of your program on
the 12 test scripts that have been uploaded on DUO, and according to the marking scheme.
If you program fails any of these tests, I will look at your assembly code and partial marks may be
awarded. I will only try to understand your approach from the structure of the code and the
comments; no attempt to fix your code will be made. If the code you are going to submit fails one
or more of the tests, make sure it is well-commented.
本网站支持 Alipay WeChatPay PayPal等支付方式
E-mail: email@example.com 微信号:vipnxx