Laboratory 1: H, 3080H C, 0AH A B, A LOOP2: M Loop1 B LOOP1: H C Loop2 H, B L, A 3090H
Laboratory 1: H, 3080H C, 0AH A B, A LOOP2: M Loop1 B LOOP1: H C Loop2 H, B L, A 3090H
1. Write a program to add 10 bytes of data at memory location starting at 3080H and store the result at 3090H ANS: LXI H, 3080H MVI C,0AH XRA A MOV B,A LOOP2: ADD M JNC LOOP1 INR B LOOP1: INX H DCR C JNZ LOOP2 MOV H,B MOV L,A SHLD 3090H HLT 2. WAP to check whether the 10 numbers at memory location starting from 3080H are greater than 80H. If they are greater than 80H, change bit D5 of those data. ANS: LXI H,3080H MVI C,0AH LOOP2: MOV A,M CPI 80H JC LOOP1 XRI 20H MOV M,A LOOP1: INX H DCR C JNZ LOOP2 HLT 3. WAP to find the largest number among the 10 data stored in memory location starting from 3080H and store the result at memory location 3090H ANS: LXI H, 3080H MVI C,0AH MOV A,M LOOP2: INX H CMP M JNC LOOP
4. WAP to count the negative number among the 10 data stored in memory location starting from 3080H and store the result at memory location 3090H ANS: LXI H,9000H MVI C,0AH MVI B,00H LOOP2: MOV A,M RLC JNC LOOP1 INR B LOOP1: INX H DCR C JNZ LOOP2 MOV A,B STA 9100 HLT