Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does the assembly instruction 'db' actually do?

Tags:

assembly

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?

like image 922
r0nk Avatar asked Jun 30 '13 05:06

r0nk


People also ask

What is the use of DB instruction?

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.

What is DB in x86 assembly?

DB - Define Byte. 8 bits. DW - Define Word. Generally 2 bytes on a typical x86 32-bit system.

What is MSG DB in assembly language?

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).

What is assembly instruction?

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.


1 Answers

It literally places that byte right there in the executable.

like image 109
user541686 Avatar answered Sep 20 '22 21:09

user541686