|
CPU
|
#include "cpu.h"
Functions | |
| void | cpucode_file_input (CpuCode *some_cpucode, const char *filename) |
| Reads machine code from file given and checks its version compatibility. More... | |
| void | execute_cpucode (CPU *some_cpu, CpuCode *some_cpucode) |
| Executes machine code sequence on the CPU. More... | |
| void | free_cpucode (CpuCode *some_cpucode) |
| Frees memory allocated by the cpucode array. More... | |
| void | execute_cpu (CPU *some_cpu, instruction_type instruction, descriptional_argument descr_arg, cpu_operand_t operand) |
| Executes instruction with arguments and operands given on the CPU. More... | |
| void | start_cpu (CPU *some_cpu) |
| Executes STRT instruction on the CPU. More... | |
| void | push_cpu (CPU *some_cpu, descriptional_argument descr_arg, cpu_operand_t value) |
| Executes PUSH instruction with the arguments and operands given on the CPU. More... | |
| void | pop_cpu (CPU *some_cpu, descriptional_argument descr_arg) |
| Executes POP instruction with the arguments given on the CPU. More... | |
| void | add_cpu (CPU *some_cpu) |
| Executes ADD instruction on the CPU. More... | |
| void | sub_cpu (CPU *some_cpu) |
| Executes SUB instruction on the CPU. More... | |
| void | mul_cpu (CPU *some_cpu) |
| Executes MUL instruction on the CPU. More... | |
| void | div_cpu (CPU *some_cpu) |
| Executes DIV instruction on the CPU. More... | |
| void | out_cpu (CPU *some_cpu) |
| Executes OUT instruction on the CPU. More... | |
| void | hlt_cpu (CPU *some_cpu) |
| Executes HLT instruction on the CPU. More... | |
| void add_cpu | ( | CPU * | some_cpu | ) |
| void cpucode_file_input | ( | CpuCode * | some_cpucode, |
| const char * | filename | ||
| ) |
Reads machine code from file given and checks its version compatibility.

| void div_cpu | ( | CPU * | some_cpu | ) |
| void execute_cpu | ( | CPU * | some_cpu, |
| instruction_type | instruction, | ||
| descriptional_argument | descr_arg, | ||
| cpu_operand_t | operand | ||
| ) |
Executes instruction with arguments and operands given on the CPU.


Executes machine code sequence on the CPU.


| void free_cpucode | ( | CpuCode * | some_cpucode | ) |
Frees memory allocated by the cpucode array.

| void hlt_cpu | ( | CPU * | some_cpu | ) |
| void mul_cpu | ( | CPU * | some_cpu | ) |
| void out_cpu | ( | CPU * | some_cpu | ) |
| void pop_cpu | ( | CPU * | some_cpu, |
| descriptional_argument | descr_arg | ||
| ) |
Executes POP instruction with the arguments given on the CPU.

| void push_cpu | ( | CPU * | some_cpu, |
| descriptional_argument | descr_arg, | ||
| cpu_operand_t | value | ||
| ) |
Executes PUSH instruction with the arguments and operands given on the CPU.
TODO добавить полноценную поддержку

| void start_cpu | ( | CPU * | some_cpu | ) |