1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| PROC setVideoMode
ARG mode RETURNS eax
mov eax, [mode]
int 10h
ret
ENDP setVideoMode
PROC waitKey
mov eax, 0
int 16h
ret
ENDP waitKey
PROC start
sti ; Set The Interrupt Flag
cld ; Clear The Direction Flag
push ds ; Put value of DS register on the stack
pop es ; And write this value to ES
; Your code comes here
call setVideoMode, 13h
mov edi, 0a0000h
; setup colors
mov esi, offset pal ; set the palette (DAC) address
mov ecx, 2 * 3 ; set color 0 and 1 (2 indexes in total, 2 * 3 bytes)
mov dx, 03c8h ; VGA DAC set port
mov al, 0 ; set start color index
out dx, al
inc dx
rep outsb
add edi, 360 *10 +160
mov [dword ptr edi], 1
call waitKey
call setVideoMode, 3h
mov eax, 4c00h ; AH = 4Ch - Exit To DOS
int 21h ; DOS INT 21h
ENDP start
;北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北?
; DATA
;北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北?
DATASEG
; Your data comes here
pal db 0, 0, 0, 63, 63, 63
blockarray db 200 dup(1) |
Partager