Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The program of Table 5.1 was written for the Basic Computer to test a subroutine SUM which calculates the sum of two vectors S= A
The program of Table 5.1 was written for the Basic Computer to test a subroutine SUM which calculates the sum of two vectors S= A +B. The vectors' elements (A = [ao ai a2 a3 ... an-1) and B = [bo bi b2 b3 ... Memory Contents of bri]) are 32 bit integers, and, given that the memory words of the address memory location Basic Computer are 16 bit long, each 32-bit integer is stored as two consecutive 16-bit words: first the least significant half (bits 15.0 in OFF akl or bk, k = 0..n-1) and followed by the most significant half (bits 100 31-16 in akH or bkh, k = 0..n-1), as illustrated in the next figure for n= 101 6410 = 4016; where 10016 is the address of aol, while 20016 is the 102 al address of bou and 30016 is the address of sol. 103 The subroutine SUM is invoked through the call-by-reference method, while addresses of the first elements of the vectors A, B and S are passed by the Parameter Linkage method. The elements of the 13E an-1.L. vectors A and B are loaded in the memory by the operator before 13Fan-1 running the test program. POL 200 201 202 bou b bil bih 203 23E 23F bn 1. bn-1.H Table 5.1 ORGO BSA SUM HEX 100 HEX 200 HEX 300 DEC -64 HLT 5.1. Rewrite below the test program, such that it will process vectors with 100 elements stored at the following memory locations: 8FE for aol, COO for bol and C200 for sol. SOL 300 301 302 303 SOH SIL SIH Sn-1,L 33E 33F 340 Sn-1.H 5.2. Can this program add vectors with 700 elements? Justify your answer. -3. Devise and write down the subroutine SUM in Assembly Language (NOT Machine Code!), using instructions from Table 6 of the Annex. OTE: You are allowed to use alternative ways to pass parameters to/from the subroutine, but Il explanations should be provided. The program of Table 5.1 was written for the Basic Computer to test a subroutine SUM which calculates the sum of two vectors S= A +B. The vectors' elements (A = [ao ai a2 a3 ... an-1) and B = [bo bi b2 b3 ... Memory Contents of bri]) are 32 bit integers, and, given that the memory words of the address memory location Basic Computer are 16 bit long, each 32-bit integer is stored as two consecutive 16-bit words: first the least significant half (bits 15.0 in OFF akl or bk, k = 0..n-1) and followed by the most significant half (bits 100 31-16 in akH or bkh, k = 0..n-1), as illustrated in the next figure for n= 101 6410 = 4016; where 10016 is the address of aol, while 20016 is the 102 al address of bou and 30016 is the address of sol. 103 The subroutine SUM is invoked through the call-by-reference method, while addresses of the first elements of the vectors A, B and S are passed by the Parameter Linkage method. The elements of the 13E an-1.L. vectors A and B are loaded in the memory by the operator before 13Fan-1 running the test program. POL 200 201 202 bou b bil bih 203 23E 23F bn 1. bn-1.H Table 5.1 ORGO BSA SUM HEX 100 HEX 200 HEX 300 DEC -64 HLT 5.1. Rewrite below the test program, such that it will process vectors with 100 elements stored at the following memory locations: 8FE for aol, COO for bol and C200 for sol. SOL 300 301 302 303 SOH SIL SIH Sn-1,L 33E 33F 340 Sn-1.H 5.2. Can this program add vectors with 700 elements? Justify your answer. -3. Devise and write down the subroutine SUM in Assembly Language (NOT Machine Code!), using instructions from Table 6 of the Annex. OTE: You are allowed to use alternative ways to pass parameters to/from the subroutine, but Il explanations should be provided
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started