Forum > Other

[solved] [msdos] Pointer operations



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:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var  wp: ^word;   c2: integer; // == smallint in msdos-modebeginwp:=ptr(3828,62); // returns 6 which is correctmove(ptr(3828,62)^,c2,2); // c2 = 6663, but could also be some other valueend; 
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).

Solved: it turned out I accidentally mixed system.a and prt0?.o files from different memory models


[0] Message Index

Go to full version