#ifndef _SETUP_H
#define _SETUP_H

#include "ktypes.h"
#include "registers.h"
#include "memory.h"
#include "code.h"

/* ----------------------------------------------------- */

// setup.h

// setup.h and setup.c are designed
// to read a KCODE source file

//    - openFile	provide access to the source file
//    - closeFile

//    - readLine	get the next line of code
//    - isBlank		if blank line then read next
//    - skipBlanks	trims leading blanks

//    - getCode		get directive or instruction
//    - getOperand	get operand(s) for code

/* ----------------------------------------------------- */

#define	 BUFFER_SIZE 256

FILE*	infile;
char	buffer[BUFFER_SIZE];
int	pos;
int	done;

void	openFile (char*);
void	closeFile (void);
void	readLine (void);
int	isBlankLine (void);
void	skipBlanks (void);
char*	getCode (void);
char*	getOperand (void);

/* ----------------------------------------------------- */

#endif
