Create an HLA Assembly language program that prompts for a single decimal value from the user and then prints the desired output which is formed from decreasing the entered number by one as well as increasing the entered number by one. I am supplying a C-based solution for what I am looking for since describing it in English is a challenge. Here are some example program dialogues to guide your efforts: Feed Me: 6 6_5_1_7_8 Feed Me: 10 10_9_1_11_12 In an effort to help you focus on building an Assembly program, I’d like to offer you the following C statements matches the program specifications stated above. If you like, use them as the basis for building your Assembly program. int x; printf( "Feed Me:" ); scanf( "%d", &x ); // acquire one less and one more int oneLess = x - 1; int oneMore = x + 1; // print the desired output printf( "%d", x ); printf( "_%d", oneLess ); printf( "_%d", x-oneLess ); printf( "_%d", oneMore ); printf( "_%d", x-oneLess+oneMore ); printf( "\n" );
Create an HLA Assembly language
Here are some example program dialogues to guide your efforts:
Feed Me: 6
6_5_1_7_8
Feed Me: 10
10_9_1_11_12
In an effort to help you focus on building an Assembly program, I’d like to offer you the following C statements matches the program specifications stated above. If you like, use them as the basis for building your Assembly program.
int x;
printf( "Feed Me:" );
scanf( "%d", &x );
// acquire one less and one more
int oneLess = x - 1;
int oneMore = x + 1;
// print the desired output
printf( "%d", x );
printf( "_%d", oneLess );
printf( "_%d", x-oneLess );
printf( "_%d", oneMore );
printf( "_%d", x-oneLess+oneMore );
printf( "\n" );
Trending now
This is a popular solution!
Step by step
Solved in 3 steps