News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Joseman

Stupid ASM question :)

Started by Joseman, 10:41, 23 May 18

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joseman

Hi guys

One question about the OUT command.

when in a program this action is performed:

ld bc,#fa7e
ld a,#01
out (c),a

but in others:

ld bc,#f40e
out (c),c

what is the use in register c (#7e) on the first example? it seems that the key is a register and c is not needed?

the OUT directive only use the b register on pair bc to address de hardware or the pair is always needed?

Thanks!!

Duke

Quote from: Joseman on 10:41, 23 May 18
ld bc,#fa7e
ld a,#01
out (c),a


IORQ is generated for address bus 0xFA7E, with  databus write 0x1
Quote
ld bc,#f40e
out (c),c

IORQ is generated for address bus 0xF40E, with databus write 0x0E

Quote
what is the use in register c (#7e) on the first example? it seems that the key is a register and c is not needed?


It used as part of I/O decoding, to ensure the right device gets it (which "listens" to a given I/O port). In this case the FDC


Joseman

Quote from: Duke on 11:09, 23 May 18
IORQ is generated for address bus 0xFA7E, with  databus write 0x1

IORQ is generated for address bus 0xF40E, with databus write 0x0E

It used as part of I/O decoding, to ensure the right device gets it (which "listens" to a given I/O port). In this case the FDC
Thanks
Its a coincidence that some times register c value equals to de port direction being different things!
understood!!


Duke

Since I was working with the CPC and logic analyser, here is what out (c),a looks like with your first example.


GOB

I don't know if my answer can help you (because i don't understand english very well), but i make a schematic about it on one of my coding website:
https://sites.google.com/site/amstradcpccoding/home/coding/4---adresser-un-port

Joseman

Quote from: GOB on 18:11, 23 May 18
I don't know if my answer can help you (because i don't understand english very well), but i make a schematic about it on one of my coding website:
https://sites.google.com/site/amstradcpccoding/home/coding/4---adresser-un-port
Thankyou for the port schematic, my main problem was that sometimes the hardware value and the byte to send was the same, and it confused me a little.


Joseman

Quote from: Duke on 11:26, 23 May 18
Since I was working with the CPC and logic analyser, here is what out (c),a looks like with your first example.
Maybe there is someting that you want to tell us about?
something related with the new Mx's and the floppy disc controller?  ;)

Duke

Quote from: Joseman on 09:09, 26 May 18
Maybe there is someting that you want to tell us about?
something related with the new Mx's and the floppy disc controller?  ;)
Not yet  8) - so much work and still so much to do.

Powered by SMFPacks Menu Editor Mod