Sonali Bhavsar
Sonali Bhavsar

Reputation: 23

What does strvar db "hello" means in Assembly?

Does processor allocates 1 byte for each character of the String? If yes then is allocating 1 byte enough for character as ASCII values vary from 0-255?

Upvotes: 0

Views: 152

Answers (1)

Jonathon Reinhart
Jonathon Reinhart

Reputation: 137398

The processor is not allocating anything. The directive

strvar:
    db "hello"

Tells the assembler to emit the bytes "hello" at a location in your program identified by the label strvar.

A byte is usually 8 bits, which can store the unsigned values 0 to (28 - 1) = 255.

Upvotes: 3

Related Questions