Last active
February 11, 2018 06:20
-
-
Save cswingler/ae231564f7dcf92d37f95e52cbcd414f to your computer and use it in GitHub Desktop.
DEBUG.COM Hello World - Commented
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
; This can be run with DEBUG.COM: Run DEBUG.COM < HELLO.ASM. | |
; You'll get a HELLO.COM output that outputs "Hello world!" | |
; This was sourced from http://www2.latech.edu/~acm/helloworld/dosdebug.html, comments are mine. | |
; Switch to DEBUG.COM assemble mode: | |
a | |
mov ah,9 ; 0100 : Put 9 (output to stdout) to ah | |
mov dx,108 ; 0102 : put 0108 in dx (which should contain the string "Hello world!$" ) | |
int 21 ; 0105 : Kick the MS-DOS API, which reads from ah | |
ret ; 0107 : Return from procedure | |
; 0108: Our data: | |
db "Hello world!$" | |
; 0115 : Get out of assemble entry mode with the following empty line: | |
; Write 15 (number of bytes to write to disk) to register cx: | |
r cx | |
15 | |
; Set the output filename: | |
n hello.com | |
; Write the assembled program: | |
w | |
; Quit DEBUG.COM: | |
q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Comments in this are weird. A couple rules I found:
db "Hello world!$"
) cannot have inline comments - the comment will be interpreted as part of the byte sequence.a
ssemble mode) also cannot have inline comments