1

I feel as if I don't understand the function 0AH of interrupt 21H in 8086 assembly. I read syntax tutorials such as:

"The first byte of the buffer specifies the maximum number of characters it can hold (1 to 255). This value must be supplied by the user. The second byte of the buffer is set by DOS to the number of characters actually read, excluding the terminating RETURN."

So I try a very basic code.

mov dh, 01
mov ah, 0AH
int 21H

I run this program, enter a single numerical value and press enter. Debug however shows that none of my registers change from this operation. I cannot tell where, if at all, the value I entered is stored. Can someone help me with this?

nrz
  • 10,435
  • 4
  • 39
  • 71
Dan Brenner
  • 880
  • 10
  • 23

1 Answers1

5

You must set DS:DX pointing to buffer prior to calling int 21h

Buffer on entry:  
+0: db MaxLength

Buffer on exit:  
+0: db MaxLength
+1: db Length of entered text (L)
+2: db 'Entered text of length L'
+(2+L): db 0Dh
Egor Skriptunoff
  • 23,359
  • 2
  • 34
  • 64