libc8
CHIP-8 utility library
Loading...
Searching...
No Matches
encode.c File Reference
#include "encode.h"
#include "private/symbol.h"
#include "defs.h"
#include "private/exception.h"
#include "private/util.h"
#include <ctype.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Functions

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

Variables

char ** c8_lines
 
char ** c8_lines_unformatted
 
int c8_line_count
 

Detailed Description

Base assembler code

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

◆ c8_lines

char** c8_lines

◆ c8_lines_unformatted

char** c8_lines_unformatted