Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Where is my mistake? Convert the following C program to assembly. Test code checks it. uint16_t b_func(uint16_t u16_a, uint16_t u16_b, uint16_t u16_c) { return u16_a

image text in transcribed

image text in transcribed

Where is my mistake?

Convert the following C program to assembly. Test code checks it. uint16_t b_func(uint16_t u16_a, uint16_t u16_b, uint16_t u16_c) { return u16_a - (16_b & u16_c); mi00 void reg_assign_ex_1(void) { 16_b = b_func(u16_b, u16_a, BxDE49); } // End. Code .text ;; void reg_assign_ex_1(void) { _reg_assign_ex_1: global _reg_assign_ex_1 Write assembly which implements the C given above. 1 mov _u16_b, we 2 mov _u16_a, w1 3 mov #OXDE49, W2 5 call _b_func 6 and we, W2, W3 7 sub wi, W3, WO Running test... Expected location: return. Actual location: return. Testing value of u16_a... Expected data: exF391 (62353). Actual data: exF391 (62353). Testing value of u16_b... Expected data: @XDB2F (56111). Actual data: @XAD30 (44336). FAIL. Convert the following C program to assembly. Test code checks it. uint16_t b_func(uint16_t u16_a, uint16_t u16_b, uint16_t u16_c) { return u16_a - (16_b & u16_c); mi00 void reg_assign_ex_1(void) { 16_b = b_func(u16_b, u16_a, BxDE49); } // End. Code .text ;; void reg_assign_ex_1(void) { _reg_assign_ex_1: global _reg_assign_ex_1 Write assembly which implements the C given above. 1 mov _u16_b, we 2 mov _u16_a, w1 3 mov #OXDE49, W2 5 call _b_func 6 and we, W2, W3 7 sub wi, W3, WO Running test... Expected location: return. Actual location: return. Testing value of u16_a... Expected data: exF391 (62353). Actual data: exF391 (62353). Testing value of u16_b... Expected data: @XDB2F (56111). Actual data: @XAD30 (44336). FAIL

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

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions