Question

In: Computer Science

Give the address of R4, R6 in the following program.

 Give the address of R4, R6 in the following program.

 ORG 0H

 MOV A, #92H

 SETB PSW.4

 MOV R4,A

 SETB PSW.3.

 MOV R6,A

 END

 I. RAM ADDRESS OF R4 = 14H and R6=1EH

 

 II. RAM ADDRESS OF R4 = 0CH and R6=0AH

 

 III.RAM ADDRESS OF R4= 15H and R6=02H

 

 IV.RAM ADDRESS OF R4= 0CH and R6=0EH




Solutions

Expert Solution

We can switch to other banks by using of the PSW register

1. Bits D4 and D3 of the PSW are used to select the desired register bank
2. Use the bit-addressable instructions SETB and CLR to access PSW.4 and PSW.

SETB PSW.4; bank 2 is selected on condition that PSW.3 is 0 ie not set

When both the PSW.4 and PSW.3 is set then Bank 3 is considered.

When in R4, A is stored, only PSW.4 is set. So, bank 2 is selected.

Hence Ram address of R4 is 14H according to the bank address.

When in R6, A is stored, both PSW.3 and PSW.4 is set ie 1. Hence Bank 3 is selected.

So, Ram address of R6 is 1EH according to the bank address

Therefore, Option (I) is correct.


Related Solutions

write a python program, please. Create a program that uses the Gettysburg Address as input and...
write a python program, please. Create a program that uses the Gettysburg Address as input and outputs a list of tuples for every two words. For example: [('Four', 'score'),('and', 'seven'), ...].
Write an assembly language program that corresponds to the following C program ****Please give correct answer...
Write an assembly language program that corresponds to the following C program ****Please give correct answer using Pep/9 machine**** int num1; int num2; ;int main () { scanf("%d", &num1); num2 = -num1; printf("num1 = %d\n", num1); printf("num2 = %d\n", num2); return 0; }
Show and classify all potential data hazards. Instructions 1. add R2, R5, R4 2. add R4,...
Show and classify all potential data hazards. Instructions 1. add R2, R5, R4 2. add R4, R2, R5 3. sw R5, 100(R2) 4 . add R5, R2, R4
Use the Gram-Schmidt process to transform the following vectors into an orthonormal basis of R4: u1=?(0...
Use the Gram-Schmidt process to transform the following vectors into an orthonormal basis of R4: u1=?(0 2 1 0)?, u2=(?1 −1 0 0) ,u3=?(1 2 0 −1?), u4=?(1 0 0 1?) can you do this in MATLAB with step by step on how to use the code
Design a C++ program An address book is a book or a database used for saving...
Design a C++ program An address book is a book or a database used for saving and storing contacts which may usually consists of a few standard fields (for example: first name, last name, company name, address, telephone number, e-mail address, fax number, mobile phone number). Design an online address book to keep track of the details of family members, close friends and certain business associates. Details which your designed address book will keep should be like names (first name,...
How many bits are required to address the program memory of PIC16F887? What is PCLATH? For...
How many bits are required to address the program memory of PIC16F887? What is PCLATH? For PC absolute addressing, describe how to write assembly program to jump to code located in a different program memory page.
Write a MIPS program that always checks the bit 0 of a memory data at address...
Write a MIPS program that always checks the bit 0 of a memory data at address 0x0BF81234. If it is equal to one add nth and (n+1)th elements of an array and store it to memory address 0x0BF85678 . Suppose $t0 contains the address of the 0th element of an array of 32-bit data and $t1 = n.
write program in java Create a class named PersonalDetails with the fields name and address. The...
write program in java Create a class named PersonalDetails with the fields name and address. The class should have a parameterized constructor and get method for each field.  Create a class named Student with the fields ID, PersonalDetails object, major and GPA. The class should have a parameterized constructor and get method for each field. Create an application/class named StudentApp that declare Student object. Prompts (GUI input) the user for student details including ID, name, address, major and GPA....
For each of the following six program fragments give an analysis of the running time (Big-Oh...
For each of the following six program fragments give an analysis of the running time (Big-Oh will do). (25,very 5 mark) (a)sum = 0; for( i=0; i<n; i++ ) for( j=0; j<n; j++ ) sum++; (b) sum = 0; for( i=0; i<n; i++ ) for( j=0; j<n*n; j++ ) sum++; (c) sum = 0; for( i=0; i<n; i++ ) for( j=0; j<i; j++ ) sum++; (d) sum =0; for( i=1; i<n; i++ ) for( j=1; j<i*i; j++ ) if( j%1...
For a direct mapped cache design with 32 bit address, the following bits of the address...
For a direct mapped cache design with 32 bit address, the following bits of the address are used to access the cache Tag Index Offset 31 - 8 7 - 4 3 - 0 What is the cache block size (in words)? How many entries does the cache have? What is the ratio between total bits required for such a cache implementation over the data storage bits? Starting from power on, the following byte-addressed cache references are recorded. Address 0...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT