-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new sections to readme, update license
Add more sections to README.md Create new file structure for project. Updated commented out code. Reformatted all operations. Add skeleton for processing statements. Continue refactor. Simplify Operation table. Move operations into separate file. Start adding directives to translate various addressing modes. Now parses included files. Better handling of translation function. Add Operand class. Add proper class for Symbols. Add ability to translate some pseudo ops. Sort out storing hex. Try and solidify how to access hex values.
- Loading branch information
1 parent
41d9b85
commit 015b702
Showing
15 changed files
with
1,089 additions
and
523 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.pyc | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
""" | ||
Copyright (C) 2019 Craig Thomas | ||
This project uses an MIT style license - see LICENSE for details. | ||
A Color Computer Assembler - see the README.md file for details. | ||
""" | ||
# I M P O R T S ############################################################### | ||
|
||
import argparse | ||
|
||
from cocoasm.program import Program | ||
|
||
# F U N C T I O N S ########################################################### | ||
|
||
|
||
def parse_arguments(): | ||
""" | ||
Parses the command-line arguments passed to the assembler. | ||
""" | ||
parser = argparse.ArgumentParser( | ||
description="Assembler for the Tandy Color Computer 1, 2, and 3. See README.md for more " | ||
"information, and LICENSE for terms of use." | ||
) | ||
parser.add_argument("filename", help="the input file") | ||
parser.add_argument( | ||
"--symbols", action="store_true", help="print out the symbol table" | ||
) | ||
parser.add_argument( | ||
"--print", action="store_true", | ||
help="print out the assembled statements when finished" | ||
) | ||
parser.add_argument( | ||
"--output", metavar="FILE", help="stores the assembled program in FILE") | ||
return parser.parse_args() | ||
|
||
|
||
def main(args): | ||
""" | ||
Runs the assembler with the specified arguments. | ||
:param args: the command-line arguments | ||
""" | ||
program = Program(args.filename) | ||
|
||
if args.symbols: | ||
program.print_symbol_table() | ||
|
||
if args.print: | ||
program.print_statements() | ||
|
||
if args.output: | ||
program.save_binary_file(args.output) | ||
|
||
|
||
main(parse_arguments()) | ||
|
||
# E N D O F F I L E ####################################################### |
Oops, something went wrong.