Hello, Agon! -- Hello World in BBC BASIC, eZ80 Assembly and C
Ғылым және технология
For the Agon Light, I go through 3 different ways to make a "Hello, World" program. All code is available on GitHub:
github.com/SlithyMatt/agon-hello
This video was sponsored by PCBWay -- visit pcbway.com to get started on your own dream project!
Join our Patreon community: / slithymatt
Chapters:
00:00 Intro
00:50 BBC BASIC Background
04:11 BBC BASIC Demo
07:45 System Architecture
14:04 Software Ecosystem
18:03 eZ80 Assembly Background
22:38 eZ80 Assembly Code Walkthrough
34:59 eZ80 Assembly Demo
42:04 C Background
45:35 C Code Walkthrough
50:55 C Demo
Пікірлер: 59
Acorn's choice to build their own interpreter wasn't an arbitrary one at all: they had a mandate from the BBC that it had to support structured programming, which Microsoft BASIC didn't support. Instead, they were influenced by COMAL, another BASIC-like language that was popular in education in Europe at the time. It also borrowed heavily from BCPL, though the influence there is a bit more subtle. The most obvious BCPL-inspired feature is the use of memory access operators instead of PEEK and POKE.
I'd love to see more Agon content!
What would be fun would be to port both CP/M (or similar OS) and BBC BASIC to support the full 2^24 address space of the eZ80.
@slithymatt
10 ай бұрын
It would be a lot of work, but the community would be very supportive of it!
Excellent video, thanks Matt. I'd definitely be interested in more Agon videos, especially if you dived into what you can do with BBC BASIC and its VDU commands to control the video and audio.
Truly appreciate all the work you do.
There is also a 16 bit forth available for the Agon as well!
@slithymatt
Жыл бұрын
I may have to do a video on Forth some time. Lots of retro machines can run it!
@andyleighton3616
11 ай бұрын
@@slithymatt There was even a machine which had Forth as its native language and not Basic. The Jupiter Ace.
Awesome stuff, thanks for all the info on this great little computer.
I really enjoyed this video. I watched it twice until now...
Thanks for this excellent video!
Any chance of seeing any Agon specific graphics and sound commands being added to Agon's BBC BASIC.
@slithymatt
11 ай бұрын
Good question. For now, it's just new VDU sequences.
Thank you for this review. I am really interested in learning assembly language on the Agonlight2. Your example worked perfectly, but when I tried examples from the eZ80 Heaven site, they compiled with errors. I think their code is for TI calculators. Where can I find an assembly language tutorial specific to the Agon? Thanks again. I have been wanting something like this for decades.
I'm currently planning a system specifically for CPM 3, and I'm thinking about the eZ80. But from what I see here, it is really quite different from the original Z80.
@slithymatt
8 ай бұрын
Yes, there are definitely things you need to look out for. I recently featured the Aquarius+, which uses a regular Z80 and would definitely have the RAM for CP/M, but currently lacks support for 80 columns.
@TSteffi
8 ай бұрын
@@slithymatt I have almost finished my port of CPM 3 for John Winans' Z80 Retro board, that one has 512k RAM, but with a inconvenient 32/32 banking. I want to develop a system with a more MSXish 16k page size, but I really want it to be Z80 compatible, using the old school assemblers (my current CPM is written in ZMAC).
i notice some programs can run directly as commands and the ones you compile, you have to load first and then run. is that just a difference of what header is on the program?
Great explanation, thanks! Also note that you can use the Zilog ZIDE to do C development of 24-bit eZ80 programs for the Agon.
@slithymatt
Жыл бұрын
Yes, indeed, but I always try to recommend a free and open source alternative whenever possible.
@andrewdunbar828
Жыл бұрын
A Google search turns up basically nothing for "Zilog ZIDE". Where can I find out about it?
How did you get ez80 and the C compiler onto Agon? Is there a Z80 binary for each of these somewhere?
@slithymatt
Жыл бұрын
I only had the eZ80asm on the Agon itself. All the details are in the link in the description
I’m curious why you went for SDCC when there are options such as Clang with Jacobly’s LLVM backend and ZDS which target the eZ80 in ADL mode.
@slithymatt
Жыл бұрын
I didn't know about the LLVM option, but as for ZDS, I wanted to demonstrate an open source alternative. If someone has an LLVM backend for clib on the Agon, I'd be glad to demo that.
@deterdamel7380
11 ай бұрын
We need an OSS C-compiler for the Agon. SDCC may be a good start, we need to add nativ ez80-support there. Edit: But there is a Z88DK-project, containing a fork of SDCC. It seems that ez80 support making it's way into this fork.
if you continue this series, i'd be really interested to see how we could use the agon board as a ttgo like board. that wouldn't be my main use for the board either but it would be cool to see how to do it if i wanted the option.
Is PCBWay unironically using beans as currency? Have they already forgotten beenz xD
And if you would replace printf() with puts()? In regular C-programs this would reduce the program... Or is printf defined to be puts? Edit: the latter....
Is there going to be a version running the ZILOG Z800 processor which will run ZILOG Z80,ZILOG Z80A and ZILOG Z800 code and make games run much faster or for that matter a PC running the ZILOG Z8000 could run UNIX System V that was compiled for the ZILOG Z8000.
@slithymatt
Жыл бұрын
Not that I'm aware of. The next one will have a 6502
looks like a GREAT SYSTEM! I just need SOME kind of communication/networking. I could use serial, but would prefer some Ethernet, hardwired or wireless, so that I could have a system programmable in BASIC that handles GPIO.
Also Z80-based nano app?
is the rst vector 18h the same, as for the vdu commands in basic? can i send my vdu commands over it, like in mos or basic?
@slithymatt
7 ай бұрын
Yes
I liked this tutorial, but what I thought was missing was how to a straight z80 program. Do I set my org address to $0000 ? I assume it's going into page $040000 -- but who knows??
@slithymatt
Жыл бұрын
To do that you have to set MBASE to $04. Or you can call Z80 code that is loaded elsewhere with CALL.S.
I was expecting you to use the built in assembler in BBC basic instead of a separate assembler program
@slithymatt
Жыл бұрын
That's a lot more fiddly to deal with.
@richy69ify
Жыл бұрын
was it ported across to Z80?
@rog2224
10 ай бұрын
@@richy69ify Indeed it is. There are some example stubs floating around. I always found the BBC BASIC inline assembler a bit of a faff - it never felt as well integrated as it might.
Does ex80asm run on Mac m1?
@slithymatt
Жыл бұрын
Yes, it should compile for any Unix-like system just fine.
@talideon
Жыл бұрын
z80asm is available using Homebrew, and it shouldn't be terribly different.
Does this mean we can play BBC Micro games on the Agon?
@slithymatt
7 ай бұрын
Only if they were written strictly in BASIC and did not make any direct hardware calls except for VDU statements. Machine code programs would be written in 6502 and have memory-addressable hardware, so that's completely different.
Excellent video. One minor point. The eZ80 is pipelined, so while theoretically the 3 byte JP should be quicker than the 4 byte JP (allowing for the much quicker clock speed), in practice it isn't. I think ! (PS: Byte Attic 4 Commander X16)
Does it do python?
@slithymatt
9 ай бұрын
No. That's a bit much to ask of the eZ80. You might be able to get a version to run on an ESP32 that had more RAM than the one on the Agon.
@cygil1
8 ай бұрын
@@slithymattI am sure micropython could be ported to it, however. As of now, however, it appears it has not.
an 8 bit computer with components largely available and 1/5th the price of a playstation 5, is it a dream?
@richy69ify
Жыл бұрын
1/10th the price
@user-zq8bt6hv9k
Жыл бұрын
@@richy69ify v1 is 100€ so 1/5th, but idd v2 or olimex version is 1/10th
@richy69ify
Жыл бұрын
@@user-zq8bt6hv9k yeah Olimex 50 euros plus tax and shipping, PS5 600 euros
First! (But probably second by the time this posts.)
If you could have got your hands on a known good working MEMOTECH MTX512 you could write BASIC and Machine code in the one program.
@rog2224
10 ай бұрын
The Z80 BBC BASIC has the inline assembler implemented, so it's possible on the Agon, but it's fiddly.