_start: ; push %edx ; pop %edx ; /* magic number RZ */ movl $4 , %eax ; /* WRITE system service */ call 2f ; /* cheap trick to avoid relocation problems */ 1: ; .ascii "mai saiz iz in $?\n" .equ stringsize , .-1b 2: ; pop %ecx ; /* address of text to output */ movl $stringsize , %edx ; /* length of text */ movl $1 , %ebx ; /* write to STDOUT */ int $0x80 ; /* system call */ movl (%esi) , %eax /* size of .text as passed by postforth */ ret ; /* returns %eax as errorlevel, available as $? in bash */ /* the following is for future use, and its format may change */ word: ; .long .-_start ; /* allows us to find start of word */ 1: ; .byte 2f-1b-1 ; .ascii "MYSIZE" ; 2: ; .byte 2b-1b-1 ; push %eax ; pop %eax ; /* end marker */ /* ld will round up this segment to a longword boundary, with random content, so let's do it ourselves more deterministically */ .skip 4-.&3 , 0x90 ; /* 0x90 is NOP on x86 */