As the title states, I'm using the _PutS syscall to print a string to the screen (code is at the bottom of this post).

Whenever I attempt to do this, I get a couple of random characters, and _DispHL works perfectly fine.


Code:

; This is ALL REQUIRED
; DON'T TOUCH IT
; {
.nolist
#include "includes\ti84pce.inc"
#define    ProgStart   $9d95
.list
   .assume ADL=1
   .org ProgStart-2
   .db tExtTok,tAsm84CeCmp
; }
   ; Bit of setup, turn off run indicator and clear screen
   ;call    _RunIndicOff
   call    _ClrScrnFull
   
   ld      HL, 0
   ld      (curRow), HL
   ld       HL, welcomeText
   call    _PutS
   
   
   ; This works now, don't F*CKING TOUCH IT
   call    _GetKey
   ; Subtracting 142 in decimal gets us the number value of the key pressed
   SUB    142
   ld       H, 0
   ld       L, A
   
   call    _DispHL
   ret
   
   
; Variables
welcomeText:
   .db      "Test", 0
   
.end
.end
Your ProgStart value is for the original 84+, so your program thinks it's at a different address than it is. You should use the userMem address from the 84+CE include file instead.
Ah, that fixed it

For people that come later, here is the fixed code!


Code:

; This is ALL REQUIRED
; DON'T TOUCH IT
; {
.nolist
#include "includes\ti84pce.inc"
.list
   .assume ADL=1
   .org userMem-2
   .db tExtTok,tAsm84CeCmp
; }
   ; Bit of setup, turn off run indicator and clear screen
   ;call    _RunIndicOff
   call    _ClrScrnFull
   
   ld      HL, 0
   ld      (curRow), HL
   ld       HL, welcomeText
   call    _PutS
   
   
   ; This works now, don't F*CKING TOUCH IT
   call    _GetKey
   ; Subtracting 142 in decimal gets us the number value of the key pressed
   SUB    142
   ld       H, 0
   ld       L, A
   
   call    _DispHL
   ret
   
   
; Variables
welcomeText:
   .db      "Test", 0
   
.end
.end

You should use fasmg, and read the docs here (tutorials folder): https://github.com/CE-Programming/asm-docs
  
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