Nahid8195

2nd lab ( Print string)

Oct 24th, 2021
722
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .MODEL SMALL   ; IN THIS COURSE ALL MODEL ARE SMALL
  2. .STACK 100H    ; WE ALWAYS USE STACK 100H
  3. .DATA     ; DATA SEGMENT
  4. MSG DB "HELLO WORLD$"    ; DB - Define Byte. 8 bits,   DW - Define Word. Generally 2 bytes on a typical x86 32-bit system
  5.                          ; $ SIGN IS USE TO END THE STING. IT HELP TO FIND THE STRING ENDING
  6. .CODE
  7.  
  8. MAIN PROC       ; MAIN CODE START HERE
  9.    
  10.     ;PROGRAMME SEGMENT PREFIX
  11.     MOV AX,@DATA
  12.     MOV DS,AX    ; INITILATION OF DS
  13.    
  14.    
  15.      
  16.      LEA DX,MSG   ; FOR STRING PRINT WE USE LEA FUNCTION TO LOAD THE STRING ; [FULL MEANING LEA : LOAD EFFICIENT ADRESS]              
  17.      MOV AH,9     ; FOR STRING PRINT WE USE AH,9 WHICH PRINT MY LOADED STRINT WHICH WAS MSG
  18.      INT 21H      ; IT WILL INTRUPT THE WORK.  
  19.    
  20.    
  21.    
  22.     MOV AX,4CH ; TERMINATED THE CODE AND EXIT
  23.     INT 21H
  24.     MAIN ENDP
  25. END MAIN                
RAW Paste Data