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

Control transfer or branching instruction-microprocessor, Control Transfer ...

Control Transfer or Branching Instruction Control transfer instructions transfer the flow of execution of the program to a new address specified in the instruction indirectly o

Das-arithmetic instruction-microprocessor, DAS: Decimal Adjust after Subtr...

DAS: Decimal Adjust after Subtraction:- This instruction converts the result of subtraction operation of 2 packed BCD numbers to a valid BCD number. The subtraction operation has

Assembly Language Programming, Write a program that defines symbolic consta...

Write a program that defines symbolic constants for all of the days of the week

The pin diagram of 8088-microprocessor, Pin diagram of 8088 : The pin ...

Pin diagram of 8088 : The pin diagram of 8088 is shown in given figure. Most of the 8088 pins and their functions are exactly similar to the corresponding pins of 8086.  Hence

LC-3 Program, Write an Lc-3 assembly language program to read in a sequence...

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

Pointer and index registers-microprocessor, Pointer and Index Registers ...

Pointer and Index Registers The pointers contain offset within the specific segments. The pointers BP, IP and SP generally containoffsets within thedata, code and stack segment

Assembly Language Program, which uses BIOS interrupt INT 21 to read current...

which uses BIOS interrupt INT 21 to read current system time and displays it on the top-left corner of screen.

Pointer(ptr)-assemblers directive-microprocessor, PTR : Pointer:- The p...

PTR : Pointer:- The pointer operator which is used to declare the type of a variable, label or memory operand. The operator PTR is prefixed by either WORD or BYTE. If the prefi

#title:Shifitng of memory, Ask 2. Exchange higher byte of AX and higher byt...

Ask 2. Exchange higher byte of AX and higher byte of BX registers by using memory location 0160 in between the transfer. Then stores AX and BX registers onto memory location 0174 o

Mmm development board, Write an account of your findings and produce a repo...

Write an account of your findings and produce a report containing all aspects of the above. Include a step-by-step 'simple User Guide' so that your program can be operated as inten

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