Tuomas J~A¤rvensivu and Harri Salokorpi:
The 30th anniversary of Amiga inspired me to dig into Amiga programming. Back in Amiga’s golden era (late ’80s and early ’90s) I never had the chance to try this out since despite my relentless whining my parents wouldn’t get me one. Luckily later when I was studying at the uni, I managed to bargain one fine Amiga 500 specimen from the flea market at an affordable price of 20 euros.
Although Amiga as such is not that useful a platform to know these days, learning how to write programs for it can be very educational. Amiga as an environment is much simpler than (for instance) modern PCs. This makes learning low-level programming on it faster than on more complex environments. Although the hardware architecture is quite simple, it has some computer system design features that are still in use in modern environments as well such as DMA and interrupts. On top of being plain fun, writing assembly on Amiga teaches programming concepts that are usually hidden by higher-level languages and modern operating systems.
I’ve written this blog post together with Harri Salokorpi. We’ll walk you through an example that creates graphics on the display with a simple animation. We both hope this blog post provides a quick start to those who want to try out programming on this legendary device. However, we’re mostly going to use an emulator as a development environment, so the real device is not mandatory.
Fascinating article for those of us who can actually program.
Neat tutorial!
Looking back to those old machines today remind us where we come from, and how amazingly skilled some coders of the time were!
For those interested in a more complete tutorial about Amiga programming, check this fantastic Youtube channel from Scoopex: https://youtu.be/p83QUZ1-P10?list=PLtjBEWQ66xeLEqAUssJEDQRV1cbQR2-xk
Interesting…
i may have a play once i get the GoTek installed into (one of my) A500’s.
“Although Amiga as such is not that useful a platform to know these days, learning how to write programs for it can be very educational. Amiga as an environment is much simpler than (for instance) modern PCs. This makes learning low-level programming on it faster than on more complex environments.”
We need to keep simple processors alive.
68k 4 eva!
Yeah, because the 68140 is a bit too much these days…
68040 you mean?
Nope, alternate reality’s 8th generation 68k (hybrid photonic processor with quantic computation capability)
Why ? Just because we can dream about it.
Bill Shooter of Bul,
Yeah, modern stuff has gotten way too complex. Too many hacks, modes and legacy features. Much of it comes down to evolutionary baggage. It would be interesting to see a different approach now that technology has advanced, like a very simple straitforward & high speed core with MMU connected to an FPGA. Highly specialized features that used to get hard coded into the instruction set’s architecture could instead be programed into the highly parallel FPGA as needed. CPU transistors aren’t wasted on niche features you don’t need. The FPGA should be designed to be generic and future-proof. CPU intensive applications could take advantage of the FPGA by replacing traditional program logic with FPGA based accelerators.
Of course, this is not something most conventional programmers are familiar with today, but it would make for an interesting paradigm shift in CPU technology. In the longer term, compiler technology might improve to the point where traditional sequencial code could automatically get converted into blazing fast FPGA networks.
That comment was half jest, half celebration of the instruction set. I learned x86 assembly first, which is kind of messed up. Moving to 68k was insane. It was like jumping a head into the future! Woo!
But its time has passed. The cleanliness of the instruction set is only loosely tied to performance these days. Modern gcc & clang Compilers are pretty good at doing the right thing most of the time. Life in the embedded world is a different story. Its likely arm and x86_64 for the foreseeable future of mainstream desktop and mobile devices ( sorry mips, sparc, att hobbit).
att hobbit 4 lyfe!
I actually found a 68000 simulator (for 16-bit DOS, written in C). Interesting, to say the least.
Most people are talking about the 8086 when they complain, not usually about the much-improved 386. I still like 8086, but I agree that some tasks were more tedious than others.
I always dreamed of submarines that could fly.
They’re called blimps.
Is complexity what keeps computing at the hands of the Leviathans. Remember former Acorn.
https://en.wikipedia.org/wiki/Acorn_Computers
“A visit to the Western Design Center in Phoenix, where the 6502 was being updated by what was effectively a single-person company, showed Acorn engineers Steve Furber and Sophie Wilson they did not need massive resources and state-of-the-art research and development facilities.”
Sophie formerly being Roger
Edited 2017-05-12 19:12 UTC
Every Amiga has 32 bit cpu.
One can use regular C/C++.
Using assembler on Amiga is waste of time.
Coding demos on Amiga is a waste of time too.
It worth only on Atari.
Well said!
no, if you really wanted to get the best out of the hardware, for demo’s or even time critical parts of a game assembly was really very useful, and the 68k instruction set is so nice, even C programmers could cope with it…
Even Bad c programmers( aka c++ programmers) like myself.
and the rest Java
Actually, good programmers know when there is time for higher level and when for Assembly.
Edited 2017-05-12 19:08 UTC
You can also these days use something like FPC (TP or Delphi dialects), which I assume also supports inline asm (like all other ports):
http://wiki.freepascal.org/Amiga
6502 Assembly, or GTFO!
So sad, ordered an S-Video to HDMI adapter today for my Atari 130XE (how is this related to the Amiga? They were both conceived by Jay Miner!) and it only worked in Black and White, lame!
Anyhow, at some point in time, after I teach myself python for work stuff, I still want to learn C then Assembly for 68k so I can work on Some Atari ST/Amiga stuff….
Assumption correct, it does. Although for plain 68000 FPC’s code generator is not ideal, because it treats the CPU as a full 32bit one, while the ‘000/’010 has only a 16bit ALU, so most 32bit wide operations are slower, and FPC prefers these. Also, the current runtime libs require Kickstart 3.1 or newer.
Better support for the ‘000 and earlier Kickstarts are on our wishlist-roadmap tho’, and there already were some successful experiments.
Shipped with every Amiga 500 back in 1987, embeded in the ROM with the rest of the AmigaDOS1.3 (or 1.2 for earlier models), the ‘graphics.library’ provided an extensive API dedicated to multimedia : sprites, blitter objects, copper list.
A couple of years ago, I tried to explore how far I could go by using this API & my favorite C compiler (SAS/C).
Turns out the graphics.library was rather comprehensive, considering the time it was designed.
The result is here (video & source code included) :
http://www.pouet.net/prod.php?which=65580
Using assembler on amiga is waste of time.
Even in games, it is better to spend time on optimisation in high level language than waste time on hand coding cpu instructions.
ppcammiga1,
I have never coded anything on amiga, but even on x86 it depends on the compiler and what it is you are doing. Not all high level languages use all the tricks of an assembly programmer and most high level languages don’t expose CPU flags at all, which often can result in less than optimal algorithms. These limitations are not shared by assembly language.
Whether it’s worth hand optimizing in assembly depends. on how important the additional performance is and how good the compiler’s optimizations are. On older systems where games were pushing the limits of the hardware, the answer was often yes.
I think you really, really over valuate what can be made out of 512K of memory (even less because frame buffer) and 8MHz. And think back about the quality of C compilers back in 1985. 32 years back, things WERE different. Really different. There was not even cellular phones. Nor internet in every house.
What framebuffer?
The smaller Amiga-models had only so called chip-ram, which was more like a unified memory for programs und graphics (and sound).
so you could easily directly manipulate the graphical output, ether by the cpu or the custom-chips (gpu).
Just like Atari ST. You had 512 minus 1K for interrupt vectors at the beginning of the ram, minus 16K for screen buffer (320x200x4bits) at the end of ram.
Old compilers were adding too much overhead to programs and routines, the debuggers weren’t stable, it was easier to code in assembly on 68k (best asm with sh4).
No: there is no fixed location or size for that on an Amiga.
The bitplanes for your screen could be located anywhere in chipram … and you can also blank your screen and use 0 K
Well, you can also move your screen buffer around, but you cannot null it. Because what’s the point anyway, to have no screen output ?
My server has no screen-output, but I would not call it useless…
(a minimal screen-output on the amiga would be 320*200 with one bitplane (two colors) using 8 K.)
Kochise,
Especially with modern compilers, even a “hello world” might have to be manually optimized to run in 512k, haha. There’s no denying today’s programmers are spoiled with such powerful hardware!
Using assembler on Amiga is waste of time.
There is no reason to use old compilers.
Use very good SAS C.
And on better Amigas one can use newest gcc.