Counting Letters in a File...

Reply

Join Date: Jun 2009
Posts: 2
Reputation: nagash07 is an unknown quantity at this point 
Solved Threads: 0
nagash07 nagash07 is offline Offline
Newbie Poster

Counting Letters in a File...

 
0
  #1
Jun 22nd, 2009
Hi,

Guys can any1 help me I'm quite a noob in Assembly language and I have an important school work to be done. And I dont even know how to start. This is what I need: An assembly program for 8086/8088 that opens a given .txt file and counts up the letters in the file (A..Z and not case sensitive).

After counting up all the letters the total amount for each letter should be displayed on screen, something like this:
A - 00035
B - 04542
C - xxxxx // the total ammount for each letter

If it were on C or Java I would do it... but I dont know Assembly X(.
Help me Please.... Oh yeah and the total ammount for each letter should not be greater than the size of a word (16 bits or 65535).
Last edited by nagash07; Jun 22nd, 2009 at 1:11 pm. Reason: correction
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 830
Reputation: wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all 
Solved Threads: 94
wildgoose's Avatar
wildgoose wildgoose is offline Offline
Practically a Posting Shark

Re: Counting Letters in a File...

 
0
  #2
Jun 22nd, 2009
Everything you need to know should have been taught in class already.

You mention 16-bit count, thus it has the implication that it this is older 16-bit code.

1) Work the DOS interrupt 21h to open a file, read byte by byte, then close the file.

2) Add compares looking at the individual character bytes and sort and if a character add to a count.

3) return the count.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 830
Reputation: wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all 
Solved Threads: 94
wildgoose's Avatar
wildgoose wildgoose is offline Offline
Practically a Posting Shark

Re: Counting Letters in a File...

 
0
  #3
Jun 22nd, 2009
Make a best try effort, and post your results.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC