OpenCores
URL https://opencores.org/ocsvn/zipcpu/zipcpu/trunk

Subversion Repositories zipcpu

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /zipcpu/trunk/sw/zasm
    from Rev 34 to Rev 36
    Reverse comparison

Rev 34 → Rev 36

/test.S
107,6 → 107,7
clr r5
clr r6
clr r7
clr r8
clr r9
clr r10
clr r11
184,6 → 185,7
clr r5
clr r6
clr r7
clr r8
clr r9
clr r10
clr r11
209,7 → 211,7
add $32,r0
add $-33,r0
bnz test_failure
not.z r0
not r0
bge test_failure
junk_address:
clrf r0
300,10 → 302,11
.dat __here__+0x0100000+5
test_start:
ldi $0x01000,r11
ldi -1,r10
lod test_data+pc,pc
clr r11
clr r10
noop
cmp $0,r11
cmp $0,r10
trap.z r11
add $1,r0
add $1,r0
530,8 → 533,8
// Now, let's test whether or not we can handle a subroutine
#ifdef PUSH_TEST
reverse_bit_order:
PUSH(R1,SP)
PUSH(R2,SP)
PUSH(R1,SP) ; R1 will be our loop counter
PUSH(R2,SP) ; R2 will be our accumulator and eventual result
LDI 32,R1
CLR R2
reverse_bit_order_loop:
/zasm.y
37,6 → 37,7
 
%{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "asmdata.h"
 
419,6 → 420,7
#include <sys/stat.h>
#include <sys/fcntl.h>
#include <assert.h>
#include <string>
 
OBJFILE objcode;
 
499,7 → 501,12
FILE *ppout;
pid_t zpp_pid;
int zpp_status;
std::string inclist;
if (NULL != getenv("ZIPINC"))
inclist = getenv("ZIPINC");
 
printf("Original INCLIST = %s\n", inclist.c_str());
 
master_input_filename = NULL;
 
// Find what directory zasm is in, so that we can find zpp when
521,7 → 528,22
skp++;
} else if (argv[argn+skp][1] == 'E')
preprocess_only = true;
else if (argv[argn+skp][1] == 'd')
else if (argv[argn+skp][1] == 'I') {
if (argv[argn+skp][2]) {
if (inclist.size() != 0) {
inclist += std::string(":");
inclist += &argv[argn+skp][2];
} else
inclist = &argv[argn+skp][2];
} else if (argn+skp+1<argc) {
if (inclist.size() != 0) {
inclist += std::string(":");
inclist += &argv[argn+skp+1][2];
} else
inclist = &argv[argn+skp+1][2];
argn++;
}
} else if (argv[argn+skp][1] == 'd')
yydebug = 1;
else if (argv[argn+skp][1] == 'h') {
usage();
540,6 → 562,7
}
}
}
printf("New INCLIST = %s\n", inclist.c_str());
 
if (preprocess_only) {
objcode.open("/dev/null");
554,6 → 577,7
objcode.open(zout_fname);
}
 
setenv("ZIPINC",inclist.c_str(), 1);
master_input_filename = NULL;
 
if (argc > 0) {
/asmdata.cpp
378,7 → 378,10
break;
case OP_NEG:
if (m_cond != zp.ZIPC_ALWAYS) {
yyerror("Illegal operation: Conditional negate. Negates cannot handle conditions");
LLINE *lln = new LLINE;
lln->addline(new ILINE(zp.op_mov(m_cond,-1,m_opb,m_opb)));
lln->addline(new ILINE(zp.op_not(m_cond,m_opb)));
return lln;
} else {
LLINE *lln = new LLINE;
lln->addline(new ILINE(zp.op_not(m_opb)));
/zpp.l
662,9 → 662,40
BUFSTACK(const char *fname) {
m_fp = fopen(fname, "r");
if (!m_fp) {
fprintf(stderr, "Cannot open %s\n", fname);
perror("O/S Err:");
exit(-1);
char *pathptr = getenv("ZIPINC");
if (!pathptr) {
fprintf(stderr, "Cannot open %s\n", fname);
perror("O/S Err:");
exit(-1);
} else {
char *dptr, *colonp;
char *pathcpy = new char[strlen(pathptr)+8192];
strcpy(pathcpy, pathptr);
 
fprintf(stderr, "ZIPINC := %s\n", pathptr);
dptr = pathptr;
while((!m_fp)&&(NULL != (colonp = strchr(dptr, ':')))) {
strncpy(pathcpy, dptr, colonp-pathptr);
strcat(pathcpy, "/");
strcat(pathcpy, fname);
fprintf(stderr, "Looking for include file, %s\n", pathcpy);
if (access(fname, R_OK)==0)
m_fp = fopen(pathcpy, "r");
dptr = colonp+1;
} if ((!m_fp)&&(*dptr)) {
strcpy(pathcpy, dptr);
strcat(pathcpy, "/");
strcat(pathcpy, fname);
fprintf(stderr, "Looking for include file, %s\n", pathcpy);
m_fp = fopen(pathcpy, "r");
} if (!m_fp) {
fprintf(stderr, "Cannot open %s\n", fname);
perror("O/S Err:");
exit(-1);
}
 
delete[] pathcpy;
}
}
 
if (curbs)
/sys.i
44,7 → 44,7
sys.ccn equ 0x004
sys.ccc equ 0x002
sys.ccz equ 0x001
sys.bu.pic equ 0x000
sys.bus.pic equ 0x000
sys.bus.wdt equ 0x001
sys.bus.cache equ 0x002
sys.bus.ctrpic equ 0x003
120,12 → 120,10
ADD 1,SP
#define RET LOD 1(SP),PC
#define SAVE_USER_CONTEXT(DR,AR) \
MOV -16(uSP),AR \
MOV -15(uSP),AR \
MOV uPC,DR \
STO DR,16(AR) \
STO DR,15(AR) \
MOV uCC,DR \
STO DR,15(AR) \
MOV uSP,DR \
STO DR,14(AR) \
MOV uR12,DR \
STO DR,13(AR) \
181,10 → 179,8
LOD 13(AR),DR \
MOV DR,uR12 \
LOD 14(AR),DR \
MOV DR,uSP \
MOV DR,uCC \
LOD 15(AR),DR \
MOV DR,uCC \
LOD 16(AR),DR \
MOV DR,uPC
#define READ_USER_TRAP(RG) \
MOV uCC,RG \

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.