Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

BIG "C" compiler cmp | the "scientific" facts ore out DW (Developers)

posted by DOS386, 10.03.2008, 12:07

> Could you someone explain to me what mean zero/nonzero based memory model?

ZERO-based: base of CS, DS and SS is ... yeah ... ZERO 0 ;-)

Non-ZERO-based: base is <>0 ... or !=0 for you ;-) ... mostly it is > 0 , but who knows, could be also < 0 maybe :lol:

> are the advantages and issues of this?

ZERO:

+ Easy access to whole memory, incl. low memory and VESA LFB
+ Better compatible with DeLL-hell ???
- Faulty C pointers can damage low memory

NON-ZERO:

+ Faulty pointers can do less damage
- Need hacks to access low memory and VESA LFB

> Why DJ decided to use it

C pointers, I guess ;-)

> I use C (mostly DJGPP) because I don't want to mess with memory management
> and let compiler to do it for me.

We know ;-)

> And I think DJGPP serves enough functions
> for accessing real and entire physical memory.

entire: YES , there are some ;-)

physical: NO , not even DPMI supports this fully: map: YES , allocate: NO :-(

With ZERO-base, accessing VGA or VESA is as easy as:

         ; Assume DS=ES , ZERO based
         mov edi,$A0000
         mov esi,qqbuffer
         mov ecx,16000
         rep movsd


         ; Assume DS=ES , ZERO based
         mov edi,qqphys ; Physical
         ...
         blah, blah, call INT $31/$0800 to "map"
         ...
         ; Now EDI has "linear" possibly paged/mapped address
         mov esi,qqbuffer
         mov ecx,qqvesasize ; In 32bit units
         rep movsd


NO NEED to change segment registers or create a mess of selectors ;-)

---
This is a LOGITECH mouse driver, but some software expect here
the following string:*** This is Copyright 1983 Microsoft ***

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 239 users online (0 registered, 239 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum