Update cron time #76
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test disassembled code produced by the emulator | |
name: Test Disassembler | |
on: | |
push: | |
workflow_dispatch: | |
inputs: | |
message: | |
description: Message to display in job summary | |
required: false | |
type: string | |
jobs: | |
test-disassembly: | |
strategy: | |
matrix: | |
include: | |
- assembler: 'zasm' | |
exec: 'zasm/zasm' | |
options: '--ixcbr2' | |
outputfileoption: '-o ' | |
- assembler: 'z88dk' | |
exec: 'z88dk/z88dk-z80asm' | |
options: '-v -b' | |
outputfileoption: '-o' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup emulator and assembler | |
run: | | |
make | |
cd tools | |
chmod +x ${{ matrix.exec }} | |
- name: Round-trip assemble, disassemble, compare | |
env: | |
FILES: test_disassembler_1 test_disassembler_2 test_disassembler_3 | |
run: | | |
cd tools | |
for f in $FILES; do | |
echo "file basename: ${f}" | |
${{ matrix.exec }} ${{ matrix.options }} ${f}.asm ${{ matrix.outputfileoption}}${f}.rom | |
echo "1" > options.txt | |
echo "3" >> options.txt | |
echo "0" >> options.txt | |
# The following calculates the ROM size by subtracting 1 from the file size | |
wc -c <${f}.rom | awk '{printf "%x\n", $1 - 1}' >> options.txt | |
echo "options file:" | |
cat options.txt | |
../emulator ${f}.rom > ${f}_disassembled.asm <options.txt | |
# Strip out the non-assembly top lines of the emulator output | |
tail -n +14 ${f}_disassembled.asm >${f}_tail.asm | |
${{ matrix.exec }} ${{matrix.options }} ${f}_tail.asm ${{ matrix.outputfileoption}}${f}_tail.rom | |
echo "Comparing... ${f}.rom ${f}_tail.rom" | |
cmp ${f}.rom ${f}_tail.rom | |
done | |
- name: Compare other opcodes | |
env: | |
FILES: test_disassembler_4 | |
run: | | |
cd tools | |
for f in $FILES; do | |
echo "file basename: ${f}" | |
${{ matrix.exec }} ${{ matrix.options }} ${f}.asm ${{ matrix.outputfileoption}}${f}.rom | |
echo "1" > options.txt | |
echo "2" >> options.txt | |
echo "0" >> options.txt | |
# The following calculates the ROM size by subtracting 1 from the file size | |
wc -c <${f}.rom | awk '{printf "%x\n", $1 - 1}' >> options.txt | |
echo "options file:" | |
cat options.txt | |
../emulator ${f}.rom > ${f}_disassembled.asm <options.txt | |
# Strip out the non-assembly top lines of the emulator output | |
tail -n +14 ${f}_disassembled.asm >${f}_tail.asm | |
echo "Comparing... ${f}_tail.asm ${f}_compare_file.txt" | |
diff -w --strip-trailing-cr ${f}_tail.asm ${f}_compare_file.txt | |
done | |
- name: Print the job summary | |
if: ${{ inputs.message }} | |
run: | | |
echo ${{ inputs.message }} >$GITHUB_STEP_SUMMARY |