I changed the structure of the assembler in this version.
*/
-#define NDEBUG /* Uncomment when done with debugging */
-
#include <stdlib.h>
#include <stdio.h>
/*#include <malloc.h>*/
#include <assert.h>
#include <ctype.h>
#include <math.h>
-#include <inttypes.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#if defined(HAVE_STDINT_H)
+# include <stdint.h>
+#elif defined(HAVE_INTTYPES_H)
+# include <inttypes.h>
+#endif
#include <unistd.h>
#include "yarandom.h"
# define random rand
#endif*/
-#ifndef USE_IPHONE
+#ifndef HAVE_MOBILE
# define READ_FILES
#endif
Pointer ptr;
BOOL isValue = getValue(machine, adm, &ptr);
warnValue(isValue);
- machine->regP = setBit(machine->regP, ZERO_FL, (ptr.value & machine->regA));
+ machine->regP = setBit(machine->regP, ZERO_FL, !(ptr.value & machine->regA));
machine->regP = setBit(machine->regP, OVERFLOW_FL, bitOn(ptr.value, OVERFLOW_FL));
machine->regP = setBit(machine->regP, NEGATIVE_FL, bitOn(ptr.value, NEGATIVE_FL));
if (op->BRA) {
pushByte(machine, op->BRA);
{
- int diff = abs(param->lbladdr - machine->defaultCodePC);
+ int diff = abs((int)param->lbladdr - (int)machine->defaultCodePC);
int backward = (param->lbladdr < machine->defaultCodePC);
pushByte(machine, (backward) ? 0xff - diff : diff - 1);
}
AsmLine *p;
if(asmlist != NULL){
for (p = asmlist; p != NULL; p = p->next)
- fprintf(stderr,"%s lbl: %s addr: %d ParamLbl: %s ParamAddr: %d\n",
+ fprintf(stderr,"%s lbl: %s addr: %x ParamLbl: %s ParamAddr: %x\n",
p->command, p->label->label, p->label->addr,
p->param->label, p->param->lbladdr);
}
do{
sleep(0); /* XXX */
#if 0
- trace(machine);
+ m6502_trace(machine, stdout);
#endif
execute(machine);
}while(machine->codeRunning);