section .text
global _start
_start:
mov eax, 16
; divide by 2
mov ebx, eax
shr ebx, 1
; divide by 4
mov ecx, eax
shr ecx, 2
; divide by 8
mov edx, eax
shr edx, 3
; multiply by 2
mov esi, eax
shl esi, 1
; multiply by 4
mov edi, eax
shl edi, 2
; multiply by 8
mov eax, 16
shl eax, 3
mov rax, 60
xor rdi, rdi
syscall
; Q2
mov eax, 20
mov ebx, 10
mov ecx, eax
add ecx, ebx
mov edx, eax
sub edx, ebx
cmp eax, ebx
jg larger
mov esi, ebx
jmp done
larger:
mov esi, eax
done:
; Q3
mov eax, 7
mov ecx, 5
repeat:
; display eax
loop repeat
To embed this project on your website, copy the following code and paste it into your website's HTML: