My Project
Macros | Functions
main.c File Reference

Driver for the lc3 assembler (do not modify) More...

#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include "assembler.h"

Macros

#define LC3AS_VAR
 

Functions

int main (int argc, char *argv[])
 

Detailed Description

This file is a driver for the lc3 assembler and contains main(). The basic flow of the function is:

  1. validte the program arguments
  2. call asm_init()
  3. call asm_pass_one()
  4. report then number of errors found in the first pass. If there were no errors, call asm_pass_two()
  5. report the number of errors found in the second pass
  6. call asm_term()

The program return 0 if no errors were found, non-zero otherwise.

Author
Fritz Sieker

Macro Definition Documentation

#define LC3AS_VAR

force instantiation of LC3AS_VAR variables in this file

Function Documentation

int main ( int  argc,
char *  argv[] 
)

The entry point of the assembler. The program is invoked using:


[my]lc3as [-hex] [-pass1] assembly_file_name
Parameters
argc- count of arguments
argv- an array of arguments