-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchess.asm
61 lines (51 loc) · 874 Bytes
/
chess.asm
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
org 0x7c00
bits 16
mov ax, 0
mov ds, ax
cli
mov ah, 0x00
mov al, 0x13 ;VGA = 320x200 e 256 cores
int 0x10
mov ax, 0xA000
mov es, ax
mov dx, 1
loop:
mov di, cx
mov [es:di], byte(13)
cmp dx, 321
je ajuste_xadrez
cont0: cmp bx, 0
je to1
cmp bx, 1
je to0
paint: cmp bx, 1
je pinta_branco
cmp bx, 0
je pinta_preto
cont1: cmp cx, 64000
jne loop
hlt
ajuste_xadrez:
mov dx, 1
cmp bx, 0
je to0
cmp bx, 1
je to1
to0:
mov bx, 0
jmp paint
to1:
mov bx, 1
jmp paint
pinta_branco:
mov [es:di], byte(15)
inc cx
inc dx
jmp cont1
pinta_preto:
mov [es:di], byte(0)
inc cx
inc dx
jmp cont1
times 510 - ($ - $$) db 0
dw 0xaa55