forked from Osama-Moh/Micro1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CHBD.asm
89 lines (69 loc) · 1016 Bytes
/
CHBD.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
.model Small
.stack 64
.data
Filename db 'chess.bin', 0h;
DIRECTORY DB 'D:\Pieces',0h
;Pieces DB
filehandle dw ?
chessData db 9C40h dup(?);
.code
main PROC far
mov ax , @data ;
mov ds , ax ;
MOV AH, 3BH
MOV DX, OFFSET DIRECTORY
INT 21H
mov ah,0;
mov al,13h;
int 10h;
call OpenFile;
call ReadData;
LEA bx , chessData
mov cx , 30h ;
mov dx , 0c8h ;
mov ah ,0ch ;
drawingloop :
mov al ,[Bx] ;
int 10h;
inc cx;
inc bx;
cmp cx , 0f8h;
JNE drawingloop ;
mov cx , 30H ;
dec dx ;
cmp dx, 0h;
JNE drawingloop;
mov ah , 0h ;
int 16h ;
call closeFile ;
mov ah , 0h ;
mov al , 3h ;
int 10h ;
mov ah , 4ch ;
int 21h;
hlt
main ENDP
OpenFile proc
mov ah , 3dh ;
mov al ,0h ;
LEA dx,Filename ;
int 21h ;
mov [filehandle], ax;
RET ;
OpenFile ENDP ;
ReadData proc
mov ah , 3fh ;
mov bx , [filehandle];
mov cx , 9C40h;
LEA dx ,chessData;
int 21h;
;mov ah , 3fh;
RET;
ReadData ENDP;
closeFile proc;
mov ah , 3eh;
mov bx , [filehandle];
int 21h;
RET ;
closeFile ENDP;
End main