Requiered a BIOS call for INT from timer in MSX1 and MSX2

ページ 2/2
1 |

By Huey

Prophet (2694)

Huey さんの画像

27-07-2011, 14:15

The BIOS in page 0 is present by default.

[quoting Bifi from on old thread:]

- at every interrupt the Z80 jumps to address $0038

- it stores all registers and jumps to $FD9A

- it returns from there it checks if the VDP caused the interrupt

if not, it restores all registers and returns to the main program

if so, it jumps to $FD9F (AF, containing the contents of VDP status register 0, is NOT stored), so if you need to have i.e. sprite collisions detected in basic after that, you need to store AF yourself before you do anything and restore it before you return to the interrupt routine and it handles stuff like keyboard scanning and basic PLAY command.

At $FD9A or $FD9F (the so called hooks) you can place a JP instruction + the address of your interrupt routine. (If you want it to run on the V-blank use $FD9F). By default the 2 addresses just contain a RET instruction.

By sp4

Master (214)

sp4 さんの画像

27-07-2011, 14:40

My assembly basic-knowledge is not well, but I know many well the c language.
I don't know well z80 assembly.

By Huey

Prophet (2694)

Huey さんの画像

27-07-2011, 14:47

sp4, what is it that you want to know?

What kind of program(part) are you trying to make?

Do you want to wait for an interrupt to end?
Do you want to put code inside the interrupt?

By sp4

Master (214)

sp4 さんの画像

29-07-2011, 10:45

Yes I want to put an asm code.
Huey told me than I must put in $0038 a jump istruction for call $FD9F and from this address
I should write my instructions in my case I should put this code:

xor a
ei
LOOP:
halt
inc a
jr LOOP

I don't know how can I call $0038 in asm and put inside it the jump istruction in $FD9F, and I want know how can I write the address $FD9F in the begin of the code in asm above for tell at the compiler where, in what RAM area, that code is puted.
I have only a SDCC compiler for write c and asm code.
I haven't an assembler.
Nobody can tell me that please?

By ro

Scribe (4902)

ro さんの画像

29-07-2011, 11:09

I'm sorry but if looks like you should first get yourself updated with the MSX- system and Assembly. Try http://map.grauw.nl/ for example.
If you want just a counter (8 bits?) then there is default counter somewhere in HiRAM which is updated every int. IIRC... dunno what address, disasm #38 and get in the know.

By Huey

Prophet (2694)

Huey さんの画像

29-07-2011, 13:00

Yes I want to put an asm code.
Huey told me than I must put in $0038 a jump istruction for call $FD9F and from this address

That is totally not what I meant Wink


I should write my instructions in my case I should put this code:

xor a
ei
LOOP:
halt
inc a
jr LOOP

I don't know how can I call $0038 in asm and put inside it the jump istruction in $FD9F, and I want know how can I write the address $FD9F in the begin of the code in asm above for tell at the compiler where, in what RAM area, that code is puted.
I have only a SDCC compiler for write c and asm code.
I haven't an assembler.
Nobody can tell me that please?

Let me assume you want:

1] increase a counter (stored in RAM) every interrupt f(50 or 60 times per second) or as long as the program runs:
- Just place asm command "CALLl" + address of a C function that does the actions needed (increasing counter) at $FD9F.

2] you just want to increase a timer in your program on the interrupt (to slow down the program for example).
- Just place an in-line asm instruction ("HALT" ) in the C code to let the code wait for an interrupt to end.

We still are not sure what you are trying to accomplish in your code. Could you please give more detail for what you need the information (explanation of the program you are making)?

ページ 2/2
1 |