asm环境配置

asm环境配置

2020-10-18

环境配置

单步

  1. 运行DosBox,将文件夹加载到Dos系统的C盘根目录下
mount c f:file\asm_file\masm
  1. 切换到C盘
c:
  1. 查看有啥文件
dir
  1. 编写文件
.model small
.stack
.data
top_left_x dw ?
top_left_y dw ?
side dw ?
color db ?

.code
line 	proc
		mov al,color
		mov cx,top_left_x
		mov dx,top_left_y
again:	mov ah,0ch
		int 10h
		inc cx
		mov bx,top_left_x
		add bx,side
	cmp cx,bx
		jnz again
		ret
Line	endp

rec		proc
		mov cx,side
repeat: inc top_left_y
		push cx
		call line
		pop cx
		loop repeat
		ret
rec		endp

start:	mov ax,@data
		mov ds,ax
		mov al,12h
		mov ah,0
		int 10h; config screen at 640*480 16 colors mode

		mov top_left_x, 50
		mov top_left_y, 50
		mov color, 1100b
		mov side,100
		call rec
		mov ax,4c00h
		int 21h
end 	start
  1. 编译
tasm example.asm
  1. 链接
tlink example.obj
  1. 运行
example.exe	
  1. 结果如下
image-20201018200448286

配置

C:\Users\lim\AppData\Local\DOSBox打开dosbox-0.74-2.conf

mount c f:file\asm_file\masm
c:
dir

常用的DOS命令

创建目录 md

md file

改变当前目录 cd

cd命令不能改变当前所在的盘

# 回到上一级
cd .. 

# 常规
cd file

# 显示当前目录
cd 

# 回到当前盘
cd\

删除子目录 rd

rm file		

显示目录

dir

路径设置 path

path = f:file\asm_file

文件复制 copy

别忘记了后缀名

copy test.txt copy_test.txt

查看内容

type test.txt	

文件重命名 ren

ren test.txt new_test.txt

删除文件

# 不询问自动删除
del test.txt

# 删除前询问
del test.txt \p

清屏 cls

cls

查看系统版本

ver
  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

bmNkotc2AECynaY6

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值