Porting Devpac to GNU as syntax

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5006
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Porting Devpac to GNU as syntax

Postby simonsunnyboy » Tue Apr 10, 2018 5:47 pm

I am currently porting older sources made with Devpac or Pure C compatible assemblers (AHCC) to GNU as.
There are some statements which puzzle me as they won't translate. Can anyone help me?

1.

Code: Select all

moveq   #0xFF,D0
-> "operands mismatch", original code is moveq #$ff,D0
2.

Code: Select all

and.w   #~%111,D2
-> "bad expression", I assume it actually assembles to and.w #0xF8,D2 but I am not sure on this.

Thank you!
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

hawlk
Atarian
Atarian
Posts: 5
Joined: Fri Apr 18, 2014 6:15 pm

Re: Porting Devpac to GNU as syntax

Postby hawlk » Tue Apr 10, 2018 6:46 pm

simonsunnyboy wrote:1.

Code: Select all

moveq   #0xFF,D0
-> "operands mismatch", original code is moveq #$ff,D0


indeed, error if the value is greater than 127 (0x7f)

Code: Select all

moveq   #-1,d0




2.

Code: Select all

and.w   #~%111,D2
-> "bad expression", I assume it actually assembles to and.w #0xF8,D2 but I am not sure on this.


maybe binary mode '%' is not supported.

Code: Select all

and.w   #0xfff8,d2

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5006
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Porting Devpac to GNU as syntax

Postby simonsunnyboy » Tue Apr 10, 2018 7:21 pm

That makes sense, thanks for the quick answer.
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 747
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: Porting Devpac to GNU as syntax

Postby mfro » Wed Apr 11, 2018 5:20 am

Binary constants are supported, but need a "0b" prefix.

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5006
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Porting Devpac to GNU as syntax

Postby simonsunnyboy » Wed Apr 11, 2018 3:37 pm

I tried and with the 0b in place this assembles aswell:

Code: Select all

and.w  #~0b111,D2
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 2 guests