Write a program to print name, Assembly Language

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.

Posted Date: 3/4/2013 7:21:15 AM | Location : United States







Related Discussions:- Write a program to print name, Assignment Help, Ask Question on Write a program to print name, Get Answer, Expert's Help, Write a program to print name Discussions

Write discussion on Write a program to print name
Your posts are moderated
Related Questions
implement the following c++ code in assembly language using the block-structured .IF and .while directives

Write an Lc-3 assembly language program to read in a sequence of single-digit positive integers from the keyboard(one integer per line) until the sentinel value of 0 is reached and

Description Write a MIPS program that reads a string from user input, reverse each word (defined as a sequence of English alphabetic letters or numeric digits without any punctu

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

Port Mapped I/O or I/O Mapped I/O I/O devices are mapped into a separate address space. This is generally accomplished by having a different set of signal lines to denote a mem

code to add two matrices

Write an assembly language program that defines symbolic constants for all seven days of the week

I/O interface I/O  devices such as displays and keyboards  establish  communication of computer with outside world. Devices may be interfaced in 2 ways Memory mapped I/O and I/

from pin description it seems that 8086 has 16 address/data lines i.e.AD0_AD15.The physical address is however is larger than 2^16.How this condition can be handled

Typical link to modems for synchronous and asynchronous transmissions are shown in Figure. With regard to the synchronous connections it is consider that the timing is controlled