static word36 getMFReg36 (uint n, bool allowDU, bool allowNIC, fault_ipr_subtype_ *mod_fault)
{
+ //printf("getMFReg36 %02o\n", n);
switch (n)
{
case 0: // n
static void setupOperandDescriptor (int k, fault_ipr_subtype_ *mod_fault)
{
+ //printf("setupOperandDescriptor %d\n", k);
EISstruct * e = & cpu.currentEISinstruction;
switch (k)
{
static void parseAlphanumericOperandDescriptor (uint k, uint useTA, bool allowDU, fault_ipr_subtype_ *mod_fault)
{
+ //printf("parseAlphanumericOperandDescriptor %d\n", k);
EISstruct * e = & cpu.currentEISinstruction;
word18 MFk = e -> MF [k - 1];
sim_debug (DBG_TRACEEXT, & cpu_dev, "N%u %o\n", k, e->N[k-1]);
word36 r = getMFReg36 (MFk & 017, allowDU, true, mod_fault); // allow du based on instruction, allow n,ic
+ //printf("r %012llo\n", r);
if ((MFk & 017) == 4) // reg == IC ?
{
void mlr (void)
{
+ //printf("mlr\n");
EISstruct * e = & cpu.currentEISinstruction;
// For i = 1, 2, ..., minimum (N1,N2)
return object_map;
}
-int allocate_linkage(int length, bool even) {
- if (even)
- next_linkage_offset = (next_linkage_offset + 1) & ~1;
+int allocate_linkage(int length, int align) {
+ align -= 1;
+ next_linkage_offset = (next_linkage_offset + align) & ~align;
rassert(next_linkage_offset + length <= 01000000);
int offset = next_linkage_offset;
next_linkage_offset += length;
return offset;
}
-int allocate_stack(int length, bool even) {
- if (even)
- next_stack_offset = (next_stack_offset + 1) & ~1;
+int allocate_stack(int length, int align) {
+ align -= 1;
+ next_stack_offset = (next_stack_offset + align) & ~align;
rassert(next_stack_offset + length <= 01000000);
int offset = next_stack_offset;
next_stack_offset += length;
);
// copy and fill in linkage section
- p->linkage_offset = allocate_linkage(object_map->linkage_length, true);
+ p->linkage_offset = allocate_linkage(object_map->linkage_length, 2);
struct linkage_header *linkage_header = (struct linkage_header *)(
M[linkage_segment] + p->linkage_offset
);
linkage_header->stats_segment_number = linkage_segment;
// copy static section
- int static_offset = allocate_linkage(object_map->static_length, true);
+ int static_offset = allocate_linkage(object_map->static_length, 2);
memcpy(
M[linkage_segment] + static_offset,
M[p->segment] + object_map->static_offset,
// allocate LOT and ISOT
stack_header->max_lot_size = N_SEGMENT;
- int lot_offset = allocate_linkage(N_SEGMENT, false);
+ int lot_offset = allocate_linkage(N_SEGMENT, 1);
lot = (struct packed_pointer *)(M[linkage_segment] + lot_offset);
stack_header->lot_ptr = its_pointer(linkage_segment, lot_offset);
- int isot_offset = allocate_linkage(N_SEGMENT, false);
+ int isot_offset = allocate_linkage(N_SEGMENT, 1);
isot = (struct packed_pointer *)(M[linkage_segment] + isot_offset);
stack_header->isot_ptr = its_pointer(linkage_segment, isot_offset);
// create first stack frame
int stack_frame_offset = allocate_stack(
sizeof(struct stack_frame) / sizeof(uint64_t),
- true
+ 8
);
struct stack_frame *stack_frame = (struct stack_frame *)(
M[stack_segment] + stack_frame_offset
);
// append command line to first stack frame
- int arg_list_offset = allocate_stack(6 + n_args * 4, true);
+ int arg_list_offset = allocate_stack(6 + n_args * 4, 2);
struct arg_list *arg_list = (struct arg_list *)(
M[stack_segment] + arg_list_offset
);
//arg_list->desc_count = n_args;
for (int i = 0; i < n_args; ++i) {
- int arg_offset = allocate_stack((strlen(args[i]) + 3) >> 2, false);
+ int arg_offset = allocate_stack((strlen(args[i]) + 3) >> 2, 1);
arg_list->args[i] = its_pointer(stack_segment, arg_offset);
uint64_t *arg = (uint64_t *)(M[stack_segment] + arg_offset);
int arg_desc_offset = allocate_stack(
sizeof(struct arg_desc) / sizeof(uint64_t),
- false
+ 1
);
arg_list->args[n_args + 1 + i] =
its_pointer(stack_segment, arg_desc_offset);
arg_desc->size = strlen(args[i]);
}
- int result_offset = allocate_stack(0x101, false); // 1 kbyte of output
+ int result_offset = allocate_stack(0x101, 1); // 1 kbyte of output
arg_list->args[n_args] = its_pointer(stack_segment, result_offset + 1);
int arg_desc_offset = allocate_stack(
sizeof(struct arg_desc) / sizeof(uint64_t),
- false
+ 1
);
arg_list->args[n_args * 2 + 1] =
its_pointer(stack_segment, arg_desc_offset);
stack_header->stack_end_ptr = its_pointer(
stack_segment,
- allocate_stack(0, true)
+ allocate_stack(0, 8)
);
// create calling stub
- int calling_stub_offset = allocate_linkage(2, false);
+ int calling_stub_offset = allocate_linkage(2, 1);
uint64_t *calling_stub = (uint64_t *)(
M[linkage_segment] + calling_stub_offset
);