I heard that int 10h, ah = 0Ch is pretty slow, and to get a reasonable speed I would need to go to the memory and put the value into the pixel I want to, I set my video mode to be 13h
with int 10h
.
the call to change the video mode:
mov ah , 0
mov al , 13h
int 10h
and this is the procedure I wrote in order to put a pixel in the given coordinates:
drawFaster proc
; bp + 2 - row (dx)
; bp + 4 - column (cx)
; bp + 6 - color
mov bp , sp
pushad
mov ax , 0A000h - presumably the memory address of the screen
mov es , ax
mov ax , [bp + 2]
mov bx , [bp + 4]
mov cx , 320
mul cx
add ax , bx
mov di , ax
mov ax , [bp + 6]
mov [es:di] , al
popad
ret 6
endp
code that calls the function:
push bp
mov ax , 30
push ax
mov cx , 50
push cx
mov dx , 50
push dx
call drawFaster
pop bp
but for some reason, this yields no results, I don't know if the memory address is incorrect or if something else is. I need your help. Thanks!
The strange thing is that the following piece of code works
mov ax , 0A000H
mov es , ax
mov [es:0] , 30
but the following piece of code doesnt:
mov ax , 0A000H
mov bx , 0
mov es , ax
mov [es:bx] , 30