Você está na página 1de 29

LAB MANUAL

1. 8-BIT MULTIPLICATION AND DIVISION

AIM:

To write an assembly language program to


(i) Multiply two 8-bit numbers
(ii) Divide two 8-bit numbers
APPARATUS REQUIRED:

8085 Kit and Power supply

ALGORITHM:

8-BIT MULTIPLICATION:

1. Initialize a register for carry.


2. Get the two input data (multiplier and multiplicand) from memory locations.
3. Clear accumulator for repeated addition and have multiplier as count.
4. Add multiplicand with accumulator content.
5. Check for carry. If carry =1, goto next step, else goto step 7.
6. Increment the carry register.
7. Decrement the count.
8. Check for count. If count=0, goto next step, else goto step 4.
9. Store the result and carry in memory locations.
10. Stop program execution.

PROGRAM:

Address Opcode Label Mnemonics Comments


4101 MVI C,00 Move immediate 00 to C register
4102
4103 LDA 4500 Load accumulator with the content of
4104 Address 4500
4105
4106 MOV B,A Move the content of B-register to
Accumulator
4107 LDA 4501 Load accumulator with the content of
4108 Address 4501
4109
410A MOV D,A Move the content of D-register to
Accumulator
410B XRA A X-OR the content of accumulator
410C L2 ADD B Add the content of B register to
accumulator content
410D JNC L1 Jump if no carry to label location L1
410E
410F
4110 INR C Increment C register
4111 L1 DCR D Decrenent D register
4112 JNZ L2 Jump on no zero to label location L2
4113
4114
4115 STA 4503 Store accumulator content to address
4503
4116
4117
4118 MOV A,C Move the content of C-register to
Accumulator
4119 STA 4504 Store accumulator content to address
4504
411A
411B
411C HLT Halt the program execution

ALGORITHM:

8-BIT DIVISION:

1. Initialize a register for quotient.


2. Get the two input data (divisor and dividend) from memory locations.
3. Compare divisor and dividend.
4. Check for carry, if set goto step 8, else to next step.
5. Subtract divisor from dividend.
6. Increment the quotient register.
7. Go to step 3.
8. Store the remainder and quotient in memory locations.
9. Stop program execution.

PROGRAM:

Address Opcode Label Mnemonics Comments


4101 MVI C,00 Move immediate 00 to C register
4102
4103 LDA 4500 Load accumulator with the content of
4104 Address 4500
4105
4106 MOV B,A Move the content of B-register to
Accumulator
4107 LDA 4501 Load accumulator with the content of
4108 Address 4501
4109
410A L2 CMP B Compare B register content to
accumulator content
410B JC L1 Jump on carry to label location L2
410C
410D
410E SUB B Subtract the content of B register from
accumulator content
410F INR C Increment C register
4110 JMP L2 Jump to label location L2
4111
4112
4113 L1 STA 4503 Store accumulator content to address
4503
4114
4115
4116 MOV A,C Move the content of C-register to
Accumulator
4117 STA 4504 Store accumulator content to address
4504
4118
4119
411A HLT Halt the program execution

PROCEDURE:

1. Key in the opcodes.


2. Give the input data at specified memory locations.
3. Execute the program.
4. Check the results at specified output locations.

OBSERVATION :

8-bit Multiplication Address Data


Input 4500 08
4501 03
Output 4503 18 (Product LSB)
4504 00 (Carry MSB)

8-bit Division Address Data


Input 4500 08
4501 03
Output 4503 02 (Remainder)
4504 02 (Quotient)
Result:

Thus the assembly language programs for 8-bit multiplication and division are
written, executed and the results are verified.
2. 16-BIT ADDITION AND SUBTRACTION

AIM:

To write an assembly language program to


(i) Add two 16-bit numbers
(ii) Subtract two 16-bit numbers

APPARATUS REQUIRED:

8085 Kit and Power supply

16-BIT ADDITION:

ALGORITHM:

1. Clear a register for carry.


2. Get the LSBs of two 16-bit data.
3. Add the LSBs and Store the result in memory location.
4. Get the MSBs of two 16-bit data.
5. Add the MSBs with carry of LSBs.
6. Check for carry. If carry =1, goto next step, else goto step 7.
7. Increment the carry register
8. Store the result (MSBs sum) and carry in memory locations.
9. Stop program execution.

PROGRAM:

Address Opcode Label Mnemonics Comments


