- 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
uint16_t Mnemonic::describeMnemonics(void) const
{
uint16_t result = 0;
size_t i = 0;
for (auto&& m : mnemonics)
result += m.index() << i++ * 4;
return result;
}
...
switch(mnemonic.describeMnemonics())
{
case constructDescription(REGISTER, REGISTER):
{
...
}
break;
case constructDescription(REGISTER, CONSTANT):
{
...
}
break;
case constructDescription(REGISTER, LABEL):
{
...
}
break;
case constructDescription(REGISTER, INDIRECT_ADDRESS):
{
...
}
break;
case constructDescription(INDIRECT_ADDRESS, REGISTER):
{
...
}
break;
default:
break;
}
digitalEugene 01.11.2021 15:27 # 0
digitalEugene 01.11.2021 15:29 # 0
ISO 01.11.2021 15:33 # 0
https://en.cppreference.com/w/cpp/algorithm/accumulate
digitalEugene 01.11.2021 15:37 # 0
digitalEugene 01.11.2021 15:43 # 0
ISO 01.11.2021 15:33 # +1
Чтобы компилятор в OOM не выпал?
digitalEugene 01.11.2021 15:36 # 0
не знаю к какому врачу идти
guest6 01.11.2021 15:47 # 0
bormand 01.11.2021 16:22 # +2