- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
#include <ctype.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MEM 100
#define READ 10
#define WRITE 11
#define LOAD 20
#define STORE 21
#define NEWLINE 22
#define ADD 30
#define SUBSTRACT 31
#define DIVIDE 32
#define MUL 33
#define POW 34
#define MOD 35
#define ENTSTR 50
#define PRTSTR 51
#define BRANCH 40
#define BRANCHNEG 41
#define BRANCHZERO 42
#define HALT 43
int main(int argc, char *argv[]) {
void dump_file(int word[]);
FILE *cfPtr;
// char buf[5];
void branch(int *cnt, int accum, int nxt, int comn);
int buf_mem[100] = {0};
void dump(int word[]);
int x = 0, y = 0, s = 0;
// int mem[MEM] = {0};
int mem[MEM];
for (; x != MEM; x++) {
mem[x] = 0;
}
int acc = 0, d = 0;
int ins_cnt = 0, ins_rgr = 0, op_code = 0, operand = 0, buf = 0;
int b = 0, l, r = 0, m = 0, ti = 0, sign = 0;
cfPtr = fopen(argv[1], "r");
for (; feof(cfPtr) == 0;) {
fscanf(cfPtr, "%d %d\n", &b, &l);
mem[b] = l;
}
Комментарии (0) RSS
Добавить комментарий