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

Functions

void load_data_term (struct pdp_11_t *pdp)
 

Function Documentation

◆ load_data_term()

void load_data_term ( struct pdp_11_t pdp)
11{
12 enum {
13 res_input_data = 2
14 }; // Введены два параметра addr,
15 // и количество байт
16
17 word_t addr, count_str, data, res_input;
18
19 addr = count_str = data = res_input = 0x00;
20 res_input = fscanf(stdin, "%hx%hx", &addr, &count_str);
21 // printf("RES INPUT DATA = %d\r\nADDR = %hx\r\nCOUNT_STR = %hx\r\n",
22 // res_input, addr, count_str);
23 DEBUG("\nRES INPUT DATA = %d\r\nADDR = %hx\r\nCOUNT_STR = %hx\r\n",
24 res_input,
25 addr,
26 count_str);
27
28 if (!(res_input == res_input_data)) {
29 ERROR("\nError Readeng With TERMINAL\r\n", "");
30 assert((res_input == res_input_data));
31 abort();
32 }
33 do {
34 for (byte_t ind = 0x0; ind < count_str; ind++) {
35 fscanf(stdin, "%hx", &data);
36 b_write(pdp, (addr | ind), data);
37 }
38 res_input = fscanf(stdin, "%hx%hx", &addr, &count_str);
39 } while (res_input == res_input_data);
40 // fprintf(stdout, "\nREAD TERMINAL EXIT\r\n\n");
41 INFO("\nREAD TERMINAL EXIT\r\n\n", "");
42 return;
43}
#define ERROR(fmt,...)
Definition logger.h:36
#define INFO(fmt,...)
Definition logger.h:37
#define DEBUG(fmt,...)
Definition logger.h:40
void b_write(struct pdp_11_t *, const address_byte_t, byte_t)
Записывает байт в память PDP-11.
Definition pdp_11.c:79
unsigned char byte_t
Definition types.h:6
unsigned short int word_t
Definition types.h:7
Here is the call graph for this function: