Mail Archives: djgpp/2014/07/17/23:31:28
> an example that includes an actual variable that'w wider than 1 byte
> to put into memory would be very very helpful.
The dosmemputw example puts a "variable" (the array) which is 4,000
bytes long. The _go32_dpmi_allocate_dos_memory() example moves
want_size bytes at a time.
> if buffer is the target as it's described, where do I put the
> source? no argument for this I can find.
The dosmemputw et al function have three different arguments. Only
one is a pointer. One is documented as a physical address. The
documentation says "from the program's virtual address space" so the
pointer argument is the source, and "to MS-DOS's conventional memory
space" with the math for computing that using offset, which is the
destination. It then says "and buffer is a pointer to somwhere
... where the data will come from."
I'm not sure how this is confusing.
> const uint16_t key=0xb055;
> _dosmemputw(__tb+0,1,info.rm_segment*16);
>
> where do I put the address for key?
In this case, __tb is the physical address, and &key is the virtual
address of your data.
_dosmemputw(&key, 1, __tb+0);
If you allocate *more* dos memory, you now have two physical addresses
for two buffers (the transfer buffer, __tb; and the new buffer,
address in info (seg*16+ofs)).
- Raw text -