hello

Displaying “Hello World” on the screen is considered to be the most basic and usually first program in every computer programming language. Because normally it gives the basic working or syntax of any language.  The following Program Prints or Display helloworld string on screen using Assembly Language.

 

Assembly Program to Print helloworld String on Screen

.model small          ; tells the assembler to use the small memory model
.stack 100h           ; sets the stack size to 256 bytes (100h in hexadecimal)
.data                 ; declares the start of the data segment

S1 db "Helloworld$"   ; declares a string variable named S1 and initializes it with the value "Helloworld$". The dollar sign is used to terminate the string.

.code                 ; declares the start of the code segment

main proc             ; declares the start of the main procedure
mov ax,@data          ; moves the address of the data segment to the AX register
mov ds,ax             ; moves the value of AX to the DS register, which sets the data segment register to point to the data segment
lea dx,s1             ; loads the effective address of the string S1 into the DX register using the LEA (load effective address) instruction
mov ah,9              ; moves the value 9 into the AH register, which tells the DOS system call to print a string to the console
INT 21h               ; calls the DOS interrupt 21h, which performs the system call with the specified function number and arguments
mov ah,4ch            ; moves the value 4Ch into the AH register, which tells the DOS system call to terminate the program
INT 21h               ; calls the DOS interrupt 21h to terminate the program
main endp             ; declares the end of the main procedure

Leave a Reply

Your email address will not be published. Required fields are marked *