-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
loop: | ||
;read from keyboard | ||
;mov ah, 0h | ||
xor ah, ah | ||
int 16h | ||
|
||
; scape key pressed | ||
cmp ah, 1 | ||
je exit ;end game | ||
|
||
jmp draw | ||
|
||
draw: | ||
|
||
;vga mode | ||
mov ax, 13h | ||
;mov ah, 0h | ||
xor ah, ah | ||
int 10h | ||
|
||
mov edi, 0A0000h | ||
mov al, 4h ;color of the pixel | ||
mov [edi], al | ||
mov edi, 0A0001h | ||
mov al, 4h ;color of the pixel | ||
mov [edi], al | ||
|
||
|
||
mov edi, 0A0002h | ||
mov al, 4h ;color of the pixel | ||
mov [edi], al | ||
|
||
jmp loop | ||
|
||
exit: | ||
mov ah, 2 | ||
int 3 | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
line_size db 10 | ||
|
||
|
||
loop: | ||
;read from keyboard | ||
;mov ah, 0h | ||
xor ah, ah | ||
int 16h | ||
|
||
; scape key pressed | ||
cmp ah, 1 | ||
je exit ;end game | ||
|
||
jmp draw | ||
|
||
draw: | ||
|
||
;vga mode | ||
mov ax, 13h | ||
;mov ah, 0h | ||
xor ah, ah | ||
int 10h | ||
|
||
; draw a pixel at x=100 y=100 color=red | ||
mov ah, 0Ch | ||
mov al, 4 | ||
mov cx, 100+line_size | ||
mov dx, 100+line_size | ||
int 10h | ||
|
||
mov bx, [line_size] | ||
dec bx | ||
mov [line_size], bx | ||
|
||
jmp loop | ||
|
||
exit: | ||
mov ax, 3 | ||
int 10h | ||
|
||
mov ax, 4C00h | ||
int 21h | ||
|