-----Oorspronkelijk bericht-----
Van: Maarten ter Huurne <[EMAIL PROTECTED]>
Aan: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Datum: zondag 21 juni 1998 21:37
Onderwerp: Re: Problems with assembler
:At 10:39 AM 06/21/98 +0200, you wrote:
:
:>out (c),value or any register exept F.
:
:Note: there is no opcode for 'out (c),value'.
:
:>out (#98),a or another register
:
:Similar problem: only 'out (nn),a' exists.
Hmmm... let's look... Hey! You're right indeed! Whow, then the Z80 was less
powerful than I thought!
:>;Input: HL
:>;
:>Set_Vdp_Write:
:> ld a,l
:> di
:> out (#99),a
:> ld a,h
:> and %00111111
:> or 64
:> ei
:> out (#99),a
:> ret
:
:Note that 'ei' before 'out (#99),a' will work correctly only because the
:Z80 won't allow interrupts until after one instruction after 'ei'. This
means
: ei
: nop
: out (#99),a
:is a horrible bug. Horrible because it depends on when an interrupt occurs
:and is therefore very difficult to trace.
:Also, some emulators enable interrupts directly after 'ei' and the code
:above won't work. Ofcourse this is a fault of the emulators and should be
:corrected, but I though you might want to know anyway.
I should have mentioned that indeed.
:>;Input: AHL
:>;
:>Set_Vdp_Write:
:> rlc h
:> rla
:> rlc h
:> rla
:> srl h
:> srl h
:> di
:> out (#99),a
:> ld a,14+128
:> out (#99),a
:> ld a,l
:> nop
:> out (#99),a
:> ld a,h
:> or 64
:> ei
:> out (#99),a
:> ret
:
:Clever bit manipulation! (faster than my routine)
:But you can do it even faster: move the two 'srl h' statements to where the
:'nop' is. The srl statements now form a delay so you can get rid of the
'nop'!
Hmmm... Yes... There is a term for that... Bitneuken.
Anyway, I'll immediately update these routines in my listings and I'll look
for other routines which can b updated the same way for they have to be as
fast as possible... Thank you!
:>From adress #4000 in page 1 of screen 5:
:>
:>xor a
:>ld hl,#4000
:>call Set_Vdp_Read
:>in (#98),any register
:
:This code reads from address #4000 in page 0. For page 1, you need 'ld
:hl,#C000' (a screen 5 page is #8000 bytes).
Sorry, sorry, sorry, horrible mistake.
~Grauw "I like mailing routines"
****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****