Author Topic: Stupid ASM question :)  (Read 297 times)

0 Members and 1 Guest are viewing this topic.

Offline Joseman

  • 6128 Plus
  • ******
  • Posts: 769
  • Country: es
  • Liked: 613
Stupid ASM question :)
« on: 12:41, 23 May 18 »
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!!
« Last Edit: 12:46, 23 May 18 by Joseman »

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 849
  • Country: dk
    • spinpoint.org
  • Liked: 789
Re: Stupid ASM question :)
« Reply #1 on: 13:09, 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


Offline Joseman

  • 6128 Plus
  • ******
  • Posts: 769
  • Country: es
  • Liked: 613
Re: Stupid ASM question :)
« Reply #2 on: 13:17, 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!!


Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 849
  • Country: dk
    • spinpoint.org
  • Liked: 789
Re: Stupid ASM question :)
« Reply #3 on: 13: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.


Offline GOB

  • CPC664
  • ***
  • Posts: 120
  • Country: fr
  • Liked: 114
Re: Stupid ASM question :)
« Reply #4 on: 20: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

Offline Joseman

  • 6128 Plus
  • ******
  • Posts: 769
  • Country: es
  • Liked: 613
Re: Stupid ASM question :)
« Reply #5 on: 11:07, 26 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.


Offline Joseman

  • 6128 Plus
  • ******
  • Posts: 769
  • Country: es
  • Liked: 613
Re: Stupid ASM question :)
« Reply #6 on: 11:09, 26 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?  ;)

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 849
  • Country: dk
    • spinpoint.org
  • Liked: 789
Re: Stupid ASM question :)
« Reply #7 on: 13:55, 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.