Hello and thank you for viewing my project.
This involves CPU emulation, a topic that I am not well versed in so the final code should be easily understandable. Programmed in one of: C, C++, VB
The challenge is to create an emulator that is able to execute programs, an example program is attached to this post or can also be found here <[login to view URL]>
The only things known about the CPU are the following characteristics...
6 registers each 8 bits
16-bit address space
1K of RAM
On reset the CPU begins execution at location 0.
CISC style instruction set, i.e. length varies with instruction.
In addition to this information the processor instruction set is also given...
n.b. addresses are 2 bytes long.
registers are AX-FX valued 0x0-0x5
Inst Bytes Format
---- ----- ------
ADD 3 0x11, reg1, reg2
SUB 3 0x22, reg1, reg2
XOR 3 0x44, reg1, reg2
LOAD 4 0x05, reg1, address
LOADR 4 0x55, reg1, address
STORE 3 0x06, address
STORR 4 0x66, reg1, address
OUT 2 0xCC, reg1
JNZ 4 0xAA, reg1, address
HALT 1 0xFF
ADD : reg1 = reg1 + reg2
SUB : reg1 = reg1 - reg2
XOR : reg1 = reg1 XOR reg2
LOAD : load reg1 with value at address
LOADR: load reg1 with value at (address + reg1)
STORE: write value in AX to address
STORR: write value in AX to (address+reg1)
OUT : send value in reg1 to output port i.e. terminal/printer/screen
JNZ : if value in reg1 isn't zero then next instruction is at address
HALT : cpu halts
The sample program included contains a message that will demonstrate the functionality of the program. This message will be used to verify the code.
NO OTHER INFORMATION IS AVAILABLE. All necessary information is included here so please do not ask for more details.
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) Code must be able to execute sample program and reveal the message within. This test will prove that the code is functioning correctly.
4) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
5) Complete explaination of how the program works through extensive commenting and answers to questions (if any).
## Platform
Windows
C++/VB/C