Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Assembly?

Status
Not open for further replies.

Attachments

  • elf-nopix.gif
    elf-nopix.gif
    65.6 KB · Views: 159
Did you build that from scratch? What does the LED display do? That is cool how you must manualy enter all the data through switches. Very cool. Have you made anything usefull from it yet?
 
Marks256 said:
Did you build that from scratch? What does the LED display do? That is cool how you must manualy enter all the data through switches. Very cool. Have you made anything usefull from it yet?

The Elf was a kit, like many round that time, I built the slightly later kit the Microtan 65, a 6502 based expandable single board computer (which I still have). The first board looks like this:
 

Attachments

  • mainboard.jpg
    mainboard.jpg
    17.4 KB · Views: 159
a bit later- but the vic-20. a 6502 also. programmed asm by poking values into the onboard 4k of RAM. still go a few. used one a while back to log when a pir alarm went off. AHH the good old days, its a hellofalot better now
zkt
 
zkt_PiratesDen said:
AHH the good old days, its a hellofalot better now
zkt

In some respects?, back then the software and hardware had to be well designed in order to function well - nowadays the software is often very poorly written, relying on ever faster processors to make it useable.

Obviously the PC type hardware is partly to blame, with programs having to work on VERY different hardware - when you know EXACTLY what hardware and what speed you were playing with it's far easier to optimise your programs. Back then of course (and for many years) most programs were written in assembler, now they are generally written in far slower high level languages - even compiled C on a PC runs far more slowly than an optimised assembler program.
 
Thats all certainly true. And in addition, nowadays corporate greed is the driving force. Intergrity isnt even a close second. If it works till the check clears, then its good enough is the motto. But the advances in hardware and even software make 20-30 years ago seem like the stone age. IMHO. Like do you remember fortran- had to define EVERYTHING. Printing my name was a monumental task- now- click the icon- done
 
Ofcourse you have to take into consideration that writing a large complex program in assembly would take a few centuries as opposed to a few years :)

Also, Nigel, There's a rule that says: 1% of the program takes up 99% of time :) ...
You only need to hand optimize those speed critical parts, and most software companies do.

However, many software companies just seem to refuse using the enhanced instruction sets available on modern machines (SSE, etc) and make their programs still run on the old 386 instruction set.
 
Exo said:
Ofcourse you have to take into consideration that writing a large complex program in assembly would take a few centuries as opposed to a few years :)

It's not that bad, you don't write assembly routines from scratch, you reuse previous sections of code you've already optimised.

If you look at the old (now VERY old) Amiga games they were generally written completely in assembler, and still look pretty good, even against todays machines which run hundreds of times faster. Bear in mind back then a PC had monochrome text only graphics, and for sound just a beep!.

One of the Amiga magazines actually ran a series on how to write games, it was written by the author of a very popular vertically scrolling game (can't remember what it was called now?) - it took you through how he wrote the game, and gave you the complete source code for the full commercial game!. Probably the best ever game writing tutorial?.
 
Somehow, i don't see games like half life 2 and quake4 written in assembler, its just too complex, it took valve 6 years as it is...

Another problem would probably be getting it done altogether. A program like half-life 2 , over 2 million lines of C++ code would be so enourmous in assembler that you'd probably get lost in the code.

Then there's also the fact that the bulk of required api's (directX, etc) only offer SDK's in high level languages.
 
Exo said:
Then there's also the fact that the bulk of required api's (directX, etc) only offer SDK's in high level languages.

That's half of the problem, you're going through so many layers to do anything, so everything runs at a crawl!.
 
Yes, that's true...

But that's one of the native problems with an open platform like x86.
Everyone is allowed to make hardware for it, thus requiring the need for hardware transparancy.

The x86 plaform would'nt be the same if they made it a proprietary platform. It would turn into a console wich is simply, no fun :)
 
Exo said:
Somehow, i don't see games like half life 2 and quake4 written in assembler, its just too complex, it took valve 6 years as it is...

The only reason these games run at a reasonable speed is that the display routines have been implemented in hardware (and very embedded software). If it wasn't for hardware rendering then todays games would not be possible without assembler.

Mike.
 
Without hardware rendering, today's games would not be possible at all...
There is NO way even a 10Ghz Athlon64 could do the rendering work of today's games in software at the same speed of even a geforce 1.

A general purpose processor can never beat a ASIC.

Read my post above tho, its a general rule: 1% of the program uses 99% of the time. There are programming tools (profilers) that allow you to run trough the program and see the time consuming parts.

It makes a lot more sense to only manually optimize the little bit of code that uses the bulk of cpu time in stead of the other way around , does'nt it ?
believe me, most game companies do this. you can download unreal1 and quake 3's source code, look at it, the tricky parts that get looped over and over are done in assembler completely...
 
Actually, put a full stop after possible and delete the words "without assembler" from my last post.

Mike.
 
Your answer is spot on. The only thing I would add is that often a better algorithm will far outstrip any gains you achieve by optimization.

As the Z80 has been mentioned, I remember we used LDI (load with increment) repeated many times instead of LDIR (LDI+repeat) because LDI was 16 cycles and LDIR was 22. It's sad when you can remember individual instruction timings from 20 years ago.

Mike.
 
Marks256 said:
Did you build that from scratch? What does the LED display do? That is cool how you must manualy enter all the data through switches. Very cool. Have you made anything usefull from it yet?
You had to enter the code with the toggle switches.

The reason the 1802 COSMAC ELF was a popular kit was no EPROM required to get it booted. EPROMs programmers were not so easy to find in 1976.

What I really want is an Apple II clone unpopulated motherboard. I built one back in 78. Great fun and 1800 solder points. A friend built one using gold machine sockets. Pretty...:rolleyes:

**broken link removed**
 
Last edited:
ermmm, I may be getting of the point here, but I would recomend asm, I have been using it now for about 15years (on PIC's) oh and if u want to mess with z80 code, then I sujest that you have a look at programming the Gameboy/Gameboy colour it's based on a modified z80 (not quite as out of date as you may think!).

But I have to say, that even though a PIC only has 35(mid range) instructions, it's not the instructions that will get you, it's how to best use them, this is only learnt from experience :( and, in my experience, painfull experience, it's the "obvious" simple things that will get you every time, don't be shy though, give us a shout!

Oh, and get MPLAB, it's great (much better than the DOS based "sim" for those old enough to remember it!)

I hope this helps
 
Yes, i have MPLAB downloaded. I just need to find a tutorial. I worked on assembly on my laptop (Really old, runs at 50mhz, monochrome screen, no hd, 20mb mem, etc). I now understand why assembly is so popular! Man, call me a geek, but it was fun! My previous experiances with qbasic left some unanswered questions, but now that i know how assembly works, i finally understand how interrupts work(software wise, no hardware, i am still lost there.).

Ok, i am going to get a couple of microcontrollers. Any suggestions? I also need a programmer that is compatable with MPLAB. Suggestions? Schematics? Thanks.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top