The system calls are called by ASM code
#define BUF_SIZE 1024 #define READ 3 #define WRITE 4 #define FD 0 void main(){ int __res; char __str[BUF_SIZE]; //__res = read(0,__str,BUF_SIZE) __asm__ volatile ("int $0x80" : \ "=a" (__res) : \ "a" (READ), \ "b" (FD), \ "c" (__str), \ "d" (BUF_SIZE)); //write(0,__str,__res) __asm__ volatile ("int $0x80" : : \ "a" (WRITE), \ "b" (FD), \ "c" (__str), \ "d" (__res)); }
No comments:
Post a Comment