Tutorial6 Questions on 8085 1. Find the machine codes of following 8085 instructions and in each case identify the opcode part, and register/ memory reference bits. Also mention the length of opcode, number of bytes in the instruction. MOV A, M; MVI C, data; PUSH B; ADC B; XRA L; JNZ address LDAX B 2. Translate the following Assembly program of 8085 into machine code (hex format) MVI C, 20 LXI H, 1500h MVI A, 00 next; MOV B, M ADC B INX H DCR C JNZ next STA 1600h HLT Assume that the program is to be stored in memory starting at address 1000h 3. Find out the number of machine cycles and the number of T-states taken by the following 8085 instructions. In each case give an explanation for your answer. (i) ADC D (ii) ADI 05 (iii) JMP 1500h (iv) JNZ 1500h (v) LDAX B (vi) MOV A, B (vii) LDA 1300h 4. Draw a complete connection diagram of a computer system with 8085 as processor, a four 1K RAM, and four 1K ROM chips. Give the address range for each RAM and ROM chips. 5. Translate the sumArray function (written in C below) to 8085 assembly language: int sumArray (int * p, int n) { int sum = 0, x; int * ptr = p; //ptr points to the starting address of array p int * pend = &p[n]; //pend points to the last element of array p while (ptr != pend) { x = *ptr; //x has the value of an element of array p if (x> 5) sum = x + sum; ptr++; } return sum; } You may make suitable assumptions about the values in processor registers before a call to this function.
Tutorial6 Questions on 8085
1. Find the machine codes of following 8085 instructions and in each case identify the opcode
part, and register/ memory reference bits. Also mention the length of opcode, number of bytes
in the instruction.
MOV A, M;
MVI C, data;
PUSH B;
ADC B;
XRA L;
JNZ address
LDAX B
2. Translate the following Assembly program of 8085 into machine code (hex format)
MVI C, 20
LXI H, 1500h
MVI A, 00
next; MOV B, M
ADC B
INX H
DCR C
JNZ next
STA 1600h
HLT
Assume that the program is to be stored in memory starting at address 1000h
3. Find out the number of machine cycles and the number of T-states taken by the following
8085 instructions. In each case give an explanation for your answer.
(i) ADC D
(ii) ADI 05
(iii) JMP 1500h
(iv) JNZ 1500h
(v) LDAX B
(vi) MOV A, B
(vii) LDA 1300h
4. Draw a complete connection diagram of a computer system with 8085 as processor, a four 1K
RAM, and four 1K ROM chips. Give the address range for each RAM and ROM chips.
5. Translate the sumArray function (written in C below) to 8085 assembly language:
int sumArray (int * p, int n) {
int sum = 0, x;
int * ptr = p; //ptr points to the starting address of array p
int * pend = &p[n]; //pend points to the last element of array p
while (ptr != pend) {
x = *ptr; //x has the value of an element of array p
if (x> 5) sum = x + sum;
ptr++;
}
return sum;
}
You may make suitable assumptions about the values in processor registers before a call to
this function.
Step by step
Solved in 2 steps