Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Rearrange opcodes for modern uxn #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ pub(crate) enum InstructionKind {
BreakOrLiteral = 0x00,
Increment,
Pop,
Duplicate,
NoOperation,
Nip,
Swap,
Over,
Rotate = 0x07,
Rotate,
Duplicate,
Over = 0x07,
// Logic
Equal = 0x08,
NotEqual,
Expand Down
6 changes: 3 additions & 3 deletions src/tokenizer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,12 @@ fn parse_instruction(symbols: &[Spanned<u8>]) -> Option<(Instruction, Vec<Warnin
let instruction_kind = match to_string(&symbols[..3]).as_slice() {
b"BRK" | b"LIT" => Some(InstructionKind::BreakOrLiteral),
b"INC" => Some(InstructionKind::Increment),
b"NIP" => Some(InstructionKind::NoOperation),
b"POP" => Some(InstructionKind::Pop),
b"DUP" => Some(InstructionKind::Duplicate),
b"NIP" => Some(InstructionKind::Nip),
b"SWP" => Some(InstructionKind::Swap),
b"OVR" => Some(InstructionKind::Over),
b"ROT" => Some(InstructionKind::Rotate),
b"DUP" => Some(InstructionKind::Duplicate),
b"OVR" => Some(InstructionKind::Over),
b"EQU" => Some(InstructionKind::Equal),
b"NEQ" => Some(InstructionKind::NotEqual),
b"GTH" => Some(InstructionKind::GreaterThan),
Expand Down