programmieren-in-rust/aufgaben/sheet10/task1/magic.s
Lukas Kalbertodt 43c17ba30d Add sheet 10
2017-01-11 03:01:00 +01:00

20 lines
321 B
ArmAsm
Executable File

magic:
push rbp
mov rbp, rsp
mov rcx, rdi
mov esi, 2
.LBB0_1:
mov al, 1
cmp rsi, rcx
jae .LBB0_4
xor edx, edx
mov rax, rcx
div rsi
inc rsi
test rdx, rdx
jne .LBB0_1
xor eax, eax
.LBB0_4:
pop rbp
ret