nasm dos interrupt (output string)

匆匆过客 提交于 2020-01-06 17:57:49

问题


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.


回答1:


This is TASM/MASM syntax:

mov dx,OFFSET msg

When using NASM you'd simply write:

mov dx,msg


来源:https://stackoverflow.com/questions/26593331/nasm-dos-interrupt-output-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!