https://github.com/susam/hello Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + By Plan + Enterprise + Teams + Compare all + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} susam / hello Public * Notifications * Fork 1 * Star 17 A 23-byte "hello, world" program assembled with DEBUG.EXE in MS-DOS License MIT license 17 stars 1 fork Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights susam/hello This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 1 branch 0 tags Code * Clone HTTPS GitHub CLI [https://github.com/s] Use Git or checkout with SVN using the web URL. [gh repo clone susam/] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @susam susam Add credits section ... 7564dc3 Oct 30, 2022 Add credits section 7564dc3 Git stats * 5 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time CHANGES.md Use RET instead of INT 21 to terminate program Oct 30, 2022 HELLO.ASM Use RET instead of INT 21 to terminate program Oct 30, 2022 HELLO.COM Use RET instead of INT 21 to terminate program Oct 30, 2022 HELLO.TXT Use RET instead of INT 21 to terminate program Oct 30, 2022 LICENSE.md Add program Jan 9, 2003 README.md Add credits section Oct 30, 2022 View code Programming "Hello, World" in MS-DOS Assemble Unassemble Run Credits License More README.md Programming "Hello, World" in MS-DOS The program HELLO.COM was developed on MS-DOS Version 6.22 using the DOS program named DEBUG.EXE. It is exactly 23 bytes in length. It can be used to print the string "hello, world" followed by newline to standard output. Assemble Here is the complete DEBUG.EXE session that shows how this program was written: C:\>debug -A 1165:0100 MOV AH, 9 1165:0102 MOV DX, 108 1165:0105 INT 21 1165:0107 RET 1165:0108 DB 'hello, world', D, A, '$' 1165:0117 -G hello, world Program terminated normally -N HELLO.COM -R CX CX 0000 :17 -W Writing 00017 bytes -Q C:\>HELLO hello, world C:\> Note that the N (name) command specifies the name of the file where we write the binary machine code to. Also, note that the W (write) command expects the registers BX and CX to contain the number of bytes to be written to the file. When DEBUG.EXE starts, it already initializes BX to 0 automatically, so we only set the register CX to 1A (decimal 26) with the R CX command above. The debugger session inputs are archived in the file named HELLO.TXT, so the binary file named HELLO.COM can also be created by running the following DOS command: DEBUG < HELLO.TXT The binary executable file can be created on a Unix or Linux system using the printf command as follows: printf '\xB4\x09\xBA\x08\x01\xCD\x21\xC3\x68\x65\x6C\x6C\x6F\x2C\x20\x77\x6F\x72\x6C\x64\x0D\x0A\x24' > HELLO.COM Unassemble Here is a disassembly of HELLO.COM to confirm that it has been written correctly: C:\>DEBUG -N HELLO.COM -L -U 100 116 117C:0100 B409 MOV AH,09 117C:0102 BA0801 MOV DX,0108 117C:0105 CD21 INT 21 117C:0107 C3 RET 117C:0108 68 DB 68 117C:0109 65 DB 65 117C:010A 6C DB 6C 117C:010B 6C DB 6C 117C:010C 6F DB 6F 117C:010D 2C20 SUB AL,20 117C:010F 776F JA 0180 117C:0111 726C JB 017F 117C:0113 64 DB 64 117C:0114 0D0A24 OR AX,240A -D 100 116 117C:0100 B4 09 BA 08 01 CD 21 C3-68 65 6C 6C 6F 2C 20 77 ......!.hello, w 117C:0110 6F 72 6C 64 0D 0A 24 orld..$ Run To run this program on MS-DOS, simply enter the following command at the command prompt: HELLO Credits * userbinator for suggesting that MOV AH, 0 and INT 21 instructions to terminate the program can be replaced with RET thus saving 3 bytes. * colejohnson66 for suggesting that moving the string from top to bottom avoids a JMP instruction thus saving 2 bytes. License This is free and open source software. You can use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of it, under the terms of the MIT License. See LICENSE.md for details. This software is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, express or implied. See LICENSE.md for details. More If you liked this repository, see reboot. About A 23-byte "hello, world" program assembled with DEBUG.EXE in MS-DOS Topics dos asm hello-world x86 ms-dos Resources Readme License MIT license Security policy Security policy Stars 17 stars Watchers 1 watching Forks 1 fork Releases No releases published Packages 0 No packages published Languages * Assembly 72.9% * DIGITAL Command Language 27.1% Footer (c) 2022 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.