So I wrote this code for the TI-84 Plus CE:

Code:

#include "includes\ti84pce.inc"

 .assume ADL=1
 .org userMem-2
 .db tExtTok,tAsm84CeCmp

;Setup

 call _ClrScrnFull

 call _HomeUp
 ld hl,LetterA
 call _PutS
 
mainloop:
 ld hl,DI_MODE
 ld (hl),2
 ld a,(kbdG6)
 bit kbitCLEAR, a
 jr z,mainloop

 call _ClrScrnFull
 ret

LetterA:
 .db "A",0

The goal is to output a question mark at 1,1 on the home screen. My problems are that the screen freezes until a ram clear, and that the text does not look correct nor is it in the right place. I basically copied that code off of the learn assembly in 28 days, except changing b_call to call and changing the character and its position.
I have tried this with interrupts enabled and disabled.

Edit: uploaded full code, this time using PutS. The problem specifically this time is that the program freezes.
You are missing a 'ret' statement at the end. Also; you might have an incorrect include file.

EDIT: The main issue is how you are scanning the keypad. By updating the scanning mode constantly; the keypad never gets a chance to actually scan the keypad and update the registers. That's why it is important to wait for the keypad to signal that it is done scanning before attempting to read any registers:


Code:
#include "ti84pce.inc"

 .assume ADL=1
 .org userMem-2
 .db tExtTok,tAsm84CeCmp

;Setup

 call _ClrScrnFull

 call _HomeUp
 ld hl,LetterA
 call _PutS
 
mainloop:
 call scankeys
 ld a,(kbdG6)
 bit kbitCLEAR, a
 jr z,mainloop

 call _ClrScrnFull
 ret
 
scankeys:
 di             ; Disable OS interrupts
 ld hl,0F50000h
 ld (hl),2      ; Set Single Scan mode
 xor a,a
scanwait:
 cp a,(hl)      ; Wait for Idle mode
 jr nz,scanwait
 ret

LetterA:
 .db "A",0


More information + example code: http://wikiti.brandonw.net/index.php?title=84PCE:Ports:A000

Hope this helps Smile
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement