Write a program to print name, Assembly Language

Assignment Help:

Write a program to do the following:

1. Print your name

2. Using a bottom testing loop, prompt the user to enter a number from 1 to 5.  If the number entered is not 1..5, print an error message.  Your program should continue to prompt and read until a value from 1..5 is entered.

3. Using a top testing loop, repeat the following.

The number of times to repeat is the number entered in step 2 (i.e. 1..5).

a. Prompt for and read two integers.

b. Print the absolute value of the difference of the numbers. 

Do not use the abs pseudo instruction but calculate the absolute value using the standard instructions.

c. If the first input is less than or equal to the second input, print the sum of the numbers from the first THROUGH the second.  Otherwise print an error message. 

See the example below.

4. Print an ending message and then end your program.

Example input and output

Tom Smith

Enter a number 1..5: 0

Input is out of range

Enter a number 1..5: 3

Enter the first number: 3

Enter the second number: 3

Absval of difference = 0

Sum of values = 3

Enter the first number: 2

Enter the second number: 8

Absval of difference = 6

Sum of values= 35

Enter the first number: 5

Enter the second number: -2

Absval of difference = 7

Sum of values cannot be determined

Program ending

Assignment 2 submittal:

a. Submit your assembly language program file. 

If your file is correctly uploaded, then you will see an exclamation mark (!) for the grade.


Related Discussions:- Write a program to print name

Call-unconditional branch instruction-microprocessor, CALL : Unconditional...

CALL : Unconditional Call:- This instruction is utilized to call a subroutine from a basic program. In case of assembly language programming, the term procedure is utilized int

Program, write a program assembly language for adding two 3*3 matrix

write a program assembly language for adding two 3*3 matrix

Formulate the linear programming model , Print Media Advertising (PMA) has ...

Print Media Advertising (PMA) has been providing a contract to market Buzz Cola via newspaper ads in a main southern newspaper. Full-page ads in the weekday editions (Monday throug

ADDITION-SUBTRACTION, HELLO I AM TRYING TO ADD AND SUBTRACT BUT I SEEM CAN'...

HELLO I AM TRYING TO ADD AND SUBTRACT BUT I SEEM CAN''T FIND THE CORRECT REGISTER TO PUT IN

Find out the content of program, a- Trace the following program fragment an...

a- Trace the following program fragment and find out the content of ax after the          the execution of the program.         X db   5,7  -3,-9,4,-7,9               Mov

Assignment, You have to write a subroutine (assembly language code using NA...

You have to write a subroutine (assembly language code using NASM) for the following equation. Dx= ax2+(ax-1)+2*(ax+2)/2

Program, 2. Write a program to separate out positive and negative numbers f...

2. Write a program to separate out positive and negative numbers from a given series of 16-bit hexadecimal numbers.

Motorola 68000 series, Motorola 68000 Series : 68000microprocessor is a...

Motorola 68000 Series : 68000microprocessor is a 16 bit processor that has addressing space of 65536 locations, each of which holds a 64-bits word; In order to address those lo

Aas-arithmetic instruction-microprocessor, AAS: ASCII Adjust AL After Subt...

AAS: ASCII Adjust AL After Subtraction AAS instruction correct the result in the AL register after subtracting operation of two unpacked ASCII operands. The result is in unpacked

Basic microprocessor architecture and interface, Basic Microprocessor Archi...

Basic Microprocessor Architecture and Interface : Introduction: Intel launches its first 4-bit microprocessor 4004 in the year 1971 and 8-bit microprocessor 8008 in the y

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd