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
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 fileC:\text.txtdoes not exist 2) you have rights to write to the root ofC:(under Windows it may not be) - PinkTux
|