4101 MVI C,00 Move immediate 00 to C register
4102
4103 LHLD 4500 Load HL registers with the contents of
Address 4500, 4501
4104
4105
4106 MOV B,L Move the content of L-register to B
register
4107 LHLD 4502 Load HL registers with the contents of
Address 4502, 4503
4108
4109
410A MOV A,L Move the content of L-register to
Accumulator.
410B ADD B Add B register content to accumulator
content
410C STA 4600 Store accumulator content to address
4600
410D
410E
410F MOV A,H Move the content of H-register to
Accumulator
4110 ADC D Add with carry, D register content to
accumulator content
4111 JNC L1 Jump on no carry to label location L2
4112
4113
4114 INR C Increment C register
4115 L1 STA 4601 Store accumulator content to address
4601
4116
4117
4118 MOV A,C Move the content of C-register to
Accumulator
4119 STA 4602 Store accumulator content to address
4602
411A
411B
411C HLT Halt the program execution

16-BIT SUBTRACTION:

ALGORITHM:

1. Clear a register for carry.


2. Get the LSBs of two 16-bit data.
3. Subtract the LSBs and Store the result in memory location.
4. Get the MSBs of two 16-bit data.
5. Subtract the MSBs with borrow.
6. Check for carry (borrow). If carry =1, goto next step, else goto step 7.
7. Increment the carry register
8. Store the result (MSBs difference) and carry in memory locations.
9. Stop program execution.
PROGRAM:

Address Opcode Label Mnemonics Comments


4101 MVI C,00 Move immediate 00 to C register
4102
4103 LHLD 4500 Load HL registers with the contents of
4104 Address 4500, 4501
4105
4106 MOV B,L Move the content of L-register to B
register
4107 MOV D,H Move the content of H-register to D
register.
4108 LHLD 4502 Load HL registers with the contents of
4109 Address 4502, 4503
410A
410B MOV A,L Move the content of L-register to
Accumulator
410C SUB B Subtract B register content from
accumulator content
410D STA 4600 Store accumulator content to address
4600
410E
410F
4110 MOV A,H Move the content of H-register to
Accumulator
4111 SBB D Subtract with borrow,D register content
from accumulator content
4112 JNC L1 Jump on no carry to label location L2
4113
4114
4115 INR C Increment C register
4116 L1 STA 4601 Store accumulator content to address
4601
4117
4118
4119 MOV A,C Move the content of C-register to
Accumulator
411A STA 4602 Store accumulator content to address
4602
411B
411C
411D HLT Halt the program execution
PROCEDURE:

1. Key in the opcodes.


2. Give the input data at specified memory locations.
3. Execute the program.
4. Check the results at specified output locations.

OBSERVATION :

16-bit Addition Address Data


Input 4500 08
4501 03
4502 04
4503 07
Output 4600 0C ( LSB Sum)
4601 0A ( MSB Sum)
4602 00 ( Carry)

16-bit Subtraction Address Data


Input 4500 08
4501 0A
4502 09
4504 0B
Output 4600 01
4601 01
4602 00

Result:

Thus the assembly language programs for 16-bit addition and subtraction are
written, executed and the results are verified.
3. 16-BIT MULTIPLICATION AND DIVISION

AIM:

To write an assembly language program


(i) to multiply two 16-bit numbers and
(ii) to divide two 16-bit numbers

APPARATUS REQUIRED:

8085 Kit and Power supply

ALGORITHM:

16-BIT MULTIPLICATION:

1. Initialize a register pair for carry.


2. Get the two 16-bit input data (multiplier and multiplicand) directly in register
pairs.
3. Clear HL register pair for repeated addition and have multiplier as count.
4. Add multiplicand with HL register pair content.
5. Check for carry. If carry =1, goto next step, else goto step 7.
6. Increment the carry register.
7. Decrement the 16-bit count (Multiplier).
8. Check for count. If count=0, goto next step, else goto step 4.
9. Store the result and carry in memory locations.
10. Stop program execution.

PROGRAM:

Address Opcode Label Mnemonics Comments


