NASM - The Netwide Assembler
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Search
Calendar
Login
Register
NASM - The Netwide Assembler
»
NASM Forum
»
Programming with NASM
»
array length and etc
« previous
next »
Print
Pages: [
1
]
Author
Topic: array length and etc (Read 13400 times)
zenid
Jr. Member
Posts: 2
array length and etc
«
on:
March 18, 2012, 12:41:06 PM »
Hi.
How can i get length(how many elements) and size of an array?
Logged
Frank Kotler
NASM Developer
Hero Member
Posts: 2667
Country:
Re: array length and etc
«
Reply #1 on:
March 18, 2012, 08:24:44 PM »
Code:
[Select]
msg "Hello Zenid", 10
msg_len equ $ - msg
array dd 5, -1, 10, 42
array_count equ ($ - array) / 4
Something like that?
Best,
Frank
Logged
zenid
Jr. Member
Posts: 2
Re: array length and etc
«
Reply #2 on:
March 18, 2012, 09:37:13 PM »
It was what I asked for thanks!!!
Another quick question: can they be used anywhere or only in global variables(arrays)?
Logged
Frank Kotler
NASM Developer
Hero Member
Posts: 2667
Country:
Re: array length and etc
«
Reply #3 on:
March 18, 2012, 09:46:37 PM »
Mmmm, as opposed to what? Local/stack variables? I don't see how it would work for stack variables. Maybe I don't understand the question. When in doubt, try it!
Best,
Frank
Logged
Print
Pages: [
1
]
« previous
next »
NASM - The Netwide Assembler
»
NASM Forum
»
Programming with NASM
»
array length and etc