A86: Switching Pages


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

A86: Switching Pages




Hello,

I am having a prolem with my program for the some laws in Math.

I tried to make a program that would show one page of laws, then when I
press MORE, I would be able to see another page.  I had done it on an 85 and
thought it would be the same for the 86 but somehow something is going
wrong.

Here is the code, wondering if anyone can spot the problem that I am having.
Most of the text is missing so some of the labels may not be on it.

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

.org _asm_exec_ram	;need at the start of every 86 program

	nop         ;Identifies the table
	jp Start
	.dw $0000   ;Version # of Table
	.dw Title   ;Absolute pointer to program description

Start:
First_Diff_Page:
	call _clrLCD
	ld d,2
	ld hl,Name
	ld b,19
	call Put_Text
Wait_Key:
	call GET_KEY	;places value of button in a
	cp K_EXIT		;checks if a is the same as K_EXIT
	ret z			;if it is exit
	cp K_MORE		;checks for K_MORE
	jr z,More_Screens	;if it is get more screens
	jr Wait_Key		;do the loop again

More_Screens:
	call _clrLCD
	ld hl,Name
	ld b,3
	call Put_Text
	ld a,d		;moves page counter into a for comparison
	cp 1
	jr z,First_Diff_Page
	cp 2
	jr z,Second_Diff_Page

Second_Diff_Page:
	ld d,1		;changes page counter to first page
	ld hl,DiffSecondPage
	ld b,16
	call Put_Text
	jr Wait_Key

;;;;;;;;;;;;;;;;;;;;;;;;;;
;Prints out the text pointed to by hl
;the first number it points to is the column, the second is the row, and the
third is the text
;;;;;;;;;;;;;;;;;;;;;;


Put_Text:
	ld a,(hl)
	ld (_penCol),a
	inc hl
	ld a,(hl)
	ld (_penRow),a
	inc hl
	call _vputs
	djnz Put_Text
	ret

	.db 0,15,"[cu]",0  ;one of the text that I am trying to show.

Thanks