DGivney / assemblytutorials

This project was put together to teach myself NASM x86 assembly language on linux.
https://asmtutor.com/
654 stars 117 forks source link

NUL terminate "msg" in lessons 3 & 4 #37

Open joast opened 2 years ago

joast commented 2 years ago

Terminate "msg" in lessons 3 and 4 with a NUL (0 byte) instead of relying on NUL padding inserted by the assembler to align things properly.

agarmash commented 2 years ago

I believe this is done on purpose. This issue is addressed later in lesson 6

joast commented 2 years ago

I realize the issue is addressed in lesson 6 to fix the bug from lesson 5. However, I still believe it should be addressed in the string length lessons because the lessons are checking for a NUL byte, but one isn't explicitly included in the data area. This can be confusing to someone following the tutorial. i.e. "How can you look for something that isn't there?"

Also, if someone following the lessons decides to experiment and changes the message string to something that assembles without any padding, then they could have problems they aren't prepared to handle unless they read-ahead a few lessons.

cassepipe commented 1 year ago

Yay, as a beginner not having reaches lesson 6 yet, this was confusing. Hence my comment here and now.