EMULATOR_PDP_11
STEPIC Учебный проект на 'С', эмулятор PDP_11 в стиле ООП
Loading...
Searching...
No Matches
utils.h File Reference
#include "types/types.h"
Include dependency graph for utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int __is_valid_address (const address_byte_t)
 
void usage (const byte_t *progname)
 
address_byte_t __get_size_buffer ()
 
file_tpdp_file_open (const byte_t *, const byte_t *)
 
void pdp_file_close (const file_t *)
 

Function Documentation

◆ __get_size_buffer()

address_byte_t __get_size_buffer ( )
7{
9}
@ size_buffer_default
Definition types.h:5
Here is the caller graph for this function:

◆ __is_valid_address()

int __is_valid_address ( const address_byte_t  addr)
14{
15 unsigned char size = 0x0;
16 if ((addr > ~(-__get_size_buffer())) || (addr < size)) {
17 return 0; // замена (__get_size_buffer() - 1) на ~(-);
18 }
19 return 1;
20}
address_byte_t __get_size_buffer()
Definition size_buffer.c:6
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pdp_file_close()

void pdp_file_close ( const file_t fd)
45{
46 fclose((file_t *) fd);
47}
FILE file_t
Definition types.h:10
Here is the caller graph for this function:

◆ pdp_file_open()

file_t * pdp_file_open ( const byte_t filename,
const byte_t mode 
)
32{
33 file_t *fd;
34 DEBUG("\nFILENAME = %s\n", filename);
35 if ((fd = fopen((char *) filename, (char *) mode)) == NULL) {
36 perror((char *) filename);
37 exit(errno);
38 }
39 return fd;
40}
#define DEBUG(fmt,...)
Definition logger.h:40
Here is the caller graph for this function:

◆ usage()

void usage ( const byte_t progname)
25{
26 fprintf(stderr, "USAGE: %s [-t] filename - input data\n", progname);
27}
Here is the caller graph for this function: