SlideShare a Scribd company logo
Write a program in MIPS that reads in a Roman form number from the user, then output the
number in decimal form.
Write a program in MIPS that reads in a Roman form number from the user, then output the
number in decimal form.
Solution
Answer:
MIPS Assembly Language Program:
.zero 1
RomanNumber::RomanNumber(std::__cxx11::basic_string, std::allocator >):
push rbp
mov rbp, rsp
push rbx
sub rsp, 24
mov QWORD PTR [rbp-24], rdi
mov QWORD PTR [rbp-32], rsi
mov rax, QWORD PTR [rbp-24]
mov rdi, rax
call std::__cxx11::basic_string, std::allocator >::basic_string()
mov rax, QWORD PTR [rbp-24]
mov rdx, QWORD PTR [rbp-32]
mov rsi, rdx
mov rdi, rax
call std::__cxx11::basic_string, std::allocator >::operator=(std::__cxx11::basic_string,
std::allocator > const&)
jmp .L4
mov rbx, rax
mov rax, QWORD PTR [rbp-24]
mov rdi, rax
call std::__cxx11::basic_string, std::allocator >::~basic_string()
mov rax, rbx
mov rdi, rax
call _Unwind_Resume
.L4:
add rsp, 24
pop rbx
pop rbp
ret
.LC0:
.string " is not a Roman Numeral!"
RomanNumber::convert():
push rbp
mov rbp, rsp
sub rsp, 32
mov QWORD PTR [rbp-24], rdi
mov rax, QWORD PTR [rbp-24]
mov rdi, rax
call std::__cxx11::basic_string, std::allocator >::length() const
mov DWORD PTR [rbp-16], eax
mov DWORD PTR [rbp-4], 0
mov BYTE PTR [rbp-5], 0
mov DWORD PTR [rbp-12], 0
mov rax, QWORD PTR [rbp-24]
mov DWORD PTR [rax+32], 0
.L24:
cmp BYTE PTR [rbp-5], 0
jne .L6
mov eax, DWORD PTR [rbp-12]
cmp eax, DWORD PTR [rbp-16]
jge .L6
mov eax, DWORD PTR [rbp-12]
movsx rdx, eax
mov rax, QWORD PTR [rbp-24]
mov rsi, rdx
mov rdi, rax
call std::__cxx11::basic_string, std::allocator >::operator[](unsigned long)
movzx eax, BYTE PTR [rax]
movsx eax, al
sub eax, 67
cmp eax, 21
ja .L7
mov eax, eax
mov rax, QWORD PTR .L9[0+rax*8]
jmp rax
.L9:
.quad .L8
.quad .L10
.quad .L7
.quad .L7
.quad .L7
.quad .L7
.quad .L11
.quad .L7
.quad .L7
.quad .L12
.quad .L13
.quad .L7
.quad .L7
.quad .L7
.quad .L7
.quad .L7
.quad .L7
.quad .L7
.quad .L7
.quad .L14
.quad .L7
.quad .L15
.L13:
mov rax, QWORD PTR [rbp-24]
mov eax, DWORD PTR [rax+32]
lea edx, [rax+1000]
mov rax, QWORD PTR [rbp-24]
mov DWORD PTR [rax+32], edx
cmp DWORD PTR [rbp-4], 999
jg .L16
mov rax, QWORD PTR [rbp-24]
mov eax, DWORD PTR [rax+32]
mov edx, DWORD PTR [rbp-4]
add edx, edx
sub eax, edx
mov edx, eax
mov rax, QWORD PTR [rbp-24]
mov DWORD PTR [rax+32], edx
.L16:
mov DWORD PTR [rbp-4], 1000
jmp .L17
.L10:
mov rax, QWORD PTR [rbp-24]
mov eax, DWORD PTR [rax+32]
lea edx, [rax+500]
mov rax, QWORD PTR [rbp-24]
mov DWORD PTR [rax+32], edx
cmp DWORD PTR [rbp-4], 499
jg .L18
mov rax, QWORD PTR [rbp-24]
mov eax, DWORD PTR [rax+32]
mov edx, DWORD PTR [rbp-4]
add edx, edx
sub eax, edx
mov edx, eax
mov rax, QWORD PTR [rbp-24]
mov DWORD PTR [rax+32], edx
.L18:
mov DWORD PTR [rbp-4], 500
jmp .L17
.L8:
mov rax, QWORD PTR [rbp-24]
mov eax, DWORD PTR [rax+32]
lea edx, [rax+100]
mov rax, QWORD PTR [rbp-24]
mov DWORD PTR [rax+32], edx
cmp DWORD PTR [rbp-4], 99
jg .L19
mov rax, QWORD PTR [rbp-24]
mov eax, DWORD PTR [rax+32]
mov edx, DWORD PTR [rbp-4]
add edx, edx
sub eax, edx
mov edx, eax
mov rax, QWORD PTR [rbp-24]
mov DWORD PTR [rax+32], edx
.L19:
mov DWORD PTR [rbp-4], 100
jmp .L17
.L12:
mov rax, QWORD PTR [rbp-24]
mov eax, DWORD PTR [rax+32]
lea edx, [rax+50]
mov rax, QWORD PTR [rbp-24]
mov DWORD PTR [rax+32], edx
cmp DWORD PTR [rbp-4], 49
jg .L20
mov rax, QWORD PTR [rbp-24]
mov eax, DWORD PTR [rax+32]
mov edx, DWORD PTR [rbp-4]
add edx, edx
sub eax, edx
mov edx, eax
mov rax, QWORD PTR [rbp-24]
mov DWORD PTR [rax+32], edx
.L20:
mov DWORD PTR [rbp-4], 50
jmp .L17
.L15:
mov rax, QWORD PTR [rbp-24]
mov eax, DWORD PTR [rax+32]
lea edx, [rax+10]
mov rax, QWORD PTR [rbp-24]
mov DWORD PTR [rax+32], edx
cmp DWORD PTR [rbp-4], 9
jg .L21
mov rax, QWORD PTR [rbp-24]
mov eax, DWORD PTR [rax+32]
mov edx, DWORD PTR [rbp-4]
add edx, edx
sub eax, edx
mov edx, eax
mov rax, QWORD PTR [rbp-24]
mov DWORD PTR [rax+32], edx
.L21:
mov DWORD PTR [rbp-4], 10
jmp .L17
.L14:
mov rax, QWORD PTR [rbp-24]
mov eax, DWORD PTR [rax+32]
lea edx, [rax+5]
mov rax, QWORD PTR [rbp-24]
mov DWORD PTR [rax+32], edx
cmp DWORD PTR [rbp-4], 4
jg .L22
mov rax, QWORD PTR [rbp-24]
mov eax, DWORD PTR [rax+32]
mov edx, DWORD PTR [rbp-4]
add edx, edx
sub eax, edx
mov edx, eax
mov rax, QWORD PTR [rbp-24]
mov DWORD PTR [rax+32], edx
.L22:
mov DWORD PTR [rbp-4], 5
jmp .L17
.L11:
mov rax, QWORD PTR [rbp-24]
mov eax, DWORD PTR [rax+32]
lea edx, [rax+1]
mov rax, QWORD PTR [rbp-24]
mov DWORD PTR [rax+32], edx
cmp DWORD PTR [rbp-4], 0
jg .L23
mov rax, QWORD PTR [rbp-24]
mov eax, DWORD PTR [rax+32]
mov edx, DWORD PTR [rbp-4]
add edx, edx
sub eax, edx
mov edx, eax
mov rax, QWORD PTR [rbp-24]
mov DWORD PTR [rax+32], edx
.L23:
mov DWORD PTR [rbp-4], 1
jmp .L17
.L7:
mov eax, DWORD PTR [rbp-12]
movsx rdx, eax
mov rax, QWORD PTR [rbp-24]
mov rsi, rdx
mov rdi, rax
call std::__cxx11::basic_string, std::allocator >::operator[](unsigned long)
movzx eax, BYTE PTR [rax]
movsx eax, al
mov esi, eax
mov edi, OFFSET FLAT:std::cout
call std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char)
mov esi, OFFSET FLAT:.LC0
mov rdi, rax
call std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*)
mov esi, OFFSET FLAT:std::basic_ostream >& std::endl >(std::basic_ostream >&)
mov rdi, rax
call std::basic_ostream >::operator<<(std::basic_ostream >& (*)(std::basic_ostream >&))
mov BYTE PTR [rbp-5], 1
mov rax, QWORD PTR [rbp-24]
mov DWORD PTR [rax+32], 0
.L17:
add DWORD PTR [rbp-12], 1
jmp .L24
.L6:
mov rax, QWORD PTR [rbp-24]
mov eax, DWORD PTR [rax+32]
leave
ret
RomanNumber::~RomanNumber():
push rbp
mov rbp, rsp
sub rsp, 16
mov QWORD PTR [rbp-8], rdi
mov rax, QWORD PTR [rbp-8]
mov rdi, rax
call std::__cxx11::basic_string, std::allocator >::~basic_string()
nop
leave
ret
.LC1:
.string "color 1F"
.LC2:
.string "  tt....ROMAN NUMBER TO DECIMAL CONVERTER....  "
.LC3:
.string "  tEnter your input in Roman Number(Plz Keep Caps Lock On): "
.LC4:
.string "  ttRoman Number "
.LC5:
.string " is equals to Decimal "
.LC6:
.string "pause"
main:
push rbp
mov rbp, rsp
push rbx
sub rsp, 136
mov edi, OFFSET FLAT:.LC1
call system
lea rax, [rbp-96]
mov rdi, rax
call std::__cxx11::basic_string, std::allocator >::basic_string()
mov esi, OFFSET FLAT:.LC2
mov edi, OFFSET FLAT:std::cout
call std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*)
mov esi, OFFSET FLAT:.LC3
mov edi, OFFSET FLAT:std::cout
call std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*)
lea rax, [rbp-96]
mov rsi, rax
mov edi, OFFSET FLAT:std::cin
call std::basic_istream >& std::operator>>, std::allocator >(std::basic_istream >&,
std::__cxx11::basic_string, std::allocator >&)
lea rdx, [rbp-96]
lea rax, [rbp-64]
mov rsi, rdx
mov rdi, rax
call std::__cxx11::basic_string, std::allocator >::basic_string(std::__cxx11::basic_string,
std::allocator > const&)
lea rdx, [rbp-64]
lea rax, [rbp-144]
mov rsi, rdx
mov rdi, rax
call RomanNumber::RomanNumber(std::__cxx11::basic_string, std::allocator >)
lea rax, [rbp-64]
mov rdi, rax
call std::__cxx11::basic_string, std::allocator >::~basic_string()
lea rax, [rbp-144]
mov rdi, rax
call RomanNumber::convert()
mov DWORD PTR [rbp-20], eax
mov esi, OFFSET FLAT:.LC4
mov edi, OFFSET FLAT:std::cout
call std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*)
mov rdx, rax
lea rax, [rbp-96]
mov rsi, rax
mov rdi, rdx
call std::basic_ostream >& std::operator<< , std::allocator >(std::basic_ostream >&,
std::__cxx11::basic_string, std::allocator > const&)
mov esi, OFFSET FLAT:.LC5
mov rdi, rax
call std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*)
mov rdx, rax
mov eax, DWORD PTR [rbp-20]
mov esi, eax
mov rdi, rdx
call std::basic_ostream >::operator<<(int)
mov esi, OFFSET FLAT:std::basic_ostream >& std::endl >(std::basic_ostream >&)
mov rdi, rax
call std::basic_ostream >::operator<<(std::basic_ostream >& (*)(std::basic_ostream >&))
mov esi, OFFSET FLAT:std::basic_ostream >& std::endl >(std::basic_ostream >&)
mov rdi, rax
call std::basic_ostream >::operator<<(std::basic_ostream >& (*)(std::basic_ostream >&))
mov edi, OFFSET FLAT:.LC6
call system
mov ebx, 0
lea rax, [rbp-144]
mov rdi, rax
call RomanNumber::~RomanNumber()
lea rax, [rbp-96]
mov rdi, rax
call std::__cxx11::basic_string, std::allocator >::~basic_string()
mov eax, ebx
jmp .L35
mov rbx, rax
lea rax, [rbp-64]
mov rdi, rax
call std::__cxx11::basic_string, std::allocator >::~basic_string()
jmp .L30
mov rbx, rax
lea rax, [rbp-144]
mov rdi, rax
call RomanNumber::~RomanNumber()
jmp .L30
mov rbx, rax
.L30:
lea rax, [rbp-96]
mov rdi, rax
call std::__cxx11::basic_string, std::allocator >::~basic_string()
mov rax, rbx
mov rdi, rax
call _Unwind_Resume
.L35:
add rsp, 136
pop rbx
pop rbp
ret
__static_initialization_and_destruction_0(int, int):
push rbp
mov rbp, rsp
sub rsp, 16
mov DWORD PTR [rbp-4], edi
mov DWORD PTR [rbp-8], esi
cmp DWORD PTR [rbp-4], 1
jne .L38
cmp DWORD PTR [rbp-8], 65535
jne .L38
mov edi, OFFSET FLAT:std::__ioinit
call std::ios_base::Init::Init()
mov edx, OFFSET FLAT:__dso_handle
mov esi, OFFSET FLAT:std::__ioinit
mov edi, OFFSET FLAT:std::ios_base::Init::~Init()
call __cxa_atexit
.L38:
nop
leave
ret
push rbp
mov rbp, rsp
mov esi, 65535
mov edi, 1
call __static_initialization_and_destruction_0(int, int)
pop rbp
ret

