PMode tutorials in C & Asm

Disclaimer

PMode Tutorials in C & ASM
Copyright (C) 2000 Alexei A. Frounze

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Introduction

I've started out this series of the PMode tutorials just for making PMode more clear and easier to learn. Complexity level of the tutorials increases from first tutes to last ones. It makes easier to get into PMode. A beginner is supposed to learn PMode step by step.

Why C and Asm?

Since pure assembly implies a lot of source code, starting something completely new (PMode, for example) is very difficult with ASM. So I decided to make the tutorials in C with a little of ASM. Such tutorials are about 2 times shorter than tutorials made in pure ASM. I think it's very handy for a beginner. (s)he won't get lost in tons of the sources.

Why Turbo C 2.01 and NASM 0.98?

Turbo C 2.01 and NASM 0.98 are available for free. Hence, anyone who wants to learn from my tutorials and make his/her own stuff using them, can have them absolutely for free. Actually, there is yet another free 16-bit C compiler available from Borland: Turbo C++ 1.01, which is much better due to improvements in IDE and syntax extensions in the language. Needless to say, we don't use OOP features of TC++. :)

System Requirements

Turbo C 2.01 Limitations

Since Turbo C 2.01 is a pretty outdated completely 16-bit compiler, you may notice some problems with 32-bit values... For example, when your program works in PMode, you're unable to use arithmetical shifts for 32-bit (long) integers. That's because these shifts are made as run-time C library subroutines and each such shift implies a far call to a subroutine. And such far calls are not allowed in protected mode because real mode segment values don't work in PMode. Be careful with 32-bit shifts, muls, divs. If you have Borland C/C++ 3.1, it's possible to avoid this problem because this compiler is capable of generating of 32-bit instructions for 32-bit arithmetics. The mentioned limitations hold for Turbo C++ 1.01 as well as for Turbo C 2.01.

Where do I get Turbo C 2.01 and NASM 0.98 from?

Turbo C 2.01 and Turbo C++ 1.01 are available at Inprise web site:
http://community.borland.com/museum/
You must register before downloading.

NASM (Netwide Assembler) 0.98 is available from:
http://www.web-sites.co.uk/nasm/

Where do I get those Tutorials?

[Read an on-line text doc on archive contents (contains info on each tut)]
A new package - 3 July, 2000:
[tut01] [tut02] [tut03] [tut04] [tut05] [tut06] [tut07] [tut08]
[tut09] [tut10] [tut11] [tut12] [tut13] [tut14] [tut15] [tut16]
[tut17]

If you can't download the tutorials from here (sometimes there are problems with that on tripod.com), download them from here or here.

Acknowledgements

Thanks to Prashant TR (tr@midpec.com) for his useful suggestions, present and further work on documentation for this package.

Contact Information

Author name: Alexei A. Frounze
E-mail: alexfru@chat.ru Please put "he110" (one hundred & ten) into the subject line
Homepage: http://alexfru.chat.ru
Mirror: http://alexfru.narod.ru
Home of this page is located at: http://welcome.to/pmode or https://members.tripod.com/protected_mode/