Skip to content

Restore EAX value before returning sprint #54

Description

@NeoSahadeo

Howdy,

Not sure if this is an issue-issue but the value in sprint for EAX is never restored which causes segfaults on repeated calls.

;------------------------------------------
; void sprint(String message)
; String printing function
sprint:
    push    edx
    push    ecx
    push    ebx
    push    eax
    call    slen
 
    mov     edx, eax
    pop     eax
 
    mov     ecx, eax
    mov     ebx, 1
    mov     eax, 4
    int     80h
 
    mov     eax, ecx ; <---- restore the contents of eax
    pop     ebx
    pop     ecx
    pop     edx
    ret

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions