News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

$

Started by HellOfMice, December 31, 2024, 06:44:20 PM

Previous topic - Next topic

HellOfMice

Hi,


With PoAsm is it possible to do something like this:


NumberOfLines = $ - OFFSET AdrLastLine


I get :


QuoteDatas.asm(854): error: Must be a constant integer expression.

Vortex

Hi Philippe,

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

Quotestrlen1 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) :

QuoteThe 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...

HellOfMice


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

Vortex

Hi Philippe,

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