Re: Rob: questions
Bernie Ryan writes:
> If Causeway allows a 0..640k map. How come when I allocate_low
> with my first instruction in a program, I don't get back a low address
> near zero ?
The operating system reserves important memory locations
near zero for itself.
> When I am trying to use real mode dos interrupts, the segments are
> required to placed into registers and other structures.
If you want to do dos *software* interrupts, you should look at
demo\dos32\dosint.ex, not hardint.ex which shows *hardware*
interrupts.
When you call dos_interrupt() you switch from the 32-bit world,
of 16-bit segments and 32-bit offsets, into the old 16-bit world
of 16-bit segments, and 16-bit offsets.
Addresses in the 16-bit world (real mode) are represented by
segments and offsets. The actual physical address equals
the segment value times 16 (*not* times 64K as you might expect!),
plus the offset. The same address can be represented by
many possible combinations of segment value and offset value
(for example, add 16 to the offset and subtract 1 from the segment,
and you get the same physical address).
This code, taken from dosint.ex, shows one way to convert a
flat address returned by allocate_low() into a segment
and offset to be stored in the data segment register and another
register...
low_buff = allocate_low(100)
reg_list[REG_DS] = floor(low_buff / 16) -- segment
reg_list[REG_SI] = remainder(low_buff, 16) -- offset
...
dos_interrupt(....)
Regards,
Rob Craig
Rapid Deployment Software
http://members.aol.com/FilesEu/
|
Not Categorized, Please Help
|
|