Poll

How often have you come across recursion?

What's recursion?
5 (3.8%)
Never seen a practical need for it
10 (7.7%)
Seen and used it in the classroom, but very rarely in practice
52 (40%)
I implement a new practical solution with recursion about once a year
47 (36.2%)
Not a month goes by without me finding a new practical way to use recursion
16 (12.3%)

Total Members Voted: 128

Author Topic: Recursion - do you use it in the real world?  (Read 41655 times)

0 Members and 1 Guest are viewing this topic.

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 3996
  • Country: nz
Re: Recursion - do you use it in the real world?
« Reply #225 on: September 21, 2017, 08:26:58 am »
Certainly he does! He was a smart guy. He states the reason why earlier:

Quote
My second remark is that our intellectual powers are rather geared to master static relations and that our powers to visualize processes evolving in time are relatively poorly developed.

Iteration in a program requires the programmer to think explicitly about time: THIS happens, and then THIS.

Recursion expresses a static relation: if THIS is correct, then THIS is also correct. e.g. if fib(9) can be somehow relied upon (we don't need to care how) to produce the correct result, then 10 * fib(9) is certainly the correct result for fib(10). No notion of time is required, only correctness.

If this premise was true, HDL languages (e.g. VHDL, Verilog) would be much easier to master than C. In reality, the exact opposite happens. People grasp time relationships and learn programming in C rather quickly, but HDL learning curve is usually much steeper and people find HDL concepts more confusing than C.

But is that true for random people from the general (intelligent) population who have never been exposed to programming before? Or is it only true for people who have already passed through the filter of "CS101" and learned C/Java/Python?

Don't forget that beginner programming courses all have HUGE dropout rates, despite a lot of effort to understand and change that. Reasoning about assignment and loops is HARD at first, even for people who eventually get it. And many never do.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 3996
  • Country: nz
Re: Recursion - do you use it in the real world?
« Reply #226 on: September 21, 2017, 08:29:16 am »
Quote
This is tied in again with whether you need the notion of time or not.
That would neatly explain the way that embedded programmers tend to disagree with algorithm designers.
Arguably, real time and interactive programming (both relatively rare at the time of The Letter) always include a notion of time...

I'm not talking about ignoring execution time or efficiency, just reasoning about correctness. You can count the number of operations just as easily with recursive code as with iterative.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4195
  • Country: us
Re: Recursion - do you use it in the real world?
« Reply #227 on: September 21, 2017, 08:43:16 am »
Quote
I'm not talking about ignoring execution time or efficiency
I wasn't, either.  Although at some point that comes into play, of course.  I mostly meant, oh, "process oriented" vs "data oriented", or something like that.   I wasn't even necessarily including "fast" under "real time" (although perhaps understanding the difference is an example of what I'm talking about.)

I don't have any problem believing that some people are better at one, and other people better at the other...
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 3996
  • Country: nz
Re: Recursion - do you use it in the real world?
« Reply #228 on: September 21, 2017, 11:29:23 am »
Quote
I'm not talking about ignoring execution time or efficiency
I wasn't, either.  Although at some point that comes into play, of course.  I mostly meant, oh, "process oriented" vs "data oriented", or something like that.   I wasn't even necessarily including "fast" under "real time" (although perhaps understanding the difference is an example of what I'm talking about.)

Of course I'm aware that "real time" doesn't mean "fast", but only "known and guaranteed upper bound on response time". That might be microseconds for some applications, but it could equally be minutes or days for other applications.
 

Offline sasa

  • Regular Contributor
  • *
  • !
  • Posts: 168
  • Country: 00
  • Hobbyist in electronic
Re: Recursion - do you use it in the real world?
« Reply #229 on: September 22, 2017, 04:24:36 pm »
I'm a professional compiler guy. What you say is ABSOLUTELY untrue of any modern production compiler. In particular it is untrue of gcc or llvm.

If you write this...

Code: [Select]
int sum(int *p){
    int i, t = 0;
    while ((i = *p++)) t += i;
    return t;
}


I did not specifically mentioned "while" loop - try on "do - while".

And I would never write such pointless function. Then you make test case around it and specific compiler optimization parameter  - all that is pretty much useless. What is usually used in a loop as a limited factor is a counter as a simplest form, or complex boolean expression. Try with better example, then results and conclusions can be slightly different...

I hope you know that any "while" loop you can turn in "do-while" in assembler quite trivially. Then you will have no unconditional jumps and a bit more compact and faster code. There is no much point for unconditional jump and right after that conditional...
« Last Edit: September 22, 2017, 04:35:39 pm by sasa »
The 30+ years professional desktop software designer and software engineer
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 3996
  • Country: nz
Re: Recursion - do you use it in the real world?
« Reply #230 on: September 23, 2017, 12:05:09 am »
I'm a professional compiler guy. What you say is ABSOLUTELY untrue of any modern production compiler. In particular it is untrue of gcc or llvm.

If you write this...

Code: [Select]
int sum(int *p){
    int i, t = 0;
    while ((i = *p++)) t += i;
    return t;
}


I did not specifically mentioned "while" loop - try on "do - while".

And I would never write such pointless function. Then you make test case around it and specific compiler optimization parameter  - all that is pretty much useless. What is usually used in a loop as a limited factor is a counter as a simplest form, or complex boolean expression. Try with better example, then results and conclusions can be slightly different...

I hope you know that any "while" loop you can turn in "do-while" in assembler quite trivially. Then you will have no unconditional jumps and a bit more compact and faster code. There is no much point for unconditional jump and right after that conditional...

It would help if you read the posts you reply to.

Did I mention I write compilers for a living? "I hope you know..." indeed. FFS.
 

Offline Vtile

  • Super Contributor
  • ***
  • Posts: 1144
  • Country: fi
  • Ingineer
Re: Recursion - do you use it in the real world?
« Reply #231 on: September 23, 2017, 12:52:52 am »
I suppose the same company allowed labels, goto, endless loops, multiple continue and breaks? That certainly break fundamental rule about structural programming, which is paradox. I would left that company immediately.


Who made these "rules?" Even MISRA-2012 has relaxed the rule banning gotos after it INCREASED the error rate. The goto rule comes from a horribly misunderstood paper by Dijkstra. Dijkstra was writing about people creating spaghetti code using C by misunderstanding how C was supposed to work, and simply using gotos to control their control flow. Somehow this got turned into the rule "you can't use gotos...gotos are bad." It's a STUPID rule and has caused countless extra lines of code, filled with countless extra bits of logic and countless more bugs. More than even just being a stupid rule, I'll go one step further and say that I believe the rule is simply wrong because it actively leads to code which is more complicated with more potential for bugs, more difficult to understand, and more difficult to test (higher complexity).
My general distaste for programming comes from these illogic mantras parroted around or rather childish fanboyism flooted most online resources. Which both often sound like the arguments we had at the school yard in our snot nose nerd circle. Sorry I needed to put this out.
« Last Edit: September 23, 2017, 12:56:14 am by Vtile »
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3137
  • Country: ca
Re: Recursion - do you use it in the real world?
« Reply #232 on: September 23, 2017, 01:39:12 am »
But is that true for random people from the general (intelligent) population who have never been exposed to programming before? Or is it only true for people who have already passed through the filter of "CS101" and learned C/Java/Python?

I don't think so. At least I haven't heard of any great HDL programmers who would have troubles understanding C.

The paper has been written in 1968. This is almost ten years before I wrote my first program, so I obviously cannot possibly know what were the programming concepts back then. But, I remember I had read a book about Algol-68. I think back then approaches and languages such as Algol-68 were believed to be the future of the programming. People thought that they will be able to create abstract languages (not unlike Algol-68), which will make programming more organized through application of higher abstractions. I have a feeling that the author of the article had similar vision.

As we know now, 50 years later, this vision happened to be incorrect, and programming is best approached not as highly abstracted science, but rather as a down-to-the-earth trade, were languages such as C are the most practical. Thus there cannot be any theoretical rules which would mandate use of recursion or forbid it. As any other tool, recursion gets used where it is called for. And this is all there is to it. Entia non sunt multiplicanda praeter necessitatem.

Don't forget that beginner programming courses all have HUGE dropout rates, despite a lot of effort to understand and change that. Reasoning about assignment and loops is HARD at first, even for people who eventually get it. And many never do.

I don't know about dropout rate statistics, but if you're right, then perhaps programming courses for the beginners do not try to teach basics before they attempt to teach programming. If someone knows how computer memory works, then understanding variables and assignments won't be hard. If you don't explain the concept of memory first then teaching programming will be hard.

 

Offline John Coloccia

  • Super Contributor
  • ***
  • Posts: 1208
  • Country: us
Re: Recursion - do you use it in the real world?
« Reply #233 on: September 23, 2017, 02:04:45 am »
I don't know about dropout rate statistics, but if you're right, then perhaps programming courses for the beginners do not try to teach basics before they attempt to teach programming. If someone knows how computer memory works, then understanding variables and assignments won't be hard. If you don't explain the concept of memory first then teaching programming will be hard.

Absolutely, 100% spot on. I couldn't begin to count the number of times I've said that the best way to teach "programming" is to teach how the stupid computer works in the first place. On occasions I've had to tutor, I don't even bother getting to the subject matter until I've gotten through the nuts and bolts of how computers work. Then the rest is EASY.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4195
  • Country: us
Re: Recursion - do you use it in the real world?
« Reply #234 on: September 23, 2017, 06:36:54 am »
Quote
As we know now ...  programming is best approached not as highly abstracted science, but rather as a down-to-the-earth trade

We know that, do we?
I don't think that I'm very confident that that is an accurate statement!
I'll accept "we've now applied programming to a large set of problems that are not at all abstract."
I'll bet there are more "computer scientists" using abstract languages to solve abstract problems today, than there were in 1968.
And I'm pretty sure that C was influenced by Algol.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19279
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Recursion - do you use it in the real world?
« Reply #235 on: September 23, 2017, 07:58:59 am »
As we know now ... and programming is best approached not as highly abstracted science, but rather as a down-to-the-earth trade, were languages such as C are the most practical.

Nonsense, from many many points of view.

Almost all people that think they know C, actually don't, since there are far too many undefined and implementation dependent behaviours (let alone standards!).

Quote
Thus there cannot be any theoretical rules which would mandate use of recursion or forbid it.

And exactly how does that follow from your assertion?

Quote
As any other tool, recursion gets used where it is called for.

Tools are often misused, and recursion is no exception.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 3996
  • Country: nz
Re: Recursion - do you use it in the real world?
« Reply #236 on: September 23, 2017, 11:37:28 am »
People thought that they will be able to create abstract languages (not unlike Algol-68), which will make programming more organized through application of higher abstractions. I have a feeling that the author of the article had similar vision.

As we know now, 50 years later, this vision happened to be incorrect, and programming is best approached not as highly abstracted science, but rather as a down-to-the-earth trade, were languages such as C are the most practical.

I think it's more that we get a heck of a lot of mileage out of a few well choosen and documented abstractions, rather than inventing new ones constantly. Things such as "everything is either a block device or a bytestream (and here's how to make one look like the other)", key-value storage, hierarchical namespaces.

Quote
I don't know about dropout rate statistics, but if you're right, then perhaps programming courses for the beginners do not try to teach basics before they attempt to teach programming. If someone knows how computer memory works, then understanding variables and assignments won't be hard. If you don't explain the concept of memory first then teaching programming will be hard.

I agree. I believe everyone wanting to learn imperative programming (C, Pascal, Java/C#, Python, ...) should start with assembly level programming. Not on something torturous like PIC or 6502 or even x86. Something where you can document the entire instruction set and programmer's model on two sides of an A4 sheet (which admittedly you can with many 8 but CPUs) AND where you don't have to jump through hoops to manipulate decent sized integers and pointers and function call/return and a stack and struct members etc.

I'd say PDP-11 qualifies, but not PDP-8, Nova, or VAX.

Thumb1 is close, but has too many different instruction formats. You could maybe just not tell them about half of them. ARMv2 has few instruction formats, but the individual instructions are too complex with predication, "free" shifts on one operand, too many addressing modes.

MIPS is good, except for the damned delay slots. But generations of students have used SPIM successfully.

The base RISC-V instructions set is just about ideal. It's something close to MIPS fixed up. Only four instruction formats, simple addressing, no condition codes. The only thing I can really criticise is that immediate constants and branch/load/store offsets are hard to code/decode by hand because they are in multiple fields and scrambled a bit. And the fields don't line up nicely into hex (or octal) digits.

PDP11 was fantastic to program in actual machine code. Five octal digits for opcode, src register, src addressing mode, dst register, dst addressing mode, and one bit left over to indicate byte or word operation (except for add/sub, which shared an opcode). 6502 came close to, with first hex digit indicating the operation and 2nd hex digit indicating the addressing mode.
 

Offline HowardlongTopic starter

  • Super Contributor
  • ***
  • Posts: 5315
  • Country: gb
Re: Recursion - do you use it in the real world?
« Reply #237 on: September 23, 2017, 01:03:33 pm »
Coincidentally this came up in my Youtube feed today.

  here

« Last Edit: September 23, 2017, 01:08:57 pm by Howardlong »
 
The following users thanked this post: Vtile

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 10576
  • Country: gb
Re: Recursion - do you use it in the real world?
« Reply #238 on: September 23, 2017, 01:28:55 pm »

I agree. I believe everyone wanting to learn imperative programming (C, Pascal, Java/C#, Python, ...) should start with assembly level programming. Not on something torturous like PIC or 6502 or even x86. Something where you can document the entire instruction set and programmer's model on two sides of an A4 sheet (which admittedly you can with many 8 but CPUs) AND where you don't have to jump through hoops to manipulate decent sized integers and pointers and function call/return and a stack and struct members etc.


What you're looking for is CESIL - Computer Education in Schools Initial Language. It's a pseudo assembler designed by a couple of chaps at ICL back in the mid-seventies as part of ICL's planned schools computer educations course (well before it was fashionable to teach computing in schools).

It's a one accumulator machine with a grand total of 14 instructions and a syntax that any assembler programmer would recognise but none of the syntactic features that get in the way of just getting your first program through the assembler without any error messages. It's just enough like a real computer to teach and test understanding of the very basics without any of the distracting details that would make trying to program in assembler as your first ever programming experience a woeful one.
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 

Offline HowardlongTopic starter

  • Super Contributor
  • ***
  • Posts: 5315
  • Country: gb
Re: Recursion - do you use it in the real world?
« Reply #239 on: September 23, 2017, 03:12:39 pm »
I wrote a CESIL interpreter when I was 13 for my homebrew hand-wired computer (a hex keyboard and LEDs were all the I/O it had). It was a very easy thing to write, the language was so simple. Even my maths teacher was impressed, but it took half a lesson to key the interpreter in before you could use it, I didn’t have the luxury of a cassette interface at the time.
 

Offline Tom45

  • Frequent Contributor
  • **
  • Posts: 555
  • Country: us
Re: Recursion - do you use it in the real world?
« Reply #240 on: September 23, 2017, 03:51:42 pm »
Who made these "rules?" Even MISRA-2012 has relaxed the rule banning gotos after it INCREASED the error rate. The goto rule comes from a horribly misunderstood paper by Dijkstra. Dijkstra was writing about people creating spaghetti code using C by misunderstanding how C was supposed to work, and simply using gotos to control their control flow. Somehow this got turned into the rule "you can't use gotos...gotos are bad." It's a STUPID rule and has caused countless extra lines of code, filled with countless extra bits of logic and countless more bugs. More than even just being a stupid rule, I'll go one step further and say that I believe the rule is simply wrong because it actively leads to code which is more complicated with more potential for bugs, more difficult to understand, and more difficult to test (higher complexity).

Dijkstra's paper predates the C language. In 1967 when he wrote the paper, assembly language, FORTRAN, and COBOL ruled. Algol 60 was more relevant in academia than in industry. Dijkstra's paper couldn't have been a reaction to bad programming using the C language.

I remember when I first heard of Dijkstra's goto paper. I was discussing it with coworkers and we couldn't imagine how it would be possible to do without goto's. But we programmed in assembly and FORTRAN. Neither had support for loop constructs that made the goto statement unnecessary.

After more than a half century I'm still writing software for a living. I can't remember the last time I used a goto statement in a high level language. It has been at least a few decades. I haven't had to try to not use a goto, it just hasn't been necessary. Assembly language is, of course, a different story.

Tom
 
The following users thanked this post: Vtile

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 3996
  • Country: nz
Re: Recursion - do you use it in the real world?
« Reply #241 on: September 23, 2017, 06:33:30 pm »

I agree. I believe everyone wanting to learn imperative programming (C, Pascal, Java/C#, Python, ...) should start with assembly level programming. Not on something torturous like PIC or 6502 or even x86. Something where you can document the entire instruction set and programmer's model on two sides of an A4 sheet (which admittedly you can with many 8 but CPUs) AND where you don't have to jump through hoops to manipulate decent sized integers and pointers and function call/return and a stack and struct members etc.


What you're looking for is CESIL - Computer Education in Schools Initial Language. It's a pseudo assembler designed by a couple of chaps at ICL back in the mid-seventies as part of ICL's planned schools computer educations course (well before it was fashionable to teach computing in schools).

No. Not even close.

While something like that might have value for very young students, or for the first one or two lessons, it is far too limited to be useful.

- no subroutines
- no arrays or structs
- no conception of memory as storage locations with addresses

It's pretty much BASIC with worse syntax and all the useful parts taken out.

The worst sin of all -- it doesn't even give you the tools required to build the useful and missing parts yourself!
 

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 10576
  • Country: gb
Re: Recursion - do you use it in the real world?
« Reply #242 on: September 23, 2017, 08:22:11 pm »

While something like that might have value for very young students, or for the first one or two lessons, it is far too limited to be useful.

- no subroutines
- no arrays or structs
- no conception of memory as storage locations with addresses

It's pretty much BASIC with worse syntax and all the useful parts taken out.

The worst sin of all -- it doesn't even give you the tools required to build the useful and missing parts yourself!

Exactly, it's for the first few lessons where all the other stuff you've just mentioned is just a distraction and contributes to information overload. it's not intended to be useful in itself, it's intended to be useful in introducing, for the first time, what the inside of machine looks like from a programmers perspective. That is exactly the context you were talking about, starting learning to program.
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4195
  • Country: us
Re: Recursion - do you use it in the real world?
« Reply #243 on: September 24, 2017, 01:40:50 am »
Quote
Why would anyone want to change that bootloader - what could it do differently for better or worse, than the one that it comes with ?
Meh.  If you're going to teach assembly language, you ought to at least teach (a subset of) a REAL assembly language.

One of the tenets of the RISC movement might be stated "it doesn't make sense to design a processor with an "elegant" assembler/machine language; you should design the processor to execute code that compilers can emit easily."  So modern cpus tend to be a bit ugly.   But probably, if you're going to teach a subset anyway (you surely don't have time to teach ALL of any architecture as "part of" an introductory class), you can use anything. 
If you want elegace, If the absence of the lovely PDP11 (sigh), I think I'd recommend the MSP430.  ARM or AVR wouldn't be awful.  Shucks, there's probably a useful common subset: load, store, math, branch...
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 3996
  • Country: nz
Re: Recursion - do you use it in the real world?
« Reply #244 on: September 24, 2017, 01:14:40 pm »
Quote
Why would anyone want to change that bootloader - what could it do differently for better or worse, than the one that it comes with ?
Meh.  If you're going to teach assembly language, you ought to at least teach (a subset of) a REAL assembly language.

I agree entirely.

I'm also thinking about a different binary coding of a real assembly language such as RISCV to simplify working in raw machine code, but keeping the assembler (and therefore compilers too) compatible.

Quote
One of the tenets of the RISC movement might be stated "it doesn't make sense to design a processor with an "elegant" assembler/machine language; you should design the processor to execute code that compilers can emit easily."  So modern cpus tend to be a bit ugly.

I disagree. It's true the original designers of RISC said something along those lines, but it's not like they made things deliberately ugly or something.

Some early RISCs didn't have pipeline interlocks, which meant the programmer needed to think about how long each instruction would take and make sure anything using the result was enough instructions later that the result would be available in time. That's a bit of a chore for the programmer to keep track of, especially if it applies to add/subtract and and/or/xor not only to multiply/divide and memory loads. Two things quickly killed this idea 1) enough transistors became available that pipeline interlocks could be added easily, and 2) CPUs got faster a lot more quickly than memory did, meaning load delays got a LOT longer, and also highly variable depending on whether the load hit in cache or not.

The other thing that happened was some studies indicated that programmers could write a certain number of lines of code in a day, and that number didn't depend on whether they were writing in a high level language or in assembly language. So some designers (most famously VAX) decided to bring assembly language and machine language closer to a high level language. They made it possible to do things such as
Code: [Select]
a[x] = b[y] + c[z] in a single instruction, and also added single instructions to do all the work of function call or return -- saving registers, adjusting stack frames etc. x86 got some of the same philosophy too.

The RISC people said "That's nuts! We can compile
Code: [Select]
a[x] = b[y] + c[z] into four simple instructions (or even seven or ten) and it runs just as fast or faster -- EVEN ON YOUR VAX".

The biggest problem with the RISC way is that the poor old programmer has to find registers to put all the intermediate results in. The VAX has to do that too, but it does it for you, using hidden registers the programmer doesn't know about and can't access.

Quote
If you want elegace, If the absence of the lovely PDP11 (sigh), I think I'd recommend the MSP430.  ARM or AVR wouldn't be awful.

Agreed on all of those, with caveats, and indeed I suggested basically the same set of machines.

PDP11 doesn't have enough registers. Only six, effectively (or five if you don't save/restore the link register). In
Code: [Select]
a[x] = b[y] + c[z] that's only enough to hold a, b, c, x, y, z but not the actual data! Need to keep at least some of them in the stack frame. Ugh.  (32 bit x86 has the same problem of course)

MSP430 is basically a PDP11 with twice the registers and half the addressing modes. Usually a good trade-off.

ARM and Thumb I already discussed. Teaching a subset of Thumb1 is I think a good choice, especially as it runs on a huge range of real hardware that people already have or can buy cheaply, from Raspberry Pi to Android to every iPhone before the new models just announced (which I assume are, like iOS 11 everywhere, Aarch64 only). Say, for example, just instruction formats 2, 3, 9, 11, 13, 14, 16, 18, 19 at first (i.e. slightly less than half of them) from page 2 here https://ece.uwaterloo.ca/~ece222/ARM/ARM7-TDMI-manual-pt3.pdf.

That's still a lot more complex than RISCV's effectively four instruction formats.

AVR is good. Lots of registers. Simple instructions. The main problems are it's only 8 bits (making dealing with useful sized numbers or even pointers a pain), and fiddly support for using multiple pointers/arrays at the same time. But the hardware is very cheap and easily available, with excellent tool support.
« Last Edit: September 24, 2017, 01:20:48 pm by brucehoult »
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4195
  • Country: us
Re: Recursion - do you use it in the real world?
« Reply #245 on: September 24, 2017, 10:03:06 pm »
Quote
PDP11 doesn't have enough registers. Only six, effectively (or five if you don't save/restore the link register). In a
  • = b[y] + c[z] that's only enough to hold a, b, c, x, y, z but not the actual data!
Don't forget that the PDP11 could operate directly on memory, and its indexed addressing modes could cover the entire address space, so a,b, and c wouldn't usually be in registers, and the data doesn't need to be, either.  (if they WERE pointers, you'd have to do explicit math anyway, since there weren't any double-register addressing modes.)  Your example might assemble to:
Code: [Select]
   mov b(y), a(x)   ; destination on the right, IIRC?
   add c(z), a(x)


Quote
it's not like [RISC designers] made things deliberately ugly or something.
Perhaps "deliberately spent no effort on making things pretty" is closer.  The ARM assembly language is one of the ugliest I've ever used (IMO.)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf