assemblytutorials
assemblytutorials copied to clipboard
NUL terminate "msg" in lessons 3 & 4
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.
I believe this is done on purpose. This issue is addressed later in lesson 6
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.
Yay, as a beginner not having reaches lesson 6 yet, this was confusing. Hence my comment here and now.