Blog about learning machine code for the MSX

Page 1/4
| 2 | 3 | 4

By Pbk71

Expert (101)

Pbk71's picture

27-04-2021, 11:13

Hi all,

Just wanted to let you know that I've started a blog about learning MSX machine code. I once owned a MSX-1 in the eighties an programmed a lot in BASIC. Back then, at the age of 12 or 13, I was unable to learn machine language. Now I'm trying it again, I'm making some progress and I really like it.

There is a lot of information that can be found about assembly, the Z80 and MSX, but machine language still has a steep learning curve when you're an absolute beginner. Most assembly books make big steps at some point or assume you have knowledge that you don't have. With this blog I hope I can help the absolute beginner by offering small assembly experiments and examples where I explain all small steps. Once you get the hang of it the other information will make more sense. At least... I hope it will! Wink

The first blogpost is online which is just an introduction. It can be found here. Hope you like it and I hope to post the first real blog post ("Hello world!", yes indeed) very soon.I'm busy writing it.

Login or register to post comments

By Daemos

Paragon (1949)

Daemos's picture

27-04-2021, 11:17

Very nice. A good start. What did the revelation for me was the fact that everything is placed in ram. I think ita very important to understand for every beginner is that each instruction is in ram at exactly that adress and the cpu reads and writes to ram at specified addresses.

By GreyWolf

Champion (400)

GreyWolf's picture

27-04-2021, 11:35

Great news!
With your permission, I will translate your work into Russian for use in teaching children.

By Manuel

Ascended (17947)

Manuel's picture

27-04-2021, 12:51

For me, I never did a lot with assembly programming. I found it a bit clumsy and I don't easily think in bits.

But the basics of assembly is not hard, I think. The most difficult is to do is to know how exactly to program the chips in the MSX, in my experience. And of course to do advanced/superoptimized assembly programming. But that's not something for me Smile

By Pbk71

Expert (101)

Pbk71's picture

27-04-2021, 13:32

Quote:

Very nice. A good start. What did the revelation for me was the fact that everything is placed in ram. I think ita very important to understand for every beginner is that each instruction is in ram at exactly that adress and the cpu reads and writes to ram at specified addresses.

@Daemos: Thanks, this is indeed something to point out.

Quote:

Great news!
With your permission, I will translate your work into Russian for use in teaching children.

@GreyWolf: Sure, no problem. I hope it will be suitable for kids.

@Manuel: The basics aren't hard indeed. Maybe that's why a lot of manuels take big steps. But you do have to understand the basics vere well before you proceed. Programming the chips (like the VDP) quite complicated when you start, but I will first use BIOS calls to avoid this. Optimizing assembly is something that is important, but in my opinion it is better that you first understand what you are doing. Optimizing probably makes it more difficult to understand it so I'll cover that later (if I am capable of it myself Tongue ).

By raymond

Hero (524)

raymond's picture

27-04-2021, 13:53

Good initiative! I bookmarked your blog, as I would like to start learning it a bit as well Smile

By Metalion

Paragon (1384)

Metalion's picture

27-04-2021, 15:47

Daemos wrote:

What did the revelation for me was the fact that everything is placed in ram

I think learning assembly is made of those moments of revelation ... I remember not understanding interruptions for a long time, thinking that there was maybe 2 threads executed by the CPU at the same time (probably because of that magic of seeing things executed *apparently* at the same time). And then I had a revelation, interruptions were exactly what their name implied : the thread was interrupted and the CPU jumped to another location to execute something else. The magic was gone, I understood the works behind the scene ...

By Manuel

Ascended (17947)

Manuel's picture

27-04-2021, 15:59

Daemos wrote:

Very nice. A good start. What did the revelation for me was the fact that everything is placed in ram. I think ita very important to understand for every beginner is that each instruction is in ram at exactly that adress and the cpu reads and writes to ram at specified addresses.

Well, it can also be executing from ROM, of course...

By djh1697

Paragon (1584)

djh1697's picture

27-04-2021, 16:28

Which compiler are you using?

By bsittler

Master (240)

bsittler's picture

27-04-2021, 16:50

I like it! For me at least the actual numeric machine codes (learning which numbers encode which instructions and how) made Z80 a lot less mysterious too, and I find it helpful to see the RAM/ROM encoding of the program instructions and data alongside the assembly language mnemonics. However maybe it's not right for your audience, I don't know. Also for 8080 and Z80 opcodes I found octal notation made opcode bytes easier to read, but of course hexadecimal became much more commonly used and is more compact. Showing each opcode all three ways (octal, hexadecimal, mnemonics) can be handy at times

Also, same question as djh1697: which assembler are you using for the articles? Linking to the toolset might make it easier to follow along for someone who comes across the articles

By Pbk71

Expert (101)

Pbk71's picture

27-04-2021, 17:33

Quote:

Good initiative! I bookmarked your blog, as I would like to start learning it a bit as well Smile

@Raymond: Thanks, hope that it will be helpfull.

Quote:

Which compiler are you using?

@djh1697: For the start I will be using MSXpen.com. I think that's a real great beginners tool.

Quote:

I like it! For me at least the actual numeric machine codes (learning which numbers encode which instructions and how) made Z80 a lot less mysterious too, and I find it helpful to see the RAM/ROM encoding of the program instructions and data alongside the assembly language mnemonics.

@bsittler: Well, guess the title of my blog is not well chosen, sorry for that. I do plan to deal with the subject of actual machine codes for instructions, but thats just for explanation. I'm not planning to actually code with these numbers, I will use assembly for that. But I'm aware of the fact that that a programmer needs this knowledge, for example if you want to set up a hook.

Page 1/4
| 2 | 3 | 4