Linked by Thom Holwerda on Fri 12th May 2017 03:17 UTC
Amiga & AROS

Tuomas Jä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.

Order by: Score:
Check also Scoopex's tutorial on Youtube
by XtoF on Fri 12th May 2017 11:31 UTC
XtoF
Member since:
2015-01-24

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

Reply Score: 1

Comment by The123king
by The123king on Fri 12th May 2017 13:04 UTC
The123king
Member since:
2009-05-28

Interesting...

i may have a play once i get the GoTek installed into (one of my) A500's.

Reply Score: 2

Comment by dionicio
by dionicio on Fri 12th May 2017 13:53 UTC
dionicio
Member since:
2006-07-12

"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.

Reply Score: 3

RE: Comment by dionicio
by Bill Shooter of Bul on Fri 12th May 2017 14:36 UTC in reply to "Comment by dionicio"
Bill Shooter of Bul Member since:
2006-07-14

68k 4 eva!

Reply Score: 2

RE[2]: Comment by dionicio
by Kochise on Fri 12th May 2017 15:00 UTC in reply to "RE: Comment by dionicio"
Kochise Member since:
2006-03-03

Yeah, because the 68140 is a bit too much these days...

Reply Score: 2

RE[3]: Comment by dionicio
by neozeed on Sat 13th May 2017 15:52 UTC in reply to "RE[2]: Comment by dionicio"
neozeed Member since:
2006-03-03

68040 you mean?

Reply Score: 1

RE[4]: Comment by dionicio
by Kochise on Sun 14th May 2017 18:25 UTC in reply to "RE[3]: Comment by dionicio"
Kochise Member since:
2006-03-03

Nope, alternate reality's 8th generation 68k (hybrid photonic processor with quantic computation capability)

Why ? Just because we can dream about it.

Reply Score: 2

RE[2]: Comment by dionicio
by Alfman on Fri 12th May 2017 16:34 UTC in reply to "RE: Comment by dionicio"
Alfman Member since:
2011-01-28

Bill Shooter of Bul,

68k 4 eva!


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.

Reply Score: 2

RE[3]: Comment by dionicio
by Bill Shooter of Bul on Fri 12th May 2017 20:12 UTC in reply to "RE[2]: Comment by dionicio"
Bill Shooter of Bul Member since:
2006-07-14

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).

Reply Score: 2

RE[4]: Comment by dionicio
by Bill Shooter of Bul on Fri 12th May 2017 21:41 UTC in reply to "RE[3]: Comment by dionicio"
Bill Shooter of Bul Member since:
2006-07-14

att hobbit 4 lyfe!

Reply Score: 4

RE[4]: Comment by dionicio
by Rugxulo on Sat 13th May 2017 13:43 UTC in reply to "RE[3]: Comment by dionicio"
Rugxulo Member since:
2007-10-09

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!


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.

Reply Score: 1

RE[3]: Comment by dionicio
by feamatar on Fri 12th May 2017 23:34 UTC in reply to "RE[2]: Comment by dionicio"
feamatar Member since:
2014-02-25

I always dreamed of submarines that could fly.

Reply Score: 2

RE[4]: Comment by dionicio
by Ibrahim on Sat 13th May 2017 06:25 UTC in reply to "RE[3]: Comment by dionicio"
Ibrahim Member since:
2016-11-03

They're called blimps.

Reply Score: 1

RE: Comment by dionicio
by dionicio on Fri 12th May 2017 18:55 UTC in reply to "Comment by dionicio"
dionicio Member since:
2006-07-12

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

Reply Score: 2

Comment by ppcamiga1
by ppcamiga1 on Fri 12th May 2017 16:11 UTC
ppcamiga1
Member since:
2017-05-12

Every Amiga has 32 bit cpu.
One can use regular C/C++.
Using assembler on Amiga is waste of time.

Reply Score: 0

RE: Comment by ppcamiga1
by Kochise on Fri 12th May 2017 16:17 UTC in reply to "Comment by ppcamiga1"
Kochise Member since:
2006-03-03

Coding demos on Amiga is a waste of time too.

It worth only on Atari.

Reply Score: 4

