Skip to content

Instantly share code, notes, and snippets.

@Theoistic
Last active February 21, 2021 08:33
Show Gist options
  • Save Theoistic/1ee4b97a70c579b63162697a3d2ff22c to your computer and use it in GitHub Desktop.
Save Theoistic/1ee4b97a70c579b63162697a3d2ff22c to your computer and use it in GitHub Desktop.
Some TikTok Panda Stuff
.intel_syntax noprefix
.global main
pandas:
.string "PANDA"
.zero 4
.string "THUNDER"
.zero 2
.string "TENT"
.zero 5
.string "PEN"
.zero 6
x:
.zero 4
x2:
.zero 4
main:
push rbp
mov rbp, rsp
mov DWORD PTR x[rip], 0
jmp .L2
.L5:
mov DWORD PTR x2[rip], 0
jmp .L3
.L4:
mov eax, DWORD PTR x[rip]
movsx rdx, eax
mov rax, rdx
sal rax, 2
add rax, rdx
add rax, rax
add rax, OFFSET FLAT:pandas
mov rdi, rax
call puts
mov edi, 400
call delay
mov eax, DWORD PTR x2[rip]
add eax, 1
mov DWORD PTR x2[rip], eax
.L3:
mov eax, DWORD PTR x2[rip]
cmp eax, 8
jle .L4
mov eax, DWORD PTR x[rip]
add eax, 1
mov DWORD PTR x[rip], eax
.L2:
mov eax, DWORD PTR x[rip]
cmp eax, 3
jle .L5
mov eax, 0
pop rbp
ret
delay:
push rbp
mov rbp, rsp
sub rsp, 48
mov DWORD PTR [rbp-36], edi
mov eax, DWORD PTR [rbp-36]
cdqe
imul rax, rax, 1000
mov QWORD PTR [rbp-16], rax
call clock
mov QWORD PTR [rbp-24], rax
mov rax, QWORD PTR [rbp-24]
mov QWORD PTR [rbp-8], rax
jmp .L8
.L9:
call clock
mov QWORD PTR [rbp-8], rax
.L8:
mov rax, QWORD PTR [rbp-8]
sub rax, QWORD PTR [rbp-24]
cmp QWORD PTR [rbp-16], rax
jg .L9
nop
nop
leave
ret
@Theoistic
Copy link
Author

updated to be GCC 10.2 compatible

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