News:

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

Main Menu

PowerBASIC and the Cambridge Test

Started by Gunther, March 01, 2022, 06:34:44 PM

Previous topic - Next topic

TimoVJL

#15
DELETED
May the source be with you

Gunther

Quote from: TimoVJL on March 03, 2022, 05:37:32 PM
OBJ file consist many parts, ...

I know that OBJ files consist of many parts, because I've read this book.
Quote from: TimoVJL on March 03, 2022, 05:37:32 PM
... so a bit funny comment :smiley:

By now I know that you have a very strange sense of humor. What's so funny about that? I have compiled the assembly language source with JWASM and TASM 4.0; both in 2 passes. With the command line
switch /q for TASM. This suppresses the parts that are not necessary for linking. The size of the OBJ JWASM file is 345 bytes and 375 bytes for TASM. And that with this ridiculously small source. I'm sorry,
but that' s not funny to me.

But once again: That's not the issue here. The thread is about PowerBASIC and the Cambridge test. There can be no doubt about this, because this topic is quite clearly named in the title.
You have to know the facts before you can distort them.

HSE

Hi Gunther!

Quote from: Gunther on March 03, 2022, 04:49:36 PM
The OBJ file generated by JWASM has a size of 343 bytes. Other assemblers obviously insert a whole lot of junk.
Like Timo say different OBJ sizes result in same EXE size. In fact, the OBJ file generated by ML has a size of 335 bytes.

Just to play, I builded JwasmR, and produce the 343 bytes OBJ, and is the same.

A little intriguing, but not important to enter Cambridge  :thumbsup:

Regards, HSE.

Equations in Assembly: SmplMath

six_L

Hi,Gunther
i got another result.
x1+x2=2*log(3,20)= 5.453666055721684 ;real10
;----------------------------------------------------
2*log(3,20)=[2*log(2,20)]/[1*log(2,3)]
local @tmpIValue:QWORD
local ResultReal10:REAL10

invoke RtlZeroMemory,addr buff,sizeof buff

invoke RtlZeroMemory,ADDR OutBuf,sizeof OutBuf
finit
;int 3
mov @tmpIValue,2
fild @tmpIValue
mov @tmpIValue,20
fild @tmpIValue
fyl2x ;st0=20,st1=2 --> st0=2*log(2,20)

        fld1   
mov @tmpIValue,3
fild @tmpIValue
fyl2x ;st0=3,st1=1 --> st0=1*log(2,3)
fdiv st(1),st(0) ; -->[2*log(2,20)]/[1*log(2,3)]
fxch st(1) ; st1 <--> st0
lea rax,ResultReal10
        fstp TBYTE PTR [rax] ;st0 --> addr ResultReal10

invoke FpuFLtoA64,addr ResultReal10,15,ADDR OutBuf,SRC2_DIMM or SRC1_REAL or STR_REG ;STR_SCI

what's wrong?

regard.
Say you, Say me, Say the codes together for ever.

Gunther

Quote from: HSE on March 03, 2022, 11:19:19 PM
Like Timo say different OBJ sizes result in same EXE size. In fact, the OBJ file generated by ML has a size of 335 bytes.

Just to play, I builded JwasmR, and produce the 343 bytes OBJ, and is the same.

This is certainly correct for such small OBJ files. Otherwise, there may already be a difference.

Quote from: HSE on March 03, 2022, 11:19:19 PM
A little intriguing, but not important to enter Cambridge  :thumbsup:

Of course. But wait a bit: in a few days I'll post on the Oxford test, which is equally quite challenging. I don't want anyone to be able to say that I'm taking sides unilaterally with Cambridge.
You have to know the facts before you can distort them.

Gunther

Dear six_L,

Quote from: six_L on March 04, 2022, 12:27:52 AM
Hi,Gunther
i got another result.
x1+x2=2*log(3,20)= 5.453666055721684 ;real10
;----------------------------------------------------
2*log(3,20)=[2*log(2,20)]/[1*log(2,3)]

At first glance, I would say that there is something wrong with the calculation. For example, I think that 1*log(2,3) = log(2,3). If you want, send me a PM with your email address. I'll then send you a PDF file with
the correct derivation of a formula with which you can calculate any logarithms to any bases. If others are interested in it too, I can also publish it here in the forum.

But I think that there is no great general interest in that. Therefore, let's do it individually between both of us.  :cool:
You have to know the facts before you can distort them.

HSE

#21
Quote from: six_L on March 04, 2022, 12:27:52 AM
i got another result.
x1+x2=2*log(3,20)= 5.453666055721684 ;real10
what's wrong?
Nothing wrong! It's that.

Using qWord's algorithm in BASIC :icon_idea:

Note for Gunther: perhaps is more clear to say "result using x1 is ..."

updated files.
Equations in Assembly: SmplMath

TimoVJL

#22
DELETED
May the source be with you

Gunther

HSE,

