Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .686
- .xmm
- .model flat, c
- includelib libcmt.lib
- includelib libvcruntime.lib
- includelib libucrt.lib
- includelib legacy_stdio_definitions.lib
- extern printf_s : proc
- .data
- array real8 5.0, 2.0, 3.0, 4.5, 7.2,
- 8.3, 1.0, 12.4, 3.0, 6.6,
- 4.0, 2.0, 3.0, 5.0, 9.0,
- 3.0, 6.0, 8.0, 4.1, 3.0
- count dword 0
- outputFormatString byte "The frequency of 3.0 = %d", 13, 10, 0
- THREE real8 3.0
- .const
- numRows equ 4
- numCols equ 5
- .code
- main proc
- mov ebx, offset array
- mov ecx, numRows
- mov edx, type array * numCols
- xor eax, eax
- movsd xmm1, THREE
- L1:
- .while eax < numCols
- movsd xmm0, real8 ptr [ebx + eax * 8]
- comisd xmm0, xmm1
- jne NOT_EQUAL
- inc count;
- NOT_EQUAL:
- inc eax
- .endw
- xor eax, eax
- add ebx, edx
- loop L1
- push count
- push offset outputFormatString
- call printf_s
- add esp, 8
- xor eax, eax
- ret
- main endp
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement