Run Code
|
API
|
Code Wall
|
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 rdx, [a] sub rdx, '0' mul rdx add rax, '0' mov [buf], rax syscall mov rax, [buf] sub rax, '0' mov rdx, [b] sub rdx, '0' div rdx 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
lec4.asm
hello.asm
Input and Display a number
Hex
lec4c
1234
dfsaffdfdsaf
BranchesLab_mSmith_bBrownV1
qw
tarea1