More Related Content

Similar to Write a program in MIPS that reads in a Roman form number from th.pdf

Evgeniy Muralev, Mark Vince, Working with the compiler, not against it
Evgeniy Muralev, Mark Vince, Working with the compiler, not against itEvgeniy Muralev, Mark Vince, Working with the compiler, not against it
Evgeniy Muralev, Mark Vince, Working with the compiler, not against it
Sergey Platonov
 
WCTF 2018 binja Editorial
WCTF 2018 binja EditorialWCTF 2018 binja Editorial
WCTF 2018 binja Editorial
Charo_IT
 
Qemu JIT Code Generator and System Emulation
Qemu JIT Code Generator and System EmulationQemu JIT Code Generator and System Emulation
Qemu JIT Code Generator and System Emulation
National Cheng Kung University
 
R/C++ talk at earl 2014
R/C++ talk at earl 2014R/C++ talk at earl 2014
R/C++ talk at earl 2014
Romain Francois
 
Write a Pep8 Assembly program that reads in and stores two integers .pdf
Write a Pep8 Assembly program that reads in and stores two integers .pdfWrite a Pep8 Assembly program that reads in and stores two integers .pdf
Write a Pep8 Assembly program that reads in and stores two integers .pdf
rushabhshah600
 
Visual Studio를 이용한 어셈블리어 학습 part 2
Visual Studio를 이용한 어셈블리어 학습 part 2Visual Studio를 이용한 어셈블리어 학습 part 2
Visual Studio를 이용한 어셈블리어 학습 part 2
YEONG-CHEON YOU
 
