What is the need to determine the byte and why in the end to specify 0?
.data Caption db 'Моя первая программа.',0 Text db 'Hello world!',0 PS I have a 32 bit architecture.
What is the need to determine the byte and why in the end to specify 0?
.data Caption db 'Моя первая программа.',0 Text db 'Hello world!',0 PS I have a 32 bit architecture.
For what it is necessary to determine the byte - because the code of each character of the string in this case takes 1 byte. The character string is an array of bytes.
0 in this case indicates the end of the line. If you do not add 0 after the first line, the lines will merge, and the data starting from the Caption address can be interpreted as the line 'Моя первая программа.Hello world!' .
The character with code 0 is a string delimiter that is “understood”, for example, by the functions of the standard C library and WinAPI functions.
See the Null-Thermal String for details .
There are other ways to specify the end of a line: for example, under DOS, line output functions implied that a line ends in a $ character, which is not very convenient if you, for example, want to output this character.
Source: https://ru.stackoverflow.com/questions/523892/
All Articles