汇编语言编程:32位与64位库的使用及调用
1. 32位库程序测试
1.1 文件写入操作
在进行文件写入时,可使用如下代码:
.code
mov eax,fileHandle
mov edx,OFFSET buffer
mov ecx,BUFFER_SIZE
call WriteToFile
对于 WriteToFile 调用后返回值的处理,可参考以下伪代码:
if EAX = 0 then
error occurred when writing to file
call WriteWindowsMessage to see the error
else
EAX = number of bytes written to the file
endif
WriteWindowsMsg 过程用于将应用程序执行系统函数调用时产生的最新错误信息字符串写入控制台窗口。示例调用如下:
call WriteWindowsMsg
示例错误信息字符串如下:
Error 2: The system cannot find the file specified.
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



