EMULATOR_PDP_11
STEPIC Учебный проект на 'С', эмулятор PDP_11 в стиле ООП
Loading...
Searching...
No Matches
register.c File Reference
#include "pdp_11/pdp_11_p.h"
#include "pdp_11/register/register_p.h"
#include "utils/utils.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
Include dependency graph for register.c:

Functions

reg_tregister_new ()
 
void reg_create (pdp_11_t *pdp, reg_t *regist)
 
void reg_destroy (pdp_11_t *pdp)
 

Function Documentation

◆ reg_create()

void reg_create ( pdp_11_t pdp,
reg_t regist 
)
17{
18 regist->R0 = 0;
19 regist->R1 = 0;
20 regist->R2 = 0;
21 regist->R3 = 0;
22 regist->R4 = 0;
23 regist->R5 = 0;
24 regist->SP = 0;
25 regist->PC = 0;
26
27 pdp->R0 = &regist->R0;
28 pdp->R1 = &regist->R1;
29 pdp->R2 = &regist->R2;
30 pdp->R3 = &regist->R3;
31 pdp->R4 = &regist->R4;
32 pdp->R5 = &regist->R5;
33 pdp->SP = &regist->SP;
34 pdp->PC = &regist->PC;
35 return;
36}
word_t * R2
Definition pdp_11_p.h:11
word_t * R0
Definition pdp_11_p.h:9
word_t * R4
Definition pdp_11_p.h:13
word_t * R5
Definition pdp_11_p.h:14
word_t * R3
Definition pdp_11_p.h:12
word_t * PC
Definition pdp_11_p.h:16
word_t * SP
Definition pdp_11_p.h:15
word_t * R1
Definition pdp_11_p.h:10
word_t SP
Definition register_p.h:9
word_t R5
Definition register_p.h:8
word_t PC
Definition register_p.h:10
word_t R4
Definition register_p.h:7
word_t R0
Definition register_p.h:3
word_t R2
Definition register_p.h:5
word_t R3
Definition register_p.h:6
word_t R1
Definition register_p.h:4
Here is the caller graph for this function:

◆ reg_destroy()

void reg_destroy ( pdp_11_t pdp)
40{
41 *pdp->R0 = 0;
42 *pdp->R1 = 0;
43 *pdp->R2 = 0;
44 *pdp->R3 = 0;
45 *pdp->R4 = 0;
46 *pdp->R5 = 0;
47 *pdp->SP = 0;
48 *pdp->PC = 0;
49 pdp->R0 = NULL;
50 pdp->R1 = NULL;
51 pdp->R2 = NULL;
52 pdp->R3 = NULL;
53 pdp->R4 = NULL;
54 pdp->R5 = NULL;
55 pdp->SP = NULL;
56 pdp->PC = NULL;
57 return;
58}
Here is the caller graph for this function:

◆ register_new()

reg_t * register_new ( )
11{
12 return (reg_t *) malloc(sizeof(reg_t));
13}
Definition register_p.h:2
Here is the caller graph for this function: