hello every body
code below make directory in an address that is define in data part.

; create c:\emu8086\vdrive\C\test1
mov dx,ah 
mov ah, 39h 
int 21h

but i want to get address from user. i can do this with macros . anyone know this with intrrupts?

best Regard

Dani AI

Generated

: the simplest, reliable approach is to let DOS read a whole line into a buffer and then turn that buffer into a zero-terminated pathname before calling your directory-create routine. is correct that you can read keys one-by-one, but using DOS buffered input avoids reimplementing echo/backspace logic.

A compact example (MASM/TASM-style) that reads a line and converts it to an ASCIIZ string:

; data
pathBuf  db 80        ; max chars
         db 0         ; will receive count
         db 80 dup(0) ; storage for characters

; code (DS must point to the data segment)
    lea dx, pathBuf
    mov ah, 0Ah
    int 21h            ; buffered input: byte0 = max, byte1 = count, bytes2.. = chars

    ; place a zero after the last character to make ASCIIZ
    mov al, [pathBuf+1]
    xor ah, ah
    lea si, pathBuf+2
    add si, ax
    mov byte ptr [si], 0

    ; now point DX at pathBuf+2 and call your existing create-directory service

Notes and troubleshooting:

  • Ensure DS points at the data segment holding pathBuf before the INT call.
  • Function 0Ah returns the character count (does not include the CR). After placing the trailing 0, pass DS:DX = address-of-characters to the directory-creation service.
  • Spaces typed by the user are preserved in the buffer (DOS APIs accept them); only command interpreters split on spaces.
  • Check the carry flag after the directory call to detect errors and read AX for the error code.
  • If you prefer manual input (BIOS INT 16h) you must implement echo, backspace, and buffer bounds checks yourself.

This method keeps input handling simple and works well under emu8086 or real DOS.

you need to use a keyboard interrupt -- . Put it in a loop, saving each character in your own buffer, until user presses the Enter key. I would make this a separate function. You will have to check that user does not type spaces in the path because 16-bit code can not handle them.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.