libc8
CHIP-8 utility library
Loading...
Searching...
No Matches
encode.h File Reference
#include <stdint.h>

Go to the source code of this file.

Macros

#define ARG_VERBOSE   1
 
#define C8_ENCODE_MAX_LINE_LENGTH   100
 
#define C8_ENCODE_MAX_WORDS   100
 
#define C8_ENCODE_MAX_LINES   500
 

Functions

int c8_encode (const char *, uint8_t *, int)
 Parse the given string.
 
char * remove_comment (char *)
 Remove comment from string if exists.
 

Variables

char ** c8_lines
 
char ** c8_lines_unformatted
 
int c8_line_count
 

Detailed Description

Base assembler code

Macro Definition Documentation

◆ ARG_VERBOSE

#define ARG_VERBOSE   1

◆ C8_ENCODE_MAX_LINE_LENGTH

#define C8_ENCODE_MAX_LINE_LENGTH   100

◆ C8_ENCODE_MAX_LINES

#define C8_ENCODE_MAX_LINES   500

◆ C8_ENCODE_MAX_WORDS

#define C8_ENCODE_MAX_WORDS   100

Function Documentation

◆ c8_encode()

int c8_encode ( const char *  s,
uint8_t *  out,
int  args 
)

Parse the given string.

This is the main assembler function.

This function generates bytecode from the given assembly code.

Parameters
sstring containing assembly code
outpointer to write bytecode to
argscommand line arguments
Returns
length of resulting bytecode.

◆ remove_comment()

char * remove_comment ( char *  s)

Remove comment from string if exists.

Parameters
sstring to remove comment from
Returns
string without comment

Variable Documentation

◆ c8_line_count

int c8_line_count
extern

◆ c8_lines

char** c8_lines
extern

◆ c8_lines_unformatted

char** c8_lines_unformatted
extern