Click to See Complete Forum and Search --> : TASM Troubles


Bad_Programmer
April 17th, 2005, 07:26 AM
Hi I'm using tasm programming in 8086 and trying to create a program that gets a digit from the user and then graws 5 squares each with a side length of the digit.

When my program reaches the sub method for drawing the square i get an error from the computer, it may have somthing to do with running a sub from within a sub and stack opperations. Can some one please help me!!

P.S There are also a lot of other problems with the program, that i have not implemented yet, and if u have any inside knowledge on how to do these extra things it would be greatly appresiated

Hobson
April 20th, 2005, 04:16 AM
Try to send parameters to your subroutines via registers, and not stack. That would make code much clearer, and it would be harder to accidentally swap arguments when reading them from a stack.
Also, if you use tasm/tlink, you possibly also have td.exe (Turbo Debugger), very good tool for debugging purposes. Just type in commandline 'td myexe.exe' and keep hitting F7 and watch registers and memory window.

Firs thing I found in your program is that it draws outside of screen, at coords like 4200h. Either coords calculation is broken, or arguments are swapped when reading them from stack.

Hob