
PutPixel 320*200: how can i do it?
Quote:
> Someone knows what I must do to write a pixel in a 320*200 resolution.
> I use Turbo C++ 3.0 with Tasm 5
> Thanks !
; pop ax ; get Color (integer)
; pop dx ; get Y
; pop bx ; get X
push 0A000h
pop es
mov si, dx ; si = Y
shl si, 6 ; si = Y * 64
mov cx, si ; cx = Y * 64
shl si, 2 ; si = Y * 256
add si, cx ; si = (Y * 256) + (Y * 64)
mov es:[si+bx], al
ret
This code will POP the arguments into AX, BX and DX which is used to hold X,
Y and Color, you may have to swap the order, I cannot remember the argument
order. Also, this is 16-bit code.
For a block-fill or block-copy routine I would strongly recommend using a
loop of REP STOSD's or REP MOVSD's instead, the same goes for a Line
routine. You should also differ between straight lines or angeled (is this a
real word?) lines.
Regards,
Thomas.