Hello, it occurred to me to write my own simple compiler for asm , I found a list of mnemonics for my architecture in octal format. I am interested in aspects of writing to the .exe file of these mnemonics, it is advisable to give a link to the relevant article, because as it turned out, I cannot manipulate files other than the .txt format.

  • one
    And who prevents you from manipulating files other than txt? - alexlz
  • For example, I created a png file, tried to write a number there, then this file opened with an error, just like with exe - Ohlol
  • one
    How do you open it? (I am not a telepath). Two common mistakes. Binary read-write mode (1) is not specified. In the file name, more precisely in the path to it, backward slashes (2) are incorrectly indicated. Both errors from dos / windows. fstream filestr ("C: \\ test.txt", fstream :: in | fstream :: binary); But what does it mean "created png, wrote down a number there" - here, please, in more detail. - alexlz
  • I open it fstream input ("input.png"); Writing down the same way - Ohlol
  • one
    @gecube well, I’ll translate it from English. But I o2n3e language who translate? You? - alexlz

0