English Amiga Board


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

 
 
Thread Tools
Old 29 January 2023, 00:38   #21
Bruce Abbott
Registered User
 
Bruce Abbott's Avatar
 
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,546
Quote:
Originally Posted by phx View Post
But that's compatibility again.
CNOP
could also use
NOP
instructions instead of zeros for alignment (hopefully in the code section only). But that depends on the assembler.
Hopefully. In the KS3.0 ROM there is a $4E71 (NOP) that is not word-aligned. How the hell did that happen?

ProAsm has CNOP, EVEN, ALIGN and ALIGN.L, none of which generate NOPs.

ProAsm is very fast, but it does have a few bugs. It may crash if you have a single character label not on the first column. Some 68020 instructions are coded wrong, others can't take labels when they should be able to.

Devpac has its own issues. The editor screws up if a source file has more than ~32,000 lines. Filenames can't have spaces in them.

Barfly assembler is even faster than ProAsm, but it has one annoying 'feature' - it 'optimizes' code with immediate operands to another 'equivalent' form (but different opcode) even when all optimization is off.

But this is all minor stuff. I have some x86 asm source that I can't find an assembler for. The ones I tried threw up an error on every line!
Bruce Abbott is offline  
Old 29 January 2023, 13:23   #22
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by Bruce Abbott View Post
In the KS3.0 ROM there is a $4E71 (NOP) that is not word-aligned. How the hell did that happen?
Was this the only unaligned instruction in this region? Some assemblers can write instructions to unaligned addresses. So a bad CNOP is not the only source for it.

Besides the restriction to code sections, a NOP used for alignment purposes should never be placed at an odd address. Example:
Code:
frank@altair cat tst.asm 
        section code,code
        dc.b    -1
        cnop    0,4
        rts
frank@altair vasmm68k_mot -quiet -Fbin tst.asm
frank@altair hexdump -C a.out 
00000000  ff 00 4e 71 4e 75                                 |..NqNu|
Data:
Code:
frank@altair cat tst.asm 
        section data,data
        dc.b    -1
        cnop    0,4
        dc.w    -1
frank@altair vasmm68k_mot -quiet -Fbin tst.asm
frank@altair hexdump -C a.out 
00000000  ff 00 00 00 ff ff                                 |......|
Quote:
ProAsm has CNOP, EVEN, ALIGN and ALIGN.L, none of which generate NOPs.
Good to know! Then ProAsm is already the second assembler, besides AssemPro, which supports this form of ALIGN directives. Maybe I will implement it in vasm for compatibility.

Quote:
Barfly assembler is even faster than ProAsm, but it has one annoying 'feature' - it 'optimizes' code with immediate operands to another 'equivalent' form (but different opcode) even when all optimization is off.
You mean CMP to CMPI, ANDI to AND, etc.? Yes, that's really annoying and I made sure in PhxAss (and so in vasm as well) that the assembler always generates the code which matches the mnemonic given in the source.

Quote:
But this is all minor stuff. I have some x86 asm source that I can't find an assembler for. The ones I tried threw up an error on every line!
All I know is that there are at least two different syntax variants for x86. The Intel-syntax with destination operand first and the MIT-syntax (GNU-assembler) with source operand first. Unlike m68k the MIT-syntax looks cleaner for x86, IMHO (which is what vasmx86 implements).
phx is offline  
Old 30 January 2023, 07:54   #23
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by Bruce Abbott View Post
But this is all minor stuff. I have some x86 asm source that I can't find an assembler for. The ones I tried threw up an error on every line!
There are variants for x86. Perhaps you just need to specify which one is the target - 16, 32 or 64-bit (but don't ask me how to do that !). There is also Dos vs Windows, things like that. In short, 'x86' by itself does not mean much (apart: you can expect a big mess).
Best asm for x86 seems to be NASM but don't expect it to be anywhere near what we have for 68k.
It would be great if we had x86 asm/disasm that takes/outputs Mot' syntax.
meynaf is offline  
Old 30 January 2023, 14:59   #24
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by meynaf View Post
It would be great if we had x86 asm/disasm that takes/outputs Mot' syntax.
Not sure if it makes much sense. Otherwise, that's easy:
Code:
frank@nerthus cd vasm
frank@nerthus gmake CPU=x86 SYNTAX=mot
...
frank@nerthus ./vasmx86_mot -v
vasm 1.9b (c) in 2002-2023 Volker Barthelmann
vasm x86 cpu backend 0.7a (c) 2005-2006,2011,2015-2019 Frank Wille
vasm motorola syntax module 3.16a (c) 2002-2022 Frank Wille
vasm test output module 1.0 (c) 2002 Volker Barthelmann
phx is offline  
Old 30 January 2023, 15:03   #25
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
And for the disassembler ?
meynaf is offline  
Old 30 January 2023, 16:52   #26
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Maybe Bruce writes one?
phx is offline  
Old 30 January 2023, 17:33   #27
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
That would be great. Could allow me to start porting PC games.
meynaf is offline  
Old 16 February 2023, 15:52   #28
Hypex
Registered User
 
Join Date: May 2015
Location: Australia
Posts: 131
Quote:
Originally Posted by phx View Post
Don't know. It's the name of the assembler used in the official Atari SDK for 6502 and 68000. It became open source in 2008 and created offsprings like smac and rmac for Atari, which also supported the JRISC from the Atari Jaguar. As vasm also supports JRISC, 68000 and 6502, the syntax became important and different enough for a separate module.

See: [URL]http://rmac.is-slick.com/history/history/[/URL
Thanks. Interesting history. Also interesting is the confusing names of smac and rmac as they look like Mac assemblers. :-D

Quote:
The oldstyle syntax module is intended for old 8-bit targets, with directives used in the 70s and early 80s. Not many of these old assemblers supported macros, so named arguments hardly caused any conflict.
Named arguments would also take up more space. Been a while since I've seen 8-bit ASM which might have had other limits on labels. But I only used the built in assembler on my C16.
Hypex 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
WTB: Assempro for the Amiga dy0d3 MarketPlace 3 22 June 2012 21:37
The Avengers Assemble on the Amiga CodyJarrett project.Amiga Lore 0 06 May 2012 17:30
Current legal status of Assempro jman Coders. General 17 24 December 2010 17:00
Forgot how to re-assemble a1200 lol Techx support.Hardware 6 24 April 2008 22:10
assemble error BippyM Coders. General 6 28 February 2007 21:05

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 04:54.

Top

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