Scale17x buffer overflows
Scale17x buffer overflowsScale17x buffer overflows
Scale17x buffer overflows
johseg
 
Answer1).LC0 .string Enter the value of N .LC1 .st.pdf
Answer1).LC0 .string Enter the value of N  .LC1 .st.pdfAnswer1).LC0 .string Enter the value of N  .LC1 .st.pdf
Answer1).LC0 .string Enter the value of N .LC1 .st.pdf
annaiwatertreatment
 
Fix assembly Code new peoblem on call printf gt .pdf
Fix assembly Code new peoblem on call printf gt  .pdfFix assembly Code new peoblem on call printf gt  .pdf
Fix assembly Code new peoblem on call printf gt .pdf
rchopra4
 
A scrupulous code review - 15 bugs in C++ code
A scrupulous code review - 15 bugs in C++ codeA scrupulous code review - 15 bugs in C++ code
A scrupulous code review - 15 bugs in C++ code
PVS-Studio LLC
 
Convert the for loop Into MIPS Instructions. Use the sit instruction .pdf
Convert the for loop Into MIPS Instructions. Use the sit instruction .pdfConvert the for loop Into MIPS Instructions. Use the sit instruction .pdf
Convert the for loop Into MIPS Instructions. Use the sit instruction .pdf
arpitcomputronics
 
Introduction to redis
Introduction to redisIntroduction to redis
Introduction to redis
Tanu Siwag
 
Extend R with Rcpp!!!
Extend R with Rcpp!!!Extend R with Rcpp!!!
Extend R with Rcpp!!!
mickey24
 
Virtual Machine for Regular Expressions
Virtual Machine for Regular ExpressionsVirtual Machine for Regular Expressions
Virtual Machine for Regular Expressions
Alexander Yakushev
 
PBL1-v1-004j.pptx
PBL1-v1-004j.pptxPBL1-v1-004j.pptx
PBL1-v1-004j.pptx
NAIST
 
HHVM on AArch64 - BUD17-400K1
HHVM on AArch64 - BUD17-400K1HHVM on AArch64 - BUD17-400K1
HHVM on AArch64 - BUD17-400K1
Linaro
 
