in assembler or loader,
which of the following statements are RELATIVE OR ABSOLUTE:
1) x - y
2) x+y-z
3) x+7+v-w
here, x,y, z, v, w is symbol or label.
PLEASE GIVE PROPER JUSTIFICATION AND EXPLANATION FOR ANSWERS.
Expressions in assembler is one of the machine independent feature of assembler.
Expressions are simply combination of operands and operators . operand can be constant or symbols.
Expressions in assembler can be divided into two categories :
1: Absolute expressions
2: Relative expressions
The significance of dividing expressions is at that time when program relocation is done, i.e. program is loaded at a new place in memory rather than its actual position , which is very common in the real world assembler.
1:ABSOLUTE EXPRESSION:
These are the expression in which we need not change/ modify value of any operand at the time of program relocation .
Absolute expressions will give same result even if they are loaded at any memory address . We can also say that absolute expressions are not affected by relocation of program.
2:RELATIVE EXPRESSIONS:
These are the expression in which we need to change/ modify values of operand at the time of program relocation .
Relative expressions give different result if they are loaded at different memory address . Hence, relative expressions are those expression which are affected by relocation of program.
we can check an expression by simply putting some values in the place of symbols and calculate result, then change address of symbols and again calculate result , if both result are same then expression will be absolute otherwise expression will be relative.
now let us solve the problems given above:
1: x-y : absolute expression
reason:
let x=2000
y=1000
(note that 1000 and 2000 are address of x and y stored in symbol table)
x-y=1000
let program is relocated and x becomes 3000
now y will also be relocated . As we know relocation does not affect the size of program in the memory, y will be at same distance from x as it was prior to relocation, hence new position of y becomes 2000.
x=3000
y=2000
x-y=1000, which is same as prior to relocation,
hence the expression x-y is absolute expression.
(x-y will always give the difference between x and y which can not be changed even when relocation is done.)
2:x+y-z: relative expression
reason:
let x=0, y=1000,z=500 : x+y-z=500
suppose , after relocation: x=500 then, y=1500 and z=1000, now x+y-z=500+1500-1000=1000
(Result for same expression are different before and after relocation.)
hence the expression x+y-z is relative expression.
3:x+7+v-w: relative expression.
reason:
let x=0 v=200 w=50
result: x+7+v-w=157
suppose program is relocated and x becomes 100 :
v will becomec 300
w will become 150
result: x+7+v-w(7 is a constant hence it does not change) =257
as results are different , expression is needed to be modified if relocation is done, hence this expression is relative expression.
In assembler or loader, which of the following statements are RELATIVE OR ABSOLUTE: 1) x - y 2) x...
in assembler or loader, which of the following statements are RELATIVE OR ABSOLUTE: 1) x - y 2) x+y-z 3) x+7+v-w here, x,y, z, v, w is symbol or label. PLEASE GIVE PROPER JUSTIFICATION AND EXPLANATION FOR ANSWERS.
are the following statements absolute or relative. justify the answers. 1) mvi A, 00 2) jmp * -6 3) store c PLEASE GIVE PROPER JUSTIFICATION AND EXPLANATION
Write the following sequence of code into RISC-V assembler. Assume that x, y, and z are stored in registers x18, x19, and x20 respectively. z = z + y - x - 4;
3- [8 points] Write the following sequence of code into RISC-V assembler: x=x-y-z+4; Assume that x, y, and z are stored in registers x18, x19, and x20 respectively.
Exam 1 Which of the following statements is true? (a) Y is a linear combination of Xi and X2, but W and Z are not. (b) W and Z are linear combinations of Xi and X2, but Y is not. (c) W and Y are linear combinations of Xi and X2, but Z is not. (d) Y is a linear combination of X, and X2, but W and Z are not. (e) All the above statements are false.
WINECT Homework 2 The following is a partial relative frequency distribution of consumer preferences for four products-W, X, Y, and Z Partial Relative Frequency Distribution Table Relative Product Frequency 0.12 0.18 0.2 (a) Find the relative frequency for product X (Round your answer to 2 decimal places.) Relative frequency (b) 600 consumers were surveyed, give the frequency distribution for these data Frequency Distribution Table Product Frequency W (d) If we wish to depict these data using a pie chart, find...
Find the variable assignment that solves the following horn formulas: 1. (w∧y∧z) ⇒ x,(x∧z) ⇒ w, x ⇒ y,⇒ x,(x∧y) ⇒ w,(w¯ ∨x¯,∨y¯),(z¯) 2. (x∧z) ⇒ y,z ⇒ w,(y∧z) ⇒ x,⇒ z,(z¯∨x¯),(w¯ ∨y¯∨z¯) please provide fully explanation.
(1 point) Are the following statements true or false? ? 1. The best approximation to y by elements of a subspace W is given by the vector y - projw(y). ? 2. If W is a subspace of R" and if V is in both W and Wt, then v must be the zero vector. ? 3. If y = Z1 + Z2 , where z is in a subspace W and Z2 is in W+, then Z, must be...
MARK WHICH STATEMENTS BELOW ARE TRUE, USING THE FOLLOWING, Consider Vf(x, y, z) in terms of a new coordinate system, x= x(u, v, w), y=y(u, v, w), z=z(u, v, w). Let r(s) = x(s) i+y(s) + z(s) k be the position vector defining some continuous path as a function of the arc length. Similarly for the other partial derivatives in v and w. For spherical coordinates the following must also be true for any points, x = Rsin o cose,...
7. According to the textbook, which of the following statements is (are) correct? (x) A period of hyperinflation is a period of extraordinarily high inflation and there was an obvious case of hyperinflation in Zimbabwe in the early part of the current century. (y) Data on hyperinflation, as illustrated in the textbook, indicates that the money supply growth rate was essentially parallel to the inflation rate during periods of hyperinflation. (z) An extraordinarily high rate of inflation in Germany during...