Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [assembly]

This challenge is related to Assembly language. Note that challenges that require the answers to be in a specific language are generally discouraged.

0
votes
0answers
90 views

Tiny, Tiny “Hello, world!” - an adventure in small executables [duplicate]

The challenge: Print Hello, world!. Shortest executable wins. Criteria: Your program must compile into an ELF x86-64 executable that prints ...
27
votes
5answers
1k views

8bit virtual machine

Background I like my old 8-bit 6502 chip. It's even fun to solve some of the challenges here on PPCG in 6502 machine code. But some things that should be simple (like, read in data or output to ...
-4
votes
2answers
188 views

Fastest way to perform the equivalent of an if-statement in x86 assembly

The task is simple: Create an if-statement from scratch in x86 assembly that runs in as few clock-cycles as possible. Must be x86 assembly. Can't use any of the conditional jump/branch instructions (...
12
votes
0answers
341 views

How to reduce EXE size of x86 ASM compiled with FASM?

As an exercise, I've created a simple solution for this challenge, in x86 Assembly Language. I'm running this with FASM on Windows. Here's my source code: ...
21
votes
16answers
1k views

Tips for golfing in x86/x64 machine code

I noticed that there's no such question, so here it is: Do you have general tips for golfing in machine code? If the tip only applies to a certain environment or calling convention, please specify ...
2
votes
0answers
305 views

Hello World!… in pure x86 opcodes [duplicate]

This is a Hello World challenge! Those plain ones! Yeah.... However, it's different this time. Because here, you can't use C or C++ or Stuck or ArnoldC or whatever you want. You can only choose raw ...
9
votes
3answers
601 views

Smallest possible runnable Mach-O executable

What is the smallest possible runnable Mach-O executable on x86_64? The program can do nothing (not even returning a return code), but must be a valid executable (must run without errors). My try: ...
20
votes
1answer
770 views

Bootloader golf: Brainf***

Create a bootloader that executes given Brainfuck program. This is code-golf, so the program with least bytes wins. Being a bootloader, the size of the program is counted in non-zero bytes in the ...
2
votes
0answers
189 views

Help golfing MIPS assembly [closed]

I want to write 7 assembly instructions (28 bytes) that runs a logical equivalent of this C snippet: c = a + b + 6; while (c > 5) { c = c - a; b = b + 1; } ...
5
votes
4answers
690 views

Box-256 Assembly - BIG SQUARE II

I'd like to start a series of challenges for http://box-256.com/ starting with the first challenge, “BIG SQUARE II”. After this one I'll add another for "CHECKERBOARD" and so on. Rules: Complete the ...
4
votes
1answer
263 views

Copy Memory Only Using Store And Subtraction

A peer of mine approached me with this challenge and I wasn't able to come up with an elegant solution. After discussing my approach, we began to wonder what the people at Code Golf would come up with....
20
votes
14answers
2k views

The Nano Core War

This is an adaption of Core War, a programming KOTH dating back to the 20th century. To be more specific, it is using an incredibly simplified instruction set primarily based off of the original ...
2
votes
0answers
192 views

Code the shortest for incremental adding up until > 100 in Hack Assembly Language [closed]

You can find the Hack Assembly Language specification here: http://www.cs.huji.ac.il/course/2002/nand2tet/docs/ch_4_machine_language.pdf You can download the Hack Computer emulator here: http://www....
11
votes
2answers
1k views

Fastest way to compute order of magnitude in x86 assembly

The task is simple: write assembly that computes the order of magnitude of an integer using as few clock cycles as possible. Order of magnitude is defined as log10,...
8
votes
1answer
641 views

WinAli - Virtual CPU for understanding assembly language

WinAli is a model assembler for Windows. It emulates a real CPU and is meant to help students learning and understanding the Assembly language. German Wikipedia article: http://de.wikipedia.org/wiki/...
4
votes
1answer
445 views

write an “operating system” that dims Num Lock

I want to write x86 assembler code that can be used to boot your computer from and dims NumLock. This means you cannot rely on glibc or any other of these "comfi" libraries you cannot rely on the ...
3
votes
3answers
908 views

Self-contained hello-world program

I want a program that outputs "hello world" on console on my x86_64 based Linux computer. Yes, a complete program, not something silly that needs an interpreter or a compiler to work. You may: use ...
5
votes
5answers
1k views

Prime sieve and sort (x86 asm)

Your challenge is to write a routine, in x86 assembly, which takes a buffer containing 32-bit signed integers and writes a sorted list of the prime values to another buffer, then returns the number of ...
7
votes
7answers
2k views

Shortest code that return SIGSEGV among the given languages [duplicate]

I come across a question in a coding competion "write a code that returns SIGSEGV(Segmentation fault ) " . Points were given on the basis of length of code. The prgramming languages available ...
18
votes
11answers
4k views

Assembly Language Quine

Write the shortest possible assembly-language quine. Use any ISA you want, unless it has a print-quine instruction or equivalent. Examples include x86, MIPS, ...