Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) Consider a program P on a Pep/8 computer with the following properties: . · ·

ID: 3727046 • Letter: 1

Question

1) Consider a program P on a Pep/8 computer with the following properties: . · · P requires data space for 600 integers. P will never need more than 150 bytes on the run-time stack. Exactly 25% of the instructions in P are unary (one byte) instructions. Also remember the following about the Pep/8 computer: .All application programs (including instructions, data, and run-time stack) occupy memory in the address range 0000-FBCE. An integer is two bytes. · What is the largest possible total number of instructions P might have? Give your answer in base 10.

Explanation / Answer

Data space reserved=1200 bytes

stack reserved =150 bytes

address range given= 0000 to FBCE = 64462 byte

Total space left for instruction=(64462-1200-15)byte=63112 byte

25% of 63112=15778 byte for unary instruction

Hence No. of unary instruction=15778

Memory left for 2-byte instruction is (63112-15778)=47334

No. of 2-byte instruction=47334/2=23,667

Hence largest possible total instruction for P =23667+15778=39445. in decimal