Consider a program to add two numbers :
| Memory Address | Instructions | Operation | Relative Address |
|---|---|---|---|
| 2000 | LDA 2050 | A<-[2050] | 1 |
| 2003 | MOV B, A | B<-A | 2 |
| 2004 | LDA 2051 | A<-[2051] | 3 |
| 2007 | ADD B | A<-A+B | 4 |
| 2008 | STA 2052 | [2052]<-A | 5 |
| 200B | HLT | Terminate | 6 |
Now, 7.11 means that suppose. CPU fetches the instruction in the memory address 2003, it will set the program counter to 2004 In simple words, Program counter contains the address of the next instruction that is being executed currently by the CPU.
7.11.1 Absolute address means the actual memory location in which the instruction is stored in the memory. Relative address means the address of the instruction relative to the instructions in the program itself as in the above program.
Maintain a relative address in the instruction register means storing the relative address in the program counter and incrementing it on each instruction fetch.
do the dyanamic address translation using the instruction register as input means you have the relative address in the instruction register but the actual instruction is stored in memory locations like 2004, 2007 etc. So, you need to convert these relative address to absolute address.
When a successfull branch or call is encountered,the relative address generated by that branch or call is loaded into the instruction register means when there is any instruction like jump or goto where the linear flow of program gets changed and the control is transferred to a new memory address, then, the relative address of the memory instruction gets stored in the instruction register rather than absolute address.
7.11.2 Maintain an absolute address in the instruction register means store the actual memory address of the next instruction in the program counter.
When a successful branch or call is encountered, dynamic address translation is employed, with the results stored in the instruction register means when there is any instruction like jump or goto where the linear flow of program gets changed and the control is transferred to a new memory address, then, the absolute address of the memory instruction gets stored in the instruction register .
7.11. During the course of execution of a program, the processor will increment the contents of t...
Note: The question needs to be answered in "C
Programming Languange ". And after the question find 3 pages for
needed informations.
Spring CE4717 Language Processors Q1. Consider the following LEx program. return R1 return R2 return R3 return R4 return R5; return R6; IA-2a-z)[A-Za-z0-9]- -2 10-91+ 10-9a-EA-FI Ihi] [01] [01] 이삐 t Vtin) int main (void) int tcode; do f tcode -yylex()i printf ("token type td \"%s\"\n", tcode, yytext); ) while (tcode)i return 0; i. Explain the steps needed...