#include <string.h>
#include <ctype.h>
#include <assert.h>
+#include <errno.h>
#include "assemble.h"
#include "cerr.h"
*/
void writememory(WORD word, WORD adr, PASS pass)
{
+ char *n;
+
/* メモリオーバーの場合、エラー発生 */
if(adr >= sys->memsize) {
- setcerr(119, word2n(adr)); /* out of COMET II memory */
+ setcerr(119, (n = word2n(adr))); /* out of COMET II memory */
+ FREE(n)
return;
}
(sys->memory)[adr] = word;
setcerr(106, ""); /* operand count mismatch */
return;
}
- if(cmdl->label == '\0') {
+ if(*(cmdl->label) == '\0') {
setcerr(107, ""); /* no label in START */
return;
}
stat = (cerr->num == 0) ? true : false;
if(cmdl != NULL) {
if(stat == true) {
- if(pass == FIRST && cmdl->label != '\0') {
+ if(pass == FIRST && *(cmdl->label) != '\0') {
stat = addlabel(asptr->prog, cmdl->label, asptr->ptr);
}
}
FILE *fp;
if((fp = fopen(file, "r")) == NULL) {
+ cerr->num = errno;
perror(file);
return false;
}