Rcpp: Seemless R and C++
Rcpp: Seemless R and C++Rcpp: Seemless R and C++
Rcpp: Seemless R and C++
Romain Francois
 
R and C++
R and C++R and C++
R and C++
Romain Francois
 
Exploring the x64
Exploring the x64Exploring the x64
Exploring the x64
FFRI, Inc.
 
C++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical ReviewerC++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical Reviewer
Andrey Karpov
 

Similar to Write a program in MIPS that reads in a Roman form number from th.pdf (20)

Evgeniy Muralev, Mark Vince, Working with the compiler, not against it
Evgeniy Muralev, Mark Vince, Working with the compiler, not against itEvgeniy Muralev, Mark Vince, Working with the compiler, not against it
Evgeniy Muralev, Mark Vince, Working with the compiler, not against it
 
WCTF 2018 binja Editorial
WCTF 2018 binja EditorialWCTF 2018 binja Editorial
WCTF 2018 binja Editorial
 
Qemu JIT Code Generator and System Emulation
Qemu JIT Code Generator and System EmulationQemu JIT Code Generator and System Emulation
Qemu JIT Code Generator and System Emulation
 
R/C++ talk at earl 2014
R/C++ talk at earl 2014R/C++ talk at earl 2014
R/C++ talk at earl 2014
 
Write a Pep8 Assembly program that reads in and stores two integers .pdf
Write a Pep8 Assembly program that reads in and stores two integers .pdfWrite a Pep8 Assembly program that reads in and stores two integers .pdf
Write a Pep8 Assembly program that reads in and stores two integers .pdf
 
Visual Studio를 이용한 어셈블리어 학습 part 2
Visual Studio를 이용한 어셈블리어 학습 part 2Visual Studio를 이용한 어셈블리어 학습 part 2
Visual Studio를 이용한 어셈블리어 학습 part 2
 
Scale17x buffer overflows
Scale17x buffer overflowsScale17x buffer overflows
Scale17x buffer overflows
 
Answer1).LC0 .string Enter the value of N .LC1 .st.pdf
Answer1).LC0 .string Enter the value of N  .LC1 .st.pdfAnswer1).LC0 .string Enter the value of N  .LC1 .st.pdf
Answer1).LC0 .string Enter the value of N .LC1 .st.pdf
 
Fix assembly Code new peoblem on call printf gt .pdf
Fix assembly Code new peoblem on call printf gt  .pdfFix assembly Code new peoblem on call printf gt  .pdf
Fix assembly Code new peoblem on call printf gt .pdf
 
A scrupulous code review - 15 bugs in C++ code
A scrupulous code review - 15 bugs in C++ codeA scrupulous code review - 15 bugs in C++ code
A scrupulous code review - 15 bugs in C++ code
 
Convert the for loop Into MIPS Instructions. Use the sit instruction .pdf
Convert the for loop Into MIPS Instructions. Use the sit instruction .pdfConvert the for loop Into MIPS Instructions. Use the sit instruction .pdf
Convert the for loop Into MIPS Instructions. Use the sit instruction .pdf
 
Introduction to redis
Introduction to redisIntroduction to redis
Introduction to redis
 
Extend R with Rcpp!!!
Extend R with Rcpp!!!Extend R with Rcpp!!!
Extend R with Rcpp!!!
 
Virtual Machine for Regular Expressions
Virtual Machine for Regular ExpressionsVirtual Machine for Regular Expressions
Virtual Machine for Regular Expressions
 
PBL1-v1-004j.pptx
PBL1-v1-004j.pptxPBL1-v1-004j.pptx
PBL1-v1-004j.pptx
 
HHVM on AArch64 - BUD17-400K1
HHVM on AArch64 - BUD17-400K1HHVM on AArch64 - BUD17-400K1
HHVM on AArch64 - BUD17-400K1
 
Rcpp: Seemless R and C++
Rcpp: Seemless R and C++Rcpp: Seemless R and C++
Rcpp: Seemless R and C++
 
R and C++
R and C++R and C++
R and C++
 
Exploring the x64
Exploring the x64Exploring the x64
Exploring the x64
 
C++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical ReviewerC++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical Reviewer
 

More from santanadenisesarin13

What does it mean by mRNA coded for by the Operon What does it.pdf
What does it mean by mRNA coded for by the Operon What does it.pdfWhat does it mean by mRNA coded for by the Operon What does it.pdf
What does it mean by mRNA coded for by the Operon What does it.pdf
santanadenisesarin13
 
