Author Topic: Arbitrary Precision with MPFR  (Read 535 times)

aw27

  • Member
  • ****
  • Posts: 709
Re: Arbitrary Precision with MPFR
« Reply #15 on: August 08, 2017, 08:36:01 PM »
I have updated the LIBs to MPFR 3.1.5 (it took a few hours  :(, believe it or not).
And updated the ASM examples for both static and dynamic linking (dynamic has not been done before) and for x86 and x64.
Unfortunately, I can not include the LIBS and DLLs in the attachment because there is a limit of 512KB, so you will have to download them from the URL supplied in the source inside the attachment.

habran

  • Member
  • *****
  • Posts: 1107
    • uasm
Re: Arbitrary Precision with MPFR
« Reply #16 on: August 08, 2017, 11:06:08 PM »
That is nice work, well presented :t
Thank you for demonstrating the ability of UASM 8)

you could have used instead of:
Code: [Select]
    mov ebx, 1
.while ebx<=100
INVOKE mpfr_mul_ui, addr t, addr t, ebx, MPFR_RNDU
INVOKE mpfr_set_d, addr u, REAL8ONE, MPFR_RNDD
INVOKE mpfr_div, addr u, addr u, addr t, MPFR_RNDD
INVOKE mpfr_add, addr s, addr s, addr u, MPFR_RNDD
inc ebx
.endw
 
this:
Code: [Select]
    .for (ebx=1:ebx<=100:ebx++)
INVOKE mpfr_mul_ui, addr t, addr t, ebx, MPFR_RNDU
INVOKE mpfr_set_d, addr u, REAL8ONE, MPFR_RNDD
INVOKE mpfr_div, addr u, addr u, addr t, MPFR_RNDD
INVOKE mpfr_add, addr s, addr s, addr u, MPFR_RNDD
    .endfor
I am here not trying to be smart ass but showing ability of UASM :icon_cool:
There is nothing wrong with your choice :biggrin:
 
Cod-Father

aw27

  • Member
  • ****
  • Posts: 709
Re: Arbitrary Precision with MPFR
« Reply #17 on: August 09, 2017, 12:36:53 AM »
Quote
.for (ebx=1:ebx<=100:ebx++)

Nice suggestion habran. :t

Quote
Topic moved: Arbitrary Precision with MPFR

I agree, all source code that does not assemble directly with the amazing Microsoft Macro Assemblers must be dispatched to specialized subforums.  :eusa_clap:


hutch--

  • Administrator
  • Member
  • ******
  • Posts: 4813
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Arbitrary Precision with MPFR
« Reply #18 on: August 09, 2017, 01:23:56 AM »
Its done for a sensible reason, the code you posted will not build with any version of MASM so I moved it to where it is properly supported with an assembler that will build it.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

jj2007

  • Member
  • *****
  • Posts: 7558
  • Assembler is fun ;-)
    • MasmBasic
Re: Arbitrary Precision with MPFR
« Reply #19 on: August 09, 2017, 01:31:23 AM »
Its done for a sensible reason, the code you posted will not build with any version of MASM so I moved it to where it is properly supported with an assembler that will build it.

Reasonable decision. Fortunately, MasmBasic builds with Masm :P

Jokes apart, for builds fine but:
Code: [Select]
for_s:
   .for (ebx=1:ebx<=100:ebx++)
    nop
   .endfor
for_endp:

while_s:
   mov ebx, 1
   .While ebx<=100
nop
inc ebx
  .Endw
while_endp:

whileOpt_s:
   xor ebx, ebx
   .While ebx<=100
inc ebx
nop
  .Endw
whileOpt_endp:

repeat_s:
   xor ebx, ebx
   .Repeat
nop
inc ebx
  .Until ebx>100
repeat_endp:

Code: [Select]
14      bytes for for
14      bytes for while
11      bytes for whileOpt
9       bytes for repeat

aw27

  • Member
  • ****
  • Posts: 709
Re: Arbitrary Precision with MPFR
« Reply #20 on: August 09, 2017, 01:55:44 AM »
Reasonable decision. Fortunately, MasmBasic builds with Masm :P

MASM, or any assembler for the case, can deal with undocumented libraries written in any language. This does not mean that the whole has anything to do with Assembly Language.
I don't know how many people you have convinced it has, after all these years.  :badgrin: