Path: utzoo!utgpu!watmath!clyde!att!rutgers!ucsd!sdcsvax!ucsdhub!esosun!seismo!uunet!sco!seanf From: seanf@sco.COM (Sean Fagan) Newsgroups: comp.arch Subject: Re: Assembly or .... Message-ID: <1813@scolex> Date: 1 Dec 88 12:28:06 GMT References: <1388@aucs.UUCP> <729@convex.UUCP> <1961@crete.cs.glasgow.ac.uk> <8993@smoke.BRL.MIL> <1032@l.cc.purdue.edu> <8938@winchester.m Reply-To: seanf@sco.COM (Sean Fagan) Organization: The Santa Cruz Operation, Inc. Lines: 38 In article <6547@june.cs.washington.edu> pardo@cs.washington.edu (David Keppel) writes: -->>>cik@l.cc.purdue.edu (Herman Rubin) writes: -->>>>divide a by b, obtaining an integer result i and a remainder c. -->>>>I know of no machine with this instruction. It is cheap in hardware, -->>>>and extremely expensive in software--at least 4 instructions. -->>mash@mips.COM (John Mashey) writes: -->cjosta@taux01.UUCP (Jonathan Sweedler) writes: -->The rather obscure but still-available VAX series of computers made by -->a small Nashua, New Hampshire company (Digital Equipment Corporation) -->introduced the EDIV instruction recently, about 1978. I heard a rumor -->that (at least in some early/small VAXen) it was faster to do two -->separate instructions than to use EDIV, although I suspect that this -->was an artifact of those implementations. What the hell. Here is a list of machines that I've worked on that had this type of instruction: PDP-11, 8086, 80286, 80386, VAX, NS32k, 68k, WE32100. I wouldn't swear to it, but I think the Elxsi might also have this. On reflection, that is *every* machine I've worked on (at least, in assembly language), except for the following: Z80, 6502, Cyber 170-state machines. The Z80 and 6502 don't have divide, so I think we can ignore them. This sequence, by the way, is *really* painful on a Cyber (and, I would expect, a Cray), because the Cyber has no integer divide. The mnemonic for an integer divide actually converts into a floating point divide, after trashing a couple of registers for you, and then packs the result back into an integer. As a result, when I wanted a modulus, I ended up writing *many* instructions (but they overlapped!), using a, *ahem*, very interesting idea of register allocation. -- Sean Eric Fagan | "Engineering without management is *ART*" seanf@sco.UUCP | Jeff Johnson (jeffj@sco) (408) 458-1422 | Any opinions expressed are my own, not my employers'.