[A83] Re: displaying values of a variable


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

[A83] Re: displaying values of a variable




To display A in the big font, you set h to 0, and l to a, then use disphl.

  ld h,0
  ld l,a
  bcall(_disphl)

Before you display large text, you set CURROW and CURCOL with the 
coordinates.  Because Currow and Curcol are next to each other, the easiest 
way to do it is to set HL to the coordinates to display it at, then set 
CURROW to hl.  Because you used a Register pair, CURCOL got set too.


Example (text at 0,0)
  ld hl,0
  ld (currow),hl

Example (Text at 4,2)
  ld hl,$0402    ;Note: $ means hexidecimal
  ld (currow),hl



For the small font used by the Text( command, use this routine:

;==========================================
;  VDispA - Displays A in the small font
;==========================================
vDispA:
	ld h,0
	ld l,a
;===========================================
;  VDispHL - Displays hl in the small font
;===========================================
vDispHL:
	push de
	push hl
	ld de,op1+5
	xor a
	ld (de),a
vdhlRepeat:
	bcall(_divhlby10)
	add a,'0'
	dec de
	ld (de),a
	ld a,h
	or l
	jr nz,vdhlRepeat
	ex de,hl
	bcall(_vputs)
	pop hl
	pop de
	ret

(note that vDispA *uses* vDispHL)

To set the coordinates to display to, set Penrow and Pencol.  note that 
unlike Currow and Curcol, X comes before Y here.

Example (text at 0,0)
  ld hl,0
  ld (pencol),hl

Example (Text at 40,20)
  ld hl,$1428    ;hex values of 20 then 40
  ld (pencol),hl



>From: "Charlie Adams" <charlie_w_adams@yahoo.com>
>Reply-To: assembly-83@lists.ticalc.org
>To: <assembly-83@lists.ticalc.org>
>
>How would you go about displaying a value in the accumulator (a) in an Ion
>program?  I'm sorry if this is a dumb question, I'm new to asm.



_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com





Follow-Ups: