I'm a bit confused as to what the asm instruction db actually does. I've read that it defines a byte, but what does that actually mean? Does it move the value into a certain place in memory, or does it predefine a value before the code is assembled?
The DB statement initializes memory with one or more byte values. label is a symbol that is assigned the current memory address. expression is a byte value that is stored in memory. Each expression may be a symbol, a string, or an expression.
DB - Define Byte. 8 bits. DW - Define Word. Generally 2 bytes on a typical x86 32-bit system.
msg is a global variable pointing to the string that follows - the db means data byte , indicating that the assembler should just emit the literal bytes that follow. len is being set to the length of the string (more below).
An assembler instruction is a request to the assembler to do certain operations during the assembly of a source module; for example, defining data constants, reserving storage areas, and defining the end of the source module.
It literally places that byte right there in the executable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With