Questions with Asm in 28 days as they come up...


First question- Hello world program-


Code:
.nolist
#include "ti83plus.inc"
#define    ProgStart    $9D95
.list
.org    ProgStart - 2
    .db    t2ByteTok, tAsmCmp
    b_call(_ClrLCDFull)
    ld    hl, 0
    ld    (PenCol), hl
    ld    hl, msg
    b_call(_PutS)            ; Display the text
    b_call(_NewLine)
    ret

msg:
    .db "Hello world!", 0
.end
.end


I get it to run with no errors, but it does not display anything. I get a space, then the 'done' message...

I googled around and tried hotdog's hello world program,


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"


and that worked perfectly. Is it because 28 days was written using TASM? Would would I need to change?


My setup is using SPASM assembler and Wabbitemu

Thank you for your time,
Any help is appreciated,

Blackhawk[/code]
Honestly, you should use the asm in 28 days. It is still the most complete set of tutorials, and if there is a problem with them, or something you don't understand, I'd highly recommend you start a topic like 'blackhawk's asm questions thread!' or something of the like. Or, you could even rename this thread (or one of us admins could do it for you) and you could use this thread to ask your questions, which would help cut down on the clutter Smile
Yep, I agree that ASM in 28 Days is still the best of the options out there. I have huge problems with Hot Dog's tutorials, from the fact that it focuses on writing games to the fact that it waits to the end to discuss binary and hex (though I respect the man for making the effort to improve the variety of tutorials). I generally recommend the Doors CS SDK for compiling instead of the vastly outdated TASM + DevPac8x combination. Also, we're gradually working on updating ASM in 28 Days, but we're all very busy.
Another great resource for learning a bit about assembly and how to actually do things in assembly (and not call routines that do all the work for you) is CoBB's z80 guide.

For assembling, i personally use spasm. It's really tiny and fast.

I second the idea to open up a thread with any and all questions you might have or come across while learning assembly. It's a great way to learn, and since z80 assembly doesn't seem to be in huge demand these days most of us are self-taught, though in a way we've really learned as a community, asking and answering each others' questions and sharing ideas.
That's really helpful - I wish I had known about this a while ago. However:
chickendude wrote:
Another great resource for learning a bit about assembly and how to actually do things in assembly (and not call routines that do all the work for you) is CoBB's z80 guide.

Is it best to learn without calling the ROM or is it really just re-inventing the wheel? Also is it possible to disassemble said routines for learning purposes ?

chickendude wrote:
I second the idea to open up a thread with any and all questions you might have or come across while learning assembly. It's a great way to learn, and since z80 assembly doesn't seem to be in huge demand these days most of us are self-taught, though in a way we've really learned as a community, asking and answering each others' questions and sharing ideas.


Yes - this would be helpful for everyone and perhaps could be used as a model for other learners.
ti83head wrote:
Is it best to learn without calling the ROM or is it really just re-inventing the wheel?


I think it's more of a case where you should learn how basic tasks like integer multiplication, drawing pixels, and other things work under the hood. Sure, you could rely only on ROM calls for math and drawing, but that would remove a ton of the speed benefits that assembly sees over Basic.
What Kaslai said.

It's also a nice to think about how things work. You'd be surprised how complicated it can be to display a "Hello World!" string in assembly without BCALLs, but once you realize how it actually works it's easy to create really robust text routines that do a lot of work for you (like displaying stats in-string), automatic text wrapping, etc.

Try using system routines to display your score while playing, for example, and you'll see how much it slows down the game. If you write your own, you'll have an easy way to display numbers and it'll be much faster.

When you start thinking about how certain routines work, in addition to the speed benefit you often think of ways to make them better. And the more things you know how to do, the more things you'll be able to do 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