user3097712
user3097712

Reputation: 1673

What is the meaning of the following assembler-code line?

I´ve written the following code in C to let create assembler code from that and to learn something about assembler.

I start with a hello world of course, and in one line, there is following:

    mov DWORD PTR[esp], OFFSET FLAT:.LCO

and about LC0, it says:

    .string "Hello World!"
    .text
    .globl main
    .type main,@function

So, and I asked myself, what the meaning of line with OFFSET FLAT:.LCO ? Am I right, when I say, that something like a pointer which points to the string is given to esp? So that esp is now pointing to the string hello world, too?

Is that right? Because this would be logical.

Upvotes: 5

Views: 2325

Answers (1)

George
George

Reputation: 15571

mov DWORD PTR[esp], OFFSET FLAT:.LCO

Moves the 4 bytes, that is the address specified .LCO to the memory location specified by ESP.

Upvotes: 4

Related Questions