-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMatrix.txt
More file actions
64 lines (50 loc) · 961 Bytes
/
Matrix.txt
File metadata and controls
64 lines (50 loc) · 961 Bytes
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
stcsg segment
stcsg ends
datsg segment
msg db "Number 5 is gonna be repeated like 4x3 matrix$"
msg2 db 0ah, 0dh, "$"
datsg ends
codsg segment
prg proc
assume ds:datsg, cs:codsg, ss:stcsg
mov ax, datsg
mov ds, ax
; Display the initial message
mov ah, 09h
lea dx, msg
int 21h
mov ah,09h
lea dx,msg2
int 21h
; Outer loop (5 rows)
mov ch, 05h ; Outer loop counter
kapi2:
; Inner loop (6 columns)
mov cl, 06h ; Inner loop counter
kapi1:
; Print '5'
mov ah, 02h
mov dl, 03h
int 21h
; Decrement inner loop counter
dec cl
cmp cl, 0
jne kapi1 ; Repeat inner loop
; Print newline after row
mov ah, 09h
lea dx, msg2
int 21h
; Decrement outer loop counter
dec ch
cmp ch, 0
jne kapi2 ; Repeat outer loop
; Wait for a keypress
mov ah, 08h
int 21h
; Exit program
mov al, 0
mov ah, 4ch
int 21h
prg endp
codsg ends
end prg