Skip to content

Commit

Permalink
Reorganize signal handler setup and input buffering in LC3VM run method
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahimcetin committed Dec 18, 2024
1 parent 44d7bda commit a2f79fe
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Sources/LC3VM/LC3VM.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ struct LC3VM: AsyncParsableCommand {
var binary: URL

func run() async throws {
// Set up the signal handler
signal(SIGINT) { handle_interrupt($0) }
// Disable input buffering
disable_input_buffering()

// Create the LC-3 hardware
let hardware = Hardware()

// Read the binary file and load it into memory
try hardware.readImage(binary)

// Set up the signal handler
signal(SIGINT) { handle_interrupt($0) }
// Disable input buffering
disable_input_buffering()

// Run the LC-3 machine
try hardware.run()

Expand Down

0 comments on commit a2f79fe

Please sign in to comment.