Hello,
I'm targeting the msdos/i8086 platform and am working on a function which will be called from a QuickBasic tool. The memory model is "compact". I have spent the whole weekend to find out what's going wrong and narrowed it down to the following problem:
var
wp: ^word;
c2: integer; // == smallint in msdos-mode
begin
wp:=ptr(3828,62); // returns 6 which is correct
move(ptr(3828,62)^,c2,2); // c2 = 6663, but could also be some other value
end;
I surely can use the first alternative, but I wonder what could go wrong with the second one?
Edit: In addition to that, compiling the same code in large memory model causes a hang in the "move" line -- which is also very strange (especially being "large" one of the memory models Microsoft recommends when using external code with QB).