-
Notifications
You must be signed in to change notification settings - Fork 0
/
dosver.asm
65 lines (63 loc) · 1.41 KB
/
dosver.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
program segment
assume cs:program, ds:program
org 100h
_start:
mov cx,0Ch
int 0E0h
push ax
lea dx,[_header]
mov ah, 09h
int 21h
pop ax
cmp al,41h
jb _print_v1
mov ah, 30h
int 21h
push ax
xor ah,ah
call _print_dec
mov dl, '.'
mov ah, 02h
int 21h
pop ax
mov al,ah
xor ah,ah
call _print_dec
lea dx,[_nl]
mov ah, 09h
int 21h
jmp _exit
_print_v1:
lea dx,[_v1]
mov ah, 09h
int 21h
_exit:
int 20h
_print_dec:
mov cx,0
mov dx,0
_print_dec_loop:
cmp ax,0
je _print_dec_1
mov bx,10
div bx
push dx
inc cx
xor dx,dx
jmp _print_dec_loop
_print_dec_1:
cmp cx,0
je _print_dec_exit
pop dx
add dx,48
mov ah,02h
int 21h
dec cx
jmp _print_dec_1
_print_dec_exit:
ret
_header db "MS-DOS Level $"
_v1 db "1.1"
_nl db 13, 10, "$"
program ends
end _start