The short answer is no: a given piece of assembly language, as normally written, cannot run on a different CPU architecture. Assembly language is tied to one instruction set architecture (ISA) — the vocabulary of machine instructions a processor executes — and that vocabulary differs fundamentally between, say, x86-64 and ARM64. Code written in x86-64 assembly will not run on an ARM processor, and vice versa. The important qualifications are that there are many "architectures" at different levels (instruction sets, operating systems, application binary interfaces), that a few broad ISAs contain compatible sub-variants, and that "porting" assembly to a new architecture almost always means rewriting it rather than running it.

This article explains why the answer is what it is, where the tempting exceptions fit, and how to think about portability when you or your team depend on assembly.

What assembly language actually is

Assembly language is a human-readable notation for the machine instructions of one specific processor family. A line like mov eax, 1 on an x86 processor means "put the value 1 into the EAX register"; the exact spelling, registers, and available operations come from that processor's instruction set.

Crucially, assembly is not a general-purpose programming language in the way C or Python are. It is a thin layer over an ISA. The assembler translates your mnemonics into the exact binary opcodes that a particular family of chips decodes. Because the binaries are defined by the ISA, the assembly source and the resulting machine code are both bound to that ISA.

A simple example makes the dependence concrete. On x86-64, a function that adds two integers might load arguments from registers named rdi and rsi and put the result in rax. On ARM64 (AArch64), the same operation uses registers x0, x1, and w0, with different instruction spellings and a different calling convention. The two programs do the same job, but neither one's text is valid on the other chip. They are not dialects of a shared language; they are languages for different machines.

Why the same program can be rewritten, not rerun

The reason assembly does not travel is that ISAs differ in nearly everything that matters:

Instruction set. Operations available, their encodings, and their operand rules vary. Some chips have single instructions for operations that others must build from several steps. Registers. The number, width, names, and roles of registers differ. x86 has a legacy of special-purpose registers; ARM64 has a large, more uniform general-purpose register file. Memory model and addressing. Byte order (endianness), alignment rules, addressing modes, and memory-ordering guarantees differ across architectures. Calling conventions. How arguments are passed, how return values come back, which registers must be preserved, and how the stack is laid out are defined per platform (and sometimes per operating system), not globally. Privilege and system instructions. Interrupt handling, system calls, and privileged instructions are specific to the architecture and the OS on top of it.

These are not surface details you can paper over with a translation table. A program's correctness depends on them. That is why the practical answer to "can assembly run on a different architecture" is that the idea of a computation can be reimplemented, but the assembly source must be rewritten for the target ISA.

The layers people confuse with "architecture"

Much of the confusion comes from using "architecture" loosely. It helps to separate at least three layers.

Layer What it means Does assembly carry over?
Instruction set architecture (ISA) The machine instructions the CPU executes, e.g., x86-64, ARM64, RISC-V No — this is the binding that matters most
Platform / ABI Operating system plus calling convention, object format, system-call interface No — changes even within one ISA
Microarchitecture A specific chip's internal design (pipelines, caches) within an ISA Yes — code for one ISA runs on any conforming chip of that ISA

The third row is the real portability story. Assembly written for x86-64 runs on Intel and AMD processors because both implement the same ISA, even though their internal microarchitectures differ. Likewise, ARM64 assembly runs across many ARM64 chip designs. So assembly is portable within an ISA family, but not across ISA families. When someone says "it runs on different architectures," they usually mean it runs on different chips that share an ISA, or they are being loose with the word.

Where compatibility actually exists

There are genuine cases where code crosses boundaries, and each has a specific explanation.

Backward compatibility within a family. x86 processors can execute older 16-bit and 32-bit x86 code because the newer chips retain the older instruction encodings. This is compatibility within one evolving ISA, not across unrelated architectures. It is a deliberate design choice by chip makers, and it is why very old x86 binaries can still run on modern x86 machines.

Compatible sub-profiles. Some ISAs define profiles or extensions, and a chip that implements a superset can run code targeting the subset. ARM has historically had architecture versions and profiles, and RISC-V is explicitly built around modular extensions. Code using only the common subset can run on any conforming implementation; code using an extension requires a chip that supports it. This is portability within an ISA family with documented rules, not across families.

Emulation and translation. An x86 program can run on an ARM machine if software emulates the x86 ISA or translates the code. Emulators such as QEMU, and translation layers used for running software built for one platform on another, make this work. But note what is happening: the assembly is not running natively. Something else is interpreting or recompiling those instructions for the host chip. Performance and fidelity vary, and some instructions or system behaviors may not be perfectly reproduced.

Binary translation at the OS or vendor level. Some vendors provide compatibility layers so that binaries compiled for one ISA run on another with translation. Again, the original machine code is not executed directly by the target CPU; a translation layer stands in between.

These exceptions are real and useful, but they do not change the core rule: native assembly is ISA-specific, and cross-architecture execution depends on emulation or translation, not on the assembly itself being portable.

What "porting assembly" involves

If you have assembly you need on another architecture, the work is a port, and it is usually substantial. In broad terms:

1: Reimplement the logic in the target ISA. Each routine must be rewritten using the target's instructions, registers, and conventions. 2: Honor the target's ABI. Argument passing, stack alignment, register preservation, and data layout must follow the new platform's rules. 3: Recheck assumptions. Endianness, atomic operations, memory ordering, and alignment can silently break code that assumed the old architecture. 4: Retest thoroughly. Correctness, performance, and edge cases must be revalidated because the new code is genuinely new machine code.

For large codebases, teams often avoid repeating this effort by keeping performance-critical code in a portable language (typically C or C++) and using assembly only for small, well-isolated hot spots, or by using intrinsics that compilers map to the appropriate instructions for each target. That is a common engineering compromise: get most of the portability from a higher-level language, and confine the ISA-specific assembly to a small, documented surface.

Common misconceptions

"Assembly is low-level, so it's universal." Being close to the machine makes assembly less portable, not more. High-level languages hide the machine; assembly exposes it.

"If it compiles, it runs anywhere." Assembly does not "compile for anywhere." An assembler targets one ISA and produces object code for that ISA. There is no portable assembly standard that spans unrelated processors.

"A different architecture just needs a different assembler." A different assembler is necessary but nowhere near sufficient. The source itself must be rewritten for the new instruction set and platform.

"Emulation means the assembly is portable." Emulation means the behavior can be reproduced on another chip. The assembly source and the original machine code remain bound to their ISA; the emulator is doing the adaptation.

A practical way to decide

If your real question is whether some assembly you have will work on another machine, ask three questions in order:

Same ISA? If yes, it will generally run, subject to OS and ABI compatibility and any ISA extensions the code uses. Same OS and ABI? Even within one ISA, a different operating system or calling convention can require changes, especially for system calls and library interfaces. Different ISA? Then plan for a rewrite, or for running it under emulation or translation with the performance and fidelity tradeoffs that entails.

That decision tree captures the honest answer. Assembly is portable across chips that share an instruction set, and it is not portable across different instruction sets without rewriting or an emulation layer.

The bottom line: assembly language cannot, by itself, run on a different architecture. It is defined by one processor's instruction set, and different architectures speak different instruction sets. Within an ISA family, and through emulation or translation, code can reach other machines — but those are qualifications to the rule, not exceptions that make assembly a portable language.