• Please review our updated Terms and Rules here

First steps into Z80 assembly

Oops I misread. :D

Don't know what they mean by the "plain vanilla", CP/M is very system specific on a CPC if that's what their referring to.

Another little Z80 which perhaps has a little less flare to it than a CPC is a Jupiter Ace. :D
 
Another little Z80 which perhaps has a little less flare to it than a CPC is a Jupiter Ace. :D

I too was going to mention the Jupiter Ace, however the community is much smaller, real-hardware less available and the graphics, while interesting, less advanced. That said it is a great machine, it packs a lot into a small well-designed package. In many respects it shows what the ZX-81 could have been. If you are interested in giving it a go, you may want to check out CanAce, a Jupiter Ace emulator I have been working on for Unix.
 
deathshadow said:
Uhm, so you're NOT going with the CPC? or did you mean DECIDED?

Sorry, English is not my first language. I mean that yes, I probably WILL choose CPC and WinAPE to play with. [Edit on 19 March: I just realized what I had written in my previous message but I can't edit it any more. Inclined was the word I wanted to use, not declined.]

CP/M User said:
Don't know what they mean by the "plain vanilla", CP/M is very system specific on a CPC if that's what their referring to.

I was referring to deathshadow's post in the first page. I take it he means that doing assembly on a level where you only rely on CP/M system calls for hardware manipulation is playing in a rather safe and easy sandbox. Which I agree.

I too was going to mention the Jupiter Ace, however the community is much smaller, real-hardware less available and the graphics, while interesting, less advanced. That said it is a great machine, it packs a lot into a small well-designed package. In many respects it shows what the ZX-81 could have been. If you are interested in giving it a go, you may want to check out CanAce, a Jupiter Ace emulator I have been working on for Unix.

Well, I tried to compile & install the emulator but it failed. I have some issues with my current desktop machine running Ubuntu 12.04 and I just gave up. After all, my focus is in Z80 assembly, rather than any particular platform or environment, and as Crypticalcode0 correctly pointed out, programming can only be learned by doing. But there are so many different systems to choose from that I simply felt lost. That is the reason why I opened this thread in the first place - I felt I need more educated opinions.
 
Last edited:
Bottom line: It doesn't matter which architecture or assembly code that you use. Not at all. Your daughter is at the right age to become multi-lingual.

Start her off with anything, but then give her exposure to other architectures or languages. I learned Z80 assembly from the Z80 data book in about a day, but then by then I was conversant in many other architectures.

If I were doing the job, I'd start her out on IBM 1620 machine code. It has a lot to recommend it--it's all decimal; there are no user-addressable registers; instructions are all the same length; I/O is very simple. A SIMH emulator exists. Then move on to other architectures...

This leads to the question of the value of learning assembly or machine language today. Most code today is not written in assembly. As a comparison, think about the value of learning 1401 autocoder in 1983.
 
Learning assembler will always be useful because even if you never use it on a real project, it makes you understand that computers aren't magic, and gets you thinking about why different high-level languages do things certain ways and how to best leverage their features.
 
If you want to learn about computers, go from the lowest level, not some invented symbolic substitute for machine code (which is an invented scheme to reduce instruction length anyway). In other words, design and build your own machine; forget about using "canned-architecture" monolithic microprocessors. I daresay perhaps only 10% of those who know Z80 assembly actually know the internal structure of the chip.

One could learn more about computer organization and operation by, for example, learning to write PDP8 machine code (surprisingly easy to do).
 
I too was going to mention the Jupiter Ace, however the community is much smaller, real-hardware less available and the graphics, while interesting, less advanced. That said it is a great machine, it packs a lot into a small well-designed package. In many respects it shows what the ZX-81 could have been. If you are interested in giving it a go, you may want to check out CanAce, a Jupiter Ace emulator I have been working on for Unix.

I didn't know about the CanAce - thanks!
 
I'm glad to see that this thread has sparked so much interest and provoked such philosophic discussion.

For myself, and as to the usefulness of assembly, I'm most likely not going to do anything useful with it. I'm no professional; I do these things out of pure interest, just for the hell of it. My motto (well, one of them) is, "try everything and keep what is good". I tend to value understanding above skill and that's exactly what I'm after: better understanding and knowledge of assembly - my skills are very basic at best. I started with 6502, I'm now going to move to Z80, and some time in the future I'd like to explore x86. I'm in no hurry; if I ever *need* a piece of software, Google will probably find in three seconds much better solutions than I will be able to write in rest of my days.
 
You might be interested to check out Rosetta Code which a wiki site designed to bring together Programming examples for all different kinds of languages in an attempt to show how the code works.

It has a section for Z80 Assembly:

http://rosettacode.org/wiki/Category:Z80_Assembly

though at the moment it's quite tiny and it looks like those examples might have been written for the Amstrad because the examples look really firmware driven, though there's a some other interesting links in their site and one to Rodney Zaks "Programming The Z80" as obtain my Rodney which is great.
 
I just got a Kaypro 2 and I would like to do some programming in assembly, but I cannot find any information on how to do this on/for Kaypro 2 hardware. Are there any resources to get me started? An Hello World example for the Kaypro in assembly would be great.
 
I just got a Kaypro 2 and I would like to do some programming in assembly, but I cannot find any information on how to do this on/for Kaypro 2 hardware. Are there any resources to get me started? An Hello World example for the Kaypro in assembly would be great.

I guess if you were using CP/M, you could do something like this:

Code:
ld hl,message
.loop ld a,(hl)
cp &00
ret z
ld e,a
ld c,2
call 5
inc hl
jr loop

.message defb "Hello World",0

The assembler you're using on your Kaypro may not understand some of those terms. Labels like "Loop" & "Message" for example vary from Assembler to Assembler, even though they mean the same thing. I've modified this from some source code I have to display text messages from my Amstrad so that it's using the CP/M BDOS Function 2 Which is the Console Output. This information is found on John Elliott's website:

http://www.seasip.demon.co.uk/Cpm/index.html
 
Thank you for your reply. This is the code that I now use:
Code:
org 100h
start:
ld hl,message
loop:
ld a,(hl)
cp 0
ret z
ld e,a
ld c,2
call 5
inc hl
jr loop
message: defb 'Hello World',0
end start
The result is that the H is printed, followd by %%%%%%%, which goes on forever. What am I doing wrong? I'm using the z80asm compiler right now.
thnx
 
Hello,

It looks to me that you are using apostrophe rather than double quote to delimit your message.
I believe that the apostrophe is used only for a single character, and you need to use the double quote to delimit a string of characters.
I think that's why you are only getting the single character H out, and then garbage after that.

Good luck!

smp
 
I just got it working. The problem was not with the apostrophes, but with the "call 5" statement. It worked when it is preceded by "push hl" and is followed by "pop hl". The hl register is probably changed as a result of the call statement.
 
I just got it working. The problem was not with the apostrophes, but with the "call 5" statement. It worked when it is preceded by "push hl" and is followed by "pop hl". The hl register is probably changed as a result of the call statement.

Ok sorry, I wasn't sure if call 5 would change the state of HL, though you worked it out. :D
 
It's safe to assume that all registers will be changed by any CP/M BDOS call. It's entirely likely that IX and IY will not be affected, as the CP/M BDOS is written for the 8080, which doesn't have those registers. However, there is always the chance that a routine in CBIOS might alter them.
 
It's safe to assume that all registers will be changed by any CP/M BDOS call. It's entirely likely that IX and IY will not be affected, as the CP/M BDOS is written for the 8080, which doesn't have those registers. However, there is always the chance that a routine in CBIOS might alter them.

Something John can add to their site. :)
 
Back
Top