I just started learning assembler and I don’t really understand how function calls work. There is a clearScreen procedure that clears the console. In the code, I call it via call. But then the code
PRINT "x = " call scan_num starts to be performed endlessly. That is, when I press Enter after entering the value of x, the program clears the console and asks for the value again. The END line is not displayed. Why it happens? Help solve the problem. Thank you in advance.
org 100h include 'emu8086.Inc' .data table dw 0, 1, 2 a db ? x db ? .code PRINT "a = " call scan_num mov a, cl clearScreen proc push ax ; зберігаємо результат обчислень у стек mov ax, 03 ; 2 наступні команди очищають консоль int 10h pop ax ; поновлюємо результат обчислення у регістр clearScreen endp PRINT "x = " call scan_num call clearScreen PRINT "END" hlt define_scan_num define_print_num define_print_num_uns END