Skip to content

Commit

Permalink
added some asm tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dpbm committed Apr 7, 2024
1 parent 6a51cff commit c719c06
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
39 changes: 39 additions & 0 deletions terceiro-ano/asm/test.asm
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
43 changes: 43 additions & 0 deletions terceiro-ano/asm/test2.asm
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

0 comments on commit c719c06

Please sign in to comment.