Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- includelib libcmt.lib
- includelib libvcruntime.lib
- includelib libucrt.lib
- includelib legacy_stdio_definitions.lib
- extern scanf_s: proc, printf_s: proc
- .data
- inputFormatString byte "%le", 0
- outputFormatString byte "Charge2 = %e Coulombs", 13, 10, 0
- promptMsg byte "Enter the charge q1 [in Coulumbs]: ", 0
- K real8 8.9875e9
- distance real8 0.004
- F real8 1.999438e-2
- .data?
- q1 real8 ?
- q2 real8 ?
- .code
- main proc
- enter 32, 0
- lea rcx, promptMsg ; scanf_s("%d", &num); ;
- call printf_s
- lea rcx, q1
- call scanf_s
- movsd distance, xmm0
- mulsd xmm0, distance
- mulsd xmm0, F
- movsd xmm1, K
- mulsd xmm1, q1
- divsd xmm0, xmm1
- movsd q2, xmm0
- lea rdx, q1
- lea rcx, outputFormatString
- call printf_s
- ;(r * r) * F / K * q1 = q2
- leave
- xor rax, rax
- ret
- main endp
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement