|
GOTO is unconditional. JMP is unconditional. There is only one unconditional branching instruction, more would not make much sense. Eell, I do know a processor with two unconditional branching instruction, but that's another story. On that processor I could actually perform an unconditional branch without using any of these instructions. Anyway, the compiler really does not have much choice how to implement a GOTO. It always comes down to this one instruction, so how much more equivalent do you want it?
Loops, IF and all that stuff are based on conditional branches, quite a selection of branching instructions. They all work the same way, but branch only if a specific condition is met. These instructions are not equivalent. A loop obviously does a little more than just branch somewhere.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
CodeWraith wrote: GOTO is unconditional. JMP is unconditional. There is only one unconditional branching instruction, more would not make much sense.
As I recall, the PDP-11 instruction set (which I used to write drivers for lab systems in the dim and distant past) had two unconditional jump instructions. One was a single byte instruction with a single byte target, and could consequently only be used for very local branches, but executed very fast. The other (LNGJMP) had a two-byte target, so it could branch anywhere within the processor's address space, but executed more slowly.
|
|
|
|
|
Exactly as in my old CDP1802 processor. The short branch had only an 8 bit address which changed only the lower half of the program counter. By having to fetch a byte less, it only needed two bus cycles to execute. The long branch instruction loaded the full 16 bit address and was one of the few instructions that needed three bus cycles.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Indeed
"We can't stop here - this is bat country" - Hunter S Thompson - RIP
|
|
|
|
|
I just inserted a GOTO into the code I'm working on and took a look at the disassembly. Guess what assembly instruction a GOTO comes down to... And now please tell me where the grand differences between your JMP and my JMP magically come from.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Would you code in IL, if you could do it and produce the same app in C#?
Of course not: it would take you far longer and produce something that is a lot less maintainable (and as a Assembler / C / C++ / C# programmer for many, many years I know this well!)
IL (and assembler) have JMP operations because that is all they have: they can't use for, foreach, or do ... while loops because the "machine code" doesn't support them - it operates on one machine instruction at a time (massive simplification) and doesn't "look ahead" to see what "loop constructs" are in use.
You know this ... or is the lack of Soapbox bringing a little light trolling to the lounge?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: You know this ... or is the lack of Soapbox bringing a little light trolling to the lounge? How often did you see me trolling in the soapbox? I may be chaotic and evil, but it hurts that you think that of me.
OriginalGriff wrote: Would you code in IL, if you could do it and produce the same app in C#? Forfeit both the direct control over the resulting machine code and the syntactic sugar of the high level language? Why should anyone do that?
OriginalGriff wrote: Of course not: it would take you far longer and produce something that is a lot less maintainable (and as a Assembler / C / C++ / C# programmer for many, many years I know this well!) The keys to rapid development and maintainability don't lie, by my experience, not in any language or paradigm.
OriginalGriff wrote: IL (and assembler) have JMP operations because that is all they have: they can't use for, foreach, or do ... while loops because the "machine code" doesn't support them - it operates on one machine instruction at a time (massive simplification) and doesn't "look ahead" to see what "loop constructs" are in use. Very massive simplification. Since when do we have caches and pipelines in the CPU, along with more or less sophisticated branch prediction? Must have been the good old '286 and things really got in motion with the 386.
The fancy loops are just syntactic sugar and boil down to a handful assembly instructions, so what? The behavior on all levels remains the same, otherwise the whole IL and JIT compiler stuff would not be very useful. An assembly macro could do the same. Besides that, why should a compiler be concerned with branch prediction besides generating code that avoids cache misses and pipeline penalties? That should only be a concern of the JIT compiler, not of the high level language or IL.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
That perfectly describes al lof the code I wrote 10 years ago or more.
CQ de W5ALT
Walt Fair, Jr.PhD P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Which part? I hope not the nitwit!
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Also known as, "Kevin's code". Right Kev?
|
|
|
|
|
I believe it is derived from the Pre-First-Peoples-Language word "Veebeesix", which, since as we no longer have the Soapbox, cannot to any extent be translated on CP.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
No-one in the modern world (thankfully) ever ran into its linguistic ancestor Veebeeone but as far as we can tell, the whole language was based round a simple structure a like this:
do
goto (iif (CoinToss.Result = CoinToss.Heads, "Label1", "Label2"))
while (Hope.SomeRemaining = true)
The ancient Veebeeans were, as we all know, drowned in a particularly large stack overflow.
Whenever you find yourself on the side of the majority, it is time to pause and reflect. - Mark Twain
|
|
|
|
|
PeejayAdams wrote: The ancient Veebeeans were, as we all know, drowned in a particularly large stackoverflow. There decedents are still there . . .
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Hah! I happen to have a copy of VeeBeeOne that was distributed by shamans from the Microsoft tribe a long, long time ago. It took an extraordinary 5 floppies.
Software Zen: delete this;
|
|
|
|
|
Would you like a full set of Microsoft reference books for MFC to go with that?
Crikey! I thought I was the only one who saves stuff that long!
Will Rogers never met me.
|
|
|
|
|
We've been having a lab cleanout the last couple of weeks here at work. I found an unopened, shrink-wrapped copy of MS-DOS 6.22, several copies of OS/2 Warp 3 and 4, and a stack of Windows 2003 Server CD's.
Software Zen: delete this;
|
|
|
|
|
Is this from the same guy who was trying to get TFF going? (TFF = That's F***in Funny)
|
|
|
|
|
If you elitists, you and everyone that replied above this one, think VB1 was bad, you should have tried Apple Basic. I wrote a payroll system in it.
I then moved on to GW-Basic (the GW stands for Gates, William) and did an Inventory, Invoicing and A/R system in that.
I've used VB1 through VB6 since then, over a reasonably successful 42 year career. I still work in both VB6 and C#. Languages are just a tool. If someone shoots himself in the foot with a shotgun while hunting, are you going to blame the shotgun, or the person holding it?
Someday some kids will make fun of the languages you are using, if you are lucky enough to last that long. Throw out the academic Kool-Aid you have obviously swallowed.
Newer isn't better, just different.
|
|
|
|
|
Slow Eddie wrote: I've used VB1 through VB6 since then, over a reasonably successful 42 year career. Could that have anything to do with you being used to the title "Slow Eddie" ? ? ? Slow Eddie wrote: Someday some kids will make fun of the languages you are using, Possibly quite soon - their ability to comprehend abstractions or do anything that takes mental acuteness is diminished with each incoming text-message. GPS - make fun of those who use maps - perhaps because they can't?
Meanwhile, I have the fallback position of returning to FORTRAN.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
No.
Go to Netflix and watch a Paul Newman Movie "The Hustler". You may then get the reference...
Remember newer isn't better, Just different.
|
|
|
|
|
And there was me thinking it was an American (or even English) tourist trying to pronounce Sauchiehall Street[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
If you're still using GOTO and/or BASIC my deep condolences. There's no place for either one of them in modern Object Oriented or Aspect Oriented Programming.
Alas, any hyperlink to an internal anchor in a web page is a GOTO statement and #HashTags on Twitter and Facebook are actually the parameter for GOTO searches on them.
So GOTO is not going the way of the dodo, just transforming itself into something useful.
|
|
|
|
|
OK - I had the impression that the idea was to make mobile phones "smarter and smarter" until they are fully computers with way-too-small monitors.
As it turns out, whilst I was distracted with life, the battle turned and went the other way as, in fact, it was the computers that are, instead, becoming phones.[^]
Once upon a time, when a journal "Language" came out, they gave an example of a simple program written in many languages just as a comparison (cube integers 1 through 10 via one function call, or equivalent). The title of the article was, "To a nail, everything is a hammer" - and now I see, expressed in the current mentality-vernacular, every device is a telephone.
OH BRAVE NEW WORLD!
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
well once (not that long ago) computers lived in buildings or small (i.e. PC's) occupied part of the area on a desk. even including fuzzy logic washing machines still way less than 1 computer per human
...computers occupied a small amount of space amonst the humans.
these days: phones, cars, tv's, shoes, coffee cups, smart cameras, iot chickens etc, even counting the poor nations must be >1 computer per human
... is it now humans occupying a small amount of space amonst computers?
Message Signature
(Click to edit ->)
|
|
|
|
|
W∴ Balboos wrote: "To a nail, everything is a hammer" It's the other way around: "if all you have is a hammer, everything looks like a nail".
It's called "the law of instruments" (or of instrumentation; something like that), if you want to look up its origins (which I forget).
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|