From: James W. <jam...@ya...> - 2005-09-04 01:50:39
|
Hello! I am trying to improve my knowledge of NASM and IA32 assembler by translating the lessons from Petzold's Programming Windows into NASM assembler. The thing is that adding additional instructions is causing the program to draw erratically. BUT! That can be fixed by adding nonsensical code. For example, the program runs OK until I add the following to it push dword WHITE_BRUSH call [GetStockObject] ; ignore result in eax This is at a point where eax does not need to be preserved. Then I add the following code push dword eax add esp,4 The program runs properly now As I check this code can be inserted after add esp,4 xor eax,eax And it makes no difference. Because eax should not matter there. I realize that many people on this list are not using Windows, but I am just stymied. Is there an issue with code alignment, linking, what? I must be doing something REALLY STUPID but I just can't think where to look. I suppose that there is an error somewhere else in my code but how could push eax add esp,4 correct them? Does it make sense to suspect the linker? Thanks James ____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs |