I wanted to start learing assembly, and i have already a problem: a simple "Hello World" program doesn't work. It just simpily prints a "H" instead of "Hello World".
Code:

Code:
#include "ti83plus.inc"
.org $9D93
.db $BB,$6D ; AsmPrgm
.define bcall(label) rst $28 \ .dw label

start:
 ld hl,txtHello
 bcall(_PutS)
 ret
txtHello:
.db "Hello World",0
You may need to start by setting the cursor column and row variables to 0 so that you can be sure you are printing the string on the display rather than off it (which tends to result in weird bugs):


Code:
; snip
    xor a         ; Clear A to 0
    ld (curCol),a ; Set cursor column to A (0)
    ld (curRow),a ; Set cursor row to A (0)
    ld hl,txtHello
    bcall(_PutS)
; snip


Depending on how up-to-date your ti83plus.inc is, you may be able to replace the three added lines with bcall(_HomeUp), which does the same thing. TI's official ti83plus.inc does not define HomeUp, though.

Code:
#include "ti83plus.inc"
bcall(_HomeUp)

; snip
    xor a         ; Clear A to 0
    ld (curCol),a ; Set cursor column to A (0)
    ld (curRow),a ; Set cursor row to A (0)
    ld hl,txtHello
    bcall(_PutS)
; snip

start:
 ld hl,txtHello
 bcall(_PutS)
 ret
txtHello:
.db "Hello World",0
Gives an error while assembling...
Indent the bcall(_HomeUp).
what assembler are you using?

and isn't there supposed to be a .end or .END (depending on assembler)?
souvik1997 wrote:
Indent the bcall(_HomeUp).

What does that mean?
qazz42 wrote:
what assembler are you using?

and isn't there supposed to be a .end or .END (depending on assembler)?

DCS SDK assembler
My code was not intended to be complete - you simply need to reset the cursor position before outputting the string. You don't need to use HomeUp, either - if your include file provides it, it saves a bit of typing, that's all:


Code:
#include "ti83plus.inc"
.org $9D93
.db $BB,$6D ; AsmPrgm
.define bcall(label) rst $28 \ .dw label

start:
 xor a
 ld (curCol),a
 ld (curRow),a
 ld hl,txtHello
 bcall(_PutS)
 ret
txtHello:
.db "Hello World",0


or, if possible


Code:
#include "ti83plus.inc"
.org $9D93
.db $BB,$6D ; AsmPrgm
.define bcall(label) rst $28 \ .dw label

start:
 bcall(_HomeUp)
 ld hl,txtHello
 bcall(_PutS)
 ret
txtHello:
.db "Hello World",0
Sorunome wrote:
souvik1997 wrote:
Indent the bcall(_HomeUp).

What does that mean?
qazz42 wrote:
what assembler are you using?

and isn't there supposed to be a .end or .END (depending on assembler)?

DCS SDK assembler

Put a space before the bcall.
benryves wrote:
My code was not intended to be complete - you simply need to reset the cursor position before outputting the string. You don't need to use HomeUp, either - if your include file provides it, it saves a bit of typing, that's all:


Code:
#include "ti83plus.inc"
.org $9D93
.db $BB,$6D ; AsmPrgm
.define bcall(label) rst $28 \ .dw label

start:
 xor a
 ld (curCol),a
 ld (curRow),a
 ld hl,txtHello
 bcall(_PutS)
 ret
txtHello:
.db "Hello World",0


or, if possible


Code:
#include "ti83plus.inc"
.org $9D93
.db $BB,$6D ; AsmPrgm
.define bcall(label) rst $28 \ .dw label

start:
 bcall(_HomeUp)
 ld hl,txtHello
 bcall(_PutS)
 ret
txtHello:
.db "Hello World",0

bouth work, thanks. Which methode is better to use?
I think the method without the bcall is better, because it is faster. However, if you are concerned about size using the bcall would be better.
The _HomeUp version is smaller, so I'd go for that. It's not defined in TI's official ti83plus.inc for some reason, which is why I provided the other version first.
Ok, thanks for youre help!
This happend to me aswell at first. It only happens at OS 2.53 or higher.
It's just because the program terminates right after it's done with displaying the text. Then, the OS takes over, creating a new layer in MathPrint. This erases everything that was there first, so it deletes the whole Hello world. A way to solve this is putting a b_call(_getKey) at the end, downgrading your calculator, or setting it to CLASSIC in the mode menu temporarly.
arriopolis wrote:
This happend to me aswell at first. It only happens at OS 2.53 or higher.
It's just because the program terminates right after it's done with displaying the text. Then, the OS takes over, creating a new layer in MathPrint. This erases everything that was there first, so it deletes the whole Hello world. A way to solve this is putting a b_call(_getKey) at the end, downgrading your calculator, or setting it to CLASSIC in the mode menu temporarly.
Thanks very much for explaining that; I don't think I would have been able to figure that out otherwise. OS 2.53 is such a travesty. Sad I should really make Doors CS automatically turn on CLASSIC mode before executing ASM programs, come to think of it.
KermMartian wrote:
arriopolis wrote:
This happend to me aswell at first. It only happens at OS 2.53 or higher.
It's just because the program terminates right after it's done with displaying the text. Then, the OS takes over, creating a new layer in MathPrint. This erases everything that was there first, so it deletes the whole Hello world. A way to solve this is putting a b_call(_getKey) at the end, downgrading your calculator, or setting it to CLASSIC in the mode menu temporarly.
Thanks very much for explaining that; I don't think I would have been able to figure that out otherwise. OS 2.53 is such a travesty. Sad I should really make Doors CS automatically turn on CLASSIC mode before executing ASM programs, come to think of it.

I tried it on other calcs around the classroom, some of which still had 2.30.Smile It all worked, exept for the ones with 2.53MP... (2.55 didn't exist yet). So I though about how this could happen, came to the theory above, and tried it... it worked!
What else is wrong with the 2.53MP than this? I don't see why this is such a travesty, it's just... kinda... normal behaviour after all...
There is a lot wrong with 2.53MP. It breaks how parser hooks work with Op1 and flags; Doors CS contains a hackish workaround that deals with this. It has quite a few crashing glitches and bugs as well.
I had issues with dumping the ROM of my calc running 2.53MP using TiLP. Turning it to classic mode fixed it, along with other asm programs.
AHelper wrote:
I had issues with dumping the ROM of my calc running 2.53MP using TiLP. Turning it to classic mode fixed it, along with other asm programs.
Whoa, how could that affect ROM dumping? More and more I'm thinking that Doors CS needs to automatically turn on Classic mode unless specifically instructed not to do so. Sad My main constraint preventing that is lack of space in the Options menu. Maybe I could make it a Display option...?
  
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