1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-15 15:57:13 +00:00
Interlisp.maiko/src/array6.c

61 lines
1.7 KiB
C

/* This is G-file @(#) array6.c Version 2.10 (4/21/92). copyright Xerox & Fuji Xerox */
static char *id = "@(#) array6.c 2.10 4/21/92";
/************************************************************************/
/* */
/* (C) Copyright 1989-95 Venue. All Rights Reserved. */
/* Manufactured in the United States of America. */
/* */
/* The contents of this file are proprietary information */
/* belonging to Venue, and are provided to you under license. */
/* They may not be further distributed or disclosed to third */
/* parties without the specific permission of Venue. */
/* */
/************************************************************************/
#include "version.h"
#include <stdio.h>
#include "lispemul.h"
#include "lspglob.h"
#include "adr68k.h"
#include "lispmap.h"
#include "lsptypes.h"
#include "emlglob.h"
#include "gc.h"
#include "arith.h"
#include "my.h"
/*** N_OP_aset2 -- op 357 (new-value array index0 index1) ***/
LispPTR N_OP_aset2(register LispPTR data, LispPTR arrayarg, LispPTR inx0, LispPTR inx1) {
register int type;
register LispArray *arrayblk;
register LispPTR base;
register int new;
register int index, temp;
int j;
/* verify array */
if (GetTypeNumber(arrayarg) != TYPE_TWOD_ARRAY) ERROR_EXIT(inx1);
arrayblk = (LispArray *)Addr68k_from_LADDR(arrayarg);
base = arrayblk->base;
/* test and setup index */
N_GetPos(inx1, temp, inx1);
if (temp >= (j = arrayblk->Dim1)) ERROR_EXIT(inx1);
N_GetPos(inx0, index, inx1);
if (index >= arrayblk->Dim0) ERROR_EXIT(inx1);
index *= j;
index += temp;
/* setup typenumber */
type = 0xFF & arrayblk->typenumber;
/* disp on type */
aset_switch(type, inx1);
doufn:
ERROR_EXIT(inx1);
} /* end N_OP_aset2() */