title: FASM HelloWorld .exe program
body: <p>I tried to write my first .exe program on FASM. It works ok when I use org 100h, but I want to compile .exe file. When I replaced first line with "format PE GUI 4.0" and tried to compile it the error occured: "value out of range" (line: mov dx,msg).</p>
  
  <pre><code>ORG 100h      ;format PE GUI 4.0
  
  mov dx,msg
  mov ah,9h
  int 21h
  
  mov ah,10h
  int 16h
  
  int 21h
  
  msg db "Hello World!$" 
  </code></pre>
  
  <p>How should I change the source code?
  <br>----------------------------------------------<br>
  The answer is:</p>
  
  <pre><code>format mz
  org 100h
  
  mov edx,msg
  mov ah,9h
  int 21h
  
  mov ah,10h
  int 16h
  
  mov ax,$4c01
  int 21h
  
  msg db "Hello World!$" 
  </code></pre>