-
Notifications
You must be signed in to change notification settings - Fork 0
/
1_uzd.asm
66 lines (57 loc) · 932 Bytes
/
1_uzd.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
.MODEL small
.STACK 100h
.DATA
ivesk DB 'Iveskite eilute zodziu, atskirtu tarpais:', 10, 13, '$'
input DB 255, 0, 255 dup('$')
newLine DB 10, 13, '$'
.CODE
Programa:
mov AX, @data
mov DS, AX
DB 10001000b, 0ffh, 01h, 23h
;Paprasoma ivesti eilute zodziu
mov AH, 09h
lea DX, ivesk
int 21h
;Ivedimas
mov AH, 0Ah
lea DX, input
int 21h
lea DX, newLine
mov AH, 09h
int 21h
mov AH, 09h
int 21h
lea DX, newLine
mov AH, 09h
int 21h
;Atskiru zodziu ilgiu radimas
mov SI, 1
Ciklas:
xor BL, BL
Zodis:
inc SI
cmp input[SI], 20h
jz Print
inc BL
cmp input[SI], 0Dh
jnz Zodis
jmp Pabaiga
;Spausdinamas raidziu skaicius zodyje
Print:
mov AH, 02h
add BL, 30h
mov DL, BL
int 21h
mov DL, 20h
int 21h
jmp Ciklas
;Uzbaigiama programa
Pabaiga:
mov AH, 02h
add BL, 2Fh
mov DL, BL
int 21h
mov AH, 4Ch
int 21h
END Programa