We have been working very hard since 2009 to facilitate in learning Read More. We can't keep up without your support. Donate.

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

# CS501- ASSIGNMENT 1 -- JUST AN IDEA SOLUTION...--

IDEA SOLUTION:

A= (B+C)*(D+E)

3 address instructions involve three operands i.e. two source and one destination. Op-code specifies the operation to be carried out.

mul a, x, y

In case of 2 address instructions, there are two operands. One of them is used as source whereas the other one is used both as source and destination.

mul y, r

store a, y

In case of 0 address instruction only op code field has to be specified. Stack is used to hold both the operands and result.

push d

push e

push b

push c

mul

pop a

** Values of all operands remained unchanged. **

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

Views: 999

### Replies to This Discussion

One more idea solution of CS501 Assignment#1 Fall 2011

Attachments:

Question # 3

Evaluate the expression a=(c+4)*15-b for the 3, 2, 1, and 0-address machines

Solution

r,c,24
Mul s,r,17
Sub y,b
Mul y,3
Mul s,17
Store z,y
Lda c
Mula 17
Sta s
Lda a
Suba b
Mul 3
Sta z
push c
push 24
push 17
mul
push a
push b
sub
push 3
mul
popz

QUESTION 1:

Write the code to implement the expression A = (B+C) * (D + E) for

In accordance with programming language practice, computing the expression should not change the values of its operands.

SOLUTION:

bhai ye solution thek ha ??????

Fit hay.........

CS501 SOLUTION

Write the code to implement the expression A = (B+C) * (D + E) for

In accordance with programming language practice, computing the expression should not change the values of its operands.

SOLUTION:

The given expression is A = (B+C) * (D + E)

thankx sir ji

See the attached file for one more idea solution of CS501 Assignment#01 Fall 2011

Attachments:

## Latest Activity

S ι у α ♡ updated their profile
3 hours ago
4 hours ago
4 hours ago
+ !! Ήලᵯᵯℹ Ⲥⱨ !! + posted discussions
4 hours ago
5 hours ago
5 hours ago
+ ⵑⵑ ӍᎥŞŞ ⲤһᵘʳһშᎥⵏ ⵑⵑ + updated their profile
5 hours ago
+ !! Ήලᵯᵯℹ Ⲥⱨ !! + liked Ammara Sabir's discussion !!!!!!Muhabbat!!!!!!
5 hours ago
5 hours ago
5 hours ago
5 hours ago
6 hours ago

1

2

3

4

5