NO

Author Topic: $  (Read 462 times)

Offline HellOfMice

  • Member
  • *
  • Posts: 362
  • Never be pleased, always improve
$
« on: December 31, 2024, 06:44:20 PM »
Hi,


With PoAsm is it possible to do something like this:


NumberOfLines = $ - OFFSET AdrLastLine


I get :


Quote
Datas.asm(854): error: Must be a constant integer expression.
--------------------------------
Kenavo

Offline Vortex

  • Member
  • *
  • Posts: 976
    • http://www.vortex.masmcode.com
Re: $
« Reply #1 on: December 31, 2024, 11:03:29 PM »
Hi Philippe,

Reading the examples section of the subtitle EQU directive (IA32, AMD64) :

Quote
strlen1 EQU ($ - str)  ; will not work as in MASM; the tokens (, $, -, str, ) are assigned to strlen1, but no "current location" is associated with $ at this point !

The subtitle Assembler here token: $ (IA32, AMD64) :

Quote
The special here token ($) holds the current location in the active code or data section.

Note! The here token should only be used in instructions or data directives. It will not work as expected if used in the EQU directive - only the token will be stored, not the current location.
Code it... That's all...

Offline HellOfMice

  • Member
  • *
  • Posts: 362
  • Never be pleased, always improve
Re: $
« Reply #2 on: January 01, 2025, 02:11:49 AM »

Hi Vortex,


With MASM32 I did "jmp $ + 4" or substract 2 address when I hat a tab of pointer to know the number of lines


Thank you for you help and I wish you an happy new year


Philippe
--------------------------------
Kenavo

Offline Vortex

  • Member
  • *
  • Posts: 976
    • http://www.vortex.masmcode.com
Re: $
« Reply #3 on: January 01, 2025, 07:21:20 PM »
Hi Philippe,

You are welcome. Me too, I wish you a happy new year.
Code it... That's all...