From 598a69c02b05b4ab3d08468520e7cc70cb7533a2 Mon Sep 17 00:00:00 2001 From: david-schmidt <1110325+david-schmidt@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:47:23 -0400 Subject: [PATCH] Complain if either the text or data segments are missing --- README.md | 4 ++-- a3driverutil.py | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e304d26..292dd73 100644 --- a/README.md +++ b/README.md @@ -92,13 +92,13 @@ Command line syntax for these Options: positional arguments: o65file Input o65 code file to be converted - sosfile SOS.DRIVER file to list the contained drivers + sosfile SOS.DRIVER file to add driver to (driver must not already exist) usage: A3Driverutil.py update [-h] o65file sosfile positional arguments: o65file Input o65 code file to be converted - sosfile SOS.DRIVER file to be updated + sosfile SOS.DRIVER file to be updated (an existing driver will be updated) ``` ## Convert o65 binary and output as driver binary file diff --git a/a3driverutil.py b/a3driverutil.py index e4926f3..5d499ac 100644 --- a/a3driverutil.py +++ b/a3driverutil.py @@ -174,7 +174,14 @@ def convert_o65(file): #print ("tlen: ",tlen) #print ("dbase: ",dbase) #print ("dlen: ",dlen) - + + if tlen == 0: + print("No text segment found; ensure your driver defines .segment \"TEXT\"") + exit(1) + if dlen == 0: + print("No data segment found; ensure your driver defines .segment \"DATA\"") + exit(1) + #skip over header options olen = readUnpack(o65file,1,type = '1') while olen != 0 : #0 marks end of options header