ALp Prog
ALp Prog
ALp Prog
lhld xchg lhld Mov sub Mov Mov sbb Mov Shld hlt
6. b. Write a program to subtract a 16-bit BCD number from another 16-bit BCD number.
lhld xchg lhld Mov Sub daa Mov Mov Sbb daa Mov shld hlt
Lhld f200 mvi a,00 Mov b,a back: add h jnc next inr b next: dcr l jnz back movl,a movh,b shld f300 hlt
9. Write a program to sort the numbers in ascending and in descending order using bubble sort.
Mvi b 08 Rep: Lxi h f200 Movc,b Back: mova,m Inx h Cmp m Jc loc1 Jz loc1 Movd,m Movm,a
9 (a.Assinding)continue
Dcx h Movm,d Inx h Loc1: dcr c Jnz back Dcr b Jnz rep Lxi h f200 Mvi a, 00 Sta fff7
9 (a.Assinding)continue
Mvi a, f2 Sta fff8 Call updad(06bc) Mova,m Sta fff9 Call update(06d3) hlt