-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
; Program typu "Hello, world!" urceny pro DOS a prelozitelny assemblerem NASM | ||
; | ||
; preklad pomoci: | ||
; nasm -f bin -o hello.com hello_macros.asm | ||
; | ||
; nebo pouze: | ||
; nasm -o hello.com hello_macros.asm | ||
|
||
;----------------------------------------------------------------------------- | ||
|
||
; ukonceni procesu a navrat do DOSu | ||
%macro exit 0 | ||
mov ah, 0x4c | ||
int 0x21 | ||
%endmacro | ||
|
||
; vyprazdneni bufferu klavesnice a cekani na klavesu | ||
%macro wait_key 0 | ||
xor ax, ax | ||
int 0x16 | ||
%endmacro | ||
|
||
; tisk retezce na obrazovku | ||
%macro print 1 | ||
mov dx, %1 | ||
mov ah, 9 | ||
int 0x21 | ||
%endmacro | ||
|
||
;----------------------------------------------------------------------------- | ||
org 0x100 ; zacatek kodu pro programy typu COM (vzdy se zacina na 256) | ||
|
||
start: | ||
print message | ||
wait_key | ||
exit | ||
|
||
; retezec ukonceny znakem $ | ||
message db "Hello, world!", 0x0d, 0x0a, "$" |