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