mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-23 00:14:25 +00:00
272 lines
6.3 KiB
C
272 lines
6.3 KiB
C
/* This module is a collection of all the Z8000 */
|
||
/* dependent C code for the P-CP/M dual processor */
|
||
/* BIOS. */
|
||
|
||
|
||
/*
|
||
*************************************************
|
||
* *
|
||
* Author: David Heintz *
|
||
* Module: Zoom8kc.c *
|
||
* Creation Date: 10/26/82 *
|
||
* Language: Standard C *
|
||
* Version: 1.0 *
|
||
* Last Mod: 11/26/82 *
|
||
* *
|
||
*************************************************
|
||
*/
|
||
|
||
|
||
|
||
/*
|
||
*************************************************
|
||
* *
|
||
* STANDARD HEADERS *
|
||
* *
|
||
*************************************************
|
||
*/
|
||
|
||
#include "unstdsys.h"
|
||
#include "zooequ.h"
|
||
#include "chnequ.h"
|
||
|
||
/*
|
||
*************************************************
|
||
* *
|
||
* EXTERNAL DECLARATIONS *
|
||
* *
|
||
*************************************************
|
||
*/
|
||
|
||
extern BYTE gb_word();
|
||
extern BYTE gb_long();
|
||
extern pb_word();
|
||
extern pb_long();
|
||
|
||
extern WORD bytlen;
|
||
extern WORD wrdlen;
|
||
extern WORD lnglen;
|
||
|
||
/*
|
||
*************************************************
|
||
* *
|
||
* Byte Ordering Arrays For *
|
||
* Word and Long *
|
||
* *
|
||
*************************************************
|
||
*/
|
||
|
||
static BYTE wrdtab[2] = {1, 0};
|
||
static WORD lngtab[4] = {3, 2, 1, 0};
|
||
|
||
/*
|
||
*************************************************
|
||
* *
|
||
* Machine dependent entities *
|
||
* *
|
||
*************************************************
|
||
*/
|
||
|
||
WORD bytlen = 1;
|
||
WORD wrdlen = 2;
|
||
WORD lnglen = 4;
|
||
|
||
/*
|
||
*************************************************
|
||
* *
|
||
* Port Addresses for Zoom Board *
|
||
* *
|
||
*************************************************
|
||
*/
|
||
|
||
WORD fiodat = 0x0001; /* Values for Zoom side */
|
||
WORD fioctl = 0x0003; /* only. */
|
||
|
||
/*
|
||
*************************************************
|
||
* *
|
||
* Memory Region Table *
|
||
* *
|
||
*************************************************
|
||
*/
|
||
|
||
/* The following table describes two memory regions: */
|
||
/* Region 1 Type: Separated instruction and data space */
|
||
/* Length: 64k I space, 64k D space, 128k total. */
|
||
/* Base: <<42>> */
|
||
/* */
|
||
/* Region 2 Type: Merged instruction and data space */
|
||
/* Length: 64k combined space. */
|
||
/* Base: <<1>> */
|
||
/* */
|
||
/* Notes This table is machine dependent (ZOOM board), */
|
||
/* but not processor dependent. */
|
||
/* Table does not include system segment. */
|
||
/* Table should probably be removed to module of */
|
||
/* machine dependent code and data. */
|
||
|
||
/* ********* This is the real memory region table ******** */
|
||
|
||
/*
|
||
struct mrt {
|
||
int count;
|
||
struct {long tpalow;
|
||
long tpalen;
|
||
} regions[2];
|
||
} memtab = {2,
|
||
{{0x42000000L, 0x1ffffL},
|
||
{0x01000000L, 0x0ffffL}
|
||
}
|
||
};
|
||
*/
|
||
|
||
/* ******** This is a kludge table for use with ****** */
|
||
/* ******** flaky zoom board hardware. ****** */
|
||
|
||
struct mrt {
|
||
int count;
|
||
struct {long tpalow;
|
||
long tpalen;
|
||
} regions[2];
|
||
} memtab = {2,
|
||
{{0x42000000L, 0x1ffffL},
|
||
{0x02000000L, 0x0ffffL}
|
||
}
|
||
};
|
||
|
||
/*
|
||
*****************************************
|
||
* *
|
||
* gb_word(): *
|
||
* Retrieve a specified *
|
||
* byte from a word *
|
||
* *
|
||
*****************************************
|
||
/
|
||
/ Inputs: Address of word
|
||
/ Byte number
|
||
/ Outputs: Byte corresponding to
|
||
/ byte number in word
|
||
*/
|
||
|
||
BYTE gb_word(pbyte, i)
|
||
|
||
BYTE *pbyte;
|
||
WORD i;
|
||
{
|
||
return(pbyte[wrdtab[i]]);
|
||
}
|
||
|
||
/*
|
||
*****************************************
|
||
* *
|
||
* gb_long(): *
|
||
* Retrieve a specified *
|
||
* byte from a long *
|
||
* *
|
||
*****************************************
|
||
/
|
||
/
|
||
/ Inputs: Address of long
|
||
/ Byte number
|
||
/ Outputs: Byte corresponding to
|
||
/ byte number in long
|
||
*/
|
||
|
||
BYTE gb_long(pbyte, i)
|
||
|
||
BYTE *pbyte;
|
||
WORD i;
|
||
{
|
||
return(pbyte[lngtab[i]]);
|
||
}
|
||
|
||
/*
|
||
*****************************************
|
||
* *
|
||
* pb_word(): *
|
||
* Place a specified *
|
||
* byte into a word *
|
||
* *
|
||
*****************************************
|
||
/
|
||
/
|
||
/ Inputs: Byte to be place
|
||
/ Address of word
|
||
/ Byte number
|
||
/ Outputs: None
|
||
*/
|
||
|
||
pb_word(sbyte, pbyte, i)
|
||
|
||
BYTE sbyte, *pbyte;
|
||
WORD i;
|
||
{
|
||
pbyte[wrdtab[i]] = sbyte;
|
||
}
|
||
|
||
/*
|
||
*****************************************
|
||
* *
|
||
* pb_long(): *
|
||
* Place a specified *
|
||
* byte into a long *
|
||
* *
|
||
*****************************************
|
||
/
|
||
/
|
||
/ Inputs: Byte to be place
|
||
/ Address of long
|
||
/ Byte number
|
||
/ Outputs: None
|
||
*/
|
||
|
||
pb_long(sbyte, pbyte, i)
|
||
|
||
BYTE sbyte, *pbyte;
|
||
WORD i;
|
||
{
|
||
pbyte[lngtab[i]] = sbyte;
|
||
}
|
||
|
||
|
||
|
||
|
||
/* End of Modul<75><0C>! |