Dosseg model small .code mov ax,@data mov ds,ax ;сСкция ΠΊΠΎΠ΄Π° mov ah, 56h ;функция DOS 0x56 для пСрСимСнования Ρ„Π°ΠΉΠ»Π° lea dx, orig ;Π·Π°Π³Ρ€ΡƒΠΆΠ°Π΅ΠΌ Π² DX адрСс исходного ΠΈΠΌΠ΅Π½ΠΈ Ρ„Π°ΠΉΠ»Π° lea di, new ;Π° Π² DI – адрСс Π½ΠΎΠ²ΠΎΠ³ΠΎ ΠΈΠΌΠ΅Π½ΠΈ Ρ„Π°ΠΉΠ»Π° int 21h mov ah,04ch ;Π·Π°Π²Π΅Ρ€ΡˆΠ΅Π½ΠΈΠ΅ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹ int 21h .data orig db "text.txt",0 new db "C:\text.txt",0 end 

    1 answer 1

    Function 56h requires the address of the new name in ES:DI , and the ES register is not initialized by the address of the data segment.

    Also, check that the current drive is C:

    • Thank you corrected, but now refusal of access (error 5) - Alexander Yavorsky
    • @ Alexander C:\text.txt , well, check that 1) the file C:\text.txt does not exist 2) you have rights to write to the root of C: (under Windows it may not be) - PinkTux