Hello All,
I am really in need of some help. I am trying to create an "address
book" application using 80x86 assembly language. I can get to read
from a text file, and write to it, but I have no idea how to go about
finding a "record" in the file, or how to go about deleting a "record"
from the file. Each "record" is on a new line in the file, an d
stores:
first name, last name, age, id number.
Thanks and regards,
Ryan.
|
|
0
|
|
|
|
Reply
|
spamtrap2 (1628)
|
5/5/2007 10:59:50 PM |
|
r.dossantos schrieb:
> Hello All,
> I am really in need of some help. I am trying to create an "address
> book" application using 80x86 assembly language. I can get to read
> from a text file, and write to it, but I have no idea how to go about
> finding a "record" in the file, or how to go about deleting a "record"
> from the file. Each "record" is on a new line in the file, an d
> stores:
>
> first name, last name, age, id number.
Does the records placed in defined size?
Else mayby a carriage return(0Dh) or a linfeed(0Ah) can help to find the
end of a line. Then you can copy the rest of the file, to the begin of
the line that you want to delete.
Dirk
|
|
0
|
|
|
|
Reply
|
Dirk
|
5/6/2007 6:36:49 AM
|
|
On 5 May 2007 15:59:50 -0700, r.dossantos <spamtrap@crayne.org> wrote:
>Hello All,
>I am really in need of some help. I am trying to create an "address
>book" application using 80x86 assembly language. I can get to read
>from a text file, and write to it, but I have no idea how to go about
>finding a "record" in the file, or how to go about deleting a "record"
>from the file. Each "record" is on a new line in the file, an d
>stores:
>
>first name, last name, age, id number.
>
>Thanks and regards,
>Ryan.
>
Sounds like you will need to find more than just each record
(which as DIrk suggests you can do with carriage return and line
feed); you will also need to be able to find each field in a record.
For a simple database like this, you would probably be best
off to use defined-size fields. You will need to decide how much
space to allocate to each field. Some can be very short, such
as age (one byte). ID number is probably already a defined
size. But for names you have to pick a balance between being
able to handle very long names, versus wasting lots of space
for all the shorter names. And you will need to have a mechanism
on the input side to restrict entry to field size.
Once you have done that, the answer to your question should
be obvious: One record size is the sum of all fields in that record.
To find any record by number, multiply the record number by the record
size. To find based upon contents of a certain field (last name, say)
you search by starting at the beginning of the chosen field in the
first record, and if that's not a match you just add the record size
to the filed start to get to the start of the same field in the next
record.
Deleting a record will involve moving all other records up to fill
the gap. (Hint: Spend some time drawing little diagrams about
how the move should proceed, so that you don't overwrite
the data you want to move next.)
No need for carriage returns and line feeds to be stored; just
add them for display.
Best regards,
Bob Masta
D A Q A R T A
Data AcQuisition And Real-Time Analysis
www.daqarta.com
Scope, Spectrum, Spectrogram, Signal Generator
Science with your sound card!
|
|
0
|
|
|
|
Reply
|
NoSpam
|
5/6/2007 12:03:06 PM
|
|
On May 5, 5:59 pm, r.dossantos <spamt...@crayne.org> wrote:
> Hello All,
> I am really in need of some help. I am trying to create an "address
> book" application using 80x86 assembly language. I can get to read
> from a text file, and write to it, but I have no idea how to go about
> finding a "record" in the file, or how to go about deleting a "record"
> from the file. Each "record" is on a new line in the file, an d
> stores:
>
> first name, last name, age, id number.
>
> Thanks and regards,
> Ryan.
Since any good text editor can do what you are trying to do in
assembler, I assume that you are doing this for the sake of the
exercise. If so, you can, of course, follow the preceding advice and
restrict yourself to fixed length fields. A more challenging exercise
is to allow variable length fields together with an index, either in
the same file or in a separate file, the latter being easier to
develop and maintain. The fields in the index file are of fixed
length, each containing a pointer to the respective record and the
length of the record in your data file, as well as respective pointers
and lengths for of each field in the record. Field pointers may be
relative to the beginning of the record.
Details are up to you to plan. They depend on the operating system
under which you develop your program.
|
|
0
|
|
|
|
Reply
|
lavron
|
5/6/2007 8:19:41 PM
|
|
|
3 Replies
116 Views
(page loaded in 0.063 seconds)
Similiar Articles: Maximizer 9 & Businessvision 7 - comp.databases.btrieveSurprisingly (I just found this out), after entering through all the errors, it appears to open the program ok, and I even tested adding a contact to the Address Book ... Calendar / appointment software for touchscreen.. - comp.os.linux ...Touch Screen PC Software - Family Organizer, Calendar & Planner ... Touch Screen Software for the PC. Touch Screen Calendar, Email, Address Book, To Do Lists ... lost address book? - comp.mail.eudora.ms-windowsThe nndbase.txt file matches what I see when I open the address book in Eudora. ... Z80 to 6502 opcode equivalents? - comp.sys.cbm... never had to program z80, I only ... Juno - lost email and folders. please help - comp.mail.misc ...Juno 5.0 Support - Email - Address Book and Email folders missing ..... my Juno software and now my Address Book and email folders are ... installed Juno in more than ... Column headers for exported data - comp.databases.filemaker ...... the data with a header row to simplify field mapping > when you import it into something else (be it an outlook address book, > some 3rd party shipping software ... Better explanation of NTP public-key authentication? - comp ...... from "bizarre" to "unintelligible", and the behavior of the "ntp-keygen" program does ... believe he will be open to improvments after he is done writing The Book, in ... Move Thunderbird to new laptop - comp.sys.mac.appsI am going nuts trying to move my Thunderbird files/old emails/address book to the ... Hi all I am running Fedora 11 on my laptop (IBM T60 ... 11 with many software ... read() error - Bad Address - comp.unix.programmerHi, I'm facing a problem with my network program. I'm writing a basic server that handles multiple clients. Whenever a client is connected, a new t... Segment, Base Address, PM, ... - comp.lang.asm.x86... This is where you send me back to confusion ! > >When I run the following software ... comp.mail.eudora.ms-windows Things seem OK, except it's using a very old address book. question marks appearing in email - comp.sys.mac.apps... up. > > I use a Mac and the person I am referring to uses a PC Your mail program ... lost address book? - comp.mail.eudora.ms-windows question marks appearing in email ... Address Book Software - Baseball Software, Softball Software ...Name and Address Book Software for home or business. Perfect for mailing your holiday cards or invitations. Address Software for Windows 7/Vista/XP. Easy Address Book - Product reviews and prices, software downloads ...This is a very basic Address Book program that was created with ease of use in mind. It stores name, mailing address, telephone number(s), and e-mail addresses for ... 7/24/2012 3:10:06 PM
|