The MASM Forum

Projects => Rarely Used Projects => GoAsm => Topic started by: shankle on January 12, 2015, 02:14:53 AM

Title: carot
Post by: shankle on January 12, 2015, 02:14:53 AM
Mistake - threw away my BASIC manuals.
I am trying to covert a Basic program from years ago to GoAsm.
I can't find out what the symbol (^) or Carot does.
I think it has to do with an exponential.

a! = (i! * l!) / ((1 - (i! + 1) ^ -m%))
Thanks for any help...
Title: Re: carot
Post by: jj2007 on January 12, 2015, 02:47:28 AM
2^3=2*2*2=8
Title: Re: carot
Post by: shankle on January 12, 2015, 04:18:43 AM
Thank you JJ.
It is definitely an exponent.

Now the problem is how to convert it to GoAsm.
I did look through the help files and didn't see anything about
carot usage. But it is possible I missed it or did not know where
to look.
Title: Re: carot
Post by: dedndave on January 12, 2015, 04:34:26 AM
hi Jack

here is a GWBASIC manual - pretty much the same thing

http://www.antonis.de/qbebooks/gwbasman/ (http://www.antonis.de/qbebooks/gwbasman/)

top left - chapter 6 gives much of the syntax
besides carot.....

% integer
! single precision float
# double precision float
$ string
Title: Re: carot
Post by: shankle on January 12, 2015, 05:30:04 AM
Thanks Dave.

I have got to stop throwing things away.:(
Title: Re: carot
Post by: anunitu on January 12, 2015, 06:17:46 AM
That is a nice reference site Dave...
Title: Re: carot
Post by: MichaelW on January 23, 2015, 03:27:15 PM
The CRT  pow function (https://msdn.microsoft.com/en-us/library/dt5dakze.aspx) is easy to use, here in a MASM example:

;=====================================================================================
include \masm32\include\masm32rt.inc
;=====================================================================================
.data
    x REAL8 2.0   
    y REAL8 3.0
    z REAL8 ?
.code
;=====================================================================================
start:
;=====================================================================================
    invoke crt_pow, x, y
    fstp z
    printf("%f\n",z)
    inkey
    exit
end start


8.000000


For the MASM32 libraries the CRT functions have "crt_" in front of the function name to avoid name conflicts. For GoAsm I expect you would need to invoke the function as "pow".