Archived

This topic is now archived and is closed to further replies.

Jiggold

Very Rookie Question about C/C++: REGS

Recommended Posts

I posted this in the Lounge, too, so please disregard if you''ve already read it, thanks. Rookie question time: I''m trying to learn about REGS through my "C for Dummies" book, but every time I run the example programs, I get errors. I tried cross-referencing the term in my other C/C++ books, but didn''t find anything. I''m using MSVC++ and Dev-C++. Is it because both of these compilers are Windows and the examples in the book are written in a DOS compiler, or should it matter? I think I understand the technical application of the command, which means, if I''m guessing right, that the command would only be valid in a DOS setting. Right/wrong? Please help!!! --------------------------- "Until next time, boobie. Push the button, Frank."

Share this post


Link to post
Share on other sites
Hmm.. I seem to recall that REGS was a struct for holding the value of registers to pass to interrupts that were called from C code. You would be correct in assuming that this was a dos specific structure.

In short, you can''t (and don''t) need to use the REGS structure in Windows.

PreManDrake

Share this post


Link to post
Share on other sites
The union REGS is located in the dos.h header file. That means that you need a DOS compiler in order to be able to use REGS. Try downloading DJGPP.

Share this post


Link to post
Share on other sites
Permandrake: Thanks, I though so but wasn''t sure. I included the dos.h when I wrote the progs and never got an error for it.

NuffSaid: Thanks, but I can''t get access to FTP through my work computer. EDS is kinda stingy on some things (justafiably so, really). I have Borland C++ 4.52 at home, though, too and I think it can be used in DOS.

Another question this raises for me: what should I be learning to program for Windows? Or, should I keep going like I am now and eventually I''ll get there?

---------------------------
"Until next time, boobie. Push the button, Frank."

Share this post


Link to post
Share on other sites
Yeah, the chapter dealing with dos-only stuff threw me too

I solved this problem by shelving vc++ until I was comfortable using c in dos (v. old version of borland c++), and when I returned to vc++ it wasn''t a problem as I knew the language enough to learn some win32 stuff.

All you need to do is sit down with the generic sample from vc++ and fiddle with it as much as youcan without breaking it. The problem with win32 is that there''s 2001 different ways to do the same things, so you need to experiment.

To answer your question:

Yes, stick with plain-vanilla c for now. If you''re not too concerned about fancy graphics and sound, you coould stick with console-text apps, but if you want to duse graphics (read: make games) you need to learn at least win32 then directx (or GDI if you''re a performance-sadist).

Hope this helps.

Waassaap!!

Share this post


Link to post
Share on other sites
pick up Andrea LaMonthe book, Trick of the Windows Game Programming Gurus. It has everything you need to get started, including a beginners version of VC6.

I'd drop the dos stuff, i did when i got to bank switching, my head just started hurting... (now known as ModeX)

the reasons REGS doesnt work, has more to do with the fact that that is a 16bit processor data register format, and with a modern windows compiler, you're in the protected/flat/32bit mode, and not the real mode.

you might be able to use some of the code using inline asm
it really pisses-off windows when you twiddle the video buffer directly though...
Edited by - Magmai Kai Holmlor on October 6, 2000 12:22:56 AM

Edited by - Magmai Kai Holmlor on October 6, 2000 12:27:42 AM

Share this post


Link to post
Share on other sites