I have a function that returns a long which is dx:ax. I am calling DOS 42h to set/get the file position and I already have dx:ax prepared by that function call.
Other functions I've done just return AX with a simple:
return _AX;
but when I am trying to return a long, I can't do a return _DX:_AX;
I can do a return with no argument which works, but generates a compiler warning because it expects a long.
I've ended up doing this which works, but I don't love it:
unsigned dx, ax;
<code>
ax=_AX;
dx=_DX;
return ((long)dx<<16) | ax;
Maybe there is nothing better...
Other functions I've done just return AX with a simple:
return _AX;
but when I am trying to return a long, I can't do a return _DX:_AX;
I can do a return with no argument which works, but generates a compiler warning because it expects a long.
I've ended up doing this which works, but I don't love it:
unsigned dx, ax;
<code>
ax=_AX;
dx=_DX;
return ((long)dx<<16) | ax;
Maybe there is nothing better...