vscode搭建汇编开发环境
开发示例
新建hello.asm
输入下列代码
data segment ;数据段
string db 'helloworld$'
data ends
code segment ;代码段
assume cs:code,ds:data
start:
mov ax,data ;获取段基址
mov ds,ax ;将段基址送入寄存器
mov dx,offset string
mov ah,9
int 21h
mov ah,4ch
int 21h
code ends
end start
后记(重要)
改用MASMplus
非常好用!!!!!
示例代码
.386
.model flat,stdcall
option casemap:none
include windows.inc
include user32.inc
includelib user32.lib
include kernel32.inc
includelib kernel32.lib
;数据段
.data
szCaption db "好一个汇编",0
szText db "hello world",0
;代码段
.code
start:
INVOKE MessageBox,NULL,addr szText,addr szCaption,MB_OK
INVOKE ExitProcess,NULL
end start
运行结果
可得到hello.exe文件