习题6.14
使用条件控制.if和循环控制.while伪指令编写习题4.21程序,并生成完整的列表文件 xor eax,eax xor ebx,ebx mov ecx,lengthof string .while (ecx !=0) .if (string[ebx]==20h) inc eax .endif inc ebx dec ecx .endw
习题6.15
调用GetCommandLine函数,可以从eax返回指向命令行输入字符串(包含路径、文件名和参数)。要求编程利用MessageBox函数输出这个字符串。 .686 .model flat,stdcall option casemap:none includelib ..\\lib\\kernel32.lib includelib ..\\lib\%user32.lib ExitProcess proto,:dword
MessageBoxA proto :dword,:dword,:dword,:dword MessageBox equ
GetCommandLineA proto
GetCommandLine equ
szCaption byte '命令行内容' .code start:
; 主程序
invoke GetCommandLine
invoke MessageBox,0,eax,addr szCaption,MB_OK invoke ExitProcess,0 ; 子程序 end start
习题6.16
在windows窗口应用程序中例6-11的基础上,增加单击鼠标右键弹出另一个消息窗口的功
能,在masm32开发环境生成可执行文件。