Quote from: HSE on March 04, 2022, 03:48:13 AM
Nothing wrong! It's that.

Using qWord's algorithm in BASIC :icon_idea:

right. It's the result for x1 + x2. But in principle, it doesn't matter at all. All we have to show is that 9*(SQR(3))^x - 3^x = 20. That's exactly what my program does - nothing more, nothing less.

But it's good that you've clarified the question. However, I had trouble because you did not change the old comment function header of GetSolution. And why is the new function called logbx? Is it
just a name or does it have a deeper meaning?
Quote from: HSE on March 04, 2022, 03:48:13 AM
Note for Gunther: perhaps is more clear to say "result using x1 is ..."
That' s a matter of taste, see my remark about what we just need to show.
You have to know the facts before you can distort them.

Gunther

Quote from: TimoVJL on March 04, 2022, 05:12:34 AM
Sure i do that, before that, i had to make a funny gmail address for that :smiley:

What's with all your blather? Are you bored?
You have to know the facts before you can distort them.

HSE

Quote from: Gunther on March 04, 2022, 06:19:58 AM
However, I had trouble because you did not change the old comment function header of GetSolution.
I don't even noted that  :thumbsup:

Quote from: Gunther on March 04, 2022, 06:19:58 AM
And why is the new function called logbx? Is it just a name or does it have a deeper meaning?
Means "logarithm of base x". It's the name in use in SmplMath from years (2011, I think).

Take me a while to find how to extract results:           **************************************
           * Result x1    = 2.92994704143585433 *
           * Result x2    = 2.52371901428582975 *
           * Result x1+x2 = 5.45366605572168408 *
           **************************************
           2 * logbx(3,20) = 5.45366605572168408
Equations in Assembly: SmplMath

Gunther

HSE,

Quote from: HSE on March 04, 2022, 06:50:54 AM
Means "logarithm of base x". It's the name in use in SmplMath from years (2011, I think).

ah, qword's material. Since I'm not a big fan of macros, I didn't look into it. Are you the current package maintainer?

Quote from: HSE on March 04, 2022, 06:50:54 AM
Take me a while to find how to extract results:
Why? The approach is quite simple after all. Correctly combine the function with its inverse function and logarithmize this expression. That's all. The rest is just a matter of skills.
You have to know the facts before you can distort them.

HSE

Gunther,

Quote from: Gunther on March 04, 2022, 08:00:19 AM
Are you the current package maintainer?
That is qWord suggestion, but everyone can make a fork.


Quote from: Gunther on March 04, 2022, 08:00:19 AM
Why? The approach is quite simple after all.

Sorry, I was talking about the program itself. The program look like a console program using print. After years using print in console assembly programs take me a lot of effort to realize that PowerBasic print is a graphic function  :biggrin: 

The instruction for console output is stdout and work exactly like print if console output is not captured. 

PRINT
PRINT"           **************************************"
PRINT"           * Result x1    ="; STR$(x1, 18);" *"
PRINT"           * Result x2    ="; STR$(x2, 18);" *"
PRINT"           * Result x1+x2 ="; STR$(x1x2, 18); " *"
PRINT"           **************************************"
PRINT
PRINT"            2 * logbx(3,20) = "; STR$(x3,18)
PRINT

STDOUT"           **************************************"
STDOUT"           * Result x1    =";
STDOUT STR$(x1, 18);
STDOUT " *"
STDOUT"           * Result x2    =";
STDOUT STR$(x2, 18);
STDOUT" *"
STDOUT"           * Result x1+x2 =";
STDOUT STR$(x1x2, 18);
STDOUT" *"
STDOUT"           **************************************"
STDOUT
STDOUT"           2 * logbx(3,20) = ";
STDOUT STR$(x3,18)
STDOUT
Equations in Assembly: SmplMath

six_L

Hi,HSE
QuoteNothing wrong! It's that.
thanks your confirm.

Hi,Gunther
Quoteright. It's the result for x1 + x2. But in principle, it doesn't matter at all. All we have to show is that 9*(SQR(3))^x - 3^x = 20. That's exactly what my program does - nothing more, nothing less.
i can't run the codes becauseof no 16bit system. At first glance, the paper " expo.pdf " is so remarkable, written 
carefully / perfectly / earnestly / attractively . it Leads me to calculate again. You are always admirable while done everything

regard.
Say you, Say me, Say the codes together for ever.

Gunther

HSE,

Quote from: HSE on March 04, 2022, 09:22:14 AM
Sorry, I was talking about the program itself. The program look like a console program using print. After years using print in console assembly programs take me a lot of effort to realize that PowerBasic print is a graphic function  :biggrin: 

The instruction for console output is stdout and work exactly like print if console output is not captured. 

that's remarkable. Can you give a simple working example for PB 3.5 and PBCC respectively? Steve aka Hutch and I would be very interested in this.
You have to know the facts before you can distort them.