annotate python/asm.py @ 374:72a3b646d543
Added if statement sample
author |
Windel Bouwman |
date |
Fri, 21 Mar 2014 15:27:18 +0100 |
parents |
6f4753202b9a |
children |
6df89163e114 |
rev |
line source |
303
|
1 #!/usr/bin/env python3
|
|
2
|
318
|
3 import argparse
|
334
|
4 from ppci.assembler import Assembler
|
196
|
5
|
|
6 if __name__ == '__main__':
|
|
7 # When run as main file, try to grab command line arguments:
|
|
8 parser = argparse.ArgumentParser(description="Assembler")
|
318
|
9 parser.add_argument('sourcefile', type=argparse.FileType('r'),
|
|
10 help='the source file to assemble')
|
196
|
11 args = parser.parse_args()
|
|
12 a = Assembler()
|
|
13 obj = a.assemble(args.sourcefile.read())
|