Created
May 15, 2019 19:10
-
-
Save MaheKarim/9e2aa2d7056279ef5cd6c0d2c6ff9c9b to your computer and use it in GitHub Desktop.
Assembly Programming Language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;CODE by Mahe Karim | |
;Date: 16 May 2019 | |
.MODEL SMALL | |
.STACK 100H ; stack size 100 hexadecimal | |
.DATA | |
MSG DB "HELLO WORLD! $" | |
; the $ sign means end OF the string | |
; MSG just a variable | |
.CODE ; code segmentation start | |
MAIN PROC ; procedure start from here | |
MOV AX, DATA ; address data to ax | |
MOV DS, AX ; initialize DS | |
; from here we start display message actually msg variable | |
LEA DX, MSG ; get message | |
MOV AH, 9 ; AH, 9 is a string display function | |
INT 21H ; display that msg and executing | |
; return to DOS | |
MOV AH, 4CH | |
INT 21H ; exit from DOS / exit() | |
MAIN ENDP ; main func (main proc) end | |
ENDP ; program end | |
; LEA means Load Effective Address. It's puts the copy of the source address to destination | |
; DATA => is defined by data segment |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment