

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
In this pdf all the things in assembly level programming covered from basics to advanced Subject DTM,25-26.
Typology: Study notes
1 / 2
This page cannot be seen from the preview
Don't miss anything!


Assembly Language Programs
16. Addition, Subtraction, Multiplication, Division
(a) Addition MVI A,05H MVI B,03H ADD B HLT
(b) Subtraction MVI A,09H MVI B,04H SUB B HLT
(c) Multiplication (by repeated addition) MVI A,03H MVI B,04H MVI C,00H BACK: ADD C DCR B JNZ BACK HLT
(d) Division (by repeated subtraction) MVI A,08H MVI B,02H MVI C,00H NEXT: SUB B INR C CMP B JNC NEXT HLT
17. Find Largest and Smallest Number
(Largest) LXI H,2050H MVI C,05H MOV A,M BACK: INX H CMP M JC SKIP MOV A,M SKIP: DCR C JNZ BACK STA 2070H HLT
(Smallest) Change JC SKIP to JNC SKIP.
18. Block Transfer of Data
19. Arrange Numbers in Ascending / Descending Order
(Ascending) LXI H,2050H MVI C,05H NEXT: LXI H,2050H MVI D,04H AGAIN: MOV A,M INX H CMP M JC SKIP MOV B,M MOV M,A DCX H MOV M,B INX H SKIP: DCR D JNZ AGAIN DCR C JNZ NEXT HLT
(Descending) Change JC SKIP to JNC SKIP.