Implement an assembly language program, Assembly Language

Assignment Help:

A good starting point for your program is the toupper.asm program shown in class. It already queries the user for input and sets up a loop that looks at each character of the input. The source code for toupper.asm 

The bytes entered by the user are ASCII characters. You should convert this to a numerical digit by subtracting the character '0'.

Recall that the last character might be an X and represents the value 10. You will need to special case this. For simplicity, let's not worry about an X appearing in the middle of the input.

You should set up your loop to iterate 10 times and NOT for the length of the string (as is done in toupper.asm) because that will include the newline character at the end of the user input.

Since all the numbers are small, you can use the 8-bit portions of the general purpose registers: AH, AL, BH, BL, CH, CL, DH and DL. This is convenient because you have more registers to play with and because you won't have to mix 8-bit and 32-bit arithmetic.

Develop your program incrementally. After each step, use the debugger to check that you have accomplished the desired goal.

Set up the loop to iterate 10 times, each time storing the next character in an 8-bit register (say AL).

Convert AL into a "number".

Add the special case where AL might be X.

Compute t in another 8-bit register.

Compute t % 11.

Compute sum % 11 in another 8-bit register.

Print out the correct message to the user.

Extra Credit

For 10 points extra credit, submit a separate assembly language program that prints out the value of the check digit given the first 9 digits of an ISBN number. A sample run of your program might look like:

linux2% ./a.out

Enter first 9 digits of ISBN #: 320154197

Check digit: 4

linux2%

linux2% ./a.out

Enter first 9 digits of ISBN #: 045777370

Check digit: 7

linux2%

linux2% ./a.out

Enter first 9 digits of ISBN #: 044101125

Check digit: X

linux2%


Related Discussions:- Implement an assembly language program

Project, I need some guidance on which project to make in assembly language...

I need some guidance on which project to make in assembly language

Program, assembly language program to find larges number in an array

assembly language program to find larges number in an array

Display control-microprocessor, Display control 8279  provides  a  16  ...

Display control 8279  provides  a  16  byte  display  memory  and  refresh  logic.  Every address in the display memory corresponds to a display unit with address zero represen

Web services. , describes vertical and horizontal web services protocols. N...

describes vertical and horizontal web services protocols. Next, identify the similarities and differences between vertical and horizontal web services protocols. Finally, explain w

Hi, i have a question.

i have a question.

8088 timing system diagram-Microprocessor, 8088  Timing System Diagram ...

8088  Timing System Diagram The 8088 address/data  bus is divided  in 3 parts (a) the lower 8 address/data  bits, (b) the middle 8 address bits, and (c) the upper 4 status/

First generation microprocessor, 1 st Generation Microprocessor : At ...

1 st Generation Microprocessor : At the end of the 70s a group of engineers developed a chip is able to processing data. This chip was called processor chip. Big processors w

Minecraft/Terminal issues, I am running a small minecraft server off of my ...

I am running a small minecraft server off of my old mac mini, and am having a big issue. My computer isn''t very good, and even just running this server is an issue. I use a comma

Average of odd numbers, write an assembly language program to find average ...

write an assembly language program to find average of odd numbers from an array of 8 bit numbers

Program to perform a conversion on characters in a text file, Write an asse...

Write an assembly language program to perform a rot13 1 conversion on characters in a text file.  The program should read charatcers from the input file, perform the rot13 convers

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