hej, wczesniej tu pytalem o uzycie funkcji z c w assembly ale juz rozwiazalem ten problem i skonczylem program, chce tylko zebyscie sprawdzili czy wszystko jest jak nalezy czy moze powinienem dodac jakiś push albo pop ? dobrze wszystko wrzucilem i zdjalem ze stosu ? Na przyklad nie rozumiem po co wrzucam tutaj na stos EBC a potem go z niego zdejmuje, znajomy polecil to dodac bo 'tak wymaga konwencja C, bo jestem w C mode' ale nie rozumiem po co to, umialby ktos wyjasnic ?
.equ BUFFER_SIZE, 32
.text
.global main
main:
movl $3, %eax
movl $0, %ebx
pushl %ebx
movl $buffer, %ecx
movl $BUFFER_SIZE, %edx
int $0x80
cmpb $'A', buffer
jne dalej
pushl $a_string
call printf
popl %eax
int $0x80
popl %ebx
xor %eax, %eax
ret
dalej:
pushl $b_string
call printf
popl %eax
int $0x80
popl %ebx
xor %eax, %eax
ret
.bss
.lcomm buffer, BUFFER_SIZE
.data
a_string:
.ascii "A string\0"
b_string:
.ascii "B string\0"