2.Zh-3.feladat-VGA

2.Zh-3.feladat-VGA
 avatar
brczmk
assembly_x86
2 years ago
922 B
3
Indexable
Never

Code	Segment
	assume CS:Code, DS:Data, SS:Stack

Start:
	mov ax, Code
	mov ds, ax
	mov dh, 1
	mov dl, 1
	push dx
; VGA MÓDBA LÉPÉS INNEN:
	mov ax, 13h
	int 10h
	mov ax, 0a000h
	mov es, ax
; EDDIG

	mov si, 15
	mov cx, 150
i:
	PUSH CX ; ; 29
	MOV CX, 150
j:
	POP BX ; 29;11|
	POP DX ; 11|
	PUSH BX ; 29|
	xor ah, ah
	mov al, dh ; dh*320+dl

	PUSH DX ; 00 ; 30
	mov bx, 320
	mul bx
	POP DX ; 30|
	add al, dl
	jnc Pixel
	inc ah
Pixel:
	push dx ; 00 30|
	mov di, ax
	xor ah, ah
	mov ax, si
	mov es:[di], al
	pop dx ; 01 30 |
	inc dl
	POP BX
	PUSH DX
	PUSH BX
	loop j
	POP BX
	POP DX
	inc dh
	mov dl, 1
	PUSH DX

	cmp si, 15
	jz LegyenKek
	cmp si, 9
	jz LegyenFeher
LegyenKek:
	mov si, 9
	jmp EndPoint
LegyenFeher:
	mov si, 15
Endpoint:
	MOV CX, BX ; CX = 30
	loop i

Program_Vege:
	xor ax, ax
	int 16h
	mov ax, 03h
	int 10h
	mov ax, 4c00h
	int 21h
Code	Ends

Data	Segment

Data	Ends

Stack	Segment

Stack	Ends
	End	Start