Created
December 6, 2020 02:49
-
-
Save codekittie/4a7a26921cf3397458eb90173914fbb9 to your computer and use it in GitHub Desktop.
Print a pyramid of stars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global _start | |
SECTION .text | |
_start: | |
mov r8, 1 | |
loop: | |
mov rax, 1 | |
mov rdi, 1 | |
mov rsi, star | |
mov rdx, r8 | |
syscall | |
mov rax, 1 | |
mov rdi, 1 | |
mov rsi, newline | |
mov rdx, 1 | |
syscall | |
add r8, 1 | |
cmp r8, 10 | |
jg return | |
jmp loop | |
return: | |
mov rax, 60 | |
mov rdi, 0 | |
syscall | |
section .data | |
star: db "**********" | |
newline: db 10 |
Author
codekittie
commented
Dec 6, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment