Author Topic: Unknown problem with add two numbers program  (Read 3195 times)

0 Members and 1 Guest are viewing this topic.

Offline lue

  • LV0 Newcomer (Next: 5)
  • Posts: 2
  • Rating: +0/-0
  • 42
    • View Profile
Unknown problem with add two numbers program
« on: October 17, 2011, 09:07:17 pm »
I have just started learning assembler for my TI-84+SE using Hot Dog's TI-83+ Z80 ASM tutorial, and I can't seem to get my first assembler program to work. I compiled it with spasm and used binpac8x.py to turn the resulting output into an .8xp file. I then load this in TilEm and executing it causes TilEm to show its "calculator off" screen and an infinite stream of output in the terminal I started TilEm from.

Here is my current addupL.asm file (the ti83plus.inc comes straight from Hot Dog's zip file):
Code: [Select]
#include "ti83plus.inc"

.org 40399

.db t2ByteTok, tAsmCmp

bcall(_ClrLCDFull)
ld a, 1
; solve problem 1+5
add a, 5
ld h, 0
ld l, a

bcall(_DispHL)
bcall(_getKey)
bcall(_ClrLCDFull)

ret

Since I've just started, I can't tell if there's a problem in the code itself or in the build process itself. Any ideas?
Yes.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Unknown problem with add two numbers program
« Reply #1 on: October 17, 2011, 09:29:44 pm »
One thing I notice is that _DispHL is called just before _ClrLCDFull. Are you sure _getkey is blocking?
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Unknown problem with add two numbers program
« Reply #2 on: October 17, 2011, 10:31:49 pm »
It is indeed blocking. It will wait until a key (or key combo, like 2nd+3) is pressed. (On a related note, use _GetKeyRetOff instead; _GetKey can create memory leaks if you use it to turn off the calc during the program. Unless you're using the unmodified form of ti83plus.inc direct from TI, ti83plus.inc should have it.)
The program looks like it should work; flow is linear!
Though it shouldn't make a difference, the .org line should have 40339, not 40399. Change that just to make sure. Also, if you think it might be TiLem, try it on your calc just to be sure.
Edit: 2100th post!
« Last Edit: October 18, 2011, 06:20:12 pm by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline lue

  • LV0 Newcomer (Next: 5)
  • Posts: 2
  • Rating: +0/-0
  • 42
    • View Profile
Re: Unknown problem with add two numbers program
« Reply #3 on: October 19, 2011, 01:44:26 am »
The .org number was just a typo on my part, although changing it didn't fix the problem.

There's no _GetKeyRetOff in my ti83plus.inc (although at this point it's not necessary, and if I need it later I can just add it to the include)

It crashed just as badly on my calculator as in the emulator, so at least it wasn't the emulator. Since the program is straightforward, I think it's something wrong in spasm or binpac8x. Since spasm has a decent reputation, I'm inclined to think binpac8x is messing up when it creates the .8xp. I'll look over binpac8x now, but does anyone know for sure if either of these has problems?
Yes.