( Index )
Month
Brief Information about a future CSIG Meeting
- Two Topics
- A Bounce-Bar Menu system
- Code from the November 1, 1996 main meeting: A CPU Emulator.
1. This program creates a bounce-bar menu.
/*--------------------------------------------------------------------------*
* Program: MENUDEMO.CPP
* Author: Michael P. Redlich
* Date/Time: 8-11-96 5:17:42 pm
* Description: This program demonstrates bbMenu.
*--------------------------------------------------------------------------*/
class bbMenu
{
int x;
int y;
int w;
int j;
struct entryType
{
int x;
int y;
int choiceNo;
const char *strbuf;
entryType *prev;
entryType *next;
int getChoice(void) const;
void setOption(int) const;
entryType(entryType *,entryType *,int,int,int,const char *);
};
entryType *firstEntry;
entryType *curEntry;
int getKey(void) const;
void setMenu(void);
public:
bbMenu(int,int,int);
~bbMenu(void);
int getChoice(void);
void addPrompt(const char *);
};
.....
void main(void)
{
setMainColor();
clrscr();
_setcursortype(_NOCURSOR);
mainMenu();
}
void setMainColor(void)
{
textbackground(1);
textcolor(15);
}
...............
Back to top of Home Page
2. Code from the November 1, 1996 main meeting
The C++ CPU Emulator Program
- An IBM compatible software program which will "run"
the "Factorial 6" program code.
- Based on the Instruction Pointer (IP), the emulator steps
through each line of the program, decodes the instruction and executes
it.
Complete Instruction Set
- ADD reg, reg ..........; Add 2 registers
- MUL reg, reg ..........; Multiply
- MOV reg, reg ..........; Move
- MOV reg, immediate ....; Assign value
- DEC reg ...............; Decrement by 1
- JZ step ...............; Jump if zero
- JNZ step ..............; Jump if not zero
- PRT reg ...............; Mystery Print
Back to top of Home Page
"Random Access" questions start at 7:30 Tuesday night.
SOURCE CODE
Source Code Files
For help, email me at b a r n o l d @ i e e e . o r g
Back to C++ Main Page