optimization - Division of high numbers in assembly -


i tried find location of crusor array of 1896(becomes whole console in 2d, 79*24). took location , divided 79.

mov ax, [y-16h]  dec ax  mov bx, 79  div bx     mov z, dl  add z, dh  mov dl, z  mov z, al  add z, ah  mov dh, z 

i overflow error. can tell me doing wrong please? maybe suggest solution?

div bx divides 32-bit number formed dx (high word) , ax (low word) bx. therefore need clear dx (e.g. xor dx,dx) prior division avoid overflow.

by way, sure don't want divide 80? i've never heard of 79-column console, although i'm no expert on such matters


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -