Re: A86: Problem with variables


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

Re: A86: Problem with variables




Thanks for your help.  I fixed my error by realizing the 6 needed to go
in c, not b to work.  I only called _delvar once and it seems to work
just fine.

What is rst??  I'm assuming it's an instruction, but how does it work,
and what other numbers are valid arguments?
---
Andy Johnson
I think therefore I am, I think

On Thu, 15 Jan 1998 16:46:07 +0000 jima@hTSO01.Cin.IX.NET writes:
>
>> This bit of code dosen't work and I can't figure out why.  Can 
>anybody
>> help?  The calc freezes in place when the variable exists, and turns 
>off
>> then freezes when it dosent.
>> 
>> #include "asm86.h"
>> #include "ti86asm.inc"
>> #include "ti86math.inc"
>> #include "ti86ops.inc"
>> #include "ti86abs.inc"
>> 
>> org _asm_exec_ram
>> 
>> _delvar                 equ     475Fh
>> _FINDSYM        equ     46CBh
>> 
>> main:
>        >         call    _OP1SET0        ; OP1 = 0
>        >         ld      hl,progname     ; Source = progname
>        >         ld      de,_OP1+1       ; Dest = OP1+1
>        >         ld      b,6             ; copy 6 bytes
>        >         ldir                    ; copy
>        >         call    _FINDSYM        ; carry flag set if var 
>        > dosen't exist, registers
>
>There's a simpler way.. Just do this instead of what I indented:
>
>   ld hl,progname ;point hl to progname
>   rst 20h  ;copies (hl) to OP1 but shorter than what you did
>   call    _FINDSYM
>
>
>Everything else looks fine..  Also, I tried a similar thing like this 
>but for some reason you had to call _delvar twice for it to work. 
>Anyway, try that
>
>>                                 ; set correctly for _delvar
>>         jr      c,dosentexist   ; if so, quit without doing
>> anything
>>         call    _delvar         ; if not, delete it
>> 
>> dosentexist:
>>         ret                     ; return to system
>> 
>> progname:
>>         .db             05h,"ABCDE"
>> 
>> end
> 
>


Follow-Ups: References: