当前位置:网站首页>VS code 编写汇编代码【微机原理】
VS code 编写汇编代码【微机原理】
2022-06-11 23:13:00 【日星月云】
VS code 编写汇编代码【微机原理】
前言
以下内容源自xxx
仅供学习交流使用
请您阅读文章声明,默认同意该声明
推荐
汇编的初体验【微机原理】
使用 VS Code 进行 x86 汇编语言 MASM Dosbox Debug (仅适用 Windows 平台)
VS code 编写汇编代码
第一步 添加插件

第二步 打开文件

我打开的是E:/masm
第三步 编写文件
为了演示新建一个testVC文件夹
在testVC下新建一个hello.asm文件
编写hello.asm
data segment
x db 1
y db 2
sum db ?
string db "The result of x+y=$"
data ends
code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov dx,offset string
mov ah,09h
int 21h
mov al,x
add al,y
mov sum,al
add al,30h
mov dl,al
mov ah,02h
int 21h
mov ah,4ch
int 21h
code ends
end start
第四步 选择编译器
点击jsdos
选择 dosbox MASM-v6.11
底部变化
注意
根据自己需求,设置汇编环境
如果发现窗口不是你想要的,
请检查你的汇编环境
例如
在jsdos Test下
调试窗口是这样的
F8-step是单步调试
第五步 运行程序
右键–运行
结果
会发现我们的程序应该是hello
但是这却是test程序
第六步 调试程序
右键–调试
结果

会发现我们的程序应该是hello
但是这却是test程序
第七步 补充一
在VS code下
不会产生.obj文件和.exe文件
右键–打开DOS环境
结果
dir命令
会发现只有一个文件
其实test.asm是DOS环境下hello.asm的拷贝
Windows下hello.asm,
可以看到大小:482 字节
证明猜想
masm test
link test
test
debug test.exe
它和hello.asm对应的语句是一样的
第八步 补充二
DOS环境下hello.asm文件会变成test.asm
如果testVC下再新建一个.asm文件会咋样?
hello2.asm
data segment
x db 11101110b
y db 11001000b
data ends
code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov al,x
add al,y
mov ah,4ch
int 21h
code ends
end start
会发现
还是只有一个test.asm文件

结论
VS code提供的dos环境是互相隔离的
就算你同时打开两个dos环境
这两环境也是互不影响的
最后
请您阅读文章声明,默认同意该声明
打赏通道
边栏推荐
- 关于腾讯域名解析阿里云服务器的一些坑
- Svn deploys servers and cleints locally and uses alicloud disks for automatic backup
- 2022高压电工考试题模拟考试题库及在线模拟考试
- The top ten trends of 2022 industrial Internet security was officially released
- Research Report on development trend and competitive strategy of global customized power supply industry
- JsonParseException: Unrecognized token ‘username‘: was expecting表单提交登陆数据报错
- The latest "capsule Network Overview" paper of imperial technology, etc., 29 pages of PDF, expounds the concept, method and application of capsule
- C language simple exercise No.17, about the combination of for and while loops
- Common problems of Converged Communication published in February | Yunxin small class
- 想做钢铁侠?听说很多大佬都是用它入门的
猜你喜欢

The second bullet of in-depth dialogue with the container service ack distribution: how to build a hybrid cloud unified network plane with the help of hybridnet

The top ten trends of 2022 industrial Internet security was officially released

A method of relay for ultra long distance wireless transmission of low power wireless module
![[naturallanguageprocessing] [multimodal] albef: visual language representation learning based on momentum distillation](/img/b7/0ccd11bd97aa0e217775b31fff3511.jpg)
[naturallanguageprocessing] [multimodal] albef: visual language representation learning based on momentum distillation

Application of Lora wireless communication module Lora technology in smart home light control

2022年高处安装、维护、拆除操作证考试题库模拟考试平台操作

The latest "capsule Network Overview" paper of imperial technology, etc., 29 pages of PDF, expounds the concept, method and application of capsule

Deconstruction of volatile | community essay solicitation

One to one correspondence of multiple schematic diagrams and PCB diagrams under Altium designer project

通用树形结构的迭代与组合模式实现方案
随机推荐
【Day4 文献精读】Space–time interdependence: Evidence against asymmetric mapping between time and space
我的创作纪念日
基于模板配置的数据可视化平台
Library management system
Try catch
2022年起重机司机(限桥式起重机)考试题模拟考试题库及模拟考试
Here we go! Dragon lizard community enters PKU classroom
2022年R1快开门式压力容器操作考题及在线模拟考试
[day11-12 intensive literature reading] on languages in memory: an internal clock account of space-time interaction
2022 high voltage electrician test question simulation test question bank and online simulation test
【Day1/5 文献精读】Speed Constancy or Only Slowness: What Drives the Kappa Effect
mysql——find_ in_ Set usage
SDNU_ ACM_ ICPC_ 2022_ Weekly_ Practice_ 1st (supplementary question)
Games-101 Yan Lingqi 5-6 lecture on raster processing (notes sorting)
Data processing and visualization of machine learning [iris data classification | feature attribute comparison]
postgresql10 进程
Processus postgresql10
The top ten trends of 2022 industrial Internet security was officially released
Application of Lora wireless communication module Lora technology in smart home light control
[day6-7 intensive literature reading] a unifying Bayesian framework accounting for spatiotemporal interactions with a