From 7b5f42a56abafd59f61c463d5f16666e5a2a3220 Mon Sep 17 00:00:00 2001 From: Ben Grant Date: Wed, 15 May 2024 18:51:13 -0700 Subject: [PATCH] doc comments for fx75/fx85 --- src/instruction.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/instruction.zig b/src/instruction.zig index bebb8aa..f6bb37b 100644 --- a/src/instruction.zig +++ b/src/instruction.zig @@ -1022,6 +1022,7 @@ test "FX65 load registers" { try std.testing.expectEqual(std.mem.zeroes([16]u8), cpu.V); } +/// FX75: store registers [V0, VX] in flags. X < 8 fn opSaveFlags(self: Instruction, cpu: *Cpu) !?u12 { if (self.regX > 8) return error.FlagOverflow; @memcpy(cpu.flags[0 .. self.regX + 1], cpu.V[0 .. self.regX + 1]); @@ -1042,6 +1043,7 @@ test "FX75 save flags" { try std.testing.expectEqual([_]u8{ 0x11, 0x22, 0, 0, 0, 0, 0, 0xff }, cpu.flags); } +/// FX75: load flags into [V0, VX]. X < 8 fn opLoadFlags(self: Instruction, cpu: *Cpu) !?u12 { if (self.regX > 8) return error.FlagOverflow; @memcpy(cpu.V[0 .. self.regX + 1], cpu.flags[0 .. self.regX + 1]);