From a7e27df7e91c7d579b87079582243de047ce1a16 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Tue, 17 Feb 2026 01:38:23 +0200 Subject: [PATCH] Add check for `fasm` installation in `compile.sh` script with optional prompt to install --- emulator/compile.sh | 16 +++++++++++++++- emulator/emulator.asm | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/emulator/compile.sh b/emulator/compile.sh index 1e132a3..bf32a8d 100755 --- a/emulator/compile.sh +++ b/emulator/compile.sh @@ -1,4 +1,18 @@ #!/bin/bash -fasm emulator.asm +if ! command -v fasm &> /dev/null; then + echo "fasm (flat assembler) is not installed." + read -p "Would you like to install it? (y/n): " choice + if [[ "$choice" =~ ^[Yy]$ ]]; then + sudo apt-get update && sudo apt-get install -y fasm + if [ $? -ne 0 ]; then + echo "Failed to install fasm." + exit 1 + fi + else + echo "fasm is required to continue. Exiting." + exit 1 + fi +fi +fasm emulator.asm \ No newline at end of file diff --git a/emulator/emulator.asm b/emulator/emulator.asm index 4c8839e..8ad524c 100644 --- a/emulator/emulator.asm +++ b/emulator/emulator.asm @@ -70,7 +70,7 @@ shl bx, 1 add bx, table jmp word [cs:bx] -table +table: dw emu ; 0 dw quit dw xkbd@ -- 2.20.1