[DM15L M1B V28] Can't jump past line 448

If you think you've found a bug in one of these machines, post about it here indicating the steps you perform in order to reproduce it.

Please prefix your topic with the model number in question and firmware version this way:

[DM16 V22] CHS gives unexpected results
michaelzinn
Posts: 41
Joined: Tue Apr 10, 2018 11:34 pm

[DM15L M1B V28] Can't jump past line 448

Post by michaelzinn »

You can't jump past line 448 using the index register even if your program is large enough, e.g. over 800 lines of code. I guess this is because the original calculator could not have more than 448 lines of program memory, ever.

You can test it with this program (Hammurabi BASIC game) either by running "B" and hitting R/S until it tries to jump to line 645 and crashes or just adding 600 CHS STO I GTO I to the start.

Code: Select all

DM15_M1B
04  000000fffff000  00000000000008  0000000000000c  00000000000eae
08  00000000000000  2faf8befbe2280  00000000000000  00000000000000
14  00000000000000  1b2d2d2d2d2d2d  00000000000282  00000000000000
18  00000000000000  0000000000007f  00000000a00000  00000000000000
80  00000000000000  00000000000000  0000000000c220  f4f538ff2020f3
84  f538ff20f2f538  ff20f1f538ff20  ebfca1fcf8c039  20f0f538ff20f9
88  f438ff8897c3f0  f1f820f8f438ff  20f7f438ff20f6  f438ff8897c3f0
8c  f1f820f5f438ff  20f4f438ff8878  f0f13797c3f2f8  f78877f35097c3
90  f2f8f78878f937  97c3f4f6f78877  f0f15097c3f4f6  f78878f73797c3
94  f7f9f58877f3f3  5097c3f7f9f520  f3f438ff203720  f2f438ff47fd39
98  3020f1f438ff20  3320f0f438ff20  f9f338ff205020  f8f338ff8897c3
9c  f0f1f820f7f338  ff20f6f338ffb2  41faf1ebfcf5a1  b220f5f338ff20
a0  3020f4f338ffb2  20f3f338ff2052  20f2f338ff8897  c3f0f1f820f1f3
a4  38ff20f0f338ff  20f9f238ff20f8  f238ff203220f7  f238ff8897c3f5
a8  f543fa32334931  60fd54fafd39fc  f0f0f132fc50fb  f1548877fc39f5
ac  f4c03297c3f7f8  f542fb31398878  313997c3f3f561  ebfcfbf3c0fca1
b0  f2c1f0f141ebfd  f0f25146ebfaf1  fdf0f0f1fd39fc  fa52fc30f0f231
b4  8997c3f7f3f662  fa35fb345244eb  fd31528876fdf2  31ebfdf23197c3
b8  f5f8f48997c3f7  f3f644f045fc53  3263318997c3f7  f3f662fbebfdf2
bc  32528897c3f0f4  f320f6f238ff20  3920f5f238ff88  78fc39f0f13297
c0  c3f9f3f48897c3  f0f4f38997c3f5  f1f688ed52ebfd  f23297c3f1f1f4
c4  8897c3f0f4f389  97c3f6f2f688ed  303297c3f7f8f3  8878f03297c3f5
c8  f4f68875f03297  c3f6f4f44249ff  c239ff20f4f238  ff41f162fb5152
cc  8897c3f6f9f289  97c3f5f1f688ed  525197c3f4f3f3  8878f05197c3f5
d0  f4f66149ffc239  ff20f3f238ff41  f062fafc515352  40fb51308897c3
d4  f6f4f28997c3f6  f2f68878305197  c3f4f8f28878f0  5197c3f5f4f661
d8  49ffc239ff20f2  f238ff8897c3f6  f9f241f062fbfc  51535240fa5130
dc  8875f05197c3f6  f4f28897c3f9f7  f18997c3f5f1f6  88ed52fc515397
e0  c3f9f1f28878f0  5197c3f5f4f661  49ffc239ff20f1  f238ff20f5f138
e4  ff205320f0f238  ff63faf7f13141  ebfca1f0f18875  f1f15497c3f9f5
e8  f620f9f138ff20  5220f8f138ff20  f7f138ff203420  f6f138ff20f5f1
ec  38ff205320f4f1  38ff20f3f138ff  203020f2f138ff  203920f1f138ff
f0  20f0f138ff49eb  fdf2398877f051  97c3f2f0f149fa  363920f938ff20
f4  3620f838ff2032  20f738ff205420  f638ff64faf154  20f538ff42f061
f8  f146f540fd5335  63f344fb523545  f0f0f0f362f0f0  f8f249f5f964f0
fc  60f043f020f438  ff20f338ff20f2  38ff2020f138ff  200bb248ffc200
A: 000000fffff000  B: 000000fffffeae  C: 00000000000eae
S: 00000000000000
M: 395033178ff000  N: 00000000000000  G: 04
Last edited by michaelzinn on Tue May 21, 2019 6:28 pm, edited 1 time in total.
rprosperi
Posts: 1703
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: [DM15L M1B V25] Can't jump past line 448

