Assembler Graphic Mode

simicoder

Mitglied
Hi,
Ich würde gerne in Assembler im Grafik modus 6A ein Bild pixeln und danach in den Text Modus zurück springen. Wie springe ich in den grafik Modus und Zurück? und wie ist das mit der Farb palette? welche Farbe ist ZB. Rot ? und wo muss ich welchen wert hinverschieben ?
Kann mir viieleicht jemand ein Beispiel Programm schicken das mir ein Rotes Pixel ausgibt?
Gruß Simicoder
 
Also ich hab ne Lösung gefunden aber was mach Ich falsch das es mir keinen roten Farbblock ausgibt?


call SetMode12
mov bx, 400
mov cx, 51
mov ax, 4
jmp pix
eof:
call ...

pix:
sub cx, 1
call pixel
cmp cx, 0
je pix1
jmp pix
pix1:
xor cx, cx
mov cx, 51
sub bx, 1
cmp bx, 0
je eof
jmp pix

clear:
mov ax,03
int 10h
ret


SetMode12:
mov ax, 12h
int 10h
mov dx,03ceh
mov ax,0205h
out dx,ax
ret

pixel: ;ax = farbe ;bx = y koordiante ;cx = x koordinate
push ax
mov ax,0xA000
mov es,ax
mov di,bx
shl di,6
shl bx,4
add di,bx
mov bx,cx
shr bx,3
add di,bx
and cx,7
mov ah,128
shr ah,cl
mov dx,03ceh
mov al,8
out dx,ax
mov dl,[es:di]
pop ax
mov [es:di],al
ret

könnte mich vieleicht jemand mal korrigiren?
 
Zuletzt bearbeitet:

Neue Beiträge

Zurück