-
Notifications
You must be signed in to change notification settings - Fork 0
/
ver.asm
57 lines (54 loc) · 1.29 KB
/
ver.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
program segment
assume cs:program, ds:program
org 100h
_start:
jmp short display
olddos:
db "1.x$"
db "000000"
digitend:
db "$"
eol:
db 0Ah,0Dh,'$'
display:
mov ah, 30h
int 21h
cmp al, 1
jg newdos
mov ah, 9
lea dx, [olddos]
int 21h
jmp short exit
newdos:
push ax
xor ah,ah
call convert
mov ah, 2
mov dl, '.'
int 21h
pop ax
mov al, ah
xor ah, ah
call convert
exit:
mov ah, 9
lea dx, [eol]
int 21h
int 20h
convert:
mov bl, 10
mov di, offset digitend
cvtloop:
dec di
div bl
add ah, '0'
mov [di], ah
xor ah, ah
test al, al
jnz short cvtloop
mov ah, 9
mov dx, di
int 21h
ret
program ends
end _start