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(_en_)caetano(_punto_)eng(_punto_)br
http://www.caetano.eng.br/