Re: A83: IS>(


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

Re: A83: IS>(




JakeGuilbo asked:

> What would be a good way to implement the basic loop:
>
>IS>(I,N) 
> 
>in asm? >
>

This is probably really inefficient but it should get the job done. Help me 
out if I forgot anything.

#DEFINE varI 8265h
#DEFINE varN 8267h

.org 9327h

call _zerooop1  ;Get sysvar N
ld hl,op1+1
ld (hl),'N'
call _rclvarsym
call _convop1
ld a,e
ld (varN),a

call _zerooop1  ;Get sysvar I
ld hl,op1+1
ld (hl),'I'
call _rclvarsym
call _convop1
ld a,e

inc a           ;IS>(I,N)
ld bc,(varN)
sub a,c
jp z,IislessthanorequaltoN
jp sp,IisgreaterthanN
IislessthanorequaltoN:
                ;command here if I is less than or equal to N
jp Done
IisgreaterthanN:
                ;command here if I is greater than N
Done:
rest of prog


The only difference is that if I< or =N, it will execute the needed command 
and skip the next, whereas IS> would execute both. This can be remedied by 
taking out the "jp Done".

btw Linus Wrote:
> 
>> sorry i can't answer that for you
>
>
>
>ROTFLMHO!.. Thanks, I needed that laugh...
>
>Linus

You think that's funny, you should see his AOL profile.

                                                                Bud


Follow-Ups: