home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * asm.c
- * Copyright © 1992 Niklas Röjemo
- */
- #include <setjmp.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <ctype.h>
- #include <string.h>
- #include "input.h"
- #include "error.h"
- #include "decode.h"
- #include "lex.h"
- #include "symbol.h"
- #include "area.h"
- #include "asm.h"
- #include "code.h"
-
- void asm(void)
- {
- Lex label;
- Symbol *symbol;
- char c;
-
- while(inputNextLine()) {
- if((c=inputLook())!=0 && !isspace(c) && c!=';' ) {
- label = lexGetId();
- skipblanks();
- if(inputLook() == ':')
- inputSkip();
- symbol = symbolAdd(label);
- if(areaCurrent) {
- symbol->value = valueLateToCode(areaCurrent->value.ValueInt.i,
- codeNewLateInfo(areaCurrent));
- symbol->type |= SYMBOL_ABSOLUTE;
- } else {
- symbol->type = 0;
- symbol->value.Tag = ValueIllegal;
- }
- } else
- symbol = 0;
- skipblanks();
- if((c=inputLook())!=0 && c!=';') {
- if(decode(symbol))
- break;
- }
- }
- }
-