Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Binary to assembly to C++ code This is from CS 410 Binary to C++ Activity Template Hello I have disassemble this binary code into assembly

Binary to assembly to C++ code

This is from CS 410 Binary to C++ Activity Template

Hello I have disassemble this binary code into assembly and need help figuring out what it means and translating it to C++ code in these tables. Please help and I will leave a like.image text in transcribedimage text in transcribed

File Four Step 2: Explain the functionality of the blocks of assembly code. Blocks of Assembly Code Explanation of Functionality Step 4: Convert the assembly code to C++ code. Step 5: Explain how the C++ code performs the same tasks as the blocks of assembly code. Blocks of Assembly Code C++ Code Explanation of Functionality Dump of assembler code for function main: Ox0000000000000000 : push Erbp Ox0000000000000001 ; mov rsp,%rbp Ox0000000000000004 : sub $0x30, rsp OX0000000000000008 ; mov fs: 0x28,%rax Ox0000000000000011 : mov %rax,-0x8(%rbp) OX0000000000000015 : xor %eax,%eax Ox0000000000000017 : mova $0x0,-0x20(%rbp) Ox000000000000001f ; mova $0x1,-0x18(%rbp) Ox0000000000000027 : lea Ox0(%rip),%rsi # Ox2e
Ox000000000000002e : lea Oxo%rip),%rdi # Ox35
OX0000000000000035 : callq ox3a
Ox000000000000003a : mov %rax,%rdx Ox000000000000003d : mov 0x0(%rip),%rax # Ox44
Ox0000000000000044 : mov Prax,%rsi Ox0000000000000047 : mov rdx,%rdi Ox000000000000004a : calla 6x4f
Ox000000000000004f : mov rax,%rsi Ox0000000000000056 Ox000000000000005d : calla Ox62
Ox0000000000000062 : mov - Ox28 (%rbp),%rax Ox0000000000000066 ; test rax,%rax Ox0000000000000069 : je Oxf2
OX000000000000006f : mov -Ox28 (prbp), rcx Ox0000000000000073 : movabs $0x6666666666666667,%rdx Ox0000000000000070 : mov srcx,%rax OX0000000000000080 ; imul rdx Ox0000000000000083 ; sar $0x2,%rdx Ox0000000000000087 : mov %rcx,%rax Ox000000000000008a : sar $0x3f,max OX000000000000008e : sub %rax,%rdx OX0000000000000091 : mov rdx,%rax Ox0000000000000094 ; mov -Ox10(%rbp),dx Ox000000000000009c ; mov rdx,%rax Ox000000000000009f : shl. $0x2,%rax |---Type to continue, or q to quit---1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

AutoCAD Database Connectivity

Authors: Scott McFarlane

1st Edition

0766816400, 978-0766816404

More Books

Students also viewed these Databases questions

Question

KEY QUESTION Refer to columns 1 and 6 in the table for question

Answered: 1 week ago