Post by rprosperi »

Suggest you update the f/w in your DM15. It appears you are running V25, but there have been 3 releases since then, including at least one fix which corrected (a possibly unrelated) bug pertaining to extended memory access for the DM15_M80 and DM15_M1B configurations. I'm not saying this will fix the limit you've shown here, only that it's possible it will, and it's enough to update, so why not check it out with V28?
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
michaelzinn
Posts: 41
Joined: Tue Apr 10, 2018 11:34 pm

Re: [DM15L M1B V25] Can't jump past line 448

Post by michaelzinn »

rprosperi wrote:
Tue May 21, 2019 3:13 am
[...] why not check it out with V28?
Thanks for the hint, I updated to DM15 M1B V28 and still get the same error (Can't jump to line numbers above 448, neither with GTO nor with GSB)
rprosperi
Posts: 1703
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: [DM15L M1B V25] Can't jump past line 448

Post by rprosperi »

michaelzinn wrote:
Tue May 21, 2019 6:32 pm
Thanks for the hint, I updated to DM15 M1B V28 and still get the same error (Can't jump to line numbers above 448, neither with GTO nor with GSB)
I suspected not, but at least now it's clear. I'm sure it is indeed a limitation of the ROM code that only envisioned a certain amount of RAM. Though SM has been able to extend RAM use for register storage, I'm sure the Matrix and Program Execution code is far too intricate (and no doubt optimized as well) to try to reverse engineer.
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
michaelzinn
Posts: 41
Joined: Tue Apr 10, 2018 11:34 pm

Re: [DM15L M1B V25] Can't jump past line 448

Post by michaelzinn »

rprosperi wrote:
Tue May 21, 2019 8:42 pm
michaelzinn wrote:
Tue May 21, 2019 6:32 pm
Thanks for the hint, I updated to DM15 M1B V28 and still get the same error (Can't jump to line numbers above 448, neither with GTO nor with GSB)
[...] I'm sure the Matrix and Program Execution code is far too intricate (and no doubt optimized as well) to try to reverse engineer.
I suspect that you just have to change a 448 in the code to a 999. I had a look at the firmware hex file and 01C0 doesn't appear that often, so I guess it's possible to figure out which one of those does the "GTO I" check.

To clarify, only jumping to line numbers fails above 448; Jumping to a label works, so it's possible to run program code above 448. It's only the range check that is faulty.
keithdalby
Posts: 564
Joined: Mon Apr 24, 2017 8:38 pm

Re: [DM15L M1B V28] Can't jump past line 448

Post by keithdalby »

Right, but SwissMicros don't have the source code, just the ROM (I think)
rprosperi
Posts: 1703
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: [DM15L M1B V28] Can't jump past line 448

Post by rprosperi »

keithdalby wrote:
Tue May 21, 2019 10:23 pm
Right, but SwissMicros don't have the source code, just the ROM (I think)
No one, including HP, has the 15C source code any more...

A good question to ask though is how important is this really? DM15's (both cc and L flavors) have been sold for 5+ years, and this is the first time this has even come up. To see it from SM's viewpoint, how many more will be sold if the work is even feasible? I'm certain that if justified, it could be done, but is it of sufficient relative priority that it should be done.

Please don't misunderstand me, I'm not criticizing your (michaelzinn) implied request to have this 'fixed', everyone is free to make suggestions for improvements that are important to them, and who knows, perhaps it is a trivial fix (though QA to verify nothing else breaks would be non-trivial) so it's well worth it to discuss it publicly. I'm just weighing in with my own view about it's relative importance to me.
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
michaelzinn
Posts: 41
Joined: Tue Apr 10, 2018 11:34 pm

Re: [DM15L M1B V28] Can't jump past line 448

Post by michaelzinn »

rprosperi wrote:
Wed May 22, 2019 12:08 am
[...]A good question to ask though is how important is this really? DM15's (both cc and L flavors) have been sold for 5+ years, and this is the first time this has even come up. To see it from SM's viewpoint, how many more will be sold if the work is even feasible? I'm certain that if justified, it could be done, but is it of sufficient relative priority that it should be done.[...]
Okay, let's look at this in more detail:

Is it a bug?
Definitely, GTO I no longer works like on a HP15c and the Error 4 you get no longer matches the description on the back of the calculator "LBL?,GTO>MEM,PRGM>MEM", it should be "LBL?,GTO>MEM,GTO>448,PRGM>MEM", which would be very ugly.

Should it be fixed?
That's up to SwissMicros of course, since the bug only happens in situations that are impossible on a HP15c and most people probably won't write large programs for the calculator anyway (I bought it as a programming toy, but serious people who would want to write large programs would probably buy the DM42 instead). But consider these two possible descriptions of the DM15L:

1. "The DM15L is like a HP15c with more memory"

2. "The DM15L is like a HP15c with more memory which you can use to allocate up to 100 registers, you can use matrices larger than 8x8, but they might lock your calculator and you can't solve or invert them, you can use up to 999 lines of program memory, but you can only jump to lines above 448 by label, not by line number."

The first one is obviously the nicer product (because it's easy to understand what you get and it's more capable) so I guess the best strategy is to get as close to (1) with the least amount of work. Given that changing matrices and register count seems to be much work I'd probably leave them as-is. As for jumping to line numbers: Who knows? Hopefully it's just one number in the firmware that can be changed easily. If not, oh well, guess I'll have to stop playing.

Why jump to line numbers anyway?
Because there are only 25 labels, which is fine for small programs but not for large ones like this one: http://vintage-basic.net/bcg/hammurabi.bas
rprosperi
Posts: 1703
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: [DM15L M1B V28] Can't jump past line 448

Post by rprosperi »

I'm glad you took my comments in the spirit intended.

I think you make a good case, and would agree that a limited attempt to correct this limitation by simply changing the 'max line number' constant is justified. If it is that simple (from an immediate 'yes that single change seems to work' viewpoint) and it withstands additional testing, I'd agree the change is justified. Though by no means do I have any expertise about f/w design regarding such things, I remain doubtful the change could be that simple; hopefully I'm simply too cynical. Maybe folks with such experience could weigh in here?

Still, I'd suggest you email David with just such a proposal, including the addresses where you've identified the constant and an offer to do some extensive testing.
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
grsbanks
Posts: 1122
Joined: Tue Apr 25, 2017 11:23 am
Location: Preston, Lancs, UK
Contact:

Re: [DM15L M1B V28] Can't jump past line 448

Post by grsbanks »

This is already on David's radar. I drew his attention to it yesterday :)
There are only 10 kinds of people in the world: those who understand binary and those who do not.
Post Reply