-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGETCMOS.ASM
More file actions
68 lines (64 loc) · 1.58 KB
/
GETCMOS.ASM
File metadata and controls
68 lines (64 loc) · 1.58 KB
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
MODEL tiny
.CODE
.STARTUP
mov ah,9
mov dx,offset hello
int 21h
mov cx,0f5h
mov al,0ah
xor si,si
repeat:
push ax
out 70h,al
jmp short $+2
in al,71h
mov byte ptr buf[si],al
pop ax
inc al
inc si
loop repeat
call open
jnc next0
mov ah,9
mov dx,offset errmsg0
int 21h
jmp short exit
next0:
mov bx,handle
mov ah,40h
mov cx,0f5h
mov dx,offset buf
int 21h
jnc next1
mov ah,9
mov dx,offset errmsg1
int 21h
jmp short exit
next1:
mov ah,9
mov dx,offset endpro
int 21h
exit:
mov ax,4c00h
int 21h
;------------------------------------
buf db 0f5h dup(0)
fname db 'cmos.dat',0
hello db 'Чтение CMOS в файл CMOS.DAT','$'
endpro db ' ...',13,10,36
errmsg0 db 'Ошибка создания файла',13,10,36
errmsg1 db 'Ошибка записи',13,10,36
;------------------------------------
;------------------------------
; Открытие файла для записи
;------------------------------
open proc near
mov ah,3ch ;
mov cx,02 ;\
lea dx,fname ; создать файл
int 21h ;/
mov handle,ax
ret
handle dw 0
open endp
end