I'm just reading the official Zilog manual. the address ports on the chip make my life a whole lot easer. I'm going to try this again.
edit: found another Z80 emulation library, it's C, but it should work.
edit 2: that's what i thought. its
LINUX ONLY. silly author neglected to mention that on it's homepage. still, the opcode table he provided will be useful.
---------- Post added at 05:39 PM ---------- Previous post was at 04:31 PM ----------
ok, this is probably a very roundabout way of doing things, but I'm using a hex editor to write Z80 machine code using the list mentioned above. i found a z80 emulator that i'm testing code on (i don't actually need the graphics engine to know what's going on, as the Z80 and the graphics engine are as seperate as oil and water: barely touching each other).
---------- Post added 08-29-10 at 11:43 AM ---------- Previous post was 08-28-10 at 05:39 PM ----------
sorry to pop in unnanounced, but can somebody tell me what i'm doing wrong here? this bit of code isn't compiling and from my knowlage, it should.
main.cpp:
Code:
//main interface for the UVGCO Z80 compiler and emulator
// Copyright (c) Neil Ray, 2010
#include <iostream>
#include <fstream>
#include "EMU.h" //include the Z80 emulator functions and variables
#include "OPCODE.h" //include the OPCODE lookup table, this is needed to compile and run Z80 programs
int main(int argc, char *argv[])
{
using namespace std;
if (argc <= 1)
{
cout << "Usage: " << argv[0] << " <input Filename> <output filename> <flags>. Flags can be found /n in the readme file supplied with the program" << endl; //self explanitory :)
return 0;
}
for (int nArg = 0; nArg < argc; nArg++) //determin what settings the user wants by reading the flags
{
switch (argv[nArg])
{
case "r": //the RUN flag
run = 1;
break;
case "c": //the COMPILE flag
compile = 1;
break;
case "d": //the debug flag
debug = 1;
break;
default:
cout << "ERROR: UNKNOWN ARGUMENT. TERMINATING" << endl; //this is going to pop up an error when an unidetified flag is set
return 0;
break;
}
}
return 0;
}
main.h:
Code:
//main interface header for the UVGCO Z80 compiler and emulator
// Copyright (c) Neil Ray, 2010
// create three boolian values to use as argument flags in main.cpp
bool run; //if this flag is = 1, and compile = 1, run the file designated in the argument OUTFILE
bool compile; // read above
bool syntax; // choose between the Intel and the Zilog syntax, this value is just a placeholder for the next version.
bool debug;
i know all it does is print stuff to the screen, but it'll do stuff when i'm finished.
EMU.h and OPCODE.h are empty.
i was trying to test the argument detection, but i have a hunch that it'll terminate without hesitation on the first argument.