[Solved] First assembly program [closed]


I would perhaps start reading about each of those lines one at a time and just see what they do.

For example, as someone in the comments said, Read about what int 21 does, it does many things, depending on what is in the AH register.

http://www.ctyme.com/intr/int-21.htm

e.g.
Reading a line from STDIN is specified by 0A in the AH register, it places the output in the DX register in a certain format.

mov dx, 200
mov ah, 0a
int 21

Number of characters read is placed in the second byte of DX, and so it is saved into BX using these lines:

mov bh, 00
mov bl, byte ptr[201]

Printing to the screen is done with a different INT 21 AH value, 09, and it is read from whereever DX points to, which is why DX is set back to 200

mov dx, 200
mov ah, 09
int 21

I will leave it to you to figure out what the rest does, but have a look at the format of reading in and writing out here http://www.ctyme.com/intr/rb-2563.htm. For instance this line mov byte ptr[202 + bx], 24 is placing an ASCII 0x24 in the last position in the string, because that is the terminating character for reading.

1

solved First assembly program [closed]