Re: A86: Re: sqrtKEY-FORM!! sqrtFORM!


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

Re: A86: Re: sqrtKEY-FORM!! sqrtFORM!




yeah, tasm tries to pad .orgs so they are the right amount of space
apart.
whoever wrote this seems to be really big on "advancing the program
counter without assigning values"  there's gotta be fifty million ways of
doing that
there's a .set directive that lets you move a label, that might do the
trick.

oh, yes.  here's that source:

; BadCalc
; David Phillips <david@acz.org>
; http://www.acz.org/
;
; This was written using the information provided by CLEM about
[sqrt]FORM
; It makes your calculator evalute incorrectly and such
; 1+1=3  huh?  what's wrong with my calc?!  ;-)

#include Asm86.h
#include Rom86.h
#include Ram86.h
#include "ti86ops.inc"
#include "ti86math.inc"

.org _asm_exec_ram

	nop
	.dw 0,Title
	jp Start
Title:
	.db "BadCalc -David & CLEM",0

Start:
	ld hl,Title
	call _puts
	ld hl,form_var-1
	rst 20h
	rst 10h
	jr c,Enable

Disable:
	call _delvar
	res alt_form,(iy+exceptionflg2)
	ld hl,Disabled_str
	jr Exit

Enable:
	ld hl,code_end - code_start
	call _createprog
	xor a
	ld hl,2
	add hl,de
	adc a,b
	call _set_abs_dest_addr
	xor a
	ld hl,code
	call _set_abs_src_addr
	ld hl,code_end - code_start
	call _set_mm_num_bytes
	call _mm_ldir
	set alt_form,(iy+exceptionflg2)
	ld hl,Enabled_str
Exit:
	call _puts
	jp _newline

form_var:
	.db 5,$10,"FORM"

Enabled_str:
	.db "Enabled",0

Disabled_str:
	.db "Disabled",0

code:

.org _asm_exec_ram - 2

code_start:

	.db textend,txasmcmp

; FORM is run each time _disp_op1 ($515B) is called
; op1 = parameter

	call _pop_op1

	ld a,(_OP1)
	and $1f
	or a
	jr nz,Not_real

	call _ckop1int
	jr nz,Float
Int:
	ld hl,IntCalls	
	jr RandCalls
Float:
	ld hl,FloatCalls

RandCalls:
	ld a,r
	cp 50
	jr nc,Disp
	ld c,a
	xor a
 	ld a,b
	srl c
	adc a,b
	srl c
	adc a,b
	srl c
	adc a,b
	sla a
	ld c,a
	add hl,bc
	call _ldhlind
	ld (RandCall),hl
	call $0000
RandCall = $-2
		
Disp:
	res alt_form,(iy+exceptionflg2)
	call _disp_op1
	set alt_form,(iy+exceptionflg2)	

	ld a,1
	or a		; res Z
	ret

Not_real:		; set Z
	cp a
	ret

IntCalls:
	.dw _PLUS1, _MINUS1, _FPSQUARE, _TIMESPT5	

FloatCalls:
	.dw _SQROOTP, _FPRECIP, _SIN, _FRAC

code_end:

.end


On Thu, 11 Nov 1999 12:34:41 -0700 "David Phillips" <david@acz.org>
writes:
>
>Fine with me if you post it.  I release source code to anything I 
>write.
>TASM can't handle two .org lines?  Or is there no way to make it just 
>move
>the program counter and not pad the output?



___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: http://dl.www.juno.com/dynoget/tagj.


Follow-Ups: