Re: LZ-Adv: line routine


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

Re: LZ-Adv: line routine



CHRIS PORTER wrote:
> 
> i dont think you can do addition along the #+# idea.. i think it would be
> more like:
> ld (textmem),a
> ld a,b
> ld a,#
> add b


Are you thinking of the res1+2 and arg1+1 routines (see below)?  In those 
cases you can because arg1 and res1 and set addresses from the 
begininning of the program, like $80DF.
If you have res1+2, for example, TASM takes the address for res1 and adds 
2 to it.  This is done with the compiler and the final address is in the 
machine code.


By the way, I don't know anything about the line routine, never used it 
:(


> 
> something like this????? if im wrong, someone correct me before i corrupt
> this person :)
> chris
> 
> At 09:01 PM 11/14/96 -0600, you wrote:
> >I posted this first to the regular zshell list-serve but got no help. I
> >know somebody here can help me. Any suggestions? Any help much
> >appreciated.
> >
> >I got that line routine off of ticalc.org but am having some trouble with
> >it. Can somebody explain to me what I'm doing wrong?
> >
> >	[Lots of code snipped]




> >Div32:                                  ; arg1 / arg2 -> arg1 , res1 =
> remainder
> >        ld      de,0                    ; uses de, b, hl
> >        ld      (res1),de
> >        ld      (res1+2),de
> >        ld      b,32
> >        and     a                       ; clear carry
> >Div32Loop:
> >        ld      de,(arg1)               ; arg1 >> 1 -> arg1
> >        rl      e
> >        rl      d
> >        ld      (arg1),de
> >        ld      de,(arg1+2)
> >        rl      e
> >        rl      d
> >        ld      (arg1+2),de
> >        ld      de,(res1)               ; res1 >> 1 -> res1
> >        rl      e
> >        rl      d
> >        ld      (res1),de
> >        ld      de,(res1+2)
> >        rl      e
> >        rl      d
> >        ld      (res1+2),de
> >        ld      hl,(res1)               ; res1 - arg2 -> res1
> >        ld      de,(arg2)
> >        sbc     hl,de
> >        ld      (res1),hl
> >        ld      hl,(res1+2)
> >        ld      de,(arg2+2)
> >        sbc     hl,de
> >        ld      (res1+2),hl
> >        jr      nc,Div32NoAdd
> >        ld      hl,(res1)               ; res1 + arg2 -> res1
> >        ld      de,(arg2)
> >        add     hl,de
> >        ld      (res1),hl
> >        ld      hl,(res1+2)
> >        ld      de,(arg2+2)
> >        adc     hl,de
> >        ld      (res1+2),hl
> >Div32NoAdd:
> >        ccf
> >        djnz    Div32Loop
> >        ld      de,(arg1)               ; arg1 >> 1 -> arg1
> >        rl      e
> >        rl      d
> >        ld      (arg1),de
> >        ld      de,(arg1+2)
> >        rl      e
> >        rl      d
> >        ld      (arg1+2),de
> >        ret
> >	[Lots of code snipped]


<pre>
-- 
Compliments of:
_-_-_-_-_-_-_-_
  Alan Bailey
  mailto:bailala@mw.sisna.com
  IRC:Abalone
  Web:http://www.mw.sisna.com/users/bailala/home.htm
</pre>


References: