#!/bin/sh GREEN='\033[0;32m' RED='\033[0;31m' NC='\033[0m' make asm_files > /dev/null if [ ! "$(command -v ./sim8086)" ]; then echo -e "\nError: 'sim8086' executable not found" exit 1 fi odin build . -out:sim8086 for asm_txt in asm_files/*.txt; do asm_listing=$(basename $asm_txt .txt) output=$(./sim8086 asm_files/${asm_listing}.bin registers) if [ $? -eq 1 ]; then echo -e "Listing $asm_listing ${RED}Failed!${NC}" echo "$output" | while IFS= read -r line; do echo "$line" done echo -e "" else echo -e "Listing $asm_listing: ${GREEN}Succeded!${NC}" fi done