Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

8086 Assembly Project

Status
Not open for further replies.

Jenny1

MIS
Mar 16, 2001
7
0
0
US
Hello, my name is Jenny and I am a 21 yr old student at a local college and I am in dire need of help regarding 8086 Assembly using Turbo Assembler. The project preparation programs are as follows:

Lab9a.asm -> reading and writing multiple-digit integer.

Lab9b.asm -> File I/O reading characters from default ASCII file and output to default file. All ASCII characters are counted by a counter.

Lab9c.asm -> File I/O reading characters from default or user-defined input file. Alphanumerical characters are counted by a counter.

Demos of the lab9x.asm files can be found here:
ftp://8086assembly:assembly@suluclac.dyndns.org
(under project folder)

Part 1 of project is:
Proj1.asm -> File I/O reading characters from default or user-defined input file and then count each of alphabets of A - Z.

Part 2 of project is:
Proj2.asm -> File I/O reading integers from default input file into an array and then sort the integers to ascending order. Output the result on screen and write to an ouput file.

I will greatly appreciate any help. All that I have to work with is a 5 page handout on 8086 Assembly Language. This handout contains no information whatsoever about the specifics of these programs, not to mention how abstract and machine specific Assembly Language is. :cool: Thanks for your time!

Jenny

jenny_mcguire1@hotmail.com
 
Hi Jenny,
I didn't understand your post, are you asking for a book for example help you with this project, or you want code?
Walid Magd
Engwam@Hotmail.com
 
Mark,

Thank you so much for responding. If at all possible, I would like code with comments explaining the syntax. I learn better this way. I'm sure you're busy with your profession and I thank you for taking the time to respond to my concern for this project. I find 8086 Assebmly interesting and I want to make sure that I understand.

Jenny
jenny_mcguire1@hotmail.com
 
The ftp link above is correct but the hyperlink is not. (obviously). this is the link, after TARGET="_new"> You can copy and paste into your web browser from ftp down to and including .nu

"ftp://8086assembly@assembly.mine.nu
The password is -> assembly


I am in dire need of help. I was not given any instruction whatsoever how to even approach this. Any help is greatly appreciated. I need to :)I Commencement is on May 19
 
Hi,

I have briefly read through the 3 project preparation programs. They are very well commented. What is it that you don't understand?

David
 
Lab9a works somewhat. If I enter 25, the output I get is 2/
My ah register may have garbage in it and I haven't tried "mov ah, 0" yet. (Demo9a under project folder)

Lab9b I figured out.

Lab9c is almost identical except that it only counts alphanumeric characters (which I figured out as you saw with the commentary). The trouble I'm having with Lab9c is being able to allow a user to specify an input file at a prompt. (Demo9c under project folder). I don't know how to take a string as input and assign it to "filename".

Thank you for taking the time to look at my code *:->*
 
For Lab9a, I understand the concept. If a user enters 25, 2 and 5 are pushed onto the stack. When outputed, 5 is popped first then 2, so the output would read 52. (I understand that this is not the number fifty-two but is just simply the number five and two).

What this program does is multiply the five by one (1) to mark the ones position, multiply the two by ten (10) to mark the tens postion, etc. so that if these numbers were added together after being multipled by the factors of 1 and 10, the answer would be 25 (twenty five) and this number is outputed to the screen.

This program only excepts a four digit input and will error out if a user enters five numeric characters at a given time. Invalid characters are converted into a default numerical value.
 
Looks like William_III made reference to my ftp site for some reason. I appreciate the extra hand, but this is my code and I've worked very hard on it, so maybe you just forgot to make mention?
 
Hi,

From your messages, I gather that you have solved the problems for Lab9a and Lab9b. So I will comment on Lab9c which requires the user to type in a string to be later used as a filename.

There are 2 ways (I can think of right now) to achieve this:

1) Get the user to type in the filename as a command line argument. You see, DOS captures whatever text that is typed in after the program name to offset 81H in the program segment prefix (PSP). When the program starts running, both DS and ES points to the PSP. So before you initialized both your DS and ES (usually done at start of program), retrieve the command line argument first. (Or you can initialized DS first, and use ES later to retrieve the argument.) Copy the text into a buffer by :

mov si, 81h
xor di, di
a:
mov al, es:[si]
cmp al, 0dh ;test for carriage return
je b
mov buffer[di], al
inc di
inc si
loop a

b:

Test for a carriage return b'cos that signals end of argument.

2) Prompt the user to key in filename. Then get filename using DOS interrupt 21h, function 0ah. Read up this function to know how it can be used.

After you got the string, append a zero value to the end of the string and call DOS interrupt 21h, function 3dh to open the file and function 3fh to read from file.

Of course do check for errors such as file not found.

HTH,
David
 
Thanks David :) I will give this a try and let you know how things went! I really appreciate your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top