Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!ptsfa!ihnp4!inuxc!pur-ee!uiucdcs!uxc.cso.uiuc.edu!hamilton From: hamilton@uxc.cso.uiuc.edu Newsgroups: comp.lang.c Subject: Re: C vs assembler, or, Here We Go Message-ID: <175400003@uxc.cso.uiuc.edu> Date: Fri, 8-May-87 16:31:00 EDT Article-I.D.: uxc.175400003 Posted: Fri May 8 16:31:00 1987 Date-Received: Sun, 10-May-87 05:01:00 EDT References: <165@mas1.UUCP> Lines: 36 Nf-ID: #R:mas1.UUCP:165:uxc.cso.uiuc.edu:175400003:000:1503 Nf-From: uxc.cso.uiuc.edu!hamilton May 8 15:31:00 1987 jda@mas1 (James D. Allen) says: > First penny) > Some control flow techniques -- in particular coroutine > linkage -- are inconvenient in C but achieved elegantly in assembly. > To avoid a proliferation of global variables > and/or "gotos" I have seen multitasking: > ... > used where an assembly language programmer would have invented > coroutines even if he'd never heard of them. Admittedly > the multitasking design may be more readable; the point is > that the assembly-level option is not readily available in C. Version 6 Unix C _had_ coroutines. as it happens, i was hunting for them just recently. i found my old manual pages, but i can't find an old enough tape around here to look for the sources. coroutines were implemented in a manner that paralleled fork's and pipe's, making them very natural in a Unix context. > Second Penny) > #define DSK_SEL *(char *)0xf12345 /* WRITE but dont READ */ > DSK_SEL = 0; > caused a parity error and had to be replaced with > temp = 0; DSK_SEL = temp; > The code generated was CLR.B and MOV.B respectively. Can anyone > elucidate? check your 68000 processor manual. under "CLR", it points out: "a memory destination will be read before it is written to". wayne hamilton U of Il and US Army Corps of Engineers CERL UUCP: {ihnp4,seismo,pur-ee,convex}!uiucuxc!hamilton ARPA: hamilton@uxc.cso.uiuc.edu USMail: Box 476, Urbana, IL 61801 CSNET: hamilton%uxc@uiuc.csnet Phone: (217)333-8703 CIS: [73047,544] PLink: w hamilton