This commit is contained in:
Irmen de Jong 2018-03-04 17:03:49 +01:00
parent 12ae95bbbc
commit 7a5813d3be
5 changed files with 29 additions and 3 deletions

View File

@ -1,4 +1,3 @@
attrs
ply
git+https://github.com/irmen/cbmcodecs.git@master

View File

@ -1,6 +1,12 @@
"""
Simplistic 8/16 bit Virtual Machine to execute a stack based instruction language.
Main entry point to launch a VM to execute the given programs.
Written by Irmen de Jong (irmen@razorvine.net) - license: GNU GPL 3.0
"""
import sys
from .parse import Parser
# from .program import Program, Opcode, Block, Instruction
from .vm import VM
mainprogram = None
@ -20,7 +26,7 @@ if len(sys.argv) not in (2, 3):
raise SystemExit("provide 1 or 2 program file names as arguments")
# zero page and hardware stack of a 6502 cpu are off limits for now
VM.readonly_mem_ranges = [(0x00, 0xff), (0x100, 0x1ff), (0xa000, 0xbfff), (0xe000, 0xffff)]
VM.readonly_mem_ranges = [(0x00, 0xff), (0x100, 0x1ff)]
vm = VM(mainprogram, timerprogram)
vm.enable_charscreen(0x0400, 40, 25)
vm.run()

View File

@ -1,3 +1,10 @@
"""
Simplistic 8/16 bit Virtual Machine to execute a stack based instruction language.
Parser for the simplistic text based program representation
Written by Irmen de Jong (irmen@razorvine.net) - license: GNU GPL 3.0
"""
import array
from typing import Optional, List, Tuple, Dict, Any
from .program import DataType, Opcode, Program, Block, Variable, Instruction, Value

View File

@ -1,3 +1,10 @@
"""
Simplistic 8/16 bit Virtual Machine to execute a stack based instruction language.
These are the program/instruction definitions that make up a program for the vm
Written by Irmen de Jong (irmen@razorvine.net) - license: GNU GPL 3.0
"""
import enum
import array
import operator

View File

@ -1,3 +1,10 @@
"""
Simplistic 8/16 bit Virtual Machine to execute a stack based instruction language.
This is the VM itself (execution engine)
Written by Irmen de Jong (irmen@razorvine.net) - license: GNU GPL 3.0
"""
# 8/16 bit virtual machine
# machine specs: