MMC lab o2 code
an anonymous user
·
Assembly
·

%macro disp 4 mov rax,%1 mov rdi,%2 mov rsi,%3 mov rdx,%4 syscall %endmacro section .data arr dd 1216.23,2384.55,1451.65,1001.11,2442.22,5512.66,8845.45 divi dd 9 hundred dd 100 point db '.' section .bss m1 resd 1 m2 rest 1 c1 resb 1 c2 resb 1 temp resb 1 result resb 1 section .text global _start _start: mov rsi,arr mov cx,7 fldz up: fadd dword[rsi] add rsi,4 dec cx jnz up fdiv dword[divi] fst dword[m1] fmul dword[hundred] fbstp tword[m2] call display mov rax, 60 mov rdi, 0 syscall display: mov rbp,m2 mov byte[c1],10 add rbp,9 next: cmp byte[c1],1 jne skip disp 1,1,point,1 skip: mov al,[rbp] mov byte[c2],02 up1: rol al,04 mov [temp],al and al,0fh cmp al,09 jbe ad add al,07h ad: add al,30h mov [result],al disp 1,1,result,1 mov al,[temp] dec byte[c2] jnz up1 dec rbp dec byte[c1] jnz next ret
Click on the Run button to get started.
The code/input has changed since you last clicked on Run. Click it
again to see the updated changes.
Comments