Hello, there were several problems when writing a program on assembler.

  1. What interruption mov ah, 9? And is it an interruption at all?
  2. The latter procedure does not print 3 lines, but rather, it does, but crocodiles. Why?

If you write mov ah, 02h nothing at all will output.

.model tiny org 100h .data chislo1 db ? mess0 db "",0ah,0dh,'$' mess db "Vvedite chislo1: ",'$' message dw "HELLO, WORLD!", '$' message1 dw "MY NAME IS EUGENE!", '$' message2 dw "I'M 18 YEARS OLD!", '$' .code start: mov ax, @data mov ds,ax xor ax, ax mov dx, "P" mov cx,5 cikl5: call procedure1 loop cikl5 ;-----------------------------| mov ah,9 mov dx,offset mess int 21h mov ah,01h int 21h mov chislo1,al mov ah,9 mov dx,offset mess0 int 21h mov cx,2 cicl2: call procedure2 loop cicl2 ;-----------------------------| push [message2] push [message1] push [message] call procedure3 ;-----------------------------| mov ax,4c00h int 21h procedure1 proc mov ah,02h int 21h ret procedure1 endp procedure2 proc mov ah,02h mov dl,chislo1 int 21h ret procedure2 endp procedure3 proc push bp mov bp,sp mov ah,9 mov dx,[bp+2] int 21h mov ax,[bp+4] mov ah,9 int 21h mov ax,[bp+6] mov ah,9 int 21h pop bp ret 6 procedure3 endp end start 

    1 answer 1

    1. Interrupt 21h . mov ah, 9 is not an interrupt, it is the choice of function number 9 interrupt 21h
    2. The address of the string must be specified in the dx register, which is done in procedure3 for the first time, but the second and third times the address is written in ax, and in dx it remains unknown what ("garbage"), hence krakozyabry. Garbage in - garbage out .
    3. mov ah, 02h - function number 2 interrupt 21h displays a single character whose code is recorded in the register DL. If you wanted to use this function to output an entire line, then you will not get what you expected.
    • Thank you very much, figured out! - Eugene Shilin