assemblytutorials icon indicating copy to clipboard operation
assemblytutorials copied to clipboard

NUL terminate "msg" in lessons 3 & 4

Open joast opened this issue 3 years ago • 3 comments

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.

joast avatar Jan 15 '22 02:01 joast

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

agarmash avatar Jan 16 '22 19:01 agarmash

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.

joast avatar Jan 16 '22 19:01 joast

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

cassepipe avatar Oct 11 '23 22:10 cassepipe