Re: A83: ti compiler....hl to a question


[Prev][Next][Index][Thread]

Re: A83: ti compiler....hl to a question




At 04:59 PM 11/7/00 -0500, you wrote:

>ok, I'm making a small compiler...current options:
>save a variable where you can say it is a:
>number/varialbe '+,-,*,/' number/variable '+,-,*,/' (etc as needed...)
>now my question is, the multiplying routine i'm using, returns HL, now my
>question is, how to save HL back to a, where it ends up saving it to a
>variable....

just do this:

  ld a,l         ; lower 8 bits of hl -> a

this means that HL = A if H=0.  ie. the product is less than 256

if you want to store a 16 bit number into a memory address then do the 
following:

  ld de,xxxx     ; where xxxx = memory address ( a label in the program )
  ld (de),l
  inc de
  ld (de),h


-harper




References: