News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

SmplMath: A little problem using local stack space

Started by HSE, October 03, 2020, 04:42:12 AM

Previous topic - Next topic

HSE

Hi all!

Developing a program with a lot SmplMath macros show warnings demanding to increase local stack allocation (more and more!).

Apparently qWord forgot to put a line in fSlvTLS()  macro :fSlvTLS macro name:=<fslv_tls>,cb:=<4*@WordSize>
IFB FSBE_ENTITY
EXITM <&name&[1]:BYTE>
ELSEIF fslv_glb_error
EXITM <&name&[1]:BYTE>
ENDIF
% IFDEF fslv_tls_name
.err <TLS duplication>
ELSE
fslv_tls_curr_used = 0 ; <---------------  this line is missing ¿?
fslv_tls_alloc_line = @Line
fslv_tls_cb = FSBE_FNC(%FSBE_ENTITY,%FSEN_TLS_SIZE)
IF fslv_tls_cb NE 0 AND fslv_tls_cb GT cb
fslv_tls_cb = (fslv_tls_cb+15) AND (-16)
ELSE
fslv_tls_cb = (cb+15) AND (-16)
ENDIF
fslv_tls_name TEXTEQU @TrimStr(<&name>)
EXITM @CatStr(<&name&[fslv_tls_cb]:BYTE>)
ENDIF
endm


Regards. HSE
Equations in Assembly: SmplMath

qWord

Hello HSE and all members old enough to remember me,

I cannot help you with that problem, but looks you have already found a solution. Nearly three years passed since I serious programmed with MASM, so I'm a bit rusty. In addition, currently I have little interest in this kind of programming, so I will not continue the development of the SmplMath macros. The same applies to the "real_math" macros, even if I have recently used them to quickly calculate some big constants. After all these years, the code of the SmplMath macros looks ugly to me, not just under the hood, but also in the public interface. I can't think what came over me choosing names like "fSlv" for macros that actual evaluate some expression ... or OMG "fSlvTLS" (local variables == Thread Local Storage? WTF  :dazzled: ).

Anyway, I was always impressed how stable the SmplMath macros work and it is nice to see that there are still some users!

To cut a long story short: You can take over the development if you are interested in it - I would supply you what I have on my disk. I make you the same offer for the "real_math" macros (which are well written IMO).

Kind regards to all

qWord

PS: Please do not be upset if it takes some days to reply you (hopefully not weeks)
MREAL macros - when you need floating point arithmetic while assembling!

felipe

it's always good to know of an old member of this forum, greeting words!  :thup:

HSE

Quote from: qWord on October 03, 2020, 08:01:08 AM
Hello HSE and all members old enough to remember me,

Hi qWord!!

Good to know you are well  :thumbsup:

Quote from: qWord on October 03, 2020, 08:01:08 AM
After all these years, the code of the SmplMath macros looks ugly to me, not just under the hood, but also in the public interface. I can't think what came over me choosing names like "fSlv" for macros that actual evaluate some expression ... or OMG "fSlvTLS" (local variables == Thread Local Storage? WTF  :dazzled: ).

:biggrin: :biggrin: :biggrin: Don't worry about names, that is easy to change.

Quote from: qWord on October 03, 2020, 08:01:08 AM
Anyway, I was always impressed how stable the SmplMath macros work and it is nice to see that there are still some users!

Still is making simple some laborius calculations (and forever will be a very interesting challenge to understand that macros  :biggrin:)

Quote from: qWord on October 03, 2020, 08:01:08 AM
To cut a long story short: You can take over the development if you are interested in it - I would supply you what I have on my disk. I make you the same offer for the "real_math" macros (which are well written IMO).

:thumbsup: Thanks for the offer. At present is working very well, from time to time grow some idea that is possible to solve with a wrapper or something like that. (like fSlvW variable++    :biggrin:)
Because I don't need velocity nor big data, I'm still making seriuos things in 32 bit. Now, I know that building in 64 bit I will have some little problem with fSlv = (something). If you remember why that difference, that could be interesting.

Regards. HSE
Equations in Assembly: SmplMath

hutch--

Good to hear from you, I thought you must have been ambushed by a blonde when you disappeared. Hope you are doing things you enjoy and getting paid for it. Sad to say I never got around to using your maths macros as I confess I am a maths illiterate, mainly count with my fingers and use computers to do the rest.

qWord

Quote from: hutch-- on October 03, 2020, 11:20:54 PM
Good to hear from you, I thought you must have been ambushed by a blonde when you disappeared.
:biggrin:
Good to see that you are still managing the community and keeping up the MASM SDK.

Quote from: hutch-- on October 03, 2020, 11:20:54 PMHope you are doing things you enjoy and getting paid for it.
Yes, of course! A mixed bag from embedded development up to cloud solutions, whatever the customer needs  :smiley:
MREAL macros - when you need floating point arithmetic while assembling!

qWord

Quote from: HSE on October 03, 2020, 09:47:59 AMNow, I know that building in 64 bit I will have some little problem with fSlv = (something). If you remember why that difference, that could be interesting.
Sorry, I cannot help you with that, but I am sure will get it, even knowing ml64 is (or was?) limited in it capacities.

I have put my two projects on github, so it should be clear that everyone is free to continue the work or use it as base for something new. The repos are read-only to indicate that there will be probably no more development from my side.

https://github.com/qwordAtGitHub/mreal-macros

https://github.com/qwordAtGitHub/SmplMath

Kind regards to all - MASM forever!

qWord
MREAL macros - when you need floating point arithmetic while assembling!

HSE

Quote from: qWord on October 05, 2020, 02:45:31 AM
I have put my two projects on github, so it should be clear that everyone is free to continue the work or use it as base for something new.
:thumbsup: Fantastic. Good idea.
Equations in Assembly: SmplMath