_player1537 wrote:
Except hEx is the wrong way to program for a beginner, but I digress Razz


I had no choice, I learnt hEx before I knew it was actually Assembly.
_player1537 wrote:
Except hEx is the wrong way to program for a beginner, but I digress Razz
I agree, but David didn't find that very helpful; cf. this post for his thoughts about it.
I was just saying that because your post said that "hEx was programming". Either way, beating a dead horse now Razz (That is the right phrase... right?)

ScoutDavid, do you have any other questions about ASM? It seems like the last thing you were working on was being able to check for other keys using mnemonics, is that right?
I believe that is indeed correct; how is the progress? Are you still working on honing the strength of your ASM coding?

Code:
.nolist
#include "ti83plus.inc"
#include "dcs7.inc"
.list
   .org userMem-2
   .db $BB,$6D
Init:

  B_CALL _ClrLCDFull
 
Loop:

  ld b,8    ;Height of Image
  ld a,0    ;X
  ld l,0    ;Y
  ld h,0
  push hl
  ld ix,Image
 
  call iPutSprite
  call iFastCopy
 
  B_CALL _getKey
 
  jr Loop
 
  ret
 
Image:
   .dw $7E
   .db $81
   .db $81
   .db $81
   .db $81
   .db $81
   .db $81
   .db $7E


We can't have infinite loops in ASM?

This code compiles but when I run in Wabbit, it opens the Debugger.
We can, but why would you use them? They just freeze your calc.
By the way, why do you have .dw $7E at the start of your pic hexidecimal?
You push hl without popping. That's bad; it means you'll overflow the stack within about 200 iterations at most.
^^ that would be it. the stack is just overflown
aeTIos wrote:
^^ that would be it. the stack is just overflown
Good point about the .dw, too, although that would just add an extra junk $00 line in his sprite, which hopefully he would notice.

Code:
.nolist
#include "ti83plus.inc"
#include "dcs7.inc"
.list
   .org userMem-2
   .db $BB,$6D
Init:

  B_CALL _ClrLCDFull
 
Loop:

  ld b,8    ;Height of Image
  ld a,0    ;X
  ld l,0    ;Y
  ld h,0
  ld ix,Image
 
  call iPutSprite
  call iFastCopy
 
  B_CALL _getKey
 
  jr Loop
 
  ret
 
Image:
   .dw $7E
   .db $81
   .db $81
   .db $81
   .db $81
   .db $81
   .db $81
   .db $7E


This code crashes too.
What do you mean, it crashes? The WabbitEmu debugger coming up means that it found a breakpoint that you set, not that the program crashed. That's going to crash because it's missing a DCS header, though.

Code:
.nolist
#include "ti83plus.inc"
#include "dcs7.inc"
.list
   .org userMem-2
   .db $BB,$6D
Init:

  B_CALL _ClrLCDFull
  B_CALL _getKey
  ret


This works perfectly. (look at the header)


Code:
.nolist
#include "ti83plus.inc"
#include "dcs7.inc"
.list
   .org userMem-2
   .db $BB,$6D
Init:

  B_CALL _ClrLCDFull
 
Loop:

  ld b,8    ;Height of Image
  ld a,0    ;X
  ld l,0    ;Y
  ld h,0
  ld ix,Image
 
  call iPutSprite
  call iFastCopy
 
  B_CALL _getKey
 
  jr Loop
 
  ret
 
Image:
   .dw $7E
   .db $81
   .db $81
   .db $81
   .db $81
   .db $81
   .db $81
   .db $7E


This opens the wabbitemu debugger.
I just answered this! Shock You're calling iPutSprite and iFastCopy, which are Doors CS functions, without using the Doors CS header to make sure that the table that defines those functions actually gets created by Doors CS (and prevents the program from being run if DCS is not present).
"That's going to crash because it's missing a DCS header, though."

I thought you mean #include "dcs7.inc".

Eitherway, I ran it using DoorsCS and it worked.
ScoutDavid wrote:
"That's going to crash because it's missing a DCS header, though."

I thought you mean #include "dcs7.inc".
Not quite. This is what you need to be using:

http://dcs.cemetech.net/index.php?title=ASM_Header

Code:
.nolist
#include "ti83plus.inc"
#include "dcs7.inc"
.list
   .org progstart
   .db $BB,$6D
Init:


That doesn't work when I don't include "dcs7.inc", and I only include it sometimes.
Of course it doesn't work when you don't include dcs7.inc, because that's what defines .org progstart. You need to include it all the time, and you need to include it for all of the Ion, MOS, and DCS functions anyway. Just copy-paste the standard header from the SDK page that I linked you to if you like.
KermMartian wrote:
Of course it doesn't work when you don't include dcs7.inc, because that's what defines .org progstart. You need to include it all the time, and you need to include it for all of the Ion, MOS, and DCS functions anyway. Just copy-paste the standard header from the SDK page that I linked you to if you like.


I like my header, cos I can just include dcs7.inc or not if I want to use it or not without changing anything else in the header.
If you plan to upload your programs, you must use the official Doors CS header so people won't accidentally execute it from other shells.
souvik1997 wrote:
If you plan to upload your programs, you must use the official Doors CS header so people won't accidentally execute it from other shells.
Exactly. That's part of the point of the header, plus it lets you have an icon and description.
  
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
» Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next
» View previous topic :: View next topic  
Page 7 of 10
» 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