Re: A83: please review my code


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

Re: A83: please review my code




inside...

PS: don't use call, use jp or jr instead for jumping to a label

>From owner-assembly-83-outgoing@towerguard.unix.edu.sollentuna.se Sun 
Sep 13 16:59:32 1998
>Delivered-To: assembly-83-outgoing@towerguard.unix.edu.sollentuna.se
>Received: by towerguard.unix.edu.sollentuna.se (VMailer, from userid 
507)
>	id 441D5429D9; Mon, 14 Sep 1998 01:59:26 +0200 (CEST)
>Message-ID: <19980913235441.26617.rocketmail@attach1.rocketmail.com>
>Date: Sun, 13 Sep 1998 16:54:41 -0700 (PDT)
>From: Sumit <sumit-1@rocketmail.com>
>Subject: A83: please review my code
>To: assembly-83@lists.ticalc.org
>MIME-Version: 1.0
>Content-Type: text/plain; charset=us-ascii
>Sender: owner-assembly-83@lists.ticalc.org
>Precedence: list
>Reply-To: assembly-83@lists.ticalc.org
>Errors-To: assembly-83-errors@lists.ticalc.org
>
>
>hi,
>can anyone please tell me what's wrong with my following code?  it
>starts looping and when i press clear the calculator shuts down and
>freezes.  please email me as soon as possible.  thank you.
>sincerely,
>sumit.
>
>the code is:
>
>.NOLIST
>#define equ .equ
>#define EQU .equ
>#define end .end
>#include "ti83asm.inc"
>#include "tokens.inc"
>.LIST
>text_mem = savesscreen
>graph_mem = plotsscreen
>xcoor = text_mem
>ycoor = text_mem + 1
>.org 9327h
>	call _runIndicOff
>	call _clrLCDFull
>	call _grbufclr
>	ld hl,0
>	ld (xcoor),hl
>	ld hl,0
>	ld (ycoor),hl
>	ld hl,title
>	ld de,plotsscreen
>	ld bc,$300
>	ldir
>	call  _grbufcpy_v
>	call mainloop
>	ret
>mainloop:
>	ld a,0ffh
>	out (1),a
>	ld a,0fdh
>	out (1),a
>	in a,(1)
>	cp 191
>	call start
>	jp nz,mainloop
>smallloop:
>	ld a,0ffh
>	out (1),a
>	ld a,0fdh
>	out (1),a
>	in a,(1)
>	cp 191
>	call quit
>	jp nz,smallloop
>quit:
>	call _clrLCDFull
>	ret

this ret's only back to smallloop, not out of the prog, you stuck it in 
a permanent loop.

>start:
>	call _clrLCDFull
>	call _grbufclr
>	SET textinverse,(iy+textflags)
>	call _homeup
>	ld hl,bare1
>	call _puts
>	RES textinverse,(iy+textflags)
>	ld hl,0102h
>	ld (CURROW),hl
>	ld hl,bare2
>	call _puts
>	ld hl,0104h
>	ld (CURROW),hl
>	ld hl,bare3
>	call _puts
>	ld hl,0106h
>	ld (CURROW),hl
>	ld hl,bare4
>	call _puts
>	call smallloop
>bare1:
>	.db "Your Choice is:",0
>bare2:
>	.db "1. English Sys",0
>bare3:
>	.db "2. Length/Area",0
>bare4:
>	.db "3. Weight/Cap.",0
>title:
>    	.db    
>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>    	.db    
>0,0,0,0,0,3,248,0,0,0,0,0,0,0,0,0,0,6,56,0,0,0,0,0,0,0,0,0,0,8,240
>    	.db    
>124,32,9,223,140,1,207,31,8,0,17,240,194,51,181,51,147,130,81,48,140,224,17,1,185,44,150,83,22,66,209
>    	.db    
>110,75,32,16,249,41,32,138,81,144,66,145,74,72,32,16,9,57,72,140,149,145,132,145,78,82,32,8,13,3,84
>    	.db    
>134,151,38,152,145,64,213,32,4,60,134,51,3,16,186,145,31,33,140,192,3,240,124,1,1,31,139,143,14,31,0
>    	.db    
>64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>    	.db    
>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>    	.db    
>0,0,0,0,240,240,0,0,0,0,0,0,0,0,0,1,141,8,0,0,0,0,0,0,0,0,0,1,101,196,0
>    	.db    
>0,0,0,0,0,0,0,0,1,100,196,0,0,0,0,0,0,0,0,0,1,105,12,0,0,0,0,0,0,0,0
>    	.db    
>0,3,244,226,0,0,0,0,0,0,0,0,0,2,100,226,0,0,0,0,0,0,0,0,0,2,5,2,0,0,0
>    	.db    
>0,0,0,0,0,0,1,13,6,0,0,0,0,0,0,0,0,0,0,241,248,0,0,0,0,0,0,0,0,0,0
>    	.db    
>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>    	.db    
>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,16,0
>    	.db    
>0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0
>    	.db    
>0,0,0,62,64,0,0,0,0,0,0,0,0,0,0,39,64,0,0,0,0,0,0,0,0,0,0,69,64,0,0
>    	.db    
>0,0,0,0,0,0,0,0,73,128,0,0,0,0,0,0,0,0,0,0,113,128,0,0,0,0,0,0,0,0,0
>    	.db    
>0,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0
>    	.db    
>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>    	.db    
>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,0,0,0,0,0,0,0,0,0,0
>    	.db    
>65,0,0,0,0,240,0,0,0,0,0,0,73,124,131,14,1,136,3,111,140,243,0,0,71,197,125,241,1,39,255
>    	.db    
>179,243,13,128,0,97,22,76,129,1,102,18,210,99,4,128,0,113,150,12,231,1,70,82,208,233,36,128,0,220,150
>    	.db    
>4,164,3,2,81,144,225,4,128,0,128,132,246,164,2,114,82,146,205,44,128,0,73,132,246,164,2,82,18,146,77
>    	.db    
>164,128,0,62,127,159,188,3,223,255,255,255,255,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>    	.db    
>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>    	.db     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>.end
>END
>_________________________________________________________
>DO YOU YAHOO!?
>Get your free @yahoo.com address at http://mail.yahoo.com
>
>


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com