Skip to content

Instantly share code, notes, and snippets.

@CinchBlue
Created April 23, 2015 17:51
Show Gist options
  • Save CinchBlue/75bb9722ba64eab94793 to your computer and use it in GitHub Desktop.
Save CinchBlue/75bb9722ba64eab94793 to your computer and use it in GitHub Desktop.
#ifndef FRAME_H
#define FRAME_H
typedef address unsigned char;
typedef instruction unsigned char;
typedef mem_block unsigned char*;
class Frame {
public:
Frame* rtrace() {return parent;}
private:
//parent - Pointer to parent frame of the frame.
// If it is the main frame, its parent is itself
Frame* parent;
//size - Size of the frame
// If uninitialized, 0;
size_t size;
//dym_ptr_count - Holds the amount of dynamic pointers allocated
size_t dym_ptr_count;
//ptr_list - Pointer to the array of dynamic pointers
mem_block* ptr_list;
//inst - The instruction to be executed
instruction inst;
//rga - The first register for instruction operands
// Holds the value of the operand for operations
// Otherwise, holds the amount of bytes passed in the ptr
addr rga;
//rga_ptr - The first register pointer value
// Holds the value of a list of arguments
// If 0, rga must be a literal value
addr rga_ptr;
addr rgb;
addr rgb_ptr;
//conc - The concurrency flag byte
// Reserved for passing concurrency-related info
addr conc;
//conc_ptr - The concurrency pointer
// Points to additional information for concurrency
//
addr conc_ptr;
//error - The error flag byte
// Reserved for passing error-based information
//
addr error;
addr error_ptr;
//block - Pointer to frame-local information
// Initial size is allocated to the frame
// Will be abandoned upon error
mem_block* block;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment