The Museum of HP Calculators

HP Forum Archive 20

[ Return to Index | Top of Index ]

Android: 15C Scientific Calculator
Message #1 Posted by Howard Owen on 21 Sept 2011, 3:49 p.m.

The first and only 15C emulator on Android is from Vicinno Soft. They also have a 12C emulator on Android. With all the talk of the GSB -I bug, I figured it would be a good test to try to try on the Android app. I wrote the following test program:

001    42,21,11      LBL A
002    0             0
003    43,30, 0      TEST 0
004    43  32        RTN
005    3             3
006    16            CHS
007    44 25         STO[I]
008    32 25         GSB[I]
009    31            R/S

edit: align columns properly.

On my classic 15C in FIX 4, I run the program like this:

[f][A]    - see "-3.0000" 
[g][P/R]  - see "000 -"

We load zero in line 2, then test for != 0. This is false, so we skip the return instruction. Lines 005 through 007 load -3 into [I]. After line 008, a branch is taken to line 3, which tests for !=0. This time the test is true, and the calculator executes a RTN. In line with the observed bug, this transfers execution to the line immediately after line 003, the GSB-I target. In other words, the RTN is executed again. When we switch to program mode, we see the PC is at line 000, just as if we had executed RTN without a pending GSB call.

I get identical results on the Android app. So this program is an emulator, rather than a simulator.

Edited: 21 Sept 2011, 5:26 p.m. after one or more responses were posted

      
RTN two levels!
Message #2 Posted by Howard Owen on 21 Sept 2011, 5:20 p.m.,
in response to message #1 by Howard Owen

*ahem* This is a return stack pop, right? Might be useful after all.

            
Re: RTN two levels!
Message #3 Posted by Howard Owen on 21 Sept 2011, 7:00 p.m.,
in response to message #2 by Howard Owen

I'm nested in two levels of self-reply calls. :)

001    42,21,11      LBL A
002    32 1          GSB 1
003    31
004    42,21, 2      LBL 2
005    0             0
006    43,30, 0      TEST 0
007    43  32        RTN
008    6             6
009    16            CHS
010    44 25         STO[I]
011    32 25         GSB[I]
012    42,21, 1      LBL 1
013    22  2         GTO 2    

[f][A] then [g][P/R] and see "004 42,21, 2 ".

Single step reveals that this works:

001    42,21,11      LBL A
002    32 1          GSB 1
012    42,21, 1      LBL 1
013    22  2         GTO 2    
004    42,21, 2      LBL 2
005    0             0
006    43,30, 0      TEST 0
008    6             6
009    16            CHS
010    44 25         STO[I]
011    32 25         GSB[I]
007    43,30, 0      TEST 0      Incorrect line number - really line 6.)
008    43  32        RTN         Really line 7 and it returns to one past the GSB target
                                 instead of one past where GSB was called
007    43  32        RTN         Right line#
003    31            R/S         Second RTN behaves correctly.

edit: change conclusion. It doesn't pop, it sizzles. :)

Conclusion: You only ever need one RTN instruction in a program! GSB [I] to the line before the RTN. The RTN will execute twice, and you will end up at the proper place for the GSB pending when you called GSB[I].

Bleh - trading RTNs for GSBs. Bet it's a net loss in memory.

Edited: 21 Sept 2011, 7:20 p.m. after one or more responses were posted

      
Re: Android: 15C Scientific Calculator
Message #4 Posted by Todd Garabedian on 21 Sept 2011, 5:48 p.m.,
in response to message #1 by Howard Owen

I'll be impressed when I see a decent HP emulator for the iPad. So far, the best one I've found is i41CX,and it's very cool since it also implements the keyboard overlays and plugin modules. The premium version also adds an emulator of the HP 82240B IR printer, complete with sound.

I'd love to find a good Voyager emulator that takes advantage of the iPad screen. The iPhone apps like this one let you enlarge the screen to fit the iPad, but the display is all pixelated. I don't like pixelated. :)

            
Re: Android: 15C Scientific Calculator
Message #5 Posted by Howard Owen on 21 Sept 2011, 7:04 p.m.,
in response to message #4 by Todd Garabedian

I have three 15C emulators on my iPod. I haven't been using it much for the last year, so there may well be more than that in the app store.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall