From 4c6e2e763f40388dd9038b4e2c5b51509b392a79 Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Mon, 11 Mar 2024 07:10:03 +0000 Subject: [PATCH] Autosave: 2024-03-11 07:10:03 --- zk/Machine code.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/zk/Machine code.md b/zk/Machine code.md index 469a056..6778249 100644 --- a/zk/Machine code.md +++ b/zk/Machine code.md @@ -9,3 +9,23 @@ created: Monday, March 11, 2024 No matter how a program was originally written, it eventually needs to execute on a [[CPU_architecture|CPU]] as a series of machine language instructions. + +## Example machine instruction + +The following machine instruction is an instruction that would be understood by +an [[Instruction_set_architectures| ARM ISA]]. It moves the number `4` into the +`r7` register: + +``` +11100011101000000111000000000100 +``` + +This 32bit line of binary has a series of instructions embedded within it. We +partition each part of the sequence below, from left to right, mapping it to the +instruction: + +| Binary sequence | Instruction | Action | +| --------------- | ----------- | ------ | +| 1110 | | | +| 00 | | | +| 1101 | | |