首页 > 解决方案 > 装配 IA32 - open() 实现

问题描述

需要用程序集实现系统调用 open(char* string, int flag) 以 WRITE-APPEND 模式打开文件。所以 int 标志将是 O_WRONLY|O_APPEND 的按位或。

ebx - 将包含字符串的内存地址(要打开的文件的路径名)。

ecx - 将包含一个整数,它是 O_WRONLY|O_APPEND 的结果。

al - 将包含 open() 的系统调用号,即 5。

如何计算 O_WRONLY|O_APPEND 来填写 ecx?

标签: linuxassemblyx86system-calls

解决方案


推荐阅读