.global _start .global myinit //temporary quickfix / test _start: // ALIGN stack //push %ebx //push %ecx //cmp $0,_impure_ptr //jne skipzero //movl $0xf5000000, _impure_ptr //mov $0xf5000000,%ebx //allzero: //movl $0, (%ebx) //add $4, %ebx //cmp $0xf5001000,%ebx //jne allzero //skipzero: /* mov _impure_ptr,%eax mov $0xf5000000,%ebx copy: mov (%eax),%ecx mov %ecx,(%ebx) add $4, %ebx add $4, %eax cmp $0xf5001000,%ebx jne copy */ movl $0xf5000000, _impure_ptr //call _init # environment adress was passed on stack pop %eax mov %eax, environ pop %ecx pop %ebx and $-16,%esp sub $8,%esp push %ebx push %ecx # call main (argc and argv are on the stack) call main // ALIGN stack and $-16,%esp sub $4,%esp # push exit code and pass to _exit syscall push %eax call exit # this should never be reached! .wait: hlt jmp .wait myinit: call _init ret