[Solved] Calculation problem
Posted: Sat Dec 15, 2007 10:16 am
I know it is probably a silly question, but I lose a lot of time and still cannot handle it.
This should be calculate the address of Video Memory for a position stored in BH and BL, but it appears that the start position is moved only by X. I load in BX 1010h and CALL my function, but text appears on the 1st line, 16th column, instead of 16th line, 16th colimn... Where do I mistake?
P.S. Sorry for the bad english
Code: Select all
XOR eax, eax ;Clear EAX for calculation
MOV al, dh ;Load the accumulator with start row
MOV cx, 80 ;Load cx with 80 because MUL require source
MUL cl ;Multiply by Screen Width - result is a word in AX
MOV cl, dl ;Load cx with the column
ADD ax, cx ;Adding the column to the result
MOV cl, 2 ;Multiply the result by two because
MUL cl ;every symbol is two bytes - one ASCII and one attribute
ADD eax, 0xB8000 ;Adding base address of Video Mem
P.S. Sorry for the bad english