hi,
does anybody know where i can get an instruction of parsing ini-files in assembler
and please not with any api. im still doing this in real mode
thanks
Uni_Sol
ini iles parsing
uh.... ehmm... one assembler instruction for parsing ini-files . You do know what programming is right? Because even the smallest program for parsing ini files surely will consist of several hundred (maybe thousand) instructions. I guess you have to do some reading and accuire a bit more domain knowledge.
edit: eh an instruction as in tutorial? my bad
edit: eh an instruction as in tutorial? my bad
Last edited by os64dev on Tue Jul 24, 2007 7:52 am, edited 2 times in total.
Author of COBOS
- AndrewAPrice
- Member
- Posts: 2303
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Re: ini iles parsing
Do you have file opening/closing routines? If you know basic string manipulation, then you could through the .ini line by line. An .ini only consists of too parts:bsunisol wrote:hi,
does anybody know where i can get an instruction of parsing ini-files in assembler
and please not with any api. im still doing this in real mode
thanks
Uni_Sol
- A category (search for [ at the beginning and ] at the end of the line to know when you're entering a new catagory).
- A variable (search the = sign, the variable name is on the left, and the value is on the right).
Then if you want to find a variable under a category, loop through until you find the category, then loop through until you find the variable, and return the value! Simple!
My OS is Perception.
What are you actually trying to do?
If you are trying to convert an ini file in to a format your software recognises (parsing), you will still have to do as MessiahAndrw states.
Go through the file looking for [ and ]. Anything between these is a category. If you have some kind of state engine, you can enter the state for that category.
Next, any values in a category have the format lvalue=rvalue. I guess you already have a target data format in mind. You now need to act on rvalue as appropriate for the current state.
Cheers,
Adam
If you are trying to convert an ini file in to a format your software recognises (parsing), you will still have to do as MessiahAndrw states.
Go through the file looking for [ and ]. Anything between these is a category. If you have some kind of state engine, you can enter the state for that category.
Next, any values in a category have the format lvalue=rvalue. I guess you already have a target data format in mind. You now need to act on rvalue as appropriate for the current state.
Cheers,
Adam
- bsunisol
- Member
- Posts: 40
- Joined: Fri Apr 06, 2007 3:00 pm
- Location: Germany, Berlin and near Hamburg
Yes thats right. i wrote an interpreter for Prefix notation in c. and yes it was quite big.os64dev wrote:Because even the smallest program for parsing ini files surely will consist of several hundred (maybe thousand) instructions
so i asked for help to do that with asm for my osloader.
it is not realy necessary to do that in real mode. the file is loaded.
so i dont need the bios any more to load somethin from fdd.
My OASML library will help you do this of course if you know how to use a simple library. It has functions for opening/closing/reading from/writing to files and etc. It works in Real Mode and has been compiled in TASM. You can simply port it to NASM and other assemblers with just a few modifications.
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.