#Is this a good x86_64 cheatsheet?

31 messages · Page 1 of 1 (latest)

grizzled coyoteBOT
#

@weary sonnet

rs.ftb Uploaded Some Code

I wrote myself an (unfinished) x86_64 cheatsheet ft. chatgpt since I'd like to get into it more, is it correct and readable? Did it on my phone so formatting might suck a little (no tables), any feedback on it is appreciated though

Uploaded these files to a Gist
boreal anvil
#

Looks fine, obviously the calling convention stuff is very sparse comparatively to the real thing but I guess it's okay.

#

ChatGPT when I tested got the x64 windows calling convention wrong.

#

I don't trust it for detail specific things like this.

#

Idk there is usually good resources outside of a lying AI to use for something like this.

#

This is a very easily goooglable thing.

#

Also Intel vs. AT&T is one thing but assemblers have their own specifics too.

#

NASM and MASM can both use Intel but have small differences.

#

Best thing to do is experiment with different assemblers.

#

It's just different assemblers.

#

The more interesting differences are the assemblers not the syntax.

#

Since they have different levels of macro support.

#

Yeah ways of making writing assembly easier.

#

MASM has a nice way to handle locals for example.

#

So macro and directive support is what makes the assemblers different.

#

The local thing is a directive and then macros are their own thing.

#

Yeah or if you're familiar with C it's like those.

#

For macros.

#

FASM has the best macro support I think.

#

It's different than a function

#

Since this is generating assembly for you.

#

It's a short hand.

fickle crater
#

macro is like scripting for a code generator, whereas functions are located at a certain address and jumped to

#

python doesn't have anything like macros, that I know of

#

python is quite a bit different from assembly 🙂

#

if you used C++, then C++ templates are like a macro system

#

more like frontside

#

first you expand macros, then you do the regular assembly (in assembly) or compilation (in C or Rust)

#

so macros are for thigns you COULD write by hand, but it would be tedious

#

and maybe you might make a mistake

#

so you're scripting a code generator, "write valid code that looks like this, with these rules", and that's what gets fed into the assembler