Pass 1
Pass 1
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h> // For isdigit()
#define MAX_SYMBOLS 20
typedef struct {
char label[20];
int address;
} Symbol;
fclose(file);
}
int main() {
// Read assembly program from a file
FILE *assemblyFile = fopen("program.sic", "r");
if (assemblyFile == NULL) {
printf("Error opening assembly file.\n");
return 1;
}
// Pass 1: Process the assembly program and generate the symbol table
char line[100];
int startingAddressSet = 0;
fclose(assemblyFile);
return 0;
}
INPUT:
OUTPUT:
user@user-Latitude-E5450:~/Desktop/S5/LAB/MM/sic$ gcc pass1.c
user@user-Latitude-E5450:~/Desktop/S5/LAB/MM/sic$ ./a.out
FIRST 1000
CLOOP 1003
ENDFIL 100C
EOF 1012
RETADR 1015
LENGTH 1018
BUFFER 101B
ZERO 201B