Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global main
- extern printf
- l_el: equ 8
- section .data
- napis: db 'nr el: %d',9,'%d',9,'%d',10,0
- tab1: db 1,2,4,8,16,32,64,128
- section .bss
- tab2: resb l_el
- section .text
- main:
- mov rsi,tab1
- mov rdi,tab2
- mov rdx,l_el
- call funkcja
- xor r15,r15
- petla_main:
- xor rax,rax
- mov rdi,napis
- mov rsi,r15
- xor rdx,rdx
- mov dl,[tab1+r15]
- xor rcx,rcx
- mov cl,[tab2+r15]
- call printf
- inc r15b
- cmp r15b,l_el
- jne petla_main
- ret
- funkcja:
- mov al,[rsi+1*rdx-1]
- mov cl,8
- cmp al,0
- jz zapisz
- xor cl,cl
- petla:
- cmp al,128
- jae zapisz
- shl al,1
- inc cl
- jmp petla
- zapisz:
- mov [rdi+rdx-1],cl
- dec rdx
- jnz funkcja
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement