ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ú ú ÛÛÛÜ ÜÛÛÛ ÜÛÛÛÜ ÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ ÜÛÜ ÛÛÛ ÛÛÛ ÛÛÛßßßßú | | úÛÛÛßÛßÛÛÛúÜÛÛ ÛÛÜ ÛÛ úß ÛÛ ß úß ÛÛÛ ÛÛÛ ÛÛÛ ú --o-- ú --o-- ÛÛÛ ú ÛÛÛ ÛÛÛÜÛÛÛ ßßßßÛÛÛ ßßßßÛÛÛ ÛÛÛúÛÛÛú ÛÛÛ ÛÛÛßßß ú | ú | ÛÛÛ ÛÛÛ ÛÛÛßÛÛÛ Ü úÛÛÛ Üú ÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛ ú ú ú ú ú ÛÛÛ úÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ ÛÛÛ ÛÛÛÛÛ ÛÛÛÜÜÜÜ ú A Living Legend ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Presents On 27-03-95 MASSiVE's Flat Real Mode by NiX / MASSiVE ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ FLAT REAL MODE ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ What is flat real mode? As many of you probably know, the 386+ has a few different processor modes, most important are: - Real Mode - Protected Mode - V86 Mode The advantage of Protected Mode (PM) above Real Mode (RM) is that in PM you have a flat 4 gigabyte big memory. So there is no need for segmenting anymore, another advantage is that you can protect your code and data, by making it inaccesible for other programs. The first advantage is the reason why lots of demos are coded in PM. The problem with PM is that you can't easily use your old routines and DOS or the BIOS. But by fooling the processor you can setup a variant of RM, being the FLAT REAL MODE (FRM)! In fact the processor is still in RM, so you can use old routines and BIOS/DOS, but all segments have a size of 4GB instead of 64KB. Using the 386+ 32 bits registers you can easily acces all this memory. This two things make Flat Real mode the perfect mode for demos and games. Another thing, but this is a bit uncertain, lots of code seems to run slower in PM than in RM or FRM. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ How does it works? The problem we face in RM are the 64K segment limits, which are set in the segment descriptors, by changing this descriptors you can set the limits to much more, up to 4GB. However, in RM your are not able to set the segment descriptors, this is only possible in PM. So we have to switch to PM before we can set the segment limits. Going to PM for this purpose is real simple, you don't have to bother about interupts etc. because we can just switch them of because they are not needed for setting the limits, after we return from PM we just switch them on again. I'm not going to explain how the segment descriptors exactly work, this is really not necesarry to understand the code. Which isn't necesarry to use it anyway, but if you want to understand it just read the sourcecode. It is proper documented, so you should be able to understand it. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ How to use it? When you are in FRM, you have full acces to 4GB of memory, but most of it probably isn't present in your computer, other parts can be occupied by other programs. To know wich memory we can use the driver HIMEM.SYS can be used. The routines in this package allow you to initialize HIMEM.SYS, and to allocate and de-allocate XMS memory, and all functions you need to use it. You can check the include file to find out about all the functions. To really acces the memory you must set a segment register to 0, and read or write to the absolute 32bit adress from the memory block. To really understand it have a look at the examples. They should explain everything much better. Another important thing is to make sure the A20 adressline is enabled, a routine is present to enable it. If you use FRM in an interrupt routine switch on the A20 everytime your interrupt routine is called, don't worry, it doesn't takes much time. If the A20 isn't enabled your adresses will be clipped at 1Mb. Also some HIMEM functions swith the A20 off, for this reason it is savest to enable it everytime after you've used one of the HIMEM functions. It is not necessary to return from FRM to RM, for normal RM programs there isn't any difference. If you encounter problems using Flat Real Mode you can always contact me, I'll try to help you out. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ About QEMM/EMM compatibilty... At the moment all of this is not compatible with QEMM and other V86 drivers, probably this is really impossible. However, I'm still trying to get things working with QEMM using VCPI, but probably also VCPI can't give me enough freedom to set up our favourite mode. But if I get it to work a new version of this package will be released immediatly. Also other improvement are coming up, which will make certain things easier and faster to do. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ How to assemble the examples??? Very simple: TASM EXAMPLE1 /M9 TLINK EXAMPLE1 /3 Nothing more and nothing less... If you want symbol information you can add /ZI and /V ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Thanks and Greetings: Special thanks to: Butterfly/MASSiVE for coming up with the idea of FRM in januari '94, and ofcourse for all the help with the descriptors and PM. Contagion/MASSiVE for providing a computer which actually had to swap to FRM... Mine seems to be in FRM always... Walken/Impact Studios for the tip on the 32bit code, which isn't used here, but which is very handy! Forge/Prologue for asking me to release this stuff... Without him I would have probably never released it :-) Special greetz fly out to: Phalanger/Agony, Sentinel/Agony, Laserdance, and all other FRM lovers out there! Also greetz to: Jinx/Logic Design, Hammer/Agony, Manticore/Hazard, GBC, Code Red/Hazard, Harlequin/Succes (We still have traumas after your music at TP4 :)), everyone in DSC and DGi, and the ones I've forgotten... ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Members List: At the moment MASSiVE consists of 4 members: - NiX Main Coding / Organizer - CONTAGiON Music / Co-Organizer - DiGiT Graphics - Butterfly Coding Support / Research - Acid Brain Graphics / Object Design ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ How to get in touch with us: To contact us you can send mail to us at one of our distribution-sites, a list is in this file. You can also get in touch with MASSiVE by sending us netmail, you'll have to address it to: Hendrik van den Boogaard at --------------------------- Fido: 2:512/64 [Public Board Driebergen] Sig: 27:2331/260 [Diabolo BBS Utrecht] SBC: 14:1000/653 [Public Board Driebergen] DGi: 68:310/17 [Sledge Hammer] Internet: massive.knoware.nl ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ You can also reach us at the following addres by normal mail: Jurjen Katsman / NiX Koppelweg 93 3704 GG Zeist Holland Speech: +31 (0)3404-54544 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ - Distribution site list - ³BBS Name ³BBS number ³Sysop ³Comments ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ MASSiVE BBS +31(0)????-???? Contagion MASSiVE WHQ (*) GBC II +31(0)2502-49975 Code Red MASSiVE EHQ GBC I +31(0)2503-25390 Consieler Sonority Systems +31(0)30-287842 Cyanosis The Real World +31(0)53-330190 Da Chief Ground Zero WHQ Enigma BBS +32-2-6403136 Dark Angel (*) At the moment MASSiVE BBS isn't online yet, as soon as it is, it will become our new WHQ. LIttle message to Dark Angel: As you can see we have accepted you as a dist-site, sorry about not mailing you but I will send mail soon... ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