summaryrefslogtreecommitdiffstats
path: root/lace_x86.asm
diff options
context:
space:
mode:
Diffstat (limited to 'lace_x86.asm')
-rw-r--r--lace_x86.asm29
1 files changed, 13 insertions, 16 deletions
diff --git a/lace_x86.asm b/lace_x86.asm
index 1cf1e85..1608ba2 100644
--- a/lace_x86.asm
+++ b/lace_x86.asm
@@ -86,11 +86,10 @@ _start:
mov al, 0x66
int 0x80
- xor esi, esi ; pipe(sock_fd, stdin)
- pop edi
+ pop edi ; pipe(fd, stdin)
+ mov ecx, esp
call pipe
-
- inc esi ; pipe(stdout, sock_fd)
+ inc esi ; pipe(stdout, fd)
xchg edi, esi
call pipe
@@ -98,20 +97,18 @@ _start:
inc eax
int 0x80
+pipe_loop:
+ mov edx, eax ; write(edi, ecx, eax)
+ mov ebx, edi
+ mov al, 0x04
+ int 0x80
+
pipe:
- mov dl, 0xff ; read(src, buff, sizeof(buff))
- lea ecx, [esp+4]
+ mov dl, 0xff ; read(esi, ecx, 0xff)
mov ebx, esi
- mov al, 3
+ mov al, 0x03
int 0x80
- cmp eax, 0 ; if finished/error, return
- jg pipe_cont
+ cmp eax, 0 ; eof/error, return
+ jg pipe_loop
ret
-
-pipe_cont:
- mov edx, eax ; write(dst, buff, nb)
- mov ebx, edi
- mov al, 4
- int 0x80
- jmp pipe ; loop