Variability of a sample can he measured use the following statistic(s.pdf
Variability of a sample can he measured use the following statistic(s.pdfVariability of a sample can he measured use the following statistic(s.pdf
Variability of a sample can he measured use the following statistic(s.pdf
santanadenisesarin13
 
What are the advantages of using a compiled language over an interpr.pdf
What are the advantages of using a compiled language over an interpr.pdfWhat are the advantages of using a compiled language over an interpr.pdf
What are the advantages of using a compiled language over an interpr.pdf
santanadenisesarin13
 
Unbiased estimators Let theta be an estimator of a parameter theta..pdf
Unbiased estimators  Let theta be an estimator of a parameter theta..pdfUnbiased estimators  Let theta be an estimator of a parameter theta..pdf
Unbiased estimators Let theta be an estimator of a parameter theta..pdf
santanadenisesarin13
 
Thomas Lewis said “the capacity to blunder slightly is the real marv.pdf
Thomas Lewis said “the capacity to blunder slightly is the real marv.pdfThomas Lewis said “the capacity to blunder slightly is the real marv.pdf
Thomas Lewis said “the capacity to blunder slightly is the real marv.pdf
santanadenisesarin13
 
The strongest attractive forces between molecules of H_2O are ionic.pdf
The strongest attractive forces between molecules of H_2O are  ionic.pdfThe strongest attractive forces between molecules of H_2O are  ionic.pdf
The strongest attractive forces between molecules of H_2O are ionic.pdf
santanadenisesarin13
 
Q1. An individual who accepts the risks and opportunities entailed b.pdf
Q1. An individual who accepts the risks and opportunities entailed b.pdfQ1. An individual who accepts the risks and opportunities entailed b.pdf
Q1. An individual who accepts the risks and opportunities entailed b.pdf
santanadenisesarin13
 
Question 3 (24 markS) Westcock Shipbuilding Ltd. has a December 31 y.pdf
Question 3 (24 markS) Westcock Shipbuilding Ltd. has a December 31 y.pdfQuestion 3 (24 markS) Westcock Shipbuilding Ltd. has a December 31 y.pdf
Question 3 (24 markS) Westcock Shipbuilding Ltd. has a December 31 y.pdf
santanadenisesarin13
 
Place the following formulas in their proper order A. ALE, residu.pdf
Place the following formulas in their proper order A. ALE, residu.pdfPlace the following formulas in their proper order A. ALE, residu.pdf
Place the following formulas in their proper order A. ALE, residu.pdf
santanadenisesarin13
 
please help i have 40 minsItem 1In the case below, the original .pdf
please help i have 40 minsItem 1In the case below, the original .pdfplease help i have 40 minsItem 1In the case below, the original .pdf
please help i have 40 minsItem 1In the case below, the original .pdf
santanadenisesarin13
 
Need help writing Conways Game of Life. These are the instructions.pdf
Need help writing Conways Game of Life. These are the instructions.pdfNeed help writing Conways Game of Life. These are the instructions.pdf
Need help writing Conways Game of Life. These are the instructions.pdf
santanadenisesarin13
 
Non-Euclidean GeometryWhat statement, if any, can be made about th.pdf
Non-Euclidean GeometryWhat statement, if any, can be made about th.pdfNon-Euclidean GeometryWhat statement, if any, can be made about th.pdf
Non-Euclidean GeometryWhat statement, if any, can be made about th.pdf
santanadenisesarin13
 
Java ProgrammingA Swing button can have more than one action liste.pdf
Java ProgrammingA Swing button can have more than one action liste.pdfJava ProgrammingA Swing button can have more than one action liste.pdf
Java ProgrammingA Swing button can have more than one action liste.pdf
santanadenisesarin13
 
JAVA Write a class called F.pdf
JAVA  Write a class called F.pdfJAVA  Write a class called F.pdf
JAVA Write a class called F.pdf
santanadenisesarin13
 
In the adult, red bone marrow would normally be found in the sternu.pdf
In the adult, red bone marrow would normally be found in the  sternu.pdfIn the adult, red bone marrow would normally be found in the  sternu.pdf
In the adult, red bone marrow would normally be found in the sternu.pdf
santanadenisesarin13
 
I need help with these two questions 4.12 and 4.13 dealing with MATL.pdf
I need help with these two questions 4.12 and 4.13 dealing with MATL.pdfI need help with these two questions 4.12 and 4.13 dealing with MATL.pdf
I need help with these two questions 4.12 and 4.13 dealing with MATL.pdf
santanadenisesarin13
 
I dont understand the min and max Find the smallest positive value.pdf
I dont understand the min and max Find the smallest positive value.pdfI dont understand the min and max Find the smallest positive value.pdf
I dont understand the min and max Find the smallest positive value.pdf
santanadenisesarin13
 
How can the activation of effector molecules within cells be restric.pdf
How can the activation of effector molecules within cells be restric.pdfHow can the activation of effector molecules within cells be restric.pdf
How can the activation of effector molecules within cells be restric.pdf
santanadenisesarin13
 
Explain how the skin of reptiles adaptive for terrestial existence. .pdf
Explain how the skin of reptiles adaptive for terrestial existence. .pdfExplain how the skin of reptiles adaptive for terrestial existence. .pdf
Explain how the skin of reptiles adaptive for terrestial existence. .pdf
santanadenisesarin13
 
Distinguish the roles of the four economic actors in economicsSo.pdf
Distinguish the roles of the four economic actors in economicsSo.pdfDistinguish the roles of the four economic actors in economicsSo.pdf
Distinguish the roles of the four economic actors in economicsSo.pdf
santanadenisesarin13
 

More from santanadenisesarin13 (20)

What does it mean by mRNA coded for by the Operon What does it.pdf
What does it mean by mRNA coded for by the Operon What does it.pdfWhat does it mean by mRNA coded for by the Operon What does it.pdf
What does it mean by mRNA coded for by the Operon What does it.pdf
 
Variability of a sample can he measured use the following statistic(s.pdf
Variability of a sample can he measured use the following statistic(s.pdfVariability of a sample can he measured use the following statistic(s.pdf
Variability of a sample can he measured use the following statistic(s.pdf
 
What are the advantages of using a compiled language over an interpr.pdf
What are the advantages of using a compiled language over an interpr.pdfWhat are the advantages of using a compiled language over an interpr.pdf
What are the advantages of using a compiled language over an interpr.pdf
 
Unbiased estimators Let theta be an estimator of a parameter theta..pdf
Unbiased estimators  Let theta be an estimator of a parameter theta..pdfUnbiased estimators  Let theta be an estimator of a parameter theta..pdf
Unbiased estimators Let theta be an estimator of a parameter theta..pdf
 
Thomas Lewis said “the capacity to blunder slightly is the real marv.pdf
Thomas Lewis said “the capacity to blunder slightly is the real marv.pdfThomas Lewis said “the capacity to blunder slightly is the real marv.pdf
Thomas Lewis said “the capacity to blunder slightly is the real marv.pdf
 
The strongest attractive forces between molecules of H_2O are ionic.pdf
The strongest attractive forces between molecules of H_2O are  ionic.pdfThe strongest attractive forces between molecules of H_2O are  ionic.pdf
The strongest attractive forces between molecules of H_2O are ionic.pdf
 
Q1. An individual who accepts the risks and opportunities entailed b.pdf
Q1. An individual who accepts the risks and opportunities entailed b.pdfQ1. An individual who accepts the risks and opportunities entailed b.pdf
Q1. An individual who accepts the risks and opportunities entailed b.pdf
 
Question 3 (24 markS) Westcock Shipbuilding Ltd. has a December 31 y.pdf
Question 3 (24 markS) Westcock Shipbuilding Ltd. has a December 31 y.pdfQuestion 3 (24 markS) Westcock Shipbuilding Ltd. has a December 31 y.pdf
Question 3 (24 markS) Westcock Shipbuilding Ltd. has a December 31 y.pdf
 
Place the following formulas in their proper order A. ALE, residu.pdf
Place the following formulas in their proper order A. ALE, residu.pdfPlace the following formulas in their proper order A. ALE, residu.pdf
Place the following formulas in their proper order A. ALE, residu.pdf
 
please help i have 40 minsItem 1In the case below, the original .pdf
please help i have 40 minsItem 1In the case below, the original .pdfplease help i have 40 minsItem 1In the case below, the original .pdf
please help i have 40 minsItem 1In the case below, the original .pdf
 
Need help writing Conways Game of Life. These are the instructions.pdf
Need help writing Conways Game of Life. These are the instructions.pdfNeed help writing Conways Game of Life. These are the instructions.pdf
Need help writing Conways Game of Life. These are the instructions.pdf
 
Non-Euclidean GeometryWhat statement, if any, can be made about th.pdf
Non-Euclidean GeometryWhat statement, if any, can be made about th.pdfNon-Euclidean GeometryWhat statement, if any, can be made about th.pdf
Non-Euclidean GeometryWhat statement, if any, can be made about th.pdf
 
Java ProgrammingA Swing button can have more than one action liste.pdf
Java ProgrammingA Swing button can have more than one action liste.pdfJava ProgrammingA Swing button can have more than one action liste.pdf
Java ProgrammingA Swing button can have more than one action liste.pdf
 
JAVA Write a class called F.pdf
JAVA  Write a class called F.pdfJAVA  Write a class called F.pdf
JAVA Write a class called F.pdf
 
In the adult, red bone marrow would normally be found in the sternu.pdf
In the adult, red bone marrow would normally be found in the  sternu.pdfIn the adult, red bone marrow would normally be found in the  sternu.pdf
In the adult, red bone marrow would normally be found in the sternu.pdf
 
I need help with these two questions 4.12 and 4.13 dealing with MATL.pdf
I need help with these two questions 4.12 and 4.13 dealing with MATL.pdfI need help with these two questions 4.12 and 4.13 dealing with MATL.pdf
I need help with these two questions 4.12 and 4.13 dealing with MATL.pdf
 
I dont understand the min and max Find the smallest positive value.pdf
I dont understand the min and max Find the smallest positive value.pdfI dont understand the min and max Find the smallest positive value.pdf
I dont understand the min and max Find the smallest positive value.pdf
 
How can the activation of effector molecules within cells be restric.pdf
How can the activation of effector molecules within cells be restric.pdfHow can the activation of effector molecules within cells be restric.pdf
How can the activation of effector molecules within cells be restric.pdf
 
Explain how the skin of reptiles adaptive for terrestial existence. .pdf
Explain how the skin of reptiles adaptive for terrestial existence. .pdfExplain how the skin of reptiles adaptive for terrestial existence. .pdf
Explain how the skin of reptiles adaptive for terrestial existence. .pdf
 
Distinguish the roles of the four economic actors in economicsSo.pdf
Distinguish the roles of the four economic actors in economicsSo.pdfDistinguish the roles of the four economic actors in economicsSo.pdf
Distinguish the roles of the four economic actors in economicsSo.pdf
 

Recently uploaded

Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Stack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 MicroprocessorStack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 Microprocessor
JomonJoseph58
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
ssuser13ffe4
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
RamseyBerglund
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
National Information Standards Organization (NISO)
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
S. Raj Kumar
 

Recently uploaded (20)

Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Stack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 MicroprocessorStack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 Microprocessor
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
 

Write a program in MIPS that reads in a Roman form number from th.pdf

  • 1. Write a program in MIPS that reads in a Roman form number from the user, then output the number in decimal form. Write a program in MIPS that reads in a Roman form number from the user, then output the number in decimal form. Solution Answer: MIPS Assembly Language Program: .zero 1 RomanNumber::RomanNumber(std::__cxx11::basic_string, std::allocator >): push rbp mov rbp, rsp push rbx sub rsp, 24 mov QWORD PTR [rbp-24], rdi mov QWORD PTR [rbp-32], rsi mov rax, QWORD PTR [rbp-24] mov rdi, rax call std::__cxx11::basic_string, std::allocator >::basic_string() mov rax, QWORD PTR [rbp-24] mov rdx, QWORD PTR [rbp-32] mov rsi, rdx mov rdi, rax call std::__cxx11::basic_string, std::allocator >::operator=(std::__cxx11::basic_string, std::allocator > const&) jmp .L4 mov rbx, rax mov rax, QWORD PTR [rbp-24] mov rdi, rax call std::__cxx11::basic_string, std::allocator >::~basic_string() mov rax, rbx mov rdi, rax call _Unwind_Resume
  • 2. .L4: add rsp, 24 pop rbx pop rbp ret .LC0: .string " is not a Roman Numeral!" RomanNumber::convert(): push rbp mov rbp, rsp sub rsp, 32 mov QWORD PTR [rbp-24], rdi mov rax, QWORD PTR [rbp-24] mov rdi, rax call std::__cxx11::basic_string, std::allocator >::length() const mov DWORD PTR [rbp-16], eax mov DWORD PTR [rbp-4], 0 mov BYTE PTR [rbp-5], 0 mov DWORD PTR [rbp-12], 0 mov rax, QWORD PTR [rbp-24] mov DWORD PTR [rax+32], 0 .L24: cmp BYTE PTR [rbp-5], 0 jne .L6 mov eax, DWORD PTR [rbp-12] cmp eax, DWORD PTR [rbp-16] jge .L6 mov eax, DWORD PTR [rbp-12] movsx rdx, eax mov rax, QWORD PTR [rbp-24] mov rsi, rdx mov rdi, rax call std::__cxx11::basic_string, std::allocator >::operator[](unsigned long) movzx eax, BYTE PTR [rax] movsx eax, al sub eax, 67
  • 3. cmp eax, 21 ja .L7 mov eax, eax mov rax, QWORD PTR .L9[0+rax*8] jmp rax .L9: .quad .L8 .quad .L10 .quad .L7 .quad .L7 .quad .L7 .quad .L7 .quad .L11 .quad .L7 .quad .L7 .quad .L12 .quad .L13 .quad .L7 .quad .L7 .quad .L7 .quad .L7 .quad .L7 .quad .L7 .quad .L7 .quad .L7 .quad .L14 .quad .L7 .quad .L15 .L13: mov rax, QWORD PTR [rbp-24] mov eax, DWORD PTR [rax+32] lea edx, [rax+1000] mov rax, QWORD PTR [rbp-24] mov DWORD PTR [rax+32], edx cmp DWORD PTR [rbp-4], 999 jg .L16
  • 4. mov rax, QWORD PTR [rbp-24] mov eax, DWORD PTR [rax+32] mov edx, DWORD PTR [rbp-4] add edx, edx sub eax, edx mov edx, eax mov rax, QWORD PTR [rbp-24] mov DWORD PTR [rax+32], edx .L16: mov DWORD PTR [rbp-4], 1000 jmp .L17 .L10: mov rax, QWORD PTR [rbp-24] mov eax, DWORD PTR [rax+32] lea edx, [rax+500] mov rax, QWORD PTR [rbp-24] mov DWORD PTR [rax+32], edx cmp DWORD PTR [rbp-4], 499 jg .L18 mov rax, QWORD PTR [rbp-24] mov eax, DWORD PTR [rax+32] mov edx, DWORD PTR [rbp-4] add edx, edx sub eax, edx mov edx, eax mov rax, QWORD PTR [rbp-24] mov DWORD PTR [rax+32], edx .L18: mov DWORD PTR [rbp-4], 500 jmp .L17 .L8: mov rax, QWORD PTR [rbp-24] mov eax, DWORD PTR [rax+32] lea edx, [rax+100] mov rax, QWORD PTR [rbp-24] mov DWORD PTR [rax+32], edx
  • 5. cmp DWORD PTR [rbp-4], 99 jg .L19 mov rax, QWORD PTR [rbp-24] mov eax, DWORD PTR [rax+32] mov edx, DWORD PTR [rbp-4] add edx, edx sub eax, edx mov edx, eax mov rax, QWORD PTR [rbp-24] mov DWORD PTR [rax+32], edx .L19: mov DWORD PTR [rbp-4], 100 jmp .L17 .L12: mov rax, QWORD PTR [rbp-24] mov eax, DWORD PTR [rax+32] lea edx, [rax+50] mov rax, QWORD PTR [rbp-24] mov DWORD PTR [rax+32], edx cmp DWORD PTR [rbp-4], 49 jg .L20 mov rax, QWORD PTR [rbp-24] mov eax, DWORD PTR [rax+32] mov edx, DWORD PTR [rbp-4] add edx, edx sub eax, edx mov edx, eax mov rax, QWORD PTR [rbp-24] mov DWORD PTR [rax+32], edx .L20: mov DWORD PTR [rbp-4], 50 jmp .L17 .L15: mov rax, QWORD PTR [rbp-24] mov eax, DWORD PTR [rax+32] lea edx, [rax+10]
  • 6. mov rax, QWORD PTR [rbp-24] mov DWORD PTR [rax+32], edx cmp DWORD PTR [rbp-4], 9 jg .L21 mov rax, QWORD PTR [rbp-24] mov eax, DWORD PTR [rax+32] mov edx, DWORD PTR [rbp-4] add edx, edx sub eax, edx mov edx, eax mov rax, QWORD PTR [rbp-24] mov DWORD PTR [rax+32], edx .L21: mov DWORD PTR [rbp-4], 10 jmp .L17 .L14: mov rax, QWORD PTR [rbp-24] mov eax, DWORD PTR [rax+32] lea edx, [rax+5] mov rax, QWORD PTR [rbp-24] mov DWORD PTR [rax+32], edx cmp DWORD PTR [rbp-4], 4 jg .L22 mov rax, QWORD PTR [rbp-24] mov eax, DWORD PTR [rax+32] mov edx, DWORD PTR [rbp-4] add edx, edx sub eax, edx mov edx, eax mov rax, QWORD PTR [rbp-24] mov DWORD PTR [rax+32], edx .L22: mov DWORD PTR [rbp-4], 5 jmp .L17 .L11: mov rax, QWORD PTR [rbp-24]
  • 7. mov eax, DWORD PTR [rax+32] lea edx, [rax+1] mov rax, QWORD PTR [rbp-24] mov DWORD PTR [rax+32], edx cmp DWORD PTR [rbp-4], 0 jg .L23 mov rax, QWORD PTR [rbp-24] mov eax, DWORD PTR [rax+32] mov edx, DWORD PTR [rbp-4] add edx, edx sub eax, edx mov edx, eax mov rax, QWORD PTR [rbp-24] mov DWORD PTR [rax+32], edx .L23: mov DWORD PTR [rbp-4], 1 jmp .L17 .L7: mov eax, DWORD PTR [rbp-12] movsx rdx, eax mov rax, QWORD PTR [rbp-24] mov rsi, rdx mov rdi, rax call std::__cxx11::basic_string, std::allocator >::operator[](unsigned long) movzx eax, BYTE PTR [rax] movsx eax, al mov esi, eax mov edi, OFFSET FLAT:std::cout call std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char) mov esi, OFFSET FLAT:.LC0 mov rdi, rax call std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*) mov esi, OFFSET FLAT:std::basic_ostream >& std::endl >(std::basic_ostream >&) mov rdi, rax call std::basic_ostream >::operator<<(std::basic_ostream >& (*)(std::basic_ostream >&)) mov BYTE PTR [rbp-5], 1
  • 8. mov rax, QWORD PTR [rbp-24] mov DWORD PTR [rax+32], 0 .L17: add DWORD PTR [rbp-12], 1 jmp .L24 .L6: mov rax, QWORD PTR [rbp-24] mov eax, DWORD PTR [rax+32] leave ret RomanNumber::~RomanNumber(): push rbp mov rbp, rsp sub rsp, 16 mov QWORD PTR [rbp-8], rdi mov rax, QWORD PTR [rbp-8] mov rdi, rax call std::__cxx11::basic_string, std::allocator >::~basic_string() nop leave ret .LC1: .string "color 1F" .LC2: .string " tt....ROMAN NUMBER TO DECIMAL CONVERTER.... " .LC3: .string " tEnter your input in Roman Number(Plz Keep Caps Lock On): " .LC4: .string " ttRoman Number " .LC5: .string " is equals to Decimal " .LC6: .string "pause" main: push rbp mov rbp, rsp
  • 9. push rbx sub rsp, 136 mov edi, OFFSET FLAT:.LC1 call system lea rax, [rbp-96] mov rdi, rax call std::__cxx11::basic_string, std::allocator >::basic_string() mov esi, OFFSET FLAT:.LC2 mov edi, OFFSET FLAT:std::cout call std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*) mov esi, OFFSET FLAT:.LC3 mov edi, OFFSET FLAT:std::cout call std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*) lea rax, [rbp-96] mov rsi, rax mov edi, OFFSET FLAT:std::cin call std::basic_istream >& std::operator>>, std::allocator >(std::basic_istream >&, std::__cxx11::basic_string, std::allocator >&) lea rdx, [rbp-96] lea rax, [rbp-64] mov rsi, rdx mov rdi, rax call std::__cxx11::basic_string, std::allocator >::basic_string(std::__cxx11::basic_string, std::allocator > const&) lea rdx, [rbp-64] lea rax, [rbp-144] mov rsi, rdx mov rdi, rax call RomanNumber::RomanNumber(std::__cxx11::basic_string, std::allocator >) lea rax, [rbp-64] mov rdi, rax call std::__cxx11::basic_string, std::allocator >::~basic_string() lea rax, [rbp-144] mov rdi, rax call RomanNumber::convert() mov DWORD PTR [rbp-20], eax
  • 10. mov esi, OFFSET FLAT:.LC4 mov edi, OFFSET FLAT:std::cout call std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*) mov rdx, rax lea rax, [rbp-96] mov rsi, rax mov rdi, rdx call std::basic_ostream >& std::operator<< , std::allocator >(std::basic_ostream >&, std::__cxx11::basic_string, std::allocator > const&) mov esi, OFFSET FLAT:.LC5 mov rdi, rax call std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*) mov rdx, rax mov eax, DWORD PTR [rbp-20] mov esi, eax mov rdi, rdx call std::basic_ostream >::operator<<(int) mov esi, OFFSET FLAT:std::basic_ostream >& std::endl >(std::basic_ostream >&) mov rdi, rax call std::basic_ostream >::operator<<(std::basic_ostream >& (*)(std::basic_ostream >&)) mov esi, OFFSET FLAT:std::basic_ostream >& std::endl >(std::basic_ostream >&) mov rdi, rax call std::basic_ostream >::operator<<(std::basic_ostream >& (*)(std::basic_ostream >&)) mov edi, OFFSET FLAT:.LC6 call system mov ebx, 0 lea rax, [rbp-144] mov rdi, rax call RomanNumber::~RomanNumber() lea rax, [rbp-96] mov rdi, rax call std::__cxx11::basic_string, std::allocator >::~basic_string() mov eax, ebx jmp .L35 mov rbx, rax lea rax, [rbp-64]
  • 11. mov rdi, rax call std::__cxx11::basic_string, std::allocator >::~basic_string() jmp .L30 mov rbx, rax lea rax, [rbp-144] mov rdi, rax call RomanNumber::~RomanNumber() jmp .L30 mov rbx, rax .L30: lea rax, [rbp-96] mov rdi, rax call std::__cxx11::basic_string, std::allocator >::~basic_string() mov rax, rbx mov rdi, rax call _Unwind_Resume .L35: add rsp, 136 pop rbx pop rbp ret __static_initialization_and_destruction_0(int, int): push rbp mov rbp, rsp sub rsp, 16 mov DWORD PTR [rbp-4], edi mov DWORD PTR [rbp-8], esi cmp DWORD PTR [rbp-4], 1 jne .L38 cmp DWORD PTR [rbp-8], 65535 jne .L38 mov edi, OFFSET FLAT:std::__ioinit call std::ios_base::Init::Init() mov edx, OFFSET FLAT:__dso_handle mov esi, OFFSET FLAT:std::__ioinit mov edi, OFFSET FLAT:std::ios_base::Init::~Init()
  • 12. call __cxa_atexit .L38: nop leave ret push rbp mov rbp, rsp mov esi, 65535 mov edi, 1 call __static_initialization_and_destruction_0(int, int) pop rbp ret