Hello. Everything I have to do is just changing some specific text from first file to another text. I have a clue - read first file character by character to array while character != space. After that compare array with my replacement text and decide what action will be performed. That's my whole idea. I wrote some code:
org 100h
start:
mov ax, 3D02h
mov dx, nameR
int 21h
mov [readF], ax
mov ax, 3C02h
mov dx, nameS
int 21h
mov [saveF], ax
read:
mov bx, readF
mov bp, 10h
mov ah, 3Fh
mov dx, buffer
mov cx, bp
int 21h
mov ah, 2Eh
int 21h
save:
mov bx, saveF
mov dx, buffer
mov ah, 40h
mov cx, bp
int 21h
mov ah, 3Eh
int 21h
theend:
mov ax, 4C00h
int 21h
nameS db "new.txt", 0
nameR db "s.txt", 0
readF dd 0
saveF dd 0
buffer: times 10h db 0
This code doesn't work :/ Compilation process is fine but program is not working. What's wrong with code above and is my idea correct?
I'm working on WinXP - 32b - NASM - x86.