Last active
December 9, 2023 13:42
-
-
Save MahraibFatima/9ef1e7e07c1bc22888fdc70c19bbf3fe to your computer and use it in GitHub Desktop.
print a string using loop in asm
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
org 100h | |
.data | |
array db 'Hello World!$' | |
.code | |
main proc | |
mov ax, @data | |
mov ds, ax | |
mov si, offset array | |
mov cx, 12 | |
loop1: | |
mov dx, [si] | |
mov ah, 2 | |
int 21h | |
inc si | |
loop loop1 | |
mov ah,4ch | |
int 21h | |
main endp | |
end main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment