473,396 Members | 1,777 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Duff Device reference ...

In Tom's original post (see http://www.lysator.liu.se/c/duffs-device.html)
discussing "Duff's Device" he refers to "another revolting way to use
swtiches to implement interrupt driven state machines".

My state machine may be considered revolting, and I was wondering if anyone
could point me to state machine example source he was referring to.
Nov 14 '05 #1
1 2016

In article <0a********************@rogers.com>, "Jamie Risk" <ri**@rogers.com> writes:
In Tom's original post (see http://www.lysator.liu.se/c/duffs-device.html)
discussing "Duff's Device" he refers to "another revolting way to use
swtiches to implement interrupt driven state machines".

My state machine may be considered revolting, and I was wondering if anyone
could point me to state machine example source he was referring to.


What Tom actually wrote was "I have another revolting way to use
switches to implement interrupt driven state machines but it's too
horrid to go into". I take that to mean that while he had conceived
of this "revolting" method, and perhaps implemented it somewhere, he
didn't want to document it for posterity. Considering the
controversy that Duff's Device caused, and the amount of silly email
he'd apparently received on the subject, I can't say I blame him.

In other words, we're probably stuck with guessing, unless someone
can coax Tom into revealing it.

(A loop around a switch is a pretty standard way of doing small state
machines in C, so I imagine Tom's talking about something rather more
bizarre. If he thinks it's odder than Duff's Device it might be a
fine spectacle indeed.)

--
Michael Wojcik mi************@microfocus.com

Viewers are bugs for famous brands.
-- unknown subtitler, Jackie Chan's _Thunderbolt_
Nov 14 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Christopher Benson-Manica | last post by:
(Fear not, I have no intention of actually using it!) Was there a particular reason Duff chose to unroll the loop 8 times, as opposed to some other number of times (besides some reason having to...
22
by: Jan Richter | last post by:
Hi there, the Code below shows DJBs own implementation of strlen (str_len): unsigned int str_len(char *s) { register char *t; t = s; for (;;) { if (!*t) return t - s; ++t;
7
by: Dan | last post by:
I'd like to have a set of more-or-less common code which I want to use for both desktop and smart device projects. I have two questions: 1. How can I set up conditional compile directives for...
7
by: Ritu | last post by:
Hi All, Can any body please tell me how i can write a device driver using CSharp. Thanks, Ritu
11
by: Hallvard B Furuseth | last post by:
I've been wondering sometimes: Anyone know why Duff's device is usually written like this: void duff(const char *str, int len) { int n = (len + 7) / 8; switch (len % 8) { case 0: do{...
10
by: anon.asdf | last post by:
Here's a reminder of duff's device: /*************************************/ #include <stdio.h> #define STEP 8 #define MAX_LEN STEP*4+1 #define SOURCE_LEN 28
9
by: yawnmoth | last post by:
dsend(to, from, count) char *to, *from; int count; { int n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.