ArkScript
A small, fast, functional and scripting language for video games
Word.hpp
Go to the documentation of this file.
1
/**
2
* @file Word.hpp
3
* @author Alexandre Plateau (
[email protected]
)
4
* @brief Describe an instruction and its immediate argument
5
* @version 0.5
6
* @date 2022-07-02
7
*
8
* @copyright Copyright (c) 2022-2024
9
*
10
*/
11
12
#ifndef ARK_COMPILER_WORD_HPP
13
#define ARK_COMPILER_WORD_HPP
14
15
namespace
Ark::internal
16
{
17
struct
bytes_t
18
{
19
uint8_t
second
;
20
uint8_t
first
;
21
};
22
23
struct
Word
24
{
25
uint8_t
padding
= 0;
///< Padding reserved for future use
26
uint8_t
opcode
= 0;
///< Instruction opcode
27
union
{
28
uint16_t
data
= 0;
///< Immediate data, interpreted differently for different instructions
29
bytes_t
bytes
;
30
};
31
32
explicit
Word
(
const
uint8_t inst,
const
uint16_t arg = 0) :
33
opcode
(inst),
data
(arg)
34
{}
35
};
36
}
37
38
#endif
Ark::internal
Definition:
Builtins.hpp:26
Ark::internal::Word
Definition:
Word.hpp:24
Ark::internal::Word::opcode
uint8_t opcode
Instruction opcode.
Definition:
Word.hpp:26
Ark::internal::Word::padding
uint8_t padding
Padding reserved for future use.
Definition:
Word.hpp:25
Ark::internal::Word::bytes
bytes_t bytes
Definition:
Word.hpp:29
Ark::internal::Word::data
uint16_t data
Immediate data, interpreted differently for different instructions.
Definition:
Word.hpp:28
Ark::internal::Word::Word
Word(const uint8_t inst, const uint16_t arg=0)
Definition:
Word.hpp:32
Ark::internal::bytes_t
Definition:
Word.hpp:18
Ark::internal::bytes_t::second
uint8_t second
Definition:
Word.hpp:19
Ark::internal::bytes_t::first
uint8_t first
Definition:
Word.hpp:20
include
Ark
Compiler
Word.hpp
Generated on Sat May 25 2024 22:44:26 for ArkScript by
1.9.6