comparison python/zcc.py @ 276:56d37ed4b4d2

phaa
author Windel Bouwman
date Mon, 16 Sep 2013 21:51:17 +0200
parents e64bae57cda8
children 4496cae24d7f
comparison
equal deleted inserted replaced
275:6f2423df0675 276:56d37ed4b4d2
57 57
58 # Invoke compiler: 58 # Invoke compiler:
59 res = zcc(src, outs, diag, dumpir=args.dumpir, do_optimize=args.optimize, pack_dir=args.package_dir) 59 res = zcc(src, outs, diag, dumpir=args.dumpir, do_optimize=args.optimize, pack_dir=args.package_dir)
60 if not res: 60 if not res:
61 diag.printErrors(src) 61 diag.printErrors(src)
62 sys.exit(1) 62 return 1
63 63
64 if args.dumpasm: 64 if args.dumpasm:
65 outs.dump() 65 outs.dump()
66 66
67 code_bytes = outs.sections['code'].to_bytes() 67 code_bytes = outs.sections['code'].to_bytes()
77 if args.hexfile: 77 if args.hexfile:
78 logging.info('Creating hexfile') 78 logging.info('Creating hexfile')
79 hf = hexfile.HexFile() 79 hf = hexfile.HexFile()
80 hf.addRegion(0x08000000, code_bytes) 80 hf.addRegion(0x08000000, code_bytes)
81 hf.save(args.hexfile) 81 hf.save(args.hexfile)
82 return 0
82 83
83 if __name__ == '__main__': 84 if __name__ == '__main__':
84 arguments = parser.parse_args() 85 arguments = parser.parse_args()
85 main(arguments) 86 sys.exit(main(arguments))
86 87