BBC BASIC for Windows
General >> General Board >> FPU Instruction fail
http://bb4w.conforums.com/index.cgi?board=general&action=display&num=1456867073

FPU Instruction fail
Post by Ric on Mar 1st, 2016, 8:17pm

Can anyone tell me why this code syntax errors at line 1250 Code:
 1230   fld   DWORD        [data%+56]
 1240   fld   DWORD        [data%+60]
 1250   fmul  st(0),st(1)
 1260   fstp  DWORD        [data%+68]
 


I am new to the fpu and highly frustrated!!

Any help is much appreciated.

Ric
Re: FPU Instruction fail
Post by DDRM on Mar 2nd, 2016, 08:43am

Hi Ric,

I have even less experience than you, so treat with caution, and I can't test it, but I note in the manual under floating point operands it says you should refer to the registers as ST0, ST1, etc. - is it just a syntax (ie st(0) instead of STO)? Your syntax implies that you are referring to array components.

Best wishes,

D
Re: FPU Instruction fail
Post by Ric on Mar 2nd, 2016, 12:23pm

The simple answer to your question about syntax is "I don't know?". I have tried many different syntax and can not get it to work. I agree it looks like I'm trying to access an array (and in a way I suppose I am). The registers I am trying to manipulate are the fp stack st0 to st7. Could you point me in the direction of the location in the manual you were reading from please, I have looked at many sources and all imply the use of brackets, which can't be right otherwise there would be no need for the post.

Cheers Ric
Re: FPU Instruction fail
Post by Ric on Mar 2nd, 2016, 12:29pm

Just found the fp section in the assembler part of the manual, the registers are in capital, which is a syntax I have not tried. Will have a go tonight and let you know.

Ric
Re: FPU Instruction fail
Post by Ric on Mar 2nd, 2016, 5:23pm

Cheers D
The solution was that the syntax requires capitals and no brackets, must have been the only combination I didn't try last night!! This is an interesting twist because every other example I could find (couldn't find any for bb4w) used lowercase and brackets. Ho hum.

Back to the faster tile transfer routine using fp asm

grin grin grin