4101 LXI B,0000 Load immediate 0000 to BC register pair
4102
4103
4104 LHLD 4500 Load HL registers with the contents of
Address 4500, 4501
4105
4106
4107 SPHL Move the content of HL-registers to
stack pointer register.
4108 LHLD 4502 Load HL registers with the contents of
Address 4502, 4503
4109
410A
410B XCHG Exchange the contents of HL and DE
register pairs
410C LXI H,0000 Load immediate 0000 to HL register pair
410D
410E
410F L2 DAD SP Add the content of stack pointer register
to HL register pair
4110 JNC L1 Jump on no carry to label location L1
4111
4112
4113 INX B Increment BC register pair
4114 L1 DCX D Decrement DE register pair
4115 MOV A,E Move the content of E-register to
Accumulator
4116 ORA D Logigally OR the content of D register to
accumulator
4117 JNZ L2 Jump on no zero to label location L2
4118
4119
411A SHLD 4600 Store the contents of HL registers to
address 4600,4601
411B
411C
411D MOV L,C Move the content of C-register to L
register
411E MOV H,B Move the content of B-register to H
register
411F SHLD 4602 Store the contents of HL registers to
address 4602,4603
4120
4121
4122 HLT Halt the program execution

16-BIT DIVISION:

ALGORITHM:

1. Initialize a register pair for quotient.


2. Get the two 16-bit data (in HL pair and in a register pair).
3. Save HL pair’s content to stack.
4. Subtract the LSBs and Store the result in L-register.
5. Subtract the MSBs with borrow.
6. Check for carry (borrow). If carry =1, goto step 9, else goto next step.
7. Increment the register pair for quotient.
8. Store the result of subtraction in H-register. Goto step 3.
9. Store the Stack register content (Remainder) and quotient in memory
locations.
10. Stop program execution

PROGRAM:

Address Opcode Label Mnemonics Comments


4101 LXI D,0000 Load immediate 0000 to DE register pair
4102
4103
4104 LHLD 4500 Load HL registers with the contents of
Address 4500, 4501
4105
4106
4107 LXI B, 16- Load immediate 16-bit data to BC
bit data register pair
4108
4109
410A SPHL Move the content of HL-registers to
stack pointer register.
410B MOV A.L
410C SUB C Load immediate 0000 to HL register pair
410D MOV L,A Move the content of L-register to B
register
410E MOV A,H
410F L2 SBB B Add the content of stack pointer register
to HL register pair
4110 JC L1 Jump on no carry to label location L1
4111
4112
4113 INX D Increment BC register pair
4114 L1 MOV H,A Decrement DE register pair
4115 JMP L2 Move the content of E-register to
Accumulator
4116 Logigally OR the content of D register to
accumulator
4117 Jump on no zero to label location L2
4118 LXI H,0000
4119
411A Store the contents of HL registers to
address 4600,4601
411B DAD SP
411C SHLD 4600 Store the contents of HL registers to
address 4600,4601
411D
411E Move the content of B-register to H
register
411F XCHG Exchange the contents of HL and DE
register pairs
4120 SHLD 4602 Store the contents of HL registers to
address 4602,4603
4121
4122
4123 HLT Halt the program execution

PROCEDURE:

1. Key in the opcodes.


2. Give the input data at specified memory locations.
3. Execute the program.
4. Check the results at specified output locations.

OBSERVATION :

16-bit Multiplication Address Data


Input 4500 24(LSB1)
4501 5A(MSB1)
4502 C2(LSB2)
4503 47(MSB2)
Output 4600 48(LSB Product)
4601 4B(LSB Product)
4602 44(MSB Product)
4603 19(MSB Product)

Result:

Thus the assembly language program for 16-bit multiplication is written, executed
and the results are verified.
4. DECIMAL ARITHMETIC AND BIT MANIPULATION

AIM:

To write an assembly language program to


(i) Add and subtract two numbers of 2 digit (8-bit) BCD data.
(ii) Perform bit manipulation using logical instructions

APPARATUS REQUIRED:

8085 Kit and Power supply

BCD ADDITION:

ALGORITHM:

1. Initialize a register for carry.


2. Get the two input data.(One data in accumulator and another in register)
3. Add the two data.
4. Restore the result in BCD.
5. Check for carry. If carry =1, goto next step, else goto step 7.
6. Increment the carry register.
7. Store the result and carry in memory locations.
8. Stop program execution.

PROGRAM:

Address Opcode Label Mnemonics Comments


4101 MVI C,00 Move immediate 00 to C register
4102
4103 LDA 4500 Load Accumulator with the content of
Address 4500
4104
4105
4106 MOV B,A Move the content of accumulator to B
register
4107 LDA 4501 Load Accumulator with the content of
Address 4501
4108
4109
410A ADD B Add B register content to accumulator
content
410B DAA Decimal Adjust Accumulator
410C JNC L1 Jump on no carry to label location L1
410D
410E
410F INR C Increment C register
4110 L1 STA 4601 Store accumulator content to address
4601
4111
4112
4113 MOV A,C Move the content of C-register to
Accumulator
4114 STA 4602 Store accumulator content to address
4602
4115
4116
4117 HLT Halt the program execution

