Skip to content

Commit 78c1505

Browse files
committed
cleanup comments
1 parent b021a5c commit 78c1505

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

sim/aviron/src/lib/io.zig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ pub const RAM = struct {
125125
// ATmega328P memory map: SRAM starts at 0x0100
126126
// Map logical addresses 0x0100-0x08FF to array indices 0x0000-0x07FF
127127
const sram_offset: Address = if (addr >= 0x100) addr - 0x100 else addr;
128-
if (sram_offset >= size) return 0; // Return 0 for out-of-bounds reads
129128
return mem.data[sram_offset];
130129
}
131130

@@ -134,7 +133,6 @@ pub const RAM = struct {
134133
// ATmega328P memory map: SRAM starts at 0x0100
135134
// Map logical addresses 0x0100-0x08FF to array indices 0x0000-0x07FF
136135
const sram_offset: Address = if (addr >= 0x100) addr - 0x100 else addr;
137-
if (sram_offset >= size) return; // Ignore out-of-bounds writes
138136
mem.data[sram_offset] = value;
139137
}
140138
};

sim/aviron/src/main.zig

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ pub fn main() !u8 {
128128

129129
std.debug.print("\nSTOP: {s}\n", .{@tagName(result)});
130130

131-
// Handle program exit - the defer block will still run
131+
// Handle program exit
132132
if (result == .program_exit) {
133133
return io.exit_code;
134134
}
@@ -152,13 +152,10 @@ pub const FileFormat = enum {
152152
const Cli = struct {
153153
help: bool = false,
154154
trace: bool = false,
155-
// Dump full register state every instruction
156155
mcu: MCU = .atmega328p,
157156
info: bool = false,
158157
format: FileFormat = .elf,
159-
// Breakpoints / halting aids
160158
break_pc: ?u24 = null,
161-
// Stop after N instructions
162159
gas: ?u64 = null,
163160

164161
pub const shorthands = .{

sim/aviron/src/testrunner.zig

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,10 @@ pub fn main() !u8 {
139139
test_system = SystemState{
140140
.options = cli.options,
141141
.config = config,
142-
.io = undefined, // Will be initialized below
143-
.cpu = undefined, // Will be initialized below
142+
.io = undefined, // Initialized below
143+
.cpu = undefined, // Initialized below
144144
};
145145

146-
// Initialize IO first
147146
test_system.io = IO{
148147
.sreg = undefined, // Will be set after CPU initialization
149148
// Initialize SP to RAMEND (0x0100 + SRAM size - 1)
@@ -155,7 +154,6 @@ pub fn main() !u8 {
155154
.stderr = &stderr,
156155
};
157156

158-
// Initialize CPU
159157
test_system.cpu = aviron.Cpu{
160158
.trace = cli.options.trace,
161159

@@ -182,7 +180,6 @@ pub fn main() !u8 {
182180
},
183181
};
184182

185-
// Now link the sreg after both are initialized
186183
test_system.io.sreg = &test_system.cpu.sreg;
187184

188185
// Initialize CPU state:

0 commit comments

Comments
 (0)