Author Topic: Bstring & Pointer  (Read 2190 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Bstring & Pointer
« on: May 18, 2014, 06:34:34 AM »
Deleted
« Last Edit: May 05, 2015, 09:12:03 AM by Peter »

Charles Pegge

  • Guest
Re: Bstring & Pointer
« Reply #1 on: May 18, 2014, 07:05:48 AM »

use string if you prefer, Peter.

Strings are garbage collected and have one more level of indirection than bstrings.

addr myreg, mystring should resolve the character pointer to myreg in both cases.

addr eax,table

Charles Pegge

  • Guest
Re: Bstring & Pointer
« Reply #2 on: May 18, 2014, 10:49:07 PM »
addr is  a pseudo-instruction for resolving variable / string / label addresses. Essential for accessing strings of different types and params passed by reference.

Incidently, you can place a string literal anywhere in your code, and its address will be loaded into the eax register:

"abcd"
print hex [eax]


(The linker usually shunts all string literals into the initialised data section)

Mike Lobanovsky

  • Guest
Re: Bstring & Pointer
« Reply #3 on: May 18, 2014, 11:27:13 PM »
What does the linker do with stray string literals not referenced anywhere in the code? ;)