AIM: To write an assembly language for the following code conversion: a)Decimal to Hexadecimal b)Hexadecimal to Decimal
APPARATUS REQUIRED: 8085 micrprocessor kit Power supply(0-5)v
a)DECIMAL TO HEXADECIMAL ALGORITHM: STEP1: Load the immediate 16 Bit data specified within the instruction into HL register pair. STEP2: Copy the content of memory location pointed by the ‘HL”register pair into ‘A’ register STEP 3: Copy the content of accumulator to ‘d’ register STEP4: ’AND’ the immediate data (F0) in to the accumulator STEP5: Shift the accumulator value to the right by one position. Repeat STEP6 for four times. STEP6: Copy the immediate value (0A) to ‘C’ register STEP7: Copy the content of accumulator to ‘B’ register and Clear the accumulator content STEP8: Add the content of the ‘B’ register with the accumulator and store the result in the accumulator .Decrement ‘C’ register STEP9: Check for non-zero value. If Z≠0, jump to STEP11 ,else copy the content from ‘A’ to ‘B’ register and ‘D’ to ‘A’ register STEP10: ’AND’ the immediate data (0F) in to the accumulator STEP11: Add the content of the ‘B’ register with the accumulator and store the result in the accumulator. STEP12: Store the result in the memory location in 4500 from the accumulator.
DECIMAL TO HEXA-DECIMAL PROGRAM MEMORY ADDRESS
LABEL
4500 4501 4502
MNEUMONIC CODE LXI
4503 4504 4504 4505
OPCODE COMMENTS
H,4100 21 00 41
MOV A,M MOV D,A ANI A,F0
LOADS THE IMMEDIATE 16 BIT DATA SPECIFIED WITH IN THE INSTRUCTION INTO HL PAIR
7E 57 E6 F0
COPY THE CONTENT OF MEMORY LOCATION POINTED BY THE HL REGISTER PAIR INTO 'A' REGISTER COPY THE CONTENO OF 'D' TO 'A' LOGICALLY 'AND' THE IMMEDIATE VALUR (F0) WITH THE ACCUMULATOR CONTENT
4506
RRC
0F
SHIFT THE ACCUMULATOR CONTENT BY ONE POSITION TO THE RIGHT
4507
RRC
0F
SHIFT THE ACCUMULATOR CONTENT BY ONE POSITION TO THE RIGHT
0F
SHIFT THE ACCUMULATOR CONTENT BY ONE POSITION TO THE RIGHT
SHIFT THE ACCUMULATOR CONTENT BY ONE POSITION TO THE RIGHT LOAD THE IMMEDIATE VALUE (0A) TO 'C' REG. COPY THE CONTENT OF 'A' TO 'B' REG. CLEAR THE ACCUMULATOR CONTENT A=A+B:AND STORE THE RESULT IN THE ACCUMULATOR DECREMENT 'C' REG. BY ONE IF 'Z≠0' JUMP TO L1(450E) COPY THE CONTENT OF 'A' TO 'B' REG. COPY THE CONTENT OF 'D' TO 'A' REG. LOGICALLY 'AND' THE IMMEDIATE VALUR (0F) WITH THE ACCUMULATOR CONTENT A=A+B:AND STORE THE RESULT IN THE ACCUMULATOR STORE THE RESULT IN SPECIFIED ADDRESS HALT THE PROGRAM
DECIMAL TO HEXADECIMAL
INPUT ADDRESS
DATA
OUTPUT ADDRESS
DATA
MANUAL CALCULATION:
b)HEXA-DECIMAL TO DECIMAL ALGORITHM: STEP1: Load the immediate value 00H to ‘E’ register. STEP2: Copy the content of ‘E’ to ‘D’ register STEP 3: Load the input data from the memory laocation to the accumulator. STEP4: Compare the immediate value(64) and the accumulator. STEP5: Check for carry condition. If ‘A’ < ‘64’,jump to STEP7 else subtract the immediate value (64)to the accumulator STEP6: Increment ‘E’ register and jump back to STEP4 STEP7: Compare the immediate value(0A) and the accumulator. STEP8: Check for carry. If ‘A’ < ‘0A’, jump to STEP 9 else subtract the aacumulator value from the immediate value (0A),Increment ‘D’ register and jump to STEP4 STEP9: Copy the content of accumulator to ‘B’ register and ‘A’ to ‘E’ registers. STEP10: Store the result (hundreds) in the specified memory location and copy the content of ‘D’ to ‘A’ register. STEP11: Store the result (tens) in the specified memory location and copy the content of ‘B’ to ‘A’ register STEP12: Store the result (ones) in the specified memory location.
1E 00 53 32 00 42 FE 64 DA 0E 45 D6 64 1C C3 06 45 FE 0A DA 1A 45 D6 0A 3C C3 11 45 47 7B 32 00 46 7A 32 01 46 78 32 02 46 76
INITIALISE 'E' REGISTER AS '00' COPY THE CONTENT OF 'E' TO 'D' REGISTER LOAD ACCUMULATOR WITH VALUE THROUGH ADDRESS 4200 COMPARE THE IMMEDIATE VALUE(64H) WITH THE ACCUMULATOR CHECK IF 'CY=1',JUMP TO L1(4511) SUBTRACT THE IMMEDIATE VALUE(64) WITH THE ACCUMULATOR INCREMENT 'E' REGISTER JUMP UNCONDITIONALLY TO L2(4506) COMPARE THE IMMEDIATE VALUE(0AH) WITH THE ACCUMULATOR CHECK IF 'CY=1',JUMP TO L3(451A) SUBTRACT THE IMMEDIATE VALUE(0A) WITH THE ACCUMULATOR INCREMENT 'A' REGISTER JUMP UNCONDITIONALLY TO L1(4511) COPY THE CONTENT OF 'A' TO 'B' REGISTER COPY THE CONTENT OF 'E' TO 'A' REGISTER STORE THE ACCUMULATOR CONTENT IN THE SPECIFIED ADDRESS(4600) COPY THE CONTENT OF 'D' TO 'A' REGISTER STORE THE ACCUMULATOR CONTENT IN THE SPECIFIED ADDRESS(4601) COPY THE CONTENT OF 'B' TO 'A' REGISTER STORE THE ACCUMULATOR CONTENT IN THE SPECIFIED ADDRESS(4602) HALT THE PROGRAM
HEXA-DECIMAL TO DECIMAL
INPUT ADDRESS
DATA
OUTPUT ADDRESS
DATA
MANUAL CALCULATION:
RESULT: Thus,the assembly language program for a code conversion was executed using 8085 microprocessor.
STEP8: Add the content of the 'B' register with the accumulator and store the ... STEP12: Store the result in the memory location in 4500 from the accumulator.
File: 8085 microprocessor by ramesh. gaonkar pdf download. Download now. Click here if your download doesn't start automatically. Page 1 of 1. 8085 microprocessor by ramesh gaonkar pdf download. 8085 microprocessor by ramesh gaonkar pdf download. Ope
which consists of various instructions such as MOV, ADD, SUB, JMP, etc. These instructions are written in the form of a program which is used to perform various operations such as branching, addition, subtraction, bitwise logical and bit shift operat
Appointments, Close More Sales Full Popular PDF, PDF The Conversion Code: Capture Internet .... the strengths of social media, apps, and blogs to capture.