2019-05-15 21:47:08 +02:00
|
|
|
// The OS/K Team licences this file to you under the MIT license.
|
2019-05-15 21:56:42 +02:00
|
|
|
// See the LICENSE file in the project root for more information.
|
2019-05-15 21:47:08 +02:00
|
|
|
|
|
|
|
#include "arch.h"
|
|
|
|
|
2019-05-15 22:08:37 +02:00
|
|
|
#define IMPL_START_0(name) \
|
|
|
|
void i_##name(ctx_t *ctx, acc_t *p1, acc_t *p2) \
|
|
|
|
{ \
|
|
|
|
|
2019-05-15 21:47:08 +02:00
|
|
|
#define IMPL_START_1(name) \
|
|
|
|
void i_##name(ctx_t *ctx, acc_t *p1, acc_t *p2) \
|
|
|
|
{ \
|
|
|
|
ulong v1 = (p1->type == A_REG ? ctx->r[p1->val].val : p1->val); \
|
|
|
|
|
|
|
|
#define IMPL_START_2(name) \
|
|
|
|
void i_##name(ctx_t *ctx, acc_t *p1, acc_t *p2) \
|
|
|
|
{ \
|
|
|
|
ulong v1 = (p1->type == A_REG ? ctx->r[p1->val].val : p1->val); \
|
|
|
|
ulong v2 = (p2->type == A_REG ? ctx->r[p2->val].val : p2->val); \
|
|
|
|
|
|
|
|
#define IMPL_OUT \
|
|
|
|
assert(p1->type == A_REG); \
|
|
|
|
ctx->r[p1->val].val = v1; \
|
|
|
|
} \
|
|
|
|
|
|
|
|
#define IMPL_END \
|
|
|
|
}
|
|
|
|
|
|
|
|
|