Mail Archives: djgpp/2014/07/18/01:36:41
--001a1136028c096f7404fe7123c2
Content-Type: text/plain; charset=UTF-8
DJ: FYI, the examples on dosmemputl & dosmemputb (
http://www.delorie.com/djgpp/doc/libc-2.02/libc_172.html and
http://www.delorie.com/djgpp/doc/libc-2.02/libc_170.html) don't match the
signature (the examples appear to be wrong) nor does it match the
order/signature of dosmemputw. I wonder how thousands of eyeballs missed
that.
Jim: If you're looking to do EDD/LBA, see this older thread (
http://www.delorie.com/djgpp//mail-archives/thread.cgi?msg=djgpp/2003/04/12/08:15:18&mode=frames
)
On Thu, Jul 17, 2014 at 8:31 PM, DJ Delorie <dj AT delorie DOT com> wrote:
>
> > 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)).
>
--001a1136028c096f7404fe7123c2
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><span style=3D"font-family:arial,sans-serif;font-size=
:13px">DJ: FYI, the=C2=A0</span><span style=3D"font-family:arial,sans-serif=
;font-size:13px">examples</span><span style=3D"font-size:13px;font-family:a=
rial,sans-serif">=C2=A0on dosmemputl & dosmemputb (</span><font face=3D=
"arial, sans-serif"><a href=3D"http://www.delorie.com/djgpp/doc/libc-2.02/l=
ibc_172.html">http://www.delorie.com/djgpp/doc/libc-2.02/libc_172.html</a> =
and=C2=A0</font><span style=3D"font-family:arial,sans-serif"><a href=3D"htt=
p://www.delorie.com/djgpp/doc/libc-2.02/libc_170.html">http://www.delorie.c=
om/djgpp/doc/libc-2.02/libc_170.html</a></span><span style=3D"font-size:13p=
x;font-family:arial,sans-serif">) don't match the</span><span style=3D"=
font-size:13px;font-family:arial,sans-serif">=C2=A0</span><span style=3D"fo=
nt-size:13px;font-family:arial,sans-serif">signature=C2=A0</span><span styl=
e=3D"font-size:13px;font-family:arial,sans-serif">(the examples appear to b=
e wrong) nor does it match the order/signature of=C2=A0</span><span style=
=3D"font-size:13px;font-family:arial,sans-serif">dosmemputw</span><span sty=
le=3D"font-size:13px;font-family:arial,sans-serif">. =C2=A0I wonder how tho=
usands of eyeballs missed that.</span></div>
<div><br></div><div>Jim: If you're looking to do EDD/LBA, see this olde=
r thread (<a href=3D"http://www.delorie.com/djgpp//mail-archives/thread.cgi=
?msg=3Ddjgpp/2003/04/12/08:15:18&mode=3Dframes">http://www.delorie.com/=
djgpp//mail-archives/thread.cgi?msg=3Ddjgpp/2003/04/12/08:15:18&mode=3D=
frames</a>)</div>
</div><div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Thu,=
Jul 17, 2014 at 8:31 PM, DJ Delorie <span dir=3D"ltr"><<a href=3D"mailt=
o:dj AT delorie DOT com" target=3D"_blank">dj AT delorie DOT com</a>></span> wrote:<br=
><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1=
px #ccc solid;padding-left:1ex">
<br>
> an example that includes an actual variable that'w wider than 1 by=
te<br>
> to put into memory would be very very helpful.<br>
<br>
The dosmemputw example puts a "variable" (the array) which is 4,0=
00<br>
bytes long. =C2=A0The _go32_dpmi_allocate_dos_memory() example moves<br>
want_size bytes at a time.<br>
<br>
> if buffer is the target as it's described, where do I put the<br>
> source? no argument for this I can find.<br>
<br>
The dosmemputw et al function have three different arguments. =C2=A0Only<br=
>
one is a pointer. =C2=A0One is documented as a physical address. =C2=A0The<=
br>
documentation says "from the program's virtual address space"=
so the<br>
pointer argument is the source, and "to MS-DOS's conventional memo=
ry<br>
space" with the math for computing that using offset, which is the<br>
destination. =C2=A0It then says "and buffer is a pointer to somwhere<b=
r>
... where the data will come from."<br>
<br>
I'm not sure how this is confusing.<br>
<br>
> =C2=A0 =C2=A0 const uint16_t key=3D0xb055;<br>
> _dosmemputw(__tb+0,1,info.rm_segment*16);<br>
><br>
> where do I put the address for key?<br>
<br>
In this case, __tb is the physical address, and &key is the virtual<br>
address of your data.<br>
<br>
_dosmemputw(&key, 1, __tb+0);<br>
<br>
If you allocate *more* dos memory, you now have two physical addresses<br>
for two buffers (the transfer buffer, __tb; and the new buffer,<br>
address in info (seg*16+ofs)).<br>
</blockquote></div><br></div>
--001a1136028c096f7404fe7123c2--
- Raw text -