Statement:A
list of 50 numbers is stored in memory, starting at 6000H. Find number
of negative, zero and positive numbers from this list and store these
results in memory locations 7000H, 7001H, and 7002H respectively.
Source program :
LXI H, 6000H: Initialize memory pointer
MVI C, 00H : Initialize number counter
MVI B, 00H : Initialize negative number counter
MVI E, 00H : Initialize zero number counter
BEGIN:MOV A, M: Get the number
CPI 00H: If number = 0
JZ ZERONUM : Goto zeronum
ANI80H: If MSB of number = 1i.e. if
JNZ NEGNUM number is negative goto NEGNUM
INR D: otherwise increment positive number counter
This Page is a little effort to make you Sharing of some own materials .This is just a Kick-Start to make the aware of Practical World !!! Best of luck.-DHRUVANG SUTHAR
0 Comments