yrp604 / rappel

A linux-based assembly REPL for x86, amd64, armv7, and armv8
Other
1.16k stars 55 forks source link

ATT-style for x86_64? #11

Closed KireinaHoro closed 6 years ago

KireinaHoro commented 6 years ago

Thanks for the great work! The tool works just as I've imagined of an ASM REPL. I'm learning x86_64 assembly, but started with ATT style and can hardly read Intel ones, let alone writing them. Is there a way to switch to ATT syntax?

yrp604 commented 6 years ago

Thanks, I’m glad it’s useful to you.

I am unlikely to add support for this. I would strongly encourage you to use Intel syntax, particularly if you’re interested in security or adjacent subjects.

If you’re insistent on using at&t, you could replace the call to nasm with another assembler of your choice in /arch/amd64/assemble_intel.c. The arm based arch’s already use gnu as (which I think is at&t by default) as their assembler, so with a little copy and paste you should be able to get it working.

Alternatively, if you want to replace it with another assembler all the code you should need to modify is in that file. As long as the assembler can dump to stdout it should be a drop in replacement.

If you want to try this and run into specific problems, please feel free to let me know.

KireinaHoro commented 6 years ago

Thanks a lot! I copied arch/armv8/assemble_armv8.c over to amd64 and changed the function name, and it's working perfectly. Happy hacking!