I am quite new to assembly and recently I have been struggling to make INT 21,43 (changing file attribute to read-only) work. I am using Windows 10, DOSBox x86, and Turbo Assembler/Linker/Debugger if that makes any difference. As far as I can tell using the debugger, it should work (CF is NOT set and I am not getting error code as I should, according to documentation). Also, if I use the same INT 21,43 to GET (setting al to 0) file attribute of a file, that was already set to read-only manually, CX is set to 20, which as far as I know does not make sense, but CF is not set as well, so it says it worked. I hope you can help me fix it, thanks in advance.
.model small
.stack 100h
.data
filename db "temp.txt",0 ; my file name
.code
start:
mov dx, @data
mov ds, dx
mov ah, 43h
mov al, 01h ; Set file attribute
mov cx, 01h ; 1 = read-only
lea dx, filename ; Set pointer to filename
int 21h
mov ah, 4ch ; Return to DOS
mov al, 0
int 21h
end start