Issues writing to file in assembly

后端 未结 1 1729
刺人心
刺人心 2021-01-29 12:46

I am trying to write a simple program in assembly in which I open an existing file and I write a message in it, a message which I define in my data segment. The problem occurs w

相关标签:
1条回答
  • 2021-01-29 12:53

    Alright, sorry for this question actually, but I finally figured it out. When I opened the file, I did

    mov al, 0
    

    which means I opened the file with read-only access. What I needed to do was

    mov al, 1 (write-only access) or 
    mov al, 2 (read+write access). 
    

    Sorry for the bother guys, I'm just glad I finally figured it out.

    0 讨论(0)
提交回复
热议问题