现在的位置: 首页 > 综合 > 正文

第一堂汇编上机

2013年07月31日 ⁄ 综合 ⁄ 共 589字 ⁄ 字号 评论关闭

上机过程如下:

        首先老师给我们一个开发环境(masm 5.1), 比较难用,和Turbo C差不多。把开发环境解压到C盘下然后老师讲解了一些指令后, 我们开始实验。

实验步骤:

在命令行下:cd /       刚开始进入命令行, 回到C盘根目录

              输入edit  hello.asm, 进入到编辑界面

      输入:

  data segment

mag db "hello world!","$"
data ends
code segment

assume cs:code,ds:data

start:

mov ax,data

mov ds,ax

lea dx,msg

mov ah,9

int 21h

mov ah, 21h

int 21h

code ends

end start

这样程序无法正常结束,老师又该了一下, 但没解释为什么

  data segment

mag db "hello world!","$"
data ends
code segment

assume cs:code,ds:data

start:

mov ax,data

mov ds,ax

lea dx,msg

mov ah,9

int 21h

mov ah, 4ch

int 21h

code ends

end start

保存关闭文件

masm hello.asm

link hello.obj

最后运行hello

这些代码都不知道是什么意思, 汗, 老师没讲, 我也没预习。 下课了, 走了, 有些仓促,  还没写完,有时间在改一下。

 

抱歉!评论已关闭.