Saturday, June 29, 2013

Write an assembly language program to display the string “microprocessor” using 16-bit microprocessor code. Assume any necessary data.



model small
·         stack 32h
·         data
string db “microprocessor$”
·         code
main proc
mov ax, @data
mov ds, ax
mov dx, offset string
mov ah,09h
int 21h
·         exit
main endp
end main
Program Analysis:
‘data’ creates an array in the memory. ‘db’ is specified for 8-dit data manipulation ‘string’ is the name of array. ‘$’ represent the end of array element. ‘@’ is used to send the address of array in ax. Since the address of each array element is not same ‘offset’ defines the different address for different element and send it to dx.
‘’mo\v ah,09h
int 21h” is the syntax to display the string.

3 comments: