ForumsFlashtro.comWhy??MC68000 versus x86 ML RSS

<<< 123 >>> 

cewlout

Avatar
# WayneK : All the NDS intros are written in assembly, sorry cewlout :)

Really? Well, then thats cool ;-)
 

plagueis

Even thought it's been interesting reading and commenting on asm on various cpu architectures, it's worth noting that the real "meat" of making demos, intros, and trainer menus is understanding how to use the custom chipsets of whatever platform you are coding on, since that's the key to making small optimized code that looks nice and doesn't bog down the CPU nor waste a lot of cycles/bytes.
 
Intros?...I'm just here for the girls!

Annatar

Avatar
The problem with the "squeeze the most out of ChipSet" technique is that in the contemporary world, there is no such thing as "the ChipSet" -- hardware is a mish-mash of different chips.

For example, by the time you would master squeezing the maximum out of an Nvidia graphics accelerator, your knowledge would be obsolete because a new Nvidia accelerator would be out.

Also, in my experience, the challenge nowadays has moved from "I can program hardware" to "I can code by writing portable programs" that compile and run on anything without modification.

Give me hardware specs, I can program the hardware; but writing a demo or intro which just compiles and runs on any OS, fast, and is fully integrated into that OS, is a much tougher challenge.

Assembler has lost much of his appeal because we must now worry about processors and hardware which are completely disparate from each other, so our highly optimized source code is not portable out of the box.

Hell, even writing C code which compiles & runs between different UNIX flavors and GNU/Linux is a challenge, for example, writing programs that run fast and are tight on SPARC, ARM, or x86 processors without modification is a worthy challenge in and of itself.
 

WayneK

The reason a lot of us like to spend our free time doing stuff for old 'fixed' retro platforms is precisely this - we don't need to worry about making the kind of safe/portable code that many of us are forced to produce during our day jobs (not me, if I coded for a living I would be a homeless person living under a bridge!).
You're absolutely right in what you said above, but my guess is those of us into producing stuff for 1.3 A500's (cracks, intros/trainers etc) very much like the appeal of assembler and 'hitting the hardware' - gives us a chance to relive our childhood and get back to all the bad coding habits we had before everything was design docs and unit testing :)
 

pmc

Precisely what WK said - I code assembler on Amigas because I enjoy being able to talk the hardware directly without the layers of abstraction that a big operating system and a suite of standard library functions bring.

Not only that but there is something addictively pure about asm for me too - making code smaller, faster and tighter to squeeze maximum speed and efficiency out of a more limited processor is fun for me. There's not as much fun for me in the "never mind if my code is inefficient, the processor runs at a gazillion gigahertz so it'll be OK" world of, for example, compiled while running byte code type languages of today.

Plus of course I'm a grumpy old dinosaur who's stuck in the past :D
 

plagueis

@PMC, no need to be an apologist. I'm in a similar place as you (with my current computer interests) but I'm not "stuck", I placed myself there with deliberate precision.

Hell, I've done it all...built, configured and maintained SQL servers, migrated DHCP servers from NT to Linux, name servers, and a plethora of other I.T. related activities at work years ago, plus I've worked under every flavor of UNIX known. I've written 1000's of lines of C code (with inline asm), tons of Perl source on Windows and Linux, as well as FreeBSD, BSDI, OpenBSD, Solaris 2.7, SunOS 4.x, DG-UX, SGI-Unix, SCO Unix, OSF Alpha, Linux (Slackware, redhat, etc etc Debian Backtrack 4 and 5, etc.

C was cake to learn. I had ANSI C mastered in 2 weeks (including linked lists and binary trees) and it was fucking fun back in 1994, but now it isn't shit to me, and frankly it doesn't challenge my brain in the right ways anymore. Sure, I.T. Unix/Software development can be challenging, but so is going out and harvesting crops by hand with a scythe...but neither one appeals to me right now. There's no passion in jumping through hoops for your master (manager) just for a paycheck. It's soulless...chasing the wild goose. ..at least for me, others may be better suited to servitude than I am, but I doubt it. The only C stuff that I look back on fondly these days are things I coded for reasons entirely different from and outside of work. And it so happens that these things (like format strings, for example) are a lot more technically mind expanding than simply porting code or optimizing someone else's library functions. Of course, some people like that stuff, but I'm pretty sure this site is to service people more like me. Actually I'm 100% sure of that :) Now porting something in assembly between two architectures...that gets me interested.

There's a quote from Puterman of Fairlight...he was speaking of why the C64 is a good platform for demo coding:

***
That the C-64 is old and slow might not sound like much of an advantage, but when it comes to demo programming, it is. Why? It means that it's difficult to do stuff that requires lots of computations. You can't just throw CPU cycles at it, and write inefficient code. You have to think, to make it efficient. And doing really difficult things is what demo programming is all about. A good programmer can write a program that does something that seems very hard to do. A good demo programmer can write code that does something that is considered completely impossible.
***

You could do this with C, but you'd have to use some modern platform like the PC, which has no homogeneity (millions of various unpredictable sound and video and other devices). This forces you to use the OS, which controls you demo to an extent (actually entirely). Demos are not about that, they are about controlling the hardware with your code. If some dude does a demo that leaves the OS intact, how do we know he has the skills to kill it and take control? So the only viable platforms for good demos are machines like the Speccy, Amiga (more or less), C64, Gameboy, etc. It so happens that the greatest cultures of cracking and coding surround these platforms, yet are extremely muddled on the PC (exceptions being maybe Future Crew and some others). As others have also said, on Windows, the demos are mostly only about design *not* code....due to the above reasons...and it just doesn't pique my interest at all. I'm not the best assembly coder around yet...not close, but I love working on projects, and that's all that matters to me...I couldn't give a damn what the contemporary computer world thinks, and frankly 99.9% of the "computer people" these days I meet are complete fucking douchebag blowhards with no knowledge to back up their claims and paychecks way too big for their brain. Of course, how difficult is it really, to get flown around by your company to set up 802.11x networks in some big hotel chain?

Yeah, there's a lot of idiots in the modern C64 cracking/demo community too, but if you search around in the rough, you'll find a lot more diamonds there. As for the OCS Amiga crew, it's like 7 or 8 dudes or so, and I have yet to release any official demo :( But the fact that it is a small community, makes it very rarefied, and every single one (whom I've met) a great guy. So the Amiga scene is very small, but fortunate.

Ok, this is the shortest draft I could manage to produce for this post. None of the scathing comments here were directed at you, Annatar, rather you just reminded me of some of the reasons I don't work full time in the I.T. industry any more, and why I don't hang around with many people who do.

DP

This post was edited by plagueis (2012-02-21 00:34, 5 years ago)
 
Intros?...I'm just here for the girls!

plagueis

It's about the past, not the present or future...our passion is driven by nostalgia and glory of days gone by, when we first saw our amigas pushed beyond known limitations by these members of the illegal scene. Like I saw the 3 disk Newtek demo...wow, but it took forever to load and was slow as shit, coded by professional programmers. Long comes Rebels Megademo 2, Newtek chick, multiplied 5 times on the screen, headbanging. Plus, it unpacked and loaded the part in a mere few seconds, and only took up 1 floppy. I knew then that there were some good coders in the underground. Moments like that, are part of why I code today, for no fame or cash. And ASM's just more fun than high level languages for me, period. I was a fool for not learning assembly 30 years ago.

It's also about the mind-fuck of getting really frustrated over some reversing/coding problem, only to solve it, sometimes after many hours => Catharsis

This post was edited by plagueis (2012-02-21 00:33, 5 years ago)
 
Intros?...I'm just here for the girls!

Annatar

Avatar
C was cake to learn. I had ANSI C mastered in 2 weeks (including linked lists and binary trees)
Lucky you, I got my start on the C=64 assembler, but really blossomed on the Amiga in ASM-One. C made absolutely no sense to me until I hit UNIX and university. The final pieces didn't fall into place until I started digging around in Solaris 11's kernel code.

This post was edited by Annatar (2012-02-21 01:02, 5 years ago)
 

Annatar

Avatar
It took x86 assembler almost 25 years until AMD x64 made into assembler usable by a human being, to the point where it wasn't a nightmare to use any more, and I'd go so far as to argue that the x86 is comfortable to program only in AT&T's System V as(1), under UNIX.

as(1), unlike the idiotic intel "MOV DST, SRC" works on what I call "Motorola 68000 principle" of "MOV SRC, DST" -- in other words, it is mnemonics for human beings.

But yeah boys, I agree with you: Amiga is a meditation heaven for programming. Never have there been more elegant processors to program than the MC680xx family.
 

plagueis

# Annatar : [QUOTE]C was cake to learn. I had ANSI C mastered in 2 weeks (including linked lists and binary trees)
Lucky you, I got my start on the C=64 assembler, but really blossomed on the Amiga in ASM-One. C made absolutely no sense to me until I hit UNIX and university. The final pieces didn't fall into place until I started digging around in Solaris' kernel code.
[/quote]

Solaris is such an amazing operating system, and of course you know this well, but so many others don't. From my perspective it's "Lucky You!", since I'm sick to death of all this modern OS/frameworks/Ruby/Groovy. I think most people should learn assembly on at least 2 different architectures (along with all the info on how the hardware works) before learning high level languages, even one as low level as C. I know I would have benefited from such a thing, but luckily the scene affords me the luxury of going back and doing these things for fun. It's like being a connoisseur in a way.

Yes, I like AT&T asm syntax too for intel, such as you see in GDB. GDB...now that was some fun times..wasn't it Wayne?
 
Intros?...I'm just here for the girls!

Annatar

Avatar
plagueis:
You could do this with C, but you'd have to use some modern platform like the PC, which has no homogeneity (millions of various unpredictable sound and video and other devices). This forces you to use the OS, which controls you demo to an extent (actually entirely).
How about this: you are correct that the OS controls everything, and one must go through the OS because the hardware is so disparate. Now: we all know, that the OS is slow. Like, really slow. So any time we go through the OS, we pay a hefty price.
Because the OS is so slow, and because the price in efficiency is so exorbitant, the challenge is to come up with a really fast, efficient algorithm. Wait, wait, isn't that exactly what demo coding is all about, efficient code? Why yes, yes it is!

One could argue, quite successfully at that, that going through the OS is the demo challenge squared: when you "demo or die", you bang the hardware directly, and there is no penalty other than one's own lack of skill / ability / imagination; one can write code at the speed of the hardware!

But going through the OS, aaahhh! Now the bar has been raised higher, not only must one write fast code, one must come up with algorithms so fast as to offset the speed penalty of making system calls! I'd call that "challenge squared".

And believe it or not, there is a challenge even one level higher than that, and it goes:


Rule of Representation: fold knowledge into data, so program logic can be stupid and robust. And whoever so believes that this is simple to do, is in for a surprise.

If anyone thinks that is trivial, pose the following question to yourself: for any given problem I am working on, how could I fold the really slick algorithm I wrote into portable, self describing data?

Yes, demo coders do not have to think about designing such things. But therein is yet another challenge: let's up the ante.
 

plagueis

Will Robinson's not seeing the same danger you are on the viewscreen...

A demo is the antithesis of portability, and you don't want to write generic code that can handle unexpected occurrences or multiple scenarios...since...your demo should already know what to expect and the code should be made to order for that specific demo. Demos are about banging metal exactly for the purpose of efficiency and speed. If you need speed you sacrifice memory or code a speedcode generator, if you need memory, you use loops and give up some speed (compromise). If you find yourself unable to disable an OS or find it unpractical to do so, you're probably on some machine that sucks shit for demos and shouldn't be used for anything except a slave for humans...something like the modern Win7 box. (a bad joke) IMHO.

The challenge is, in my view, only one of 2 or 3 important elements I already mentioned.

There is an os for the PC, which is completely coded in asm complete with working TCP stack and working browser. I can't remember the name at the moment, but it's on my list of things to try out. My polish cracker friend who mentioned it to me said it's lightning fast.

Now if you were to code some demo which was its own os (which demos should be), on the PC, then actually go from there with your demo (and if it looked cool, not like amorphous blobs of random art) then I'd be impressed, but really, the IBM demo scene was better back in the DOS days.

I'm not sure where you were going with that last post, but I'm not going to follow you there and debate. I will say that I like some cracktros I've seen on the PC, but I haven't really disassembled any and checked them out.......not since I fired up IDA and looked at Hitmen's dos intro that was a port from their c64 intro...can't remember the number, but I was entertained seeing how they did their scroller and background color wash, etc.
 
Intros?...I'm just here for the girls!

plagueis

It will be years before I can do half the stuff I see in Booze demos...or less. So until then, the ante is high enough for me. I'm right in the middle of my first real game NTSC fix on the c64, and that is challenge enough for this intermediate coder...or maybe I should say beginner-intermediate.

We can't forget about design, though I've been pretty quiet about it up to this point because I am not too great at that. However, like anything else, I'll get better at the *art* side of demos with practice. One thing that tends to help the art, is to shy away from reusing code (at least this is predominately true on the commodore 64).
 
Intros?...I'm just here for the girls!

Annatar

Avatar
plagueis:
If you find yourself unable to disable an OS or find it unpractical to do so, you're probably on some machine that sucks shit for demos and shouldn't be used for anything except a slave for humans...
Yep! That's it!!!
That, to me, is the next level of challenge: the system sucks ass for demos: write code that is so fast and so clean, that it will run like a champ on a system which sucks ass for writing demos.

Isn't that the very essence of demo coding? Anyone can bang hardware really fast. It's been done many times.
 

plagueis

If that's your idea of demo coding go for it. I have already made my motivations clear. What you're describing sounds like something we should call an "App" rather than a demo.

It's up to us to figure out how to develop our own personal philosophies and then go out and have fun. Mine won't align with yours exactly, but that's fine. I simply have no need to *update* the philosophy, since for me...all the old stuff is new, while all the new stuff is old hat and boring. I'm terminally burned out of high level computing. I haven't done anything serious with C since 2006 or so, and I don't plan on taking it up again any time soon. And that's fine with me...I've nothing to prove in that arena, or any other.

If you want to act on your ideas you should do exactly that, but make no mistake, it won't be congruent with the old school demo mentality, you'll be walking alone in an avant garde path, which might not be a bad thing...

I don't think the matter of unsuitability of the PC for traditional (old school) demo productions can simply be distilled to one or two factors. Also, I think you fail to see all the reasons for that aforementioned unsuitability. The main reason high level languages and fast machines are incompatible with traditional demo making is that they allow so much cheating (GHz processors, high level languages where most of the hard code is written by others and described by Kernighan and Richie back in 1969). It's apples and oranges....you can't compare coding on some machine like the spectrum with coding on a quad core windows box....there are just so many issues.

But really....there is already a PC demo scene. I've watched plenty of those demos, I hated them all (as demos). Some of them worked pretty good as Nvidia/ATI demonstration programs though..hehehe. I don't even like TBL demos, but I respect those guys skills, since the guys I look up to in Amiga look up to those guys. I've liked old school demos and intros since 1987, and I doubt I'll ever change or open my mind. I don't even really like trackmos that much unless they are really outstanding. I want to be able to fucking hit space or the left mouse button when I want it, not some arty little soundtrack which decides for me. Yet, I will probably make a trackmo or two just for the challenge. Windows demo -- Never. Cracktro -- maybe.

Cheers.

PS: Cracking on the PC can be nice, or any Reverse Code Engineering, since you can attack and dissect things at the API level (API breakpoints, etc) and debugging is really full featured. But demos....dude, it's nearly impossible (with even 1/2 a brain) to write slow demo code on a modern PC system. No matter how bad or wasteful your code is, no one will notice unless they break in with Olly/Immunity and have a look. I'm just not seeing the challenge, and if you have a look around, you'll see that the PC demo folks are mostly interested in design not code for the reasons I've already outlined. It took me a few days to get a decent plasma working on the c64. Using the super portable SDL, on my Windows box...I did it in 5 minutes, and it ran faster than the c64 version, even though I did *no* optimization. Game set match.

This post was edited by plagueis (2012-02-21 02:49, 5 years ago)
 
Intros?...I'm just here for the girls!