Separate even numbers from given numbers

No comments
Statement :  Writean assembly language program to separate even numbers from the given list of 50 numbers and store them in the another list starting from 2300H. Assume starting address of 50 number list is 2200H.

LXI  H,  2200H      : “Initialize memory pointer 1”
LXI D, 2300H        : “Initialize memory pointer2”
BACK:MOV A, M  : “Get the numbr”
ANI  01H                : “Check for even number”
Microprocessor Programs
JNZ  SKIP          : “If ODD, don’t store”
MOV  A,  M         : “Get the number”
STAX D                : “Store the number in result list”
INX  D                 : “Increment pointer 2”
SKIP: INX  H       : “Increment pointer 1”
DCR  C                : “Decrement counter”
JNZ BACK           : “If not zero, repeat”
HLT                     : “Stop”

No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