Peeking And Poking The 68000 - Racal Instruments 7064 Instruction Manual

Table of Contents

Advertisement

4.4 P E E K I N G A N D P O K I N G T H E 68000
The Message-Based Interface allows the user t o "poke" and "peek" words and bytes
to/from any location within the 68000's address space. T h e intent of these commands is
to allow the user to exercise I/O ports and circuitry. T h e adventurous Message-Based
Interface user will soon realize that programs can be "poked" uncommitted R A M or the
user global area. T h e following C program illustrates this point. I t will endlessly toggle
a selected bit of a specified I/O port. It's intended to be run from the command line of the
host system. I t "pokes" a simple loop into the beginning o f the user global area, and
selects this simple routine as the "application parser" to be repeatedly called.
#include <stdio.h>
#include <ctype.h>
extern void exit(int);
/* each elem = "Ox" + 4 hex digits + N U L L * /
char Instrs[][6+11 =
"0x207c", / * movea.1 #<address>, a0
"" ,
" ,
"0x70ff", / * moveq #-1, dO ; 64K loop iters
"Ox1210", / * move.b (a0), d l * /
/* loop
* /
"0x0841", 1* bchg #<bitnum>, d l * /
"" ,
"Ox1081", / * move.b d l , (a0) * /
"0x51c8", / * d b f dO, loop * /
"0xfff6", / * offset back to 'loop' label * /
"0x4e75", / * its * /
#define N U M _ I N S T R U C T I O N S (sizeof(Instrs)/(6+1))
void pokeNrunToggleBitCocie unsigned long addr,unsigned bitnum)
char buf[100];
int i, ud;
const unsigned long targaddr = 0x00401000L;
unsigned upper, lower;
ud = ibfind ("VXITECH");
upper = ((addr & 0xffff0000L) >> 16);
lower = ( a d d r & Ox0000ffffL);
sprintf(&Instrs(11, "Ox%.4x", upper);
sprintf(&Instrs[2], "Ox%.4x", lower);
I* upper 16 address bits * /
/* lower 16 address bits * /
/* bit to toggle * /
* 1
4-11

Advertisement

Table of Contents
loading

Related Products for Racal Instruments 7064

Table of Contents