Configuration:
MS-DOS 16 BIT (write to .asm file, then compile with TASM and TLINK)
Windows 7 x64
I made a simple program in the assembly, which should only open the file and write the text to it.
Here is the code for it:
assume cs:code, ds:data data segment fileName db "input.txt", 0 ; We assure it is an ASCIIZ(ero) file. toWrite db "Hello World!", "$" data ends code segment writeToFile: ; pentru functia 3Dh mov AH, 3Dh mov AL, 0h mov dx, offset fileName int 21h ret start_program: mov ax, data mov ds, ax CALL writeToFile mov ax, 4c00h int 21h code ends end start_program
I used TurboDebugger to find out what would happen. Oddly enough, it always sets the AX value to 0005 value of Access Denied
Everything I could find on the Internet to search for ASSEMBLY access denied open file was about a DLL , and that didn't help.
I tried anything from restarting my program to opening dosbox "As an administrator." Unfortunately, nothing worked, and I have no ideas.
Which is also strange that my friend said that after activating his windows 10, everything works fine.
What is the reason for receiving only "access denied"? I mention that I was able to create, delete and close files, but I can not open them.
source share