HispaMSX

RE: duda z88dk+asm

2004-08-25 21:03:14
you are right, now works   :D

thank you very much


--- En hispamsx(_en_)yahoogroups(_punto_)com, "Daniel Caetano" <daniel@c...> 
escribió:
On Wed, 25 Aug 2004 14:29:36 -0000, the_goulin wrote:

Alguien sabe como mezclar assembler con C en el z88dk

  I don't know z88dk, but your assembly doesn't do what
you expect.

main()
{
  a=65;
  #asm
     ld hl,40000
     ld hl,(_a) ; tambien lo he probado sin parentesis 
  #endasm
  return 0;
}

  Maybe it shoud look like this:

main()
{
   a=65;
   #asm
      ld a,(_a)
      ld hl,40000
      ld (hl),a
   #endasm
   return 0;
}

  Or even a simpler version (if the write address is fixed)

main()
{
   a=65;
   #asm
      ld a,(_a)
      ld (40000),a
   #endasm
   return 0;
}

y si hago un print peek 40000 
me sale 88  ¿?¿?¿ 

  With your code you had written nothing to the RAM. Firts
you load HL with 40000. After you load L with _a and H with
the byte that follows _a in the RAM.



 []'s

Daniel Caetano
daniel@c...
http://www.caetano.eng.br/


<Anterior en la conversación] Conversación actual [Siguiente en la conversación>