RE[2]: Comment by ppcamiga1
by DeepThought on Fri 12th May 2017 19:07 UTC in reply to "RE: Comment by ppcamiga1"
DeepThought Member since:
2010-07-17

Well said! :-)

Reply Score: 1

RE: Comment by ppcamiga1
by codifies on Fri 12th May 2017 16:21 UTC in reply to "Comment by ppcamiga1"
codifies Member since:
2014-02-14

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...

Reply Score: 1

RE[2]: Comment by ppcamiga1
by Bill Shooter of Bul on Fri 12th May 2017 20:13 UTC in reply to "RE: Comment by ppcamiga1"
Bill Shooter of Bul Member since:
2006-07-14

Even Bad c programmers( aka c++ programmers) like myself.

Reply Score: 2

Real programmers use Assembly
by DeepThought on Fri 12th May 2017 19:06 UTC in reply to "Comment by ppcamiga1"
DeepThought Member since:
2010-07-17

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

Reply Score: 1

RE: Comment by ppcamiga1
by Rugxulo on Sat 13th May 2017 13:39 UTC in reply to "Comment by ppcamiga1"
Rugxulo Member since:
2007-10-09

Every Amiga has 32 bit cpu.
One can use regular C/C++.
Using assembler on Amiga is waste of time.


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

Reply Score: 2

RE[2]: Comment by ppcamiga1
by leech on Sat 13th May 2017 18:57 UTC in reply to "RE: Comment by ppcamiga1"
leech Member since:
2006-01-10

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....

Reply Score: 2

RE[2]: Comment by ppcamiga1
by chainq on Mon 15th May 2017 17:04 UTC in reply to "RE: Comment by ppcamiga1"
chainq Member since:
2009-06-09

You can also these days use something like FPC (TP or Delphi dialects), which I assume also supports inline asm (like all other ports)

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. ;)

Reply Score: 1

Graphics.library
by astrofra on Sun 14th May 2017 05:44 UTC
astrofra
Member since:
2007-02-16

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

Reply Score: 4

v Comment by ppcamiga1
by ppcamiga1 on Sun 14th May 2017 05:54 UTC
RE: Comment by ppcamiga1
by Alfman on Sun 14th May 2017 15:03 UTC in reply to "Comment by ppcamiga1"
Alfman Member since:
2011-01-28

ppcammiga1,

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.



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.

Reply Score: 2

RE: Comment by ppcamiga1
by Kochise on Sun 14th May 2017 18:23 UTC in reply to "Comment by ppcamiga1"
Kochise Member since:
2006-03-03

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.

Reply Score: 2

RE[2]: Comment by ppcamiga1
by cybergorf on Mon 15th May 2017 00:53 UTC in reply to "RE: Comment by ppcamiga1"
cybergorf Member since:
2008-06-30

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).

Reply Score: 1

RE[3]: Comment by ppcamiga1
by Kochise on Mon 15th May 2017 11:30 UTC in reply to "RE[2]: Comment by ppcamiga1"
Kochise Member since:
2006-03-03

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).

Reply Score: 2

No...
by cybergorf on Tue 16th May 2017 10:21 UTC in reply to "RE[3]: Comment by ppcamiga1"
cybergorf Member since:
2008-06-30

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.


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

Reply Score: 1

RE: No...
by Kochise on Tue 16th May 2017 13:03 UTC in reply to "No..."
Kochise Member since:
2006-03-03

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 ?

Reply Score: 2

RE[2]: No...
by cybergorf on Wed 17th May 2017 11:01 UTC in reply to "RE: No..."
cybergorf Member since:
2008-06-30

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.)

Reply Score: 1

RE[2]: Comment by ppcamiga1
by Alfman on Mon 15th May 2017 02:15 UTC in reply to "RE: Comment by ppcamiga1"
Alfman Member since:
2011-01-28

Kochise,

I think you really, really over valuate what can be made out of 512K of memory.


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!

Reply Score: 2

Comment by ppcamiga1
by ppcamiga1 on Mon 15th May 2017 03:45 UTC
ppcamiga1
Member since:
2017-05-12

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.

Reply Score: 0