Files
vt1200/harness/dis/disrange.sh
T

12 lines
437 B
Bash
Executable File

#!/bin/sh
# Disassemble a ROM byte range with dis34, using physical bit addresses.
# usage: disrange.sh <image.bin> <start_byte_hex> <len_byte_hex>
set -e
IMG="$1"; START="$2"; LEN="$3"
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
TMP="$(mktemp)"
dd if="$IMG" of="$TMP" bs=1 skip=$((START)) count=$((LEN)) 2>/dev/null
BASE=$(printf '%x' $(( (0x07E40000 + START) * 8 )))
"$ROOT/tools/smart34010/dis34" -a -l -b "$BASE" "$TMP"
rm -f "$TMP"