Added error return value...
This commit is contained in:
parent
65a74456f2
commit
86c4188320
@ -416,7 +416,7 @@ unsigned char * text_sector_byte = NULL;
|
||||
|
||||
int was_instruction_array_empty = 0;
|
||||
|
||||
void assemble (unsigned int count, unsigned int * array) {
|
||||
int assemble (unsigned int count, unsigned int * array) {
|
||||
unsigned int index;
|
||||
|
||||
if ((count == 0) || (array == NULL)) {
|
||||
@ -463,8 +463,7 @@ void assemble (unsigned int count, unsigned int * array) {
|
||||
case ENTER: index += build_enter (& array [index]); break;
|
||||
case POP: index += build_pop (& array [index]); break;
|
||||
case PUSH: index += build_push (& array [index]); break;
|
||||
// IS IT BAD TO JUST QUIT?
|
||||
default: exit ((int) array [index]);
|
||||
default: return (EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -480,4 +479,6 @@ void assemble (unsigned int count, unsigned int * array) {
|
||||
|
||||
replace (& text_sector_byte [get], (unsigned char *) & set, sizeof (set));
|
||||
}
|
||||
|
||||
return (EXIT_SUCCESS);
|
||||
}
|
||||
|
@ -41,6 +41,6 @@ extern unsigned char * text_sector_byte;
|
||||
|
||||
extern int was_instruction_array_empty;
|
||||
|
||||
extern void assemble (unsigned int count, unsigned int * array);
|
||||
extern int assemble (unsigned int count, unsigned int * array);
|
||||
|
||||
#endif
|
||||
|
@ -96,7 +96,9 @@ int compile(void) {
|
||||
|
||||
dump_variables_to_assembler();
|
||||
|
||||
assemble(token_count, token_array);
|
||||
if (assemble(token_count, token_array)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
create_header();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user