Appendix B: Example Program Listings; Example 1 - Fujitsu F2MC-16L Series User Manual

Hide thumbs Also See for F2MC-16L Series:
Table of Contents

Advertisement

7.2.

Appendix B: Example Program Listings

7.2.1.

Example 1

/*
*/
#define MAXLED 20
#include "global.h"
#include "tinybios.h"
/* some global variables to work with symbols */
BYTE
LEDtext[MAXLED] = {0,
0x76,0x79,0x38,0x38,0x3f,0x0,0x71,0x3e,0x1e,0x6,
LWORD
Delay = 0x10000L;
int
LEDctr = 0;
char Msg[] = "\15\12\tPress any key and set new message or ESC to
reset\15\12";
int LEDfun(int);
void Input(void);
__interrupt extern void start(void);
int LEDfun(int upps)
{
LWORD ctr = Delay;
LEDDISP1 = ~LEDtext[LEDctr++];
LEDDISP0 = ~LEDtext[LEDctr];
if (LEDctr >= MAXLED-2)
LEDctr = 0;
while(ctr--);
return (LEDctr);
}
void Input(void)
{
bios_put('#');
bios_inp(Msg+3,sizeof(Msg)-4);
bios_str("\15\12New message is:");
bios_str(Msg);
}
void main(void)
{
int ctr;
int ch;
__set_vect(8, start, 0x88);
bios_str("\15\12\t Hello User, look for the text on LED displays");
while (1) {
© FUJITSU Mikroelektronik GmbH 1996
FUJITSU MB90675-Evaluation Board - User Manual
First Example for Monitor Test
0x78,0x6d,0x3e,0,0,0,0,0,0};
bios_str(Msg);
for (ctr = 3*MAXLED; ctr; ctr--) {
LEDfun(ctr);
if (bios_poll()) {
if (bios_get() == 27)
Input();
}
}
/* init routine */
/* stack vari */
generates the reset vector
bios_res();
- 55 -

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb90675 series

Table of Contents