Examples of Programs
Examples of Programs
Code SEGMENT
ASSUME CS: Code, DS: Data // Informs the assembler about the correct segments
Code ENDS
END
Q 2) WAP to add a series of 10 bytes stored in the memory from locations 20,000H to
20,009H. Store the result immediately after the series.
Code SEGMENT
LOOP Back
MOV [SI], AX
INT3
Code ENDS
END
Q 3) WAP to transfer a block of 10 bytes from location 20,000H to 30,000H.
Code SEGMENT
INT3
Code ENDS
END
Q 4) WAP to multiply two 16-bit numbers. Operands and result in Data Segment.
Data SEGMENT
A DW 1234H
B DW 1845H
Result DD ?
Data ENDS
Code SEGMENT
ASSUME CS: Code, DS: Data
MOV AX, Data
MOV DS, AX
MOV AX, A
MUL B
LEA BX, Result
MOV [BX], AX
MOV [BX+2], DX
INT3
Code ENDS
END
Q 5) WAP to find “highest” in a given series of 10 numbers beginning from location
20,000H. Store the result immediately after the series.
Code SEGMENT
LOOP Back
MOV [SI], AL
INT3
Code ENDS
END
Q 6) WAP to find the number of –ve numbers in a series of 10 numbers from 20,000H. Store
the result immediately after the series.
Code SEGMENT
LOOP Back
MOV [SI], AH
INT3
Code ENDS
END
Q 7) WAP to SORT a series of 10 numbers from 20,000H in ascending order.
Code SEGMENT
INT3
Code ENDS
END