Program 1:
Write a program to subtract a 16 bit number stored at locations 51H-52H from 55H-56H and store the result in locations 40H and 41H. Assume that the least significant byte of data or the result is stored in low address. If the result is
positive, then store 00H, else store 01H in 42H. ORG 0000H; Set program counter 0000H
MOV A, 55H;
Load the contents of memory location 55 into A
CLR C; Clear the borrow flag
SUBB A,51H; Sub the contents of memory 51H from contents of A SUBB A, 52H ; MOV 42H, A; If result is positive, store00H, else store OlH in 42H
MOV 40H, A; Save the LS Byte of the result in location 40H
MOV A, 56H; Load the contents of memory location 56H into A Subtract the content of memory 52H from the content A
MOV 41H, A; Save the MS byte of the result in location 41H. MOV A, #00; Load 00H into A
ADDC A, #00; Add the immediate data and the carry flag to A
END
Answers
Answered by
1
A typical microprocessor consists of arithmetic and logic unit (ALU) in association ... 2 Internal Architecture of 8085 ... The 8085 includes six registers, one accumulator and one flag register, ... In addition, it has two 16-bit registers: stack pointer and program counter. ... the eight bits of the I/O addresses during first clock cycle.
Similar questions