capstone-engine / capstone

Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, LoongArch, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, TriCore, Webassembly, XCore and X86.
http://www.capstone-engine.org
7.26k stars 1.53k forks source link

M68K: attribute suffixes for branches #1668

Open maximumspatium opened 4 years ago

maximumspatium commented 4 years ago

Capstone engine uses the .B/.W/.L suffixes for the branch attribute. Examples:

./cstool m68k40 "60 0c"
bra.b   $e

./cstool m68k40 "61 00 00 38"
bsr.w   $3a

./cstool m68k40 "60 FF 00 00 E9 3E"
bra.l   $e940

While being consequent, the common suffix for the short branch is BRA.S though. That's what the most 68k disassemblers out here will generate for the first instruction.

Question: should we use the more common syntax for short branches?

huth commented 1 year ago

I'm also more used to "bra.s" instead of "bra.b" from the Atari assemblers/disasseblers. So FWIW, I'm in favour of switching to .s instead of using .b here.

troed commented 1 year ago

A tool I use has recently begun implementing Capstone and this issue has popped up. I second the use of bra.s - I've never seen the other use either on the native platform or with modern cross assemblers.

d-hedberg commented 1 year ago

Indeed, bra.s is my preferred choice as well!

czietz commented 1 year ago

I have to agree with the previous posters: The mnemonic for a short branch has always been BRA.S -- all the way back to the original 68k assembler by Motorola: https://archive.org/details/bitsavers_motorolave000AsmJul83_3899531/page/n15/mode/2up?view=theater