dcpu16

Virtual Machine and Assembler for Notch's DCPU-16 Architecture
git clone http://frotz.net/git/dcpu16.git
Log | Files | Refs | README

emulator.h (1614B)


      1 /*
      2  * Copyright (c) 2012, Brian Swetland
      3  * All rights reserved.
      4  *
      5  * Redistribution and use in source and binary forms, with or without 
      6  * modification, are permitted provided that the following conditions are met:
      7  *
      8  *   Redistributions of source code must retain the above copyright notice, 
      9  *   this list of conditions and the following disclaimer.
     10  *
     11  *   Redistributions in binary form must reproduce the above copyright 
     12  *   notice, this list of conditions and the following disclaimer in the 
     13  *   documentation and/or other materials provided with the distribution.
     14  *
     15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
     16  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
     17  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
     18  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
     19  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
     20  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
     21  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
     22  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
     23  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
     24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
     25  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     26  *
     27  */
     28 
     29 #ifndef _DCPU_H_
     30 #define _DCPU_H_
     31 
     32 typedef uint8_t u8;
     33 typedef uint16_t u16;
     34 typedef uint32_t u32;
     35 
     36 struct dcpu {
     37 	u16 r[8];
     38 	u16 pc;
     39 	u16 sp;
     40 	u16 ov;
     41 	u16 unused;
     42 	u16 m[65536];
     43 };
     44 
     45 void dcpu_step(struct dcpu *d);
     46 
     47 #endif