Re: [M100] Notoriously S.L.O.W BASIC posted - help speeding it up appreciated

2022-10-27 Thread B 9
On Thu, Oct 27, 2022 at 8:51 AM MikeS wrote: > It might not be so bad on a 200 but my main annoyance is having to > scroll up and down on the M100's 8 line screen; as a matter of fact the > larger screen was the main reason I bought a DVI when they came out. > When they came out? I wonder if th

Re: [M100] Notoriously S.L.O.W BASIC posted - help speeding it up appreciated

2022-10-27 Thread Joshua O'Keefe
> On Oct 27, 2022, at 8:39 PM, B 9 wrote: > 200 REM Print 2 hexits In all my years, this is the first time I have seen the term "hexit." From the code it's apparently another way of describing a hex representation of a nibble! Quite a good couple of days for learning from the list, that's for

Re: [M100] Notoriously S.L.O.W BASIC posted - help speeding it up appreciated

2022-10-27 Thread B 9
P.S. I forgot to put in `18 TS$=TIME$`, so the timing is inaccurate. Once I got that corrected it does seem like PEEKing at the bytes in the integer is faster than dividing by 4096. On Thu, Oct 27, 2022 at 8:38 PM B 9 wrote: > On Thu, Oct 27, 2022 at 3:04 PM John R. Hogerhuis > wrote: > >> >> W

Re: [M100] Notoriously S.L.O.W BASIC posted - help speeding it up appreciated

2022-10-27 Thread B 9
On Thu, Oct 27, 2022 at 3:04 PM John R. Hogerhuis wrote: > > With hex it's a question though since MOD 16 can be done with AND 15 which > is probably faster than a general integer 16 modulus. There's no bitshift > operator so you still need a integer divide by 16%. Who knows how efficient > an in

Re: [M100] Notoriously S.L.O.W BASIC posted - help speeding it up appreciated

2022-10-27 Thread Mike Stein
I don't see where it makes much difference In general in BASIC but in this case there is a justification for MSB first ;-) It goes from MSB to LSB because the same routine does 4 or 2 digits depending on where you enter; line 5 gives the 4 digit address and it falls through to line 7 which also giv

Re: [M100] Compute a 16-bit signed value in BASIC

2022-10-27 Thread MikeS
Yeah, i try to avoid IF..THEN wherever I can, especially if it requires an extra line. It does give some strange-looking code though, like line 40 in the HEX to decimal conversion in my dump program that conditionally converts the from/to address digits to upper case if necessary by subtracting

Re: [M100] Notoriously S.L.O.W BASIC posted - help speeding it up appreciated

2022-10-27 Thread John R. Hogerhuis
On Thu, Oct 27, 2022 at 1:10 PM MikeS wrote: > More good tips, thanks. Yes, I have to look at defining the various types, > especially the ones that can go above 32768. > > Concatenation with '+' is a habit from other languages I've worked with; > as a matter of fact in most cases the M100 lets y

Re: [M100] Compute a 16-bit signed value in BASIC

2022-10-27 Thread John R. Hogerhuis
I was curious if loading a string pointer could be done without an explicit IF. Seems like what we're doing is J as LSB, K as MSB K>127: J + K*256-65536 or K<=127: J + K*256 - 0 Taking J + K * 256 - 65536 factoring out 256 and putting both functions in a similar form: K > 127: J + 256 ( K - 25

Re: [M100] Notoriously S.L.O.W BASIC posted - help speeding it up appreciated

2022-10-27 Thread MikeS
More good tips, thanks. Yes, I have to look at defining the various types, especially the ones that can go above 32768. Concatenation with '+' is a habit from other languages I've worked with; as a matter of fact in most cases the M100 lets you print without any separators at all, e.g. print A$

Re: [M100] Notoriously S.L.O.W BASIC posted - help speeding it up appreciated

2022-10-27 Thread John R. Hogerhuis
On Thu, Oct 27, 2022, 12:14 PM MikeS wrote: > Good tips. > > DEFINT a-z reduced the time to print 50 lines from 61 seconds to 51 > > I'd also forgotten about integer division; that reduced it another 4 > seconds to 47. > > Any more ideas? > > m > Seems like you can declare constants in expressio

Re: [M100] Notoriously S.L.O.W BASIC posted - help speeding it up appreciated

2022-10-27 Thread MikeS
Good tips. DEFINT a-z reduced the time to print 50 lines from 61 seconds to 51 I'd also forgotten about integer division; that reduced it another 4 seconds to 47. Any more ideas? m - Original Message - From: B 9 To: m...@bitchin100.com Sent: Thursday, October 27, 2022 1:16 A

Re: [M100] Notoriously S.L.O.W BASIC posted - help speeding it up appreciated

2022-10-27 Thread MikeS
Hi, It might not be so bad on a 200 but my main annoyance is having to scroll up and down on the M100's 8 line screen; as a matter of fact the larger screen was the main reason I bought a DVI when they came out. The keyboard is definitely better than most laptops but I prefer a good solid desk

Re: [M100] Notoriously S.L.O.W BASIC posted - help speeding it up appreciated

2022-10-27 Thread MikeS
Thanks; that was on my mental list of possible speedups. Speaking of, I ran into the same signed integer issue as John, i.e. MOD can only deal with values up to 32768. What you say about GOTO and GOSUB is interesting; that suggests that they should always be forward references as opposed to bei

Re: [M100] Compute a 16-bit signed value in BASIC

2022-10-27 Thread Ken Pettit
On 10/26/22 11:50 PM, John R. Hogerhuis wrote: On Wed, Oct 26, 2022 at 4:57 PM Ken Pettit > wrote: You have to make it a negative number by subtracting it from 65536: 20 H$="0123456789ABCDEF": D=VARPTR(H$)+1:IFPEEK(D+1)>127THENC=65536-256*PEEK(D+1)-PE