macro.asm

;macro.asm
;macros as per 64 bit conventions


%macro print 2
    mov    rax,1        ;print/write
    mov    rdi,1        ;stdout/screen
    mov    rsi,%1    ;msg
    mov    rdx,%2    ;msg_len
    syscall
%endmacro

%macro read 2
    mov    rax,0        ;read
    mov    rdi,0        ;stdin/keyboard
    mov    rsi,%1    ;buf
    mov    rdx,%2    ;buf_len
    syscall
%endmacro

%macro exit 0
    print    nline,nline_len
    mov    rax,60    ;exit
    mov    rdi,0
    syscall
%endmacro
SHARE
    Blogger Comment
    Facebook Comment