Functions
seeLC3.c File Reference

Program to demonstrate how to use ISA info from lc3.h More...

#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include "lc3.h"
#include "util.h"

Functions

static int count_bits (int v)
 
static void usage (void)
 
int main (int argc, char *argv[])
 

Detailed Description

Study the code in main to understand how to determine the number and types of operands a particular LC3 instruction has. This information is encoded in a data structure defined in lc3.h This code is a subset of the operations you will need to do when writing the assembler.

Author
Fritz Sieker

Function Documentation

static int count_bits ( int  v)
static

Count the number on 1 bits in a value

Parameters
v- the value to use (non-negative)
Returns
- the number of 1 bits
int main ( int  argc,
char *  argv[] 
)

entry point of program

static void usage ( void  )
static

print usage statement and exit