提交 41db572f 创建 作者: 赵鹏翀's avatar 赵鹏翀

init template

上级
/*.img
/bochs
/Debug
/Release
bochsout.txt
\ No newline at end of file
<?xml version="1.0" encoding="gb2312"?>
<ASMProject Version="1.00" Name="Demo017">
<Configurations>
<Configuration Name="Debug" ConfigurationType="2">
<Tool Name="PreBuildEventTool"/>
<Tool Name="CustomBuildTool"/>
<Tool Name="GCCCompilerTool"/>
<Tool Name="JWASMAssemblerTool" ObjectFormate="5" GenerateDebugInformation="-1" VersionDebugInfo="-1" AdditionalOptions="/W0"/>
<Tool Name="PreLinkEventTool"/>
<Tool Name="GCCLinkerTool"/>
<Tool Name="JWlinkLinkerTool" AdditionalOptions="disable 1014"/>
<Tool Name="PostBuildEventTool"/>
</Configuration>
</Configurations>
<Files>
<Filter Name="Դļ" Filter="asm">
<File RelativePath=".\main.asm">
</File>
</Filter>
</Files>
</ASMProject>
添加文件
assume cs:codesg,ds:data,ss:stack
data segment
dw 0123h, 0456h, 0789h, 0abch, 0defh, 0fedh, 0cbah, 0987h
data ends
stack segment
dw 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
stack ends
codesg segment
start:
mov ax, start
mov ss, ax
mov sp, 20h ;设置栈顶ss:sp指向stack:20
mov ax, data
mov ds, ax ;ds指向data段
mov bx, 0 ;ds:bx指向data段中的第一个单元
mov cx, 8
s: push [bx]
add bx, 2
loop s ;使用循环将data段中的0~15单元中的8个字型数据依次入栈
mov bx, 0
mov cx, 8
s0: pop [bx]
add bx, 2
loop s0 ;使用循环出栈8个字型数据到data段的0~15单元中
mov ax,4c00h
int 21h
codesg ends
end start
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论