Keresés

Aktív témák

  • angelka

    csendes tag

    Sziasztok,

    Valaki, megnézné nekem mi a baj ezzel a kóddal?

    section .text
    global main

    main

    mov eax,4
    mov ebx,1
    mov ecx, szoveg1
    mov edx,[szhossz1]
    int 0x80

    mov eax, 3 ; 3 is recognized by the system as meaning "input"
    mov edx, 2 ; input length (one byte)
    mov ecx,v1 ; address to pass to
    mov ebx, 1 ; read from standard input
    int 0x80 ; call the kernel

    mov eax,4
    mov ebx,1
    mov ecx,szoveg2
    mov edx,[szhossz2]
    int 0x80

    mov eax, 3
    mov edx, 2
    mov ecx, v2
    int 0x80

    mov eax,v1
    mov ecx,v2
    add eax,ecx

    mov eax,[esp+4]
    xor edx,edx
    mov ebx,[eax+9]
    mov ecx,10
    osztas:
    div ecx
    add dl,'0'
    mov [ebx],dl
    dec ebx
    cmp eax,0
    je vege
    mov edx,0
    jmp osztas
    vege:
    mov eax,4
    mov ebx,1
    mov ecx,uzenet
    mov edx,adat-uzenet
    int 0x80
    mov eax,4
    mov ebx,1
    mov ecx,adat
    mov edx,11
    int 0x80
    ret

    segment .data

    szoveg1 db "Kerem az elso szamot!",0xA
    szhossz1 db szhossz1-szoveg1
    szoveg2 db "Kerema masodik szamot!", 0xA
    szhossz2 db szhossz1-szoveg2
    uzenet db "A kapott szam: ", 0xA
    adat db " ", 0xA

Aktív témák