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 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
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
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
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
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.
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.
Tutorial problems on 8086 Architecture
1. If a physical branch target address is 5A230 when CS = 5200, what will it be if the CS
= 7800 ?
2. Given that the EA of a data is 2359 and DS = 490B, what is the PA of data.
3. Given following values in various registers/memory of a 8086 system:
IP = 2BC0, CS= 0200 DS = 212A BX = 1200
[224A0] = 0600 [275B9] = 098A Displacement = 5119
Find the branch address for a branch instruction that uses:
(a) Intrasegment (or Near) direct addressing using
JMP [2]
(b) Near Indirect addressing using register mode
JMP BX
Near Indirect addressing using
JMP WORD PTR [BX]
JMP disp[BX]
(c) Intersegment Direct addressing using
JMP 10000H
In each case find out the number of trips to memory required for calculating the target
address.
4. Find the flag settings for SF, ZF, CF, OF, and PF after adding 62A0 to each of the
following values:
(a) 1234 (b) 4321 (c) CFA0 (d) 9D60
5. Write an instruction using based indexed addressing (using BX and SI) to add the
contents of a memory location to AL and put the result in AL. Write the Machine
Code.
6. Assuming, W, X, Y and Z as memory addresses. Write a program sequence that will
carry out the following: Z ← W + (Z-X)
7. Translate the following assembly instructions into machine code using the instruction
format information and the opcodes (find them from books or internet):
(a) ADC AL, [245A]
(b) INC CX
(c) CMP CL, 24[BP+SI]
(d) PUSH CS
(e) POP DX
8. Write a short program that pushes the contents of AX,BX and CX onto the stack &
then
(a) First POP retrieve the value that was pushed on to the stack from CX and place it
into the AX
(b) The second POP places the original value of BX into CX
(c) The last POP places the original value of AX into BX
Step by step
Solved in 2 steps