sendToBDOS.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. # script for compiling a C program for BDOS, and send it to the FPGC over the network
  3. if [ "$1" == "" ]
  4. then
  5. echo "No program to compile given"
  6. exit 1
  7. fi
  8. echo "Processing: $1"
  9. # compile and send
  10. echo "Compiling C code to B32P ASM"
  11. if (./bcc --bdos $1 ../Assembler/code.asm) # compile c code with BDOS flag and write compiled code to code.asm in Assembler folder
  12. then
  13. echo "C code successfully compiled"
  14. echo "Assembling B32P ASM code"
  15. if (cd ../Assembler && python3 Assembler.py bdos 0x400000 -O > ../Programmer/code.list) # assemble with offset for BDOS and write to code.list in Programmer folder
  16. then
  17. echo "B32P ASM code successfully assembled"
  18. # convert list to binary files and send to FPGC
  19. (cd ../Programmer && bash compileROM.sh noPadding && echo "Sending binary to FPGC over Network" && python3 netFlash.py code.bin)
  20. else # assemble failed, run again to show error
  21. echo "Failed to assemble B32P ASM code"
  22. cd ../Assembler && python3 Assembler.py bdos 0x400000 -O
  23. fi
  24. else # compile failed
  25. echo "Failed to compile C code"
  26. fi