Vampier's quest for assembly [hopefully a n00b guide to assembly]

Pagina 3/21
1 | 2 | | 4 | 5 | 6 | 7 | 8

Van Huey

Prophet (2694)

afbeelding van Huey

22-02-2010, 07:13

- set my own ROM at page 0 (48kbROM setup) (using BIOS calls)
ROM or RAM, but don't use BIOS calls. (BIOS calls are on page 0, so changeing page 0... not a good idea while you execute code there...)

Is that right? Or not? Or could I use the EXX command?
Of course I need to save more registers Wink

It depends... If you use only HL, BC, DE and AF in <my code I want to run on int> then this is fine... Even EX AF,AF' & EXX might do the trick for you, if you are absolutely sure that these shadow registers can be changed any time in you main code without it being crashed.

Interrupts are not magic. Interrut is simply RST #38 (=CALL #38) that can happen any time in your code inside EI / DI block... Same rules apply as with any subroutine, but you want to make sure that registers you are working with don't suddenly have values returned from interrupt handler call.

Thanks! I only use BIOS calls to set my ROM at page 0. Then I never use it again.

Van Vampier

Prophet (2413)

afbeelding van Vampier

23-02-2010, 07:13

I'm a bit busy with real life right now and the thing I was developing is on hold until I have some inspiration again Wink

Van Huey

Prophet (2694)

afbeelding van Huey

24-02-2010, 08:14


Interrupts are not magic. Interrut is simply RST #38 (=CALL #38) that can happen any time in your code inside EI / DI block... Same rules apply as with any subroutine, but you want to make sure that registers you are working with don't suddenly have values returned from interrupt handler call.

Nothing magic. At least if you do not forget to read register 0 (in a,(0x99)) Evil

Working like a charm now.

Van NYYRIKKI

Enlighted (6067)

afbeelding van NYYRIKKI

24-02-2010, 10:20

Yes... You need to tell to device causing interrupt to lower the interrupt line otherways the interrupt routine will be executed immediately again when you enable the interrupts.

Van Vampier

Prophet (2413)

afbeelding van Vampier

25-02-2010, 01:52

sorry for my interruption, but what is an interrupt?

Van NYYRIKKI

Enlighted (6067)

afbeelding van NYYRIKKI

25-02-2010, 08:58

Interrupt is a way to inform Z80, that something interesting is going on outside of it... For example UART of RS-232 interface or MIDI interface can tell that it received a byte... or MSX-Audio can tell that it has finished playing a sample... or something like this.

In MSX1 usually only device causing interrupts is VDP that tells to Z80 that "Hey, I've finished drawing picture to screen" ... this happens 50 or 60 times in a second.

Normally MSX-BIOS handles this interrupt and uses it to calculate time, check keyboard status etc. Other devices always need interrupt handler to be inserted, if they want to use interrupts. Otherways they will cause infinite loop when interrupt handler does not know how to tell that interrupt has been received.

In MSX2 VDP is a bit more advanced and can be programmed to cause interrups on other situations as well... Like "Hey, I've finished drawing line 128 to screen"... This is what is usually used to cause effect called "screen split"

Van Huey

Prophet (2694)

afbeelding van Huey

25-02-2010, 12:04

sorry for my interruption, but what is an interrupt?

Question
You must be kidding. Right?
Assembly learning step 1 - Z80 architecture.

Van NYYRIKKI

Enlighted (6067)

afbeelding van NYYRIKKI

25-02-2010, 15:22

Assembly learning step 1 - Z80 architecture.

Sure in school, but I don't agree that this should be the first step... way too boring stuff... Tongue It will come naturally after you have written your first programs...

Van wolf_

Ambassador_ (10109)

afbeelding van wolf_

25-02-2010, 15:28

The first thing to do in asm and any other language is Hello World!

Van hap

Paragon (2042)

afbeelding van hap

25-02-2010, 16:19

Hmm, doing a simple sum, like a=1; b=5; a=a+b; store_it_in_ram, is much much easier than Hello World in asm.
Anyway, I agree with NYYRIKKI, just start what you want to start with, this isn't school. Tongue

Pagina 3/21
1 | 2 | | 4 | 5 | 6 | 7 | 8