Advertisement
DarkAtom77

Hello world Assembly x86-16 (MS-DOS, Compact Memory Model)

May 28th, 2020
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Hello world program
  2. ; Language: x86 (16-bit) Assembly (Compact Memory Model)
  3. ; Library: MS-DOS interrupts
  4.  
  5. segment code
  6. ..start:
  7.     mov ax, data
  8.     mov ds, ax
  9.     mov ax, stack
  10.     mov ss, ax
  11.     mov sp, stacktop
  12.     mov dx, message
  13.     mov ah, 0x9
  14.     int 0x21
  15.     mov ax, 0x4C00
  16.     int 0x21
  17.  
  18. segment data
  19.     message db 'Hello world!', 0xD, 0xA, '$'
  20.  
  21. segment stack class=stack
  22.     resb 0x400
  23. stacktop:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement