Google Answers Logo
View Question
 
Q: Assembly Programming code needed for 2 part small ques. ( No Answer,   1 Comment )
Question  
Subject: Assembly Programming code needed for 2 part small ques.
Category: Computers > Programming
Asked by: jty202-ga
List Price: $5.00
Posted: 23 Oct 2005 11:35 PDT
Expires: 22 Nov 2005 10:35 PST
Question ID: 583882
I am working on a bigger project and need a small part to help me work faster.
I need someone to write an assembly code to just to do the following....

convert a single byte in memory into two ASCII hexadecimal digits, and
reverse the process in the same program. The input should be in
location 1000H. At that new location, take the byte and create two
ASCII hex digits in the two bytes which follow it, and then the
reconverted number in the byte which follows those two (ASCII) bytes.

Thus if the input is:
--------------------------------------------
7F	?	?	?

1000H	1001H	1002H	1003H
--------------------------------------------
The output should look like:
--------------------------------------------
7F	37	46	7F

1000H	1001H	1002H	1003H
--------------------------------------------
 

Note that converting the digits 0-9 may be done in the same manner as
the decimal conversion, but that the digits A-F do NOT follow
immediately afterward in the ASCII table. Of course, the final output
byte (Byte 1003H) should be computed by looking at the preceeding two
bytes, NOT by inspecting the original input byte!

For output, your program should not only leave the three bytes in
memory, it should also print the two output ASCII bytes to the screen,
using INT 10H, subfunction 0EH, as described in class. It should print
the two hex digits, followed by two spaces to separate one run of your
program from the next.

So, the printed output for the above example would be:

7F


=========================================================================
=========================================================================
Here is the 2nd part of the question.

I need a program to input a series of characters until you reach an
exclamation mark ("!"). Then print on the screen the count of each
letter which has occurred, sorted in descending order by occurrence.
The maximum count will be 255.

Thus, if  input is:

Wow, I just Loooooooooooooooove Assembler!

 output would be:

The Letter Count of  Message is:

O  17
E   3
S   3
L   2
W   2
A   1
B   1
J   1
I   1
M   1
T   1
U   1


Notes: One solution is to keep an array which has both the letters and
the counts in it, such as this:

'A' 0 'B' 0 'C' 0 'D' 0 'E' 
   ... etc. 

Then,  sort the array by the count, keep the letter and the count
together, like this:

'O' 17 'E' 3 'S' 3 'L' 2 'W' 
   ... etc. 

 

Use INT 16H (which we demonstrated in class) for input. Echo print 
input character by character.

The code for converting the count into decimal ascii is exactly that
found in Chapter 2, with the exception that leading zeroes should be
converted into spaces.

All variables should be now be written using db's or dw's.
Answer  
There is no answer at this time.

Comments  
Subject: Re: Assembly Programming code needed for 2 part small ques.
From: philnj-ga on 24 Oct 2005 07:49 PDT
 
Cutting and pasting your homework into GA is not cool.  At least
disguise it a little.  You never give the processor for which someone
is expected to write the assembly.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy