提交 550a8eb7 创建 作者: 赵鹏翀'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="Demo046">
<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
data segment
db 'conversation', 0
data ends
codesg segment
start:
;将转化以0结尾的字符串中的字母为大写功能的程序安装到0:200处
mov ax, cs
mov ds, ax
mov si, offset capital
mov ax, 0
mov es, ax
mov di, 200h
mov cx, offset capitalend-offset capital
cld
rep movsb
;设置中断向量表,将程序的入口地址保存在7ch表项中,使其成为中断7ch的中断例程
mov ax, 0
mov es, ax
mov word ptr es:[7ch*4], 200h
mov word ptr es:[7ch*4+2], 0
mov ax, data ;将data段中的字符串转化为大写
mov ds, ax
mov si, 0
int 7ch
mov ax, 4c00h
int 21h
capital:
push cx
push si
change:
mov cl, [si]
mov ch, 0
jcxz ok
and byte ptr [si], 11011111b
inc si
jmp short change
ok:
pop si
pop cx
iret
capitalend:
nop
codesg ends
end start
\ No newline at end of file
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论