home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
useful
/
dev
/
c
/
cmanual
/
system
/
hardware
/
example1.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-12
|
2KB
|
53 lines
/***********************************************************/
/* */
/* Amiga C Encyclopedia (ACE) V3.0 Amiga C Club (ACC) */
/* ------------------------------- ------------------ */
/* */
/* Book: ACM System Amiga C Club */
/* Chapter: Hardware Tulevagen 22 */
/* File: Example1.c 181 41 LIDINGO */
/* Author: Anders Bjerin SWEDEN */
/* Date: 92-05-02 */
/* Version: 1.00 */
/* */
/* Copyright 1992, Anders Bjerin - Amiga C Club (ACC) */
/* */
/* Registered members may use this program freely in their */
/* own commercial/noncommercial programs/articles. */
/* */
/***********************************************************/
/* This fantastic useful program does what all true hackers have */
/* dreamt of. Enjoy your Amiga's fantastic ability to flash one LED! */
#include <exec/types.h>
#include <hardware/cia.h>
/* These two structures are defined by the Amiga itself, and */
/* are automatically connected to the two CIA (8520) chips. */
extern struct CIA far ciaa;
extern struct CIA far ciab;
/* Declare our function: */
void main();
void main()
{
int loop;
/* Let the disco begin... */
for( loop = 0; loop < 40000; loop++ )
{
/* We change the second bit in the ciapra register. If the bit is */
/* unset (0) the LED is on, if the bit is set (1) the LED is off. */
if( loop % 1000 == 0 )
ciaa.ciapra ^= CIAF_LED;
}
}