BCD SUBTRACTION:

ALGORITHM:

1. Get the two input data.(Minuend in accumulator and Subtrahend in one


register)
2. Take the 10’s complement of Subtrahend.
3. Add the two data.
4. Restore the result in BCD.
5. Store the result memory.
6. Stop program execution.

PROGRAM:

Address Opcode Label Mnemonics Comments


4101 LDA 4500 Load Accumulator with the content of
Address 4500
4102
4103
4104 MOV B,A Move the content of accumulator to B
register
4105 MVI A,99 Move immediate 00 to A register
4106
4107 SUB B Subtract the content of B-register from
Accumulator content
4108 INR A Increment A register content
4109 MOV B,A Move the content of accumulator to B
registe
410A LDA 4501 Load Accumulator with the content of
Address 4501
410B
410C
410D ADD B Add B register content to accumulator
content
410E DAA Decimal Adjust Accumulator
410F STA 4601 Store accumulator content to address
4601
4110
4111
4112 HLT Halt the program execution

BIT MANIPULATION: (CONVERTING BCD DATA TO BINARY NUMBER)

ALGORITHM:

1. Get the BCD data in one register.


2. Mask the Units number (lower nibble) and get the ten’s number in a register.
3. Clear accumulator.
4. Load the count 10 in a register.
5. Add the Ten’s number to accumulator.
6. Decrement count.
7. Check for zero. if count=0, goto next step else goto step 5.
8. Save the product in a register.
9. Mask the ten’s number (upper nibble) of BCD data.
10. Add the units number in the above step to the product in step 8.
11. Store the binary value.
12. Stop program execution.

PROGRAM:

Address Opcode Label Mnemonics Comments


4101 LDA 4500 Load accumulator with the content of
Address 4500
4102
4103
4104 MOV E,A Move the content of Accumulator to E
register
4105 ANI F0 AND immediate F0, with the content of
accumulator
4106
4107 RLC Rotate accumulator left to carry
4108 RLC Rotate accumulator left to carry
4109 RLC Rotate accumulator left to carry
410A RLC Rotate accumulator left to carry
410B MOV B,A Move the content of Accumulator to B
register
410C XRA A X-OR the content of accumulator
410D MVI C,0A Move immediate 0A to C register
410E
410F L1 ADD B Add the content of B register to
accumulator content
4110 DCR C Decrement C register
4111 JNZ L1 Jump on no zero to label location L1
4112
4113
4114 MOV B,A Move the content of Accumulator to B
register
4115 MOV A,E Move the content of E register to
Accumulator
4116 ANI 0F AND immediate 0F, with the content of
accumulator
4117 ADD B Add the content of B register to
accumulator content
4118 STA 4501 Store accumulator content to address
4501
4119
411A
411B HLT Halt the program execution

PROCEDURE:

1. Key in the opcodes.


2. Give the input data at specified memory locations.
3. Execute the program.
4. Check the results at specified output locations.
OBSERVATION :

BCD Addition Address Data


Input 4500 24
4501 55
Output 4601 79
4602 00

BCD Subtraction Address Data


Input 4500 24
4501 55
Output 4601 31

Bit Manipulation(BCD to Address Data


Binary Conversion)
Input 4500 45(BCD)
Output 4501 2D(Binary)

Result:

Thus the assembly language programs for BCD Addition, BCD Subtraction and
Bit manipulation (BCD to Binary conversion) are written, executed and the results are
verified.
5. CODE CONVERSION

AIM:

To write an assembly language program to


(i) Convert 8-bit Binary data to ASCII code
(ii) Convert ASCII code to Binary number

APPARATUS REQUIRED:

8085 Kit and Power supply

BINARY TO ASCII:

ALGORITHM:

1. Get the data in a register.


2. Mask the upper nibble of binary (Hex) data.
3. Call subroutine CODE to get ASCII code of the lower nibble and store in a
memory.
4. Mask the lower nibble of binary(Hex) input data.
5. Rotate upper nibble to lower nibble position.
6. Call subroutine CODE to get ASCII code of the upper nibble and store in a
memory.
7. Stop.

ALGORITHM FOR SUBROUTINE “CODE”:

