extern io_get_dec, io_print_dec, io_print_char
section .bss
table_1 resd 10000
table_2 resd 10000
n resd 1
m resd 1
k resd 1
section .text
global main
main:
call io_get_dec
mov [n], eax
call io_get_dec
mov [m], eax
call io_get_dec
mov [k], eax
xor ecx, ecx ; счетчик индекса от 0 до n*m-1
mov eax, [n]
mul dword [m] ; eax = n * m
mov edi, eax ; edi = общее количество элементов
.fill_loop:
cmp ecx, edi
jge .print_table
call io_get_dec
mov [table_1 + 4 * ecx], eax
inc ecx
jmp .fill_loop
.print_table:
xor ecx, ecx ; счетчик индекса от 0 до n*m-1
mov eax, [n]
mul dword [m] ; eax = n * m
mov edi, eax ; edi = общее количество элементов
.print_loop:
cmp ecx, edi
jge .done
mov eax, [table_1 + 4 * ecx]
call io_print_dec
inc ecx
jmp .print_loop
.done:
xor eax, eax
ret