Сообщение 5 Время повтора? - PullRequest
0 голосов
/ 20 октября 2018

Это мой код с комментариями:

SECTION .data           ; Section containing initialised data

    EatMsg: db "Eat at Joe's!",10
    EatLen: equ $-EatMsg    

SECTION .bss            ; Section containing uninitialized data 

SECTION .text           ; Section containing code
global  _start          ; Linker needs this to find the entry point!    
_start:
nop                     ; This no-op keeps gdb happy...
    mov rax,1           ; Code for Sys_write call
    mov rdi, 1          ; Specify File Descriptor 1: Standard Output
    mov rsi, EatMsg     ; Pass offset of the message
    mov rdx, EatLen     ; Pass the length of the message
    mov R9,  [EatMsg]   ; move the adresse of Msg into R9
    syscall

mov rcx, 5 
DoMore: 
    mov rax, 1          ; Code for Sys_write call
    mov rdi, 1          ; Specify File Descriptor 1: Standard Output
    mov rsi, EatMsg     ; Pass offset of the message
    mov rdx, EatLen     ; Pass the length of the message
    dec rcx         
    jnz DoMore
    syscall             ; Make kernel call  


    mov rax, 1          ; Code for exit
    mov rdi, 0          ; Return a code of zero
    syscall             ; Make kernel call
...