Author Topic: How are exceptions handled?  (Read 4277 times)

0 Members and 1 Guest are viewing this topic.

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
How are exceptions handled?
« on: July 03, 2011, 03:29:00 pm »
How does ndless handle exceptions? I specifically want to know about [explosion]divide by zero.[/explosion]

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: How are exceptions handled?
« Reply #1 on: July 03, 2011, 03:49:47 pm »
If the ARM is anything like the SuperH (which it very much is) then no automatic exception is generated for divide by 0. Instead an undefined result is what happens. For an exception there must be a specific test for 0 before division begins. This would be done as a conditional statement and not as an internal exception processing. I would though confirm this with someone who actually does low-level nspire dev such as calc84

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: How are exceptions handled?
« Reply #2 on: July 03, 2011, 04:01:29 pm »
So what would the value of undefined be? So I can check for it and abort the iteration of the loop it is in.

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: How are exceptions handled?
« Reply #3 on: July 03, 2011, 04:07:39 pm »
mathematically speaking it should be infinity or negative infinity which floating points represent properly but for integers I believe it would just be 0 but once again I'm not sure.

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

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: How are exceptions handled?
« Reply #4 on: July 03, 2011, 04:30:02 pm »
Ndless might actually generate "exceptions" because of how compilers handle floating point arithmetic. These of course wouldn't be hardware exceptions without an FPU, but it might be possible to catch them.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