1. Compare the nibble in Accumulator with 0A(Hex).


2. If Carry=1, goto step 4, else goto next step.
3. Add 07(Hex) to the nibble in Accumulator.
4. Add 30(Hex) to the nibble in Accumulator.
5. Return to main program.

FLOWCHART:
PROGRAM:

Address Opcode Label Mnemonics Comments


4101 LDA 4200 Load accumulator with the content of
Address 4200
4102
4103
4104 MOV B,A Move the content of Accumulator to B
register
4105 ANI 0F AND immediate 0F, with the content of
accumulator
4106
CALL Code Call the Subroutine labeled “Code”

STA 4201 Store accumulator content to address


4201
MOV A,B Move the content of B register to
accumulator
ANI F0 AND immediate F0, with the content of
accumulator

4107 RLC Rotate accumulator left to carry


4108 RLC Rotate accumulator left to carry
4109 RLC Rotate accumulator left to carry
410A RLC Rotate accumulator left to carry
410B CALL Code Call the Subroutine labeled “Code”
410C
410D
410E STA 4202 Store accumulator content to address
4202
410F
4110
4111 HLT Halt the program execution

4112
4113 Code: CPI 0A Compare immediate 0a with the content
of accumulator
4114
4115 JC L1 Jump on carry to label location L1
4116 ADI 07 ADD immediate 07, with the content of
accumulator
4117
4118 L1 ADI 30 ADD immediate 30, with the content of
accumulator
4119
411A RET Return to main program
OBSERVATION :

Binary(HEX) to ASCII Address Data


Input 4200 E4(HEX)
Output 4201 34(ASCII Code for 4)
4202 45(ASCII code for E)
Result:

Thus the assembly language programs for the code conversion (Binary to ASCII
and ASCII to Binary) are written, executed and the results are verified.

VIVA QUESTIONS:

1. What is the difference between RLC and RAL?


2. What are machine control instructions?
3. How many machine cycles are required for STA 4500?
4. What is T-State?
5. What are I/O related instructions?

MATRIX MULTIPLICATION

AIM:

To write an assembly language program to reform matrix multiplication using


8086.

ALGORITHM:

1. Define the segments and the data for two matrices ant their size using the
respective assembler directives.
2. Get the offset addresses of Matrix 1 & 2 in corresponding index registers.
3. Clear Accumulator and Lower byte of flag register.
4. Multiply the elements of corresponding row and column in sequence, for matrix
multiplication using loop.
5. Store the result and stop execution.

FLOWCHART:
PROGRAM:

ASSUME CS: CODE, DS: DATA


DATA SEGMENT
ROCOL EQU 03H
MAT1 DB 05H, 09H, 0AH,03H, 02H, 07H, 03H, 00H, 09H
MAT2 DB 09H, 07H, 02H, 01H, 00H, 0DH, 07H, 06H, 02H
PMAT3 DW 09H DUP (?)
DATA ENDS
CODE SEGMENT
START : MOV AX, DATA
MOV DS, AX
MOV CH, ROCOL
MOV BX, OFFSET PMAT3
MOV SI, OFFSET MAT1
NEXTROW: MOV DI, OFFSET MAT2
MOV CL, ROCOL
NEXTCOL: MOV DL, ROCOL
MOV BP, 0000H
MOV AX, 0000H
SAHF
NEXT_ELE: MOV AL, [SI]
MUL BYTE PTR [DI]
ADD BP, AX
INC SI
ADD DI, 03
DEC DL
JNZ NEXT_ELE
SUB DI, 08
SUB SI, 03
MOV [BX], BP
ADD BX, 02
DEC CL
JNZ NEXTCOL
ADD SI, 03
DEC CH
JNZ NEXTROW
MOV AH, 4CH
INT 21H
CODE ENDS
END START

PROCEDURE:

1. Type the program in editor pad.


2. Copy it to MASM assembler software.
3. Assemble the program, check for errors.
4. Run the program and check the result.
5. Or transfer the program to kit and execute. Verify the result.

RESULT:

The program for performing 3x3 matrix multiplication is written, executed and
the result is verified.
INTERFACING KEYBOARD/DISPLAY CONTROLLER TO 8085

AIM:
To interface Keyboard/Display controller(8279) with 8085 processor and to
display a particular string.

ALGORITHM: (To display the string “HELLO”)

1. Form the look up table.


