English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 23 April 2020, 07:55   #1
Auscoder
Registered User

 
Join Date: Jan 2019
Location: Brisbane
Posts: 70
Couple of vasm questions

Hi, just moved my project over to cross compile on Windows with vasm. Was previously using Devpac on the Amiga.

Is there a way to disable optimization messages or any messages by id?
I see vasm has -showopt but can't see how to disable..

The other easy to work around, I noticed on latest release build from source that setting -devpac compatibility mode does not set -ldots. At least I had to also set -ldots to support dots. Older version I was using did set -ldots behaviour with -devpac

Another little one, halt on error count, can I set max error arbitrarily?

And last of all, would like to use float/double in expression. Rounded results are fine. This results in data has illegal type

Code:
data: dc.l 128*0.1 ; -> 12
Is it possible to do this?

Thanks for the advice in advance!

Last edited by Auscoder; 23 April 2020 at 08:06.
Auscoder is offline  
Old 23 April 2020, 11:28   #2
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,717
Quote:
Originally Posted by Auscoder View Post
Is there a way to disable optimization messages or any messages by id?
Should be in the documentation. You can disable any warning by
-nowarn=<n>
. Optimization messages are only enabled in Devpac compatibility mode, because Devpac does the same. And you can disable these messages in the same way as with Devpac:
opt ow-
.

Quote:
The other easy to work around, I noticed on latest release build from source that setting -devpac compatibility mode does not set -ldots.
And V1.8g doesn't either. That's my fault! Seems I did a cut&paste instead of copy&paste when adding this feature for PhxAss-compatibility in 1.8g.
Thanks for reporting! Fixed in tomorrow's daily source snapshot.

Quote:
Another little one, halt on error count, can I set max error arbitrarily?
This is documented:
-maxerrors=<n>
. Set maxerrors to zero if you want to see all of them without halt.

Quote:
This results in data has illegal type
Code:
data: dc.l 128*0.1 ; -> 12
As in most assemblers I know. Also in Devpac.

Quote:
Is it possible to do this?
Yes, with
dc.l 128/10
.

Unlike many other assemblers vasm allows floating point expressions in floating point directives (
dc.s
,
dc.d
,...) or in floating point symbols (with
fequ
, for example). But there is no way to use them anywhere else.
phx is offline  
Old 23 April 2020, 15:14   #3
Auscoder
Registered User

 
Join Date: Jan 2019
Location: Brisbane
Posts: 70
Quote:
Originally Posted by phx View Post
As in most assemblers I know. Also in Devpac.

Yes, with
dc.l 128/10
.

Unlike many other assemblers vasm allows floating point expressions in floating point directives (
dc.s
,
dc.d
,...) or in floating point symbols (with
fequ
, for example). But there is no way to use them anywhere else.
Thanks for the tips phx! much appreciated.

Yes of course 128/10 -- but generally...

It's quite handy for me to be able to use float, if I were to look at the source, would it be as simple as in cpu.c around line 4975 to look at value of fval (is it valid at this point), cast and place correct type in data (I just noticed 32/64/96 bit types are treated differently, I guess as these are the supported float types - so maybe more complex than I can guage)

Code:
  switch (bitsize) {
    case 8:
      if (etype == NUM) {
        if (typechk && (val<-0x80 || val>0xff))
          cpu_error(39);  /* data out of range */
        db->data[0] = val & 0xff;
      }
      else if (etype == FLT)
        cpu_error(40);  /* data has illegal type */
      else
        ierror(0);
      break;

    case 16:
      if (etype == NUM) {
        if (typechk && (val<-0x8000 || val>0xffff))
          cpu_error(39);  /* data out of range */
        setval(1,db->data,2,val);
      }
      else if (etype == FLT)
        cpu_error(40);  /* data has illegal type */
      else
        ierror(0);
      break;
Auscoder is offline  
Old 23 April 2020, 20:22   #4
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,717
Quote:
Originally Posted by Auscoder View Post
cpu.c around line 4975 to look at value of fval (is it valid at this point),
Yes, it is valid, as your expression became a FLT type.

Quote:
cast and place correct type in data
Right. That would work for your specific case, but see below.

Quote:
(I just noticed 32/64/96 bit types are treated differently, I guess as these are the supported float types - so maybe more complex than I can guage)
Exactly! 32, 64 and 96 bit data types are those which are encoded into IEEE format when you provide a floating point expression. If you would truncate and convert the fval to integer then dc.s for defining IEEE single precision floats would no longer work.
phx is offline  
Old 24 April 2020, 01:02   #5
Auscoder
Registered User

 
Join Date: Jan 2019
Location: Brisbane
Posts: 70
Quote:
Originally Posted by phx View Post
Yes, it is valid, as your expression became a FLT type.

Right. That would work for your specific case, but see below.

Exactly! 32, 64 and 96 bit data types are those which are encoded into IEEE format when you provide a floating point expression. If you would truncate and convert the fval to integer then dc.s for defining IEEE single precision floats would no longer work.
Thanks phx, that’s also what I concluded here. I don’t really need floating point elsewhere so I may try with a local custom build. Big help cheers!!
Auscoder is offline  
Old 24 April 2020, 16:16   #6
Auscoder
Registered User

 
Join Date: Jan 2019
Location: Brisbane
Posts: 70
Hey phx, I found an issue if the coder uses a float in an expression for a 32 bit type it’s converted to fp and injected as such.

So this is possible

Data: dc.l 65536.0

But the value will be invalid as an integer, vasm does not detect that case, but does pick up the 8 and 16bit cases as invalid.

I’ve made local mods and happy to say uses truncated floats now in my expressions.

Last edited by Auscoder; 24 April 2020 at 16:17. Reason: Typo
Auscoder is offline  
Old 28 April 2020, 23:17   #7
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,717
Quote:
Originally Posted by Auscoder View Post
Data: dc.l 65536.0
This is intended. 32-bit values may also be specified as IEEE Single Precision floating point. So you can either write its hex-code or use a decimal point and let vasm convert.

It is even allowed in a
move.l
to load floating point that way.
phx is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Couple questions about using workbench liquidsmoke support.Apps 3 16 October 2019 22:34
A couple of questions if I may? Mclane support.WinUAE 4 25 April 2014 17:29
So I have a whole tosec, a couple of questions Kitty support.FS-UAE 2 05 May 2013 17:54
Couple of hardware questions Smiley support.Hardware 3 10 February 2007 02:38
A couple of newbie questions... kemppe New to Emulation or Amiga scene 2 17 April 2002 09:50

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 20:18.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.07302 seconds with 15 queries