# What to count in assembly?

Yes, I've checked this post (How are bytes counted in assembly), but I'm asking a different question. I'm asking, if I have an .asm file, an .obj file and an .exe file, which one should I submit? Which part in the code should I submit? Especially for .obj files and .exe files -- I have no idea which part of code is the real assembled code, while others are only boilerplates.

• If you read the linked post, then it should be clear that object files are not assembly at all. If you're asking how to golf in machine code, then... I don't know a damn thing, so feel free to edit your question to ask that (or head over to the chat room). Feb 4 at 1:27
• If you submit .asm (whether it is a function or a program), then it simply becomes a valid assembly submission. I think a full program machine code submission should be the entirety of the .exe or whatever executable you have, but for a function submission, I believe most machine code golfers use some kind of disassembly tool (which shows the address, the raw machine code bytes in hex, and the corresponding assembly). Feb 4 at 1:33

## It's up to you!

Some of my assembly answers are provided as instruction listings, because the assembly IR / target code is larger than the mnemonic size.

For x86, it's usually the best idea to provide the assembled machine code as a flat binary, state where the entry point is, and describe the calling convention. If you need to access the system interface, you're locked out of libc, so you'll have to use either linux syscalls, or whatever your operating system supports.

You can also post DOS .com submissions - MS-DOS provides you some system API's (and some users on codegolf made a lot of MS-DOS specific answers!), but also it provides you the flexibility and code golf potential with unrestricted hardware and memory access.

• Thanks for answering! Actually I only have MASM available, no Linux :) Is "disassemble and find the expected part" a good option? Feb 4 at 14:28
• I advise you to use nasm, which has the binary output format, making stuff much more convenient. Feb 4 at 14:39
• Here's the link: nasm Also, ndisasm makes disassembly very convenient (MASM doesn't come with this tool).
– user99151
Feb 5 at 8:44