0% found this document useful (0 votes)
10 views3 pages

CS508 Assignment 1

Uploaded by

Sidra asif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views3 pages

CS508 Assignment 1

Uploaded by

Sidra asif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

CS508

BC170202271
Shahroz Ali
Question Statement
You are required to guess the flow of following IBM mainframe instructions and write the
resultant values of registers (i.e., A, B, C, D and E) and memory locations (i.e., x101,
x102, x103, x104 and x105) after the execution in the tables given below;

Suppose A, B, C, D and E are registers and initially contain the following values;
A=2
B=3
C=4
D=5
E=7

And x101, x102, x103, x104 and x105 are the memory locations, which contain the
following values;
x101 = 10
x102 = 20
x103 = 30
x104 = 40
x105 = 50
Now examine the flow of following IBM instructions (as guided in above discussion);

1) AR A, B // AR = Addition of registers
A = 2+3 = 5

2) MR B, A // MR = Multiplication of registers
B = 3*5 = 15

3) A C, x101 // A = Addition of register and memory


C = 4+10 = 14

4) A C, x102 // A = Addition of register and memory


C = 14+20 = 34

5) AR C, A // AR = Addition of registers
C = 34+5 = 39

6) SR C, D // SR = Subtraction of registers
C = 39-5 = 34

7) ST x101, A // ST = Storing register value in memory


X101 = 5

8) A D, x104 // A = Addition of register and memory


D = 5+40 = 45

9) ST x103, D // ST = Storing register value in memory


X103 = 45

10) MR D, E // MR = Multiplication of registers


D = 45*7 = 315

11) AR C, A // AR = Addition of registers


C = 34+5 = 39

12) ST x102, C // ST = Storing register value in memory


X102 = 39

13) A A, x101 // A = Addition of register and memory


A = 5+5 = 10

14) A B, x103 // A = Addition of register and memory


B = 15+45 = 60

15) ST x104, B // ST = Storing register value in memory


X104 = 60

16) M E, x105 // M = Multiplication of register and memory


E = 7*50 = 350

17) ST x105, E // ST = Storing register value in memory


X105 = 350

18) AR C, B // AR = Addition of registers


C = 60+39 = 99

19) AR E, A // AR = Addition of registers


E = 350+10 = 360

Finally, write the resultant values;

Registers Values
A 10
B 60
C 99
D 315
E 360

Memory Locations Values


x101 5
x102 39
x103 45
x104 60
x105 350

You might also like