2. Move the control word to accumulator and out it through control register.
3. Get the letters one by one from memory and out it.
4. Check whether all letters are displayed. If not, display next character.
5. Stop of program.

FLOWCHART:
PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


4500 21 LXI H, 4600 Load immediate HL register
pair with 4600
4501 00
4502 46
4503 3E MVI A, 10 Move immediate 10 to
accumulator
4504 90
4505 D3 OUT 01 Out it through CR
4506 01
4507 7E L1 MOV A,M Move memory content to
accumulator
4508 D3 OUT 00 Out it through 8279 port
4509 00
450A 23 INX H Increment HL register pair
450B 7D MOV A,L Move the content of L
register to accumulator
450C FE CPI 06 Compare immediate with 06
450D 06
450E C2 JNZ L1 Jump on no zero to label
location L1
450F 07
4510 81
4511 76 HLT Halt the process

PROCEDURE:

1. Key in the opcodes.


2. Give the input data from look up table at the specified memory locations.
3. Execute the program and verify the character display.

Result:

The Keyboard/Display controller is interfaced with 8085 and the character display
is verified.
SIMPLE ARITHMETIC OPERATIONS USING 8051

AIM:

To write an assembly language program to (i) add two 8-bit numbers


(ii) subtract two 8-bit numbers (iii) multiply two 8-bit numbers (iv) divide two 8-bit
numbers.

APPARATUS REQUIRED:

8051 Microcontroller Kit and Power Supply

ALGORITHM:

8-BIT ADDITION:
1. Clear carry flag.
2. Get the first data in accumulator.
3. Add the second data with that of accumulator.
4. Store the result in a memory location.
5. Stop execution.

Flowchart:

PROGRAM:

ADDRESS OPCODES MNEMONICS COMMENTS


4100 C3 CLR C
4101 74 MOV A, #DATA1
4102 34
4103 24 ADDC A, #DATA2
4104 78
4105 90 MOV DPTR, #4150
4106 41
4107 50
4108 F0 MOVX @DPTR, A
4109 80 L1: SJUMP L1
410A FE

ALGORITHM:

8-BIT SUBTRACTION:
1. Clear carry Flag.
2. Get the first data in accumulator.
3. Subtract the second data from that of accumulator.
4. Store the result in a memory location.
5. Stop execution.
6.

FLOCHART:

PROGRAM:

ADDRESS OPCODES MNEMONICS COMMENTS


4100 C3 CLR C
4101 74 MOV A, #DATA1
4102 34
4103 94 SUBB A, #DATA2
4104 24
4105 90 MOV DPTR, #4500
4106 45
4107 00
4108 F0 MOVX @DPTR, A
4109 80 L1: SJUMP L1
410A FE

ALGORITHM:

8-BIT MULTIPLICATION:
1. Get the first data in accumulator.
2. Get the second data in B register.
3. Multiply the two data.
4. Store the result in a memory location.
5. Stop execution.

FLOWCHART:

PROGRAM:

ADDRESS OPCODES MNEMONICS COMMENTS


4100 74 MOV A, #DATA1
4101 0A
4102 75 MOV B, #DATA2
4103 F0
4104 88
4105 A4 MUL AB
4106 90 MOV DPTR, #4150
4107 41
4107 50
4108 F0 MOVX @DPTR, A
4109 A3 INC DPTR
410A E5 MOV A,B
410B F0
410C F0 MOVX @DPTR,A
410D 80 L1: SJUMP L1
410E FE

ALGORITHM:

8-BIT DIVISION:

1. Get the first data (dividend) in accumulator.


2. Get the second data (Divisor) in B register.
3. Divide the two data.
4. Store the result in a memory location.
5. Stop execution.

FLOWCHART:

PROGRAM:

ADDRESS OPCODES MNEMONICS COMMENTS


4100 74 MOV A, #DATA1
4101 65
4102 75 MOV B, #DATA2
4103 F0
4104 08
4105 84 DIV AB
4106 90 MOV DPTR, #4150
4107 41
4107 50
4108 F0 MOVX @DPTR, A
4109 A3 INC DPTR
410A E5 MOV A,B
410B F0
410C F0 MOVX @DPTR,A
410D 80 L1: SJUMP L1
410E FE
PROCEDURE:

1. Enter the opcodes and data.


2. Execute the program and verify the results at specified memory locations.

OBSERVATION:

RESULT:

The assemble language programs for addition, subtraction, multiplication and


division operation are written, executed and the results are verified.

Você também pode gostar