Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

help do all thank you 1. Consider the following registers. Label the following: args 1-6, return, base pointer, stack pointer, accumulator, counter, caller-owned, callee-owned, volatile.

help do all thank you image text in transcribed
image text in transcribed
image text in transcribed
1. Consider the following registers. Label the following: args 1-6, return, base pointer, stack pointer, accumulator, counter, caller-owned, callee-owned, volatile. rax rcx rdx rdi rsi rbp rsp r10 r11 r12 r13 Sr14 r15 2. For each C data type below, write the equivalent x86 data type and the size in bits and bytes. x86 Data Format bits bytes C Data Type char short int long char int 3. Lower-order bytes within a register can be accessed using different names. Label below. rax 4. For each instruction. Write the equivalent instructions using mov. push irbx pop %rbx code segment. What is the resulting value in rax ? Result: 5. Consider the following segment push rax pop trax 6. Consider the following registers and memory state 0x100 0x108 0x110 0x118 0x042 OxDEADBEEF 0x108 0x110 12 rdx Modify the table above with the values after running the following code mov 0x100, Seax add leax, Seax mov trax, (rcx) mov 8(srcx), rbx mov trbx, 8(rdx) 7. When using idiv what is the significance of teax and ledx before and after the instruction? 8. Which instruction can split a 64 bit register across seax and irdx? 9. Rewrite the following C code segment in x86 (assume atrax, b-1rbx): x86 if (a+ b > 0) ab; '. Rewrte te folowing code segment in r86 (assumo a " Ear,b-, b f a--b oise if (a > 0 b > 0) 11. Rewrite the following C code segment in x88 (assume count - secx, n "eax) x86 int count-0 while (n>0) n/e101 ,2. Rewrite the following C code segment in x86 (assume i = 1 rex, evens-1 r 8) x86 int evens0 for (int i " 0; i

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

Students also viewed these Databases questions