0

I have the following code:

    %include "io.inc"

section .data
msg db 'Hello World...$'

section .text
global CMAIN
CMAIN:
    ;write your code here

     mov ah,09
     mov dx,OFFSET msg
     int 21h
     xor eax, eax
     xor dx,dx
     ret

and it gets the next error:

[19:28:32] Warning! Errors have occurred in the build: C:/Users/user/AppData/Local/Temp/SASM/program.asm:12: error: comma, colon, decorator or end of line expected after operand gcc.exe: error: C:/Users/user/AppData/Local/Temp/SASM/program.o: No such file or directory

What is the problem? i'm using sasm ide.

ByoTic
  • 103
  • 8

1 Answers1

3

This is TASM/MASM syntax:

mov dx,OFFSET msg

When using NASM you'd simply write:

mov dx,msg
Michael
  • 57,169
  • 9
  • 80
  • 125
  • now there's another error for the same line: COFF format does not support non-32-bit relocations – ByoTic Oct 27 '14 at 17:38
  • 1
    You're writing real-mode DOS code. Such code would have to be compiled into a DOS EXE or COM file, and be executed in DOS (or something that can run DOS executables, like Windows 9x or DOSBox). I don't know what commands the SASM IDE uses to build. – Michael Oct 27 '14 at 17:40