annotate python/asm.py @ 387:34ac19044b8a

Hello world with paging in emulator
author Windel Bouwman
date Thu, 01 May 2014 22:09:18 +0200
parents 6df89163e114
children
rev   line source
303
be7f60545368 Final fixups
Windel Bouwman
parents: 287
diff changeset
1 #!/usr/bin/env python3
be7f60545368 Final fixups
Windel Bouwman
parents: 287
diff changeset
2
318
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents: 315
diff changeset
3 import argparse
381
6df89163e114 Fix section and ldr pseudo instruction
Windel Bouwman
parents: 334
diff changeset
4 from ppci.target.target_list import targets
6df89163e114 Fix section and ldr pseudo instruction
Windel Bouwman
parents: 334
diff changeset
5 from ppci.buildfunctions import assemble
196
ec2b423cdbea Merge asm and asmlib files
Windel Bouwman
parents: 195
diff changeset
6
ec2b423cdbea Merge asm and asmlib files
Windel Bouwman
parents: 195
diff changeset
7 if __name__ == '__main__':
ec2b423cdbea Merge asm and asmlib files
Windel Bouwman
parents: 195
diff changeset
8 # When run as main file, try to grab command line arguments:
ec2b423cdbea Merge asm and asmlib files
Windel Bouwman
parents: 195
diff changeset
9 parser = argparse.ArgumentParser(description="Assembler")
318
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents: 315
diff changeset
10 parser.add_argument('sourcefile', type=argparse.FileType('r'),
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents: 315
diff changeset
11 help='the source file to assemble')
196
ec2b423cdbea Merge asm and asmlib files
Windel Bouwman
parents: 195
diff changeset
12 args = parser.parse_args()
381
6df89163e114 Fix section and ldr pseudo instruction
Windel Bouwman
parents: 334
diff changeset
13 obj = assemble(args.sourcefile, targets['arm'])