To ZERO or NOT to ZERO (memory / segment basing) (DOSX)
> I hacked on the USEDPMI.ASM example (generously discussed in other forum
> ) - and got a true flat ZERO-based memory model !!!
> With very marginal adjustments only What's wrong ? Is the
> statement correct ? Did I miss something ? Where is the limitation
> supposed to come from ?
So please post your adjustments!
the problem is that "near32" addresses (=offsets) in MZ are always relative to the address the binary is loaded to, and this address is never 0 in DOS.
However, due to the way Intel cpus handle "call" and "jmp" opcodes it is possible to set the base of CS, SS, DS, ES to 0 and indeed run "non-flat" code then ... if it avoids certain things. Among these "certain things" is access to global variables, so it won't be a true option usually.
---
MS-DOS forever!
Complete thread:
- To ZERO or NOT to ZERO (memory / segment basing) - DOS386, 05.08.2007, 08:33 (DOSX)
- To ZERO or NOT to ZERO (memory / segment basing) - Japheth, 05.08.2007, 09:22
- To ZERO or NOT to ZERO (memory / segment basing) - DOS386, 05.08.2007, 14:45
- To ZERO or NOT to ZERO (memory / segment basing) - Japheth, 06.08.2007, 07:52
- To ZERO or NOT to ZERO (memory / segment basing) vs C - DOS386, 09.08.2007, 19:12
- To ZERO or NOT to ZERO (memory / segment basing) vs C - Japheth, 10.08.2007, 07:18
- To ZERO or NOT to ZERO (memory / segment basing) vs C - DOS386, 09.08.2007, 19:12
- To ZERO or NOT to ZERO (memory / segment basing) - Japheth, 06.08.2007, 07:52
- To ZERO or NOT to ZERO (memory / segment basing) - DOS386, 05.08.2007, 14:45
- To ZERO or NOT to ZERO (memory / segment basing) - Japheth, 05.08.2007, 09:22