1/* BEGIN LICENSE BLOCK
2 * Version: CMPL 1.1
3 *
4 * The contents of this file are subject to the Cisco-style Mozilla Public
5 * License Version 1.1 (the "License"); you may not use this file except
6 * in compliance with the License.  You may obtain a copy of the License
7 * at www.eclipse-clp.org/license.
8 *
9 * Software distributed under the License is distributed on an "AS IS"
10 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See
11 * the License for the specific language governing rights and limitations
12 * under the License.
13 *
14 * The Original Code is  The ECLiPSe Constraint Logic Programming System.
15 * The Initial Developer of the Original Code is  Cisco Systems, Inc.
16 * Portions created by the Initial Developer are
17 * Copyright (C) 1989-2006 Cisco Systems, Inc.  All Rights Reserved.
18 *
19 * Contributor(s):
20 *
21 * END LICENSE BLOCK */
22
23/*
24 * SEPIA C SOURCE MODULE
25 *
26 * VERSION	$Id: test.c,v 1.1 2008/06/30 17:43:58 jschimpf Exp $
27 */
28
29/*
30 * IDENTIFICATION		test.c
31 *
32 * DESCRIPTION:		SEPIA test file
33 *				by Micha Meier
34 *
35 * CONTENTS: 		Sample code to work out the syntax of the
36 *			assembler on the corresponding machine. This
37 *			should then help to write the macros in emu_config.h.
38 *
39 */
40
41#ifndef lint
42#include "sepia.h"
43#include "types.h"
44
45extern int	I_ChainP();
46
47long op_addr[] = {
48(long) I_ChainP
49};
50
51static long req_env_table[] = {
52(long) I_ChainP,
53100L
54};
55
56test_procedure(i, f)
57int	i;
58register int	(** f)();
59{
60	register long		*pp = &req_env_table[0];
61	register long		l = op_addr[0];
62
63	switch (i)
64	{
65	case 0:
66		asm("L1:");
67		l = *pp++;
68		asm("L2:");
69		l = q(l);
70		asm("L3:");
71		l = (**f)(l);
72		break;
73
74	case 1:
75		i = 2;
76		break;
77
78	case 2:
79		i = 9;
80		break;
81
82	case 3:
83		i = 4;
84		break;
85
86	case 4:
87		i = 1;
88		break;
89	}
90	return i;
91}
92
93
94#endif
95