开发者

First ASM program

Hello, I'm trying to run my first ASM 8086 program on MASM on Windows Vista 64bit OS.

I put this program on my MASM editor:

.model small
.stack
.data
message   db "Hello world, I'm learning Assembly !!!", "$"

.code

main   proc
mov   ax,seg message
mov   ds,ax

mov   ah,09
lea   dx,message
int   21h

mov   ax,4c00h
int   21h
main   endp
end main

and the MASM editor gives me this output that I got no idea what's wrong with the program:


 Assembling: D:\masm32\First.asm
D:\masm32\First.asm(9) : error A2004: symbol type conflict
D:\masm32\First.asm(19) : warning A4023: with /coff switch, leading underscore required for start address : main
_
Assembly Error

Where is the problem with this code? This is my first ASM program please remember. Thank you开发者_运维技巧 :)


Platforms that use C a lot tend to like having an underscore before function names, depending on calling convention and executable format (hence the "with /coff switch" warning). Try adding one to the function name?

BTW, does Vista 64-bit even support 16 bit code? I was told it was one of the things that got dropped...see http://en.wikipedia.org/wiki/Windows_on_Windows .


Your best bet is to probably install an XP virtual machine. Fire that baby up and then install MASM32 Then get yourself a copy of the 16bit linker: 16 bit linker

Then try again.

Since you are using segments, you require 16 bit assembly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