My program(assembly tasm 16bit) supposed to print a bar graph represtion for an array.Right now its only supports specificarray but I will add support for general cases in the f
Turbo Debugger sets a bunch of registers to 0 when it loads the program. When MS-DOS starts these registers are not set to null. The information which register needs to be null you can achieve by adding
xor ax, ax
xor bx, bx
xor cx, cx
xor dx, dx
xor si, si
xor di, di
xor bp, bp
at the beginning of the start procedure and by commenting it out successively. It will turn out that the delinquent is DX
. So search for the first function or instruction which expects a null in this register. I found it in the first div
instruction in FindWidthForColAndSpace
. This div
performs DX:AX/BX
and needs therefore a value in DX
. Is it an accident that the line xor dx, dx
follows the div
? It must be in front of it.