From 2d43212c04c393e9688c27418abb8bf38573923e Mon Sep 17 00:00:00 2001 From: jn Date: Thu, 2 Feb 2023 03:12:12 +0100 Subject: [PATCH] docs/cpu.md: Add comment about operand order --- docs/cpu.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/cpu.md b/docs/cpu.md index 6860bc8..3bc8717 100644 --- a/docs/cpu.md +++ b/docs/cpu.md @@ -55,6 +55,16 @@ by a source operand, or by source and target operands, depending on the opcode. | 15:14 | size | operation size, e.g. 32 bits +NOTE: Although in the instruction encoding the source operand comes first, +followed by the target operand, the order is reversed in the fox32 assembly +language. The following lines are equivalent: + +``` +cmp r1, r20 +data.16 0x8700 data.8 20 data.8 1 +``` + + ### Operand types | value | description | size of operand | what's actually stored?