Re: A86: square root -1


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

Re: A86: square root -1




>>format for imaginary numbers, it would be interesting if someone 
>could hack it
>>so that it says 3+3i... but is it really that necessecary? (Kinda 

On Tue, 2 Feb 1999 21:09:17 -0600 "David Phillips" <david@acz.org>
writes:
>I think that would actually be pretty easy using a [sqrt]FORM program, 
>but I

yes, it's easy.  takes 103 bytes of code.  i'd upload it, but netcom
won't let me sign on.
call once to install, second time to remove

-josh

fixi.asm:

#include "asm86.h"
#include "ti86asm.inc"
#include "ti86abs.inc"
#include "ti86ops.inc"

_formreal       equ $5191
_pop_fp         equ $479f
_ABS_MOVE       equ $524d

.org _asm_exec_ram

        ld hl,name-1
        rst $20
        rst $10
        jr c,install
        jp _delvar              ;os will reset the flag for us
install:
        ld hl,there-here
        call _CREATEPROG
	xor a
	ld hl,2
	add hl,de
        adc a,b
        call _SET_ABS_DEST_ADDR
        xor a
        ld hl,here
        call _SET_ABS_SRC_ADDR
        ld hl,there-here
        call _ABS_MOVE
        set 1,(iy+$24)
        ret

name:   .db $05,$10,"FORM"

here:   .db $8e,$28
myform: call _pop_fp
        ld a,(_OP1)
        and $1f
        cp $01                  ;ignore not simple complex #
        jr z,mf0
        cp a                    ;set zf
        ret
mf0:    ld (_curCol),a          ;start in col 1
        call show-myform+_asm_exec_ram
        ld a,'+'
        call _putc
        call _OP2TOOP1
        call show-myform+_asm_exec_ram
        ld a,'i'
        call _putc
        call _newline
        or a                    ;clear zf
        ret

show:   ld a,18
        call _formreal
        ld hl,_OP3
        jp _puts
there:

.end



___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]