1
0
mirror of https://github.com/moshix/mvs.git synced 2026-01-11 23:43:00 +00:00

Update assembler.bash

This commit is contained in:
moshix 2024-06-29 03:00:10 +02:00 committed by GitHub
parent 1bc385fc42
commit 41cef91d44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,3 +1,4 @@
#!/bin/bash
# this is the basic structure for an S/370 assembler in bash
# (c) 2024 by moshix
# can be easily extended
@ -5,7 +6,7 @@
# v 0.1 humble beginnings
# v 0.2 first few instructions
# v 0.3 CSECT and DSECT
#!/bin/bash
# Instruction set (extendable)
declare -A INSTRUCTIONS=(
@ -26,7 +27,7 @@ declare -A INSTRUCTIONS=(
assemble_line() {
local line="$1"
local instruction=$(echo "$line" | awk '{print $1}')
local operands=$(echo "$line" | awk '{print $2}')
local operands=$(echo "$line" | awk '{print $2, $3}')
# Handle special directives
case "$instruction" in
@ -72,3 +73,4 @@ if [[ $# -ne 1 ]]; then
fi
assemble_file "$1"