Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For this assignment you will create a cprogram that includes inline assembly cod

ID: 3788742 • Letter: F

Question

For this assignment you will create a cprogram that includes inline assembly code. Your code should do the following: 1. Query the user for a 32-bit integer, saving the integer into an appropriate C variable. Use assembly code to copy the value into another C variable. 2. Query the user for a 16-bit variable saving the value into an appropriate C variable. Use assembly code to copy the value into another 16-bit C variable. 3. Query the user for an 8-bit character saving the value into an appropriate C variable. Use assembly code to copy the value into another 8-bit variable. 4. Copy the 8-bit value entered in step 3 into the lower 8-bit portion of the copied-to variable used in step 1 (using assembly. 5. Print the results of each of the above steps (using printf in your C code).

Explanation / Answer

2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #include<stdio.h> void main() { long a,b; int d,e; char c,m; cout<<"enter 32 bit integer"; cin>>a; asm { mov ax,a; mov b,ax; mov dx,d; mov e,dx; } cout<<"Enter 8 bit character"; cin>>c; asm{ mov cx,c; mov m,cx; } printf("%d",b); printf("%d",e); printf("%c",m); getch(); } #include<stdio.h> void main() { long a,b; int d,e; char c,m; cout<<"enter 32 bit integer"; cin>>a; asm { mov ax,a; mov b,ax; mov dx,d; mov e,dx; } cout<<"Enter 8 bit character"; cin>>c; asm{ mov cx,c; mov m,cx; } printf("%d",b); printf("%d",e); printf("%c",m); getch(); } 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #include<stdio.h> void main() { long a,b; int d,e; char c,m; cout<<"enter 32 bit integer"; cin>>a; asm { mov ax,a; mov b,ax; mov dx,d; mov e,dx; } cout<<"Enter 8 bit character"; cin>>c; asm{ mov cx,c; mov m,cx; } printf("%d",b); printf("%d",e); printf("%c",m); getch(); }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote