Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
mortgage
;nasm 2.13.02 ;Project 1 - CMSC 313 section .data msg1: db "Enter a principal amount: " len1: equ $-msg1 a: dq '6' b: dq '500' msg2: db "Your mortgage payment is: " len2: equ $-msg2 section .bss buf: resb 256 c: resb 256 section .text global _start _start: mov rax, 1 mov rdi, 1 mov rsi, msg1 mov rdx, len1 syscall mov rax, 0 mov rdi, 0 mov rsi, buf mov rdx, 256 syscall mov rax, 1 mov rdi, 1 mov rsi, buf mov rdx, 241 syscall mov rax, 1 mov rdi, 1 mov rsi, msg2 mov rdx, len2 syscall mov rax, [buf] sub rax, '0' mov rcx, [a] sub rcx, '0' mul rcx add rax, '0' mov [buf], rax mov rax, rbx syscall mov rax, [buf] sub rax, '0' mov rbx, [b] sub rbx, '0' xor rdx, rdx div rbx add rax, '0' mov [buf], rax syscall mov rax, 1 mov rdi, 1 mov rsi, buf mov rdx, 25 syscall mov rax, 60 xor rdi, rdi syscall
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
lec4.asm
khvfkhvh
First Program Group Lab
write
index1
hello.asm
Group Lab 1
Hello world!
displaying 9 stars
Pass
Please log in to post a comment.