Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CODE: /*Enumerated Type creates set of constants numbered 0 and upward*/ /* *p1 = rdi, *p2 = rsi, modetype = rdx */ typedef enum {ACASE,

CODE:

/*Enumerated Type creates set of constants numbered 0 and upward*/

/* *p1 = rdi, *p2 = rsi, modetype = rdx */

typedef enum {ACASE, BCASE, CCASE, DCASE, ECASE} modetype;

long switch4 (long *p1, long *p2, modetype action) {

long result =0; switch (action){

case ACASE:

case BCASE:

case CCASE:

case DCASE:

case ECASE:

default:

}

return result;

}

Assembly code:

switch4: .LFB0: .cfi_startproc movl $2, %eax cmpl $4, %edx ja .L2 movl %edx, %edx jmp *.L8(,%rdx,8) .section .rodata .align 8 .align 4 .L8: .quad .L3 .quad .L4 .quad .L5 .quad .L6 .quad .L7 .text .L7: movl $24, %eax ret .L3: movq (%rdi), %rax subq (%rsi), %rax movq %rax, (%rsi) ret .L4: movq $31, (%rdi) movq (%rsi), %rax ret .L5: movq (%rdi), %rax movq %rax, %rdx addq (%rsi), %rdx movq %rdx, (%rdi) ret .L6: movq (%rsi), %rax movq %rax, (%rdi) movl $24, %eax .L2: rep ret .cfi_endproc .LFE0: .size switch4, .-switch4 .ident "GCC: (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3" .section .note.GNU-stack,"",@progbits

Use the assembly code to fill out the code for each cases above

if possible, please explain how you used assembly code to write out the cases

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

Creating A Database In Filemaker Pro Visual QuickProject Guide

Authors: Steven A. Schwartz

1st Edition

0321321219, 978-0321321213

More Books

Students also viewed these Databases questions

Question

Define Scientific Management

Answered: 1 week ago

Question

Explain budgetary Control

Answered: 1 week ago

Question

Solve the integral:

Answered: 1 week ago

Question

What is meant by Non-programmed decision?

Answered: 1 week ago

Question

1. PricewaterhouseCoopers

Answered: 1 week ago

Question

3. SCC Soft Computer

Answered: 1 week ago