Assembly language - Hello World

2019-12-11 Views Assembly Language127字1 min read
×

引用

MLA
Tim, Q. "Assembly language - Hello World". Serence, 2019, https://blog.blinkstar.cn/post/assembly-language-hello-world/.
APA
Tim, Q. (2019). Assembly language - Hello World. Serence. Retrieved from https://blog.blinkstar.cn/post/assembly-language-hello-world/.

Record of the first program in Assembly Language and the problem of "cannot find msvcrt.inc"

.586

.Model flat, stdcall

include msvcrt.inc
includelib msvcrt.lib

.data
text db "Hello World", 0

.code 
main proc
	invoke crt_printf, addr text
    ret
main ENDP
END main

I compile this code in Visual Studio 2017. It shows an error when I debug this program.

❌ Cannot find msvcrt.inc

On the Internet, it seems that no one has the same question like me. It seems that visual studio 2017 lacks some library about Assembly language. But this problem can be solved in the following procedure:

  1. Download masm32 in this website
  2. Install masm32
  3. Change additional library
  4. Change include path in Microsoft Macro Assembler

The problem is solved now!

EOF