NASM Forum > Programming with NASM

Preprocessor. Array

(1/1)

AntonPotapov:
How to use a string as an array in the preprocessor?
For example I have a string:

--- Code: ---%define string "Hello World"

--- End code ---
how do i get e.g. 'W' ?
Does the preprocessor have arrays?
I want to get a string character similar to C:

--- Code: ---char *str = "Hello World";
char ch = str[6]; // just like that

--- End code ---

I recently started learning assembler, literally half a week ago. I read the documentation: https://www.nasm.us/xdoc/2.16.01/html/nasmdoc4.html.
I found operators like substr, which should be enough for my purposes. But I want to understand the preprocessor more thoroughly.

Navigation

[0] Message Index

Go to full version