When I try to complile this, I get an error: my_size = my_end - my_start: INVALID use of symbol, is this normal?
All source code:
format ELF
section '.text' executable
public _start
my_start:
get_str_length:
push ebp
mov ebp,esp
push ecx esi
mov esi,dword [ebp+8]
xor ecx,ecx
@@:
lodsb
or al,al
jz @f
inc ecx
jmp @b
@@:
mov eax,ecx
pop esi ecx
mov esp,ebp
pop ebp
ret 4
print_msg:
push ebp
mov ebp,esp
mov esi,[ebp+8]
push esi
call get_str_length
pushad
mov edx,eax
mov ecx,esi
xor ebx,ebx
inc ebx
mov eax,4
int 80h
popad
mov esp,ebp
pop ebp
ret 4
hex2str:
push ebp
mov ebp,esp
pushad
mov edi,[ebp+8]
mov ebx,_table
mov dl,al
shr al,4
xlatb
stosb
mov al,dl
and al,0Fh
xlatb
stosb
popad
mov esp,ebp
pop ebp
ret 4
_table db '0123456789ABCDEF'
print_hex_byte:
push buffer
call hex2str
push buffer
call print_msg
ret
_start:
mov al,13h
call print_hex_byte
xor ebx,ebx
mov eax,ebx
inc eax
int 80h
my_size = my_end - my_start
section '.data' writeable
buffer db 'XX',0
my_end: