News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

True DOS program help, please?

Started by KrisB, April 25, 2005, 02:30:05 PM

Previous topic - Next topic

KrisB

Greetings,

I am a newbie and I have been struggling with a 16 bit DOS program that I have been requested to create.

This small program simply needs to read a database or a csv after the user inputs a zipcode. From this there will need to be two variables which will include the current time zone and whether or not they use daylight savings time.

I have not done any work with True DOS previous to this (unless you count high school 20 years ago) and I have searched the web for 4 days and even visited bookstores to see if I could find any information that would at least point me in the right direction. I have been utterly unsuccessful.  :(

Any help I could get would be greatly appreciated. I'm at the end of my rope. :'(

Thanks in advance,
Kris

MichaelW

This seems like a task that would best be done in a high-level language.
eschew obfuscation

Tedd

What exactly are you having trouble with - the method? or the madness (coding :wink)??
No snowflake in an avalanche feels responsible.

KrisB

Quote from: MichaelW on April 26, 2005, 05:31:40 AM
This seems like a task that would best be done in a high-level language.


*grin*
Yes, I can do it easily in C# or VB.NET, however, those won't work on the old 16bit DOS OS that we need it for.  :boohoo:

Kris

KrisB

Quote from: Tedd on April 26, 2005, 11:15:16 AM
What exactly are you having trouble with - the method? or the madness (coding :wink)??


Yes! :)

I could do it in .NET

void Main()
{
System.Console.WriteLine("Welcome to Time Sync");
System.Console.WriteLine("Please Enter the Laptop's Originating Zip Code");
object ZipCode = Console.ReadLine;
OleDbConnection cn;
OleDbCommand cmd;
OleDbDataReader dr;
string TimeZone;
string DayLightSavings;
try {
   cn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\zipcode.mdb; Persist Security Info=False");
   cn.Open();
   cmd = new OleDbCommand("select TOP 1 * from table1 WHERE ZIP_CODE = '" + ZipCode + "' ", cn);
   dr = cmd.ExecuteReader;
   while (dr.Read()) {
     TimeZone = (dr("TIME_ZONE"));
     DayLightSavings = (dr("DAY_LIGHT_SAVING"));
   }
} catch {
}
dr.Close();
cn.Close();
}

But I have no idea how to do it so that it will run on True DOS.

:dazzled:
Kris

dioxin

Kris,
  I aggree with Michael, do it in a High Level Language unless there is some very good reason not to.
  There are plenty of DOS based High Level Languages available including free ones (e.g.QBASIC which came free with MSDOS and is still available) or PowerBasic which is not free. Either of those will easily do the job in just a few lines of code.

Paul.

P1

Kris,

I am assuming a native True DOS OS, and no M$ mdb drivers.

Output your current data to the CSV (Zip, TimeZone, DST).  Scan the file for the Zip on the beginning of the line.  Then once found, manipulate the rest of the CSV data to handle it the way you want.

Of course, I think QBasic or QuickC maybe better suited for this.

Regards,  P1  :8)


rea

Is posible to dump the data base to a ascii file and then load it again, that can be a way.

The database programm is also in 16-bit ¿? I dont understand this :P.

By the way, if you watch a programm in C for DOS that can do that, then in asm also can be done, perhaps you only need the interface for access the database..... by the way, thinking now in DOS how you call another programm if is mono-work(some one say the correct term :P ) ¿?. I supose you have a header and a .obj that can be statically linked for output a programm that *can* access the database commands¿? (If Im not wrong?).


I supose you need clarify more about the enviroment, the database is running in a Win32 Operative system, like Oracle, SQLitle or some other and you whant to access from console or you think you need 16 bit real-mode programming ¿?¿?...

KrisB

Quote from: rea on April 26, 2005, 01:45:58 PM
Is posible to dump the data base to a ascii file and then load it again, that can be a way.

The database programm is also in 16-bit ¿? I dont understand this :P.

By the way, if you watch a programm in C for DOS that can do that, then in asm also can be done, perhaps you only need the interface for access the database..... by the way, thinking now in DOS how you call another programm if is mono-work(some one say the correct term :P ) ¿?. I supose you have a header and a .obj that can be statically linked for output a programm that *can* access the database commands¿? (If Im not wrong?).


I supose you need clarify more about the enviroment, the database is running in a Win32 Operative system, like Oracle, SQLitle or some other and you whant to access from console or you think you need 16 bit real-mode programming ¿?¿?...

Yes, it comes down to all I need to figure out is how create an interface to access the database.
The database will be on a server that will be accessed by various people throughout the work day.

LOL
The server, I believe, is SQL 2003, but it will only host the database. The database theoretically will be in whatever format my program must utilize to access the information and save the variables which will then be moved into a batch file from the DOS os behind Windows 98.  (Yes, it is time to upgrade, but not plausible at this time).

My co-worker suggested SQLite as well, but that is another area that holds my weakness.

Kris

KrisB

Quote from: P1 on April 26, 2005, 01:40:35 PM
Kris,

I am assuming a native True DOS OS, and no M$ mdb drivers.

Output your current data to the CSV (Zip, TimeZone, DST).  Scan the file for the Zip on the beginning of the line.  Then once found, manipulate the rest of the CSV data to handle it the way you want.

Of course, I think QBasic or QuickC maybe better suited for this.

Regards,  P1  :8)



Yes, that sounds like what I may need to do.
I suppose I may need to research QBasic and / or QuickC.....

Thanks,
Kris

mnemonic

If you don't want to use QBasic or the like I would suggest SPHINX C-- as an option.
I don't know whether the current version supports DOS anymore but I think it should.
I sometimes play around with C-- on my old 286 SIEMENS laptop (I'm using an old version of C-- there).
C-- is a mixture between C and ASM. You'll find some info about C-- here in some subforum.

Regards
Be kind. Everyone you meet is fighting a hard battle.--Plato
-------
How To Ask Questions The Smart Way

P1

Quote from: KrisB on April 26, 2005, 02:12:49 PM
The server, I believe, is SQL 2003, but it will only host the database. The database theoretically will be in whatever format my program must utilize to access the information and save the variables which will then be moved into a batch file from the DOS os behind Windows 98.  (Yes, it is time to upgrade, but not plausible at this time).
You can do a triggered event from there, when there is a update to the base information, to run a CSV export, so you are assured of updated information in the parallel CSV.

QBasic was a suggestion.  Any of the older DOS based compilers should work for you, and maybe have some familiarity with.

Note to rea:  The CSV is an ascii database format type of file.

Regards,  P1  :8)

Bieb

If you still want to learn real mode ASM, you might want to have a look at Randy Hyde's Art of Assembly 16 Bit Edition

rea

I was thinking that CSV was a miswrite of CVS :P and I was thinking for what database if there is also a CVS ... ¿? a little confused I guess, thx for the clarification.

Indeed a good place to look at randy book about 16 bits.

MichaelW

Kris,

Without a good library of support procedures doing something like this in MASM would be fairly time consuming.

AFAIK QuickC is long gone. In case you don't know, QBASIC is an interpreter with limited capacity (nominally 160KB code and data combined). QBASIC 1.1 should be available on any Windows 9x CD in the oldmsdos directory, under other or tools, depending on the version. And it is included in the olddos archive available here:

ftp://ftp.microsoft.com/Products/Windows/Windows95/CDRomExtras/OtherUtilities/

Some of the older Borland tools are available for download here:

http://community.borland.com/museum/
eschew obfuscation