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...
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...
(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,...
1. Suppose that E(X) E(Y) E(Z) 2 Y and Z are independent, Cov(X, Y) V(X) V(Z) 4, V(Y) = 3 Let U X 3Y +Z and W = 2X + Y + Z 1, and Cov(X, Z) = -1 Compute E(U) and V (U) b. Compute Cov(U, W). а.
The second phase of your semester project is to write pass one of a two‑pass assembler for the SIC assembler language program. As with Phase 1, this is to be written in C (not C++) and must run successfully on Linux. Pass one will read each line of the source file, and begin the process of translating it to object code. (Note: it will be to your advantage to have a separate procedure handle reading, and perhaps tokenizing, the source...
n - meraymowa:)--00 [1] [ Let the vectors x, y and z be x = -2 y=1tz= -1 [3] [2] Find r. s and t such that y + z = x O (r, s, t) = (-2, -1, 1) O (r, s, t) = (-2, 1, 1) O (r, s, t) = (-2, 1,-1) (r, s, t) = (2, 1,-1) m Consider the set S = {w,x,y,z} of vectors in R3, S = { 121, Let V = span...
Please help answer this question 1) 2) 3) Why does the assembler make two passes through the program? To determine the addresses of labels in order to calculate the correct offset for PC relative memory and branch instructions. To calculate immediate values for operate instructions. To determine register values for LDR and STR instructions. To create constant values for . FILL assembler directives. After the second pass, what machine code instruction would the assembler create for BRnzp TEST, with the...