summaryrefslogtreecommitdiff
path: root/sem2/lab4/task3.asm
blob: 9dd868d1bbed546a09fafb0a1acd93063720fccf (plain)
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
.286
.model tiny
.data
string db ?,?,' ',?,?,' ',?,?,0Ah,0Dh,'$'

.code
org 100h
start:   
    MOV ah,1
    INT 1Ah
    CMP bx,dx
    MOV ah,2
    INT 1Ah
    MOV ah,0
    MOV al,ch
    ROR ax,4
    SHR ah,4
    OR ax,'00'
    MOV word ptr string,ax
    MOV ah,0
    MOV al,cl
    ROR ax,4
    SHR ah,4
    OR ax,'00'
    MOV word ptr string+3,ax
    MOV ah,0
    MOV al,dh
    ROR ax,4
    SHR ah,4
    OR ax,'00'
    MOV word ptr string+6,ax
    MOV ah,9
    MOV dx,offset string
    INT 21h
    MOV ax,4C00h
    INT 21h
end start

text segment
text ends