pacman128 / pcasm

PC Assembly language book
160 stars 34 forks source link

`first.asm` code fail to compile under Linux #11

Open Saldef opened 1 year ago

Saldef commented 1 year ago

Thanks for the Book Paul, very helpful.

While trying to run the first.asm code, I was not able to compile it under x86_64 Linux. GCC will complain citing architecture incompatibility issues. After a little bit of search I found out that ones needs to add the -m32 option to for it to correctly compile (along with installing gcc-multilib and g++-multilib packages before-head)

Also, assembling the asm_io.asm was not mentioned in section 1.4.3, although it is necessary, and it has a caveat where one needs to add the inline macro -d ELF_TYPE, this would only be noticed when reading the comments of the asm_io.asm file. For a beginner, and for his/her very first code, this will hinder a bit, and distract the learner on a quest on the web trying to find a solution.

I have submitted a pull request with some some details on the comments to the asm_io.asm file.

GuichiZhao commented 11 months ago

You are absolutely correct, I faced the exactly the same problem and take quite a while to figure it out!