From 0da98a3d83b5aa6ccae73658ef0692c4023bc70f Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Wed, 26 Apr 2023 11:57:37 +0100 Subject: Add Y and Z registers --- main/command.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'main/command.go') diff --git a/main/command.go b/main/command.go index 9403020..296ad69 100644 --- a/main/command.go +++ b/main/command.go @@ -107,6 +107,30 @@ func (cmd AppendXRegCommand) exec(state *ProgramState) { state.xreg = append(state.xreg, state.value...) } +type SwapYRegCommand struct {} +func (cmd SwapYRegCommand) exec(state *ProgramState) { + v := state.value + state.value = state.yreg + state.yreg = v +} + +type AppendYRegCommand struct {} +func (cmd AppendYRegCommand) exec(state *ProgramState) { + state.yreg = append(state.yreg, state.value...) +} + +type SwapZRegCommand struct {} +func (cmd SwapZRegCommand) exec(state *ProgramState) { + v := state.value + state.value = state.zreg + state.zreg = v +} + +type AppendZRegCommand struct {} +func (cmd AppendZRegCommand) exec(state *ProgramState) { + state.zreg = append(state.zreg, state.value...) +} + type SwapPathCommand struct {} func (cmd SwapPathCommand) exec(state *ProgramState) { v := state.value -- cgit v1.2.3