Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #2471 > unrolled thread

qsort for 65c02

Started bywssimms@gmail.com
First post2016-03-10 07:34 -0800
Last post2016-03-21 01:40 -0500
Articles 15 on this page of 55 — 9 participants

Back to article view | Back to comp.sys.apple2.programmer


Contents

  qsort for 65c02 wssimms@gmail.com - 2016-03-10 07:34 -0800
    Re: qsort for 65c02 qkumba <peter.ferrie@gmail.com> - 2016-03-10 09:10 -0800
    Re: qsort for 65c02 gids.rs@sasktel.net - 2016-03-10 17:23 -0800
      Re: qsort for 65c02 gids.rs@sasktel.net - 2016-03-10 19:13 -0800
      Re: qsort for 65c02 "Michael J. Mahon" <mjmahon@aol.com> - 2016-03-10 19:37 -0800
        Re: qsort for 65c02 wssimms@gmail.com - 2016-03-10 21:37 -0800
          Re: qsort for 65c02 gids.rs@sasktel.net - 2016-03-11 12:43 -0800
            Re: qsort for 65c02 Michael J. Mahon <mjmahon@aol.com> - 2016-03-11 15:48 -0600
              Re: qsort for 65c02 gids.rs@sasktel.net - 2016-03-11 20:59 -0800
                Re: qsort for 65c02 gids.rs@sasktel.net - 2016-03-11 21:13 -0800
                  Re: qsort for 65c02 wssimms@gmail.com - 2016-03-11 21:19 -0800
            Re: qsort for 65c02 wssimms@gmail.com - 2016-03-12 07:15 -0800
              Re: qsort for 65c02 wssimms@gmail.com - 2016-03-12 07:25 -0800
              Re: qsort for 65c02 Michael J. Mahon <mjmahon@aol.com> - 2016-03-12 11:22 -0600
              Re: qsort for 65c02 gids.rs@sasktel.net - 2016-03-12 10:00 -0800
                Re: qsort for 65c02 Michael J. Mahon <mjmahon@aol.com> - 2016-03-12 14:09 -0600
                Re: qsort for 65c02 wssimms@gmail.com - 2016-03-12 22:17 -0800
                  Re: qsort for 65c02 Scott Hemphill <hemphill@hemphills.net> - 2016-03-13 09:03 -0400
                  Re: qsort for 65c02 gids.rs@sasktel.net - 2016-03-13 09:22 -0700
                    Re: qsort for 65c02 Michael J. Mahon <mjmahon@aol.com> - 2016-03-13 13:45 -0500
                      Re: qsort for 65c02 gids.rs@sasktel.net - 2016-03-13 19:01 -0700
                        Re: qsort for 65c02 wssimms@gmail.com - 2016-03-13 21:28 -0700
                          Re: qsort for 65c02 Michael J. Mahon <mjmahon@aol.com> - 2016-03-14 14:06 -0500
                        Re: qsort for 65c02 Michael Pohoreski <michael.pohoreski@gmail.com> - 2016-03-13 22:15 -0700
                          Re: qsort for 65c02 Michael J. Mahon <mjmahon@aol.com> - 2016-03-14 14:06 -0500
                        Re: qsort for 65c02 Michael J. Mahon <mjmahon@aol.com> - 2016-03-14 14:06 -0500
                  Re: qsort for 65c02 Michael J. Mahon <mjmahon@aol.com> - 2016-03-13 13:45 -0500
                    Re: qsort for 65c02 wssimms@gmail.com - 2016-03-13 15:46 -0700
                      Re: qsort for 65c02 Michael J. Mahon <mjmahon@aol.com> - 2016-03-14 14:06 -0500
    Re: qsort for 65c02 Michael Pohoreski <michael.pohoreski@gmail.com> - 2016-03-11 03:30 -0800
      Re: qsort for 65c02 gids.rs@sasktel.net - 2016-03-11 13:25 -0800
        Re: qsort for 65c02 Michael Pohoreski <michael.pohoreski@gmail.com> - 2016-03-14 16:24 -0700
          Re: qsort for 65c02 Michael J. Mahon <mjmahon@aol.com> - 2016-03-14 23:35 -0500
            Re: qsort for 65c02 gids.rs@sasktel.net - 2016-03-15 10:20 -0700
              Re: qsort for 65c02 Michael J. Mahon <mjmahon@aol.com> - 2016-03-15 17:30 -0500
            Re: qsort for 65c02 Michael Pohoreski <michael.pohoreski@gmail.com> - 2016-03-15 13:35 -0700
              Re: qsort for 65c02 gids.rs@sasktel.net - 2016-03-15 20:15 -0700
              Re: qsort for 65c02 gids.rs@sasktel.net - 2016-03-15 20:23 -0700
                Re: qsort for 65c02 Michael Pohoreski <michael.pohoreski@gmail.com> - 2016-03-16 10:33 -0700
                  Re: qsort for 65c02 wssimms@gmail.com - 2016-03-18 08:50 -0700
                    Re: qsort for 65c02 David Schmidt <schmidtd@my-deja.com> - 2016-03-18 12:37 -0400
                      Re: qsort for 65c02 wssimms@gmail.com - 2016-03-18 10:04 -0700
                    Re: qsort for 65c02 Michael Pohoreski <michael.pohoreski@gmail.com> - 2016-03-18 10:12 -0700
                      Re: qsort for 65c02 wssimms@gmail.com - 2016-03-18 10:33 -0700
                        Re: qsort for 65c02 Michael J. Mahon <mjmahon@aol.com> - 2016-03-18 13:01 -0500
                          Re: qsort for 65c02 wssimms@gmail.com - 2016-03-18 11:33 -0700
                            Re: qsort for 65c02 Michael J. Mahon <mjmahon@aol.com> - 2016-03-18 17:37 -0500
                    Re: qsort for 65c02 Michael Pohoreski <michael.pohoreski@gmail.com> - 2016-03-20 10:52 -0700
                      Re: qsort for 65c02 Michael J. Mahon <mjmahon@aol.com> - 2016-03-20 13:42 -0500
                        Re: qsort for 65c02 D Finnigan <dog_cow@macgui.com> - 2016-03-20 19:05 +0000
                          Re: qsort for 65c02 Michael J. Mahon <mjmahon@aol.com> - 2016-03-20 15:37 -0500
                        Re: qsort for 65c02 Michael Pohoreski <michael.pohoreski@gmail.com> - 2016-03-20 13:33 -0700
                          Re: qsort for 65c02 Michael J. Mahon <mjmahon@aol.com> - 2016-03-20 15:53 -0500
                      Re: qsort for 65c02 gids.rs@sasktel.net - 2016-03-20 18:40 -0700
                        Re: qsort for 65c02 Michael J. Mahon <mjmahon@aol.com> - 2016-03-21 01:40 -0500

Page 3 of 3 — ← Prev page 1 2 [3]


#2539

FromDavid Schmidt <schmidtd@my-deja.com>
Date2016-03-18 12:37 -0400
Message-ID<nchan1$h1g$1@dont-email.me>
In reply to#2535
On 3/18/2016 11:50 AM, wssimms@gmail.com wrote:
> By the way, when I start work on my virtual reality IBM 704 emulator, I'm commandeering you to help out with the graphics.

[Young girl dons VR goggles]
"This is an EBCDIC system!  I know this!"

[toc] | [prev] | [next] | [standalone]


#2541

Fromwssimms@gmail.com
Date2016-03-18 10:04 -0700
Message-ID<647cdc74-a0b7-441f-830e-186765c851fb@googlegroups.com>
In reply to#2539
Just BCD, no 'E' about it :-)

[toc] | [prev] | [next] | [standalone]


#2542

FromMichael Pohoreski <michael.pohoreski@gmail.com>
Date2016-03-18 10:12 -0700
Message-ID<b365ed1f-7e5e-45f7-8cf3-23cb9630e81a@googlegroups.com>
In reply to#2535
On Friday, March 18, 2016 at 8:50:36 AM UTC-7, wss...@gmail.com wrote:
> No problem, I found the thread interesting enough.
> I'd like to share more of what I'm doing but without context, most of what I could share now wouldn't make much sense.
> By the way, when I start work on my virtual reality IBM 704 emulator, I'm commandeering you to help out with the graphics.

Just a wee bit before my time ;-)  Doubt I'd be much help -- my interest / speciality / knowledge is Apple + 3D Graphics + OpenGL / WebGL.

Oh wow, they had big monitors back then :-)

* https://en.wikipedia.org/wiki/IBM_704

The IBM 740 Cathode Ray Tube Output Recorder was also available, which was a 21-inch vector display with a very long phosphor persistence time of 20 seconds for human viewing, together with a 7-inch display receiving the same signal as the larger display but with a fast-decaying phosphor brightness designed to be photographed with an attached camera

[toc] | [prev] | [next] | [standalone]


#2543

Fromwssimms@gmail.com
Date2016-03-18 10:33 -0700
Message-ID<f93528e4-7d81-41b3-a131-cd2b8a4fcd72@googlegroups.com>
In reply to#2542
Yeah right, you'll do the VR graphics bit.
I want to be able to reach out and flip those flippin' switches and watch the tap drives whirr.

Don't panic, this project is years in the future.

[toc] | [prev] | [next] | [standalone]


#2544

FromMichael J. Mahon <mjmahon@aol.com>
Date2016-03-18 13:01 -0500
Message-ID<7d2dnX1WpKf633HLnZ2dnUU7-e_NnZ2d@giganews.com>
In reply to#2543
<wssimms@gmail.com> wrote:
> Yeah right, you'll do the VR graphics bit.
> I want to be able to reach out and flip those flippin' switches and watch
> the tap drives whirr.
> 
> Don't panic, this project is years in the future.
> 

Must be something in the temporospatial nostalgia fabric...  I'm early in
the design of a Burroughs B220 simulator--the last commercial vacuum tube
computer, 11-digit BCD words with floating point and an index register!

It was my first "personal computer". ;-)
-- 
-michael - NadaNet 3.1 and AppleCrate II:  http://michaeljmahon.com

[toc] | [prev] | [next] | [standalone]


#2545

Fromwssimms@gmail.com
Date2016-03-18 11:33 -0700
Message-ID<8ec0f2aa-73cc-4da0-b541-b5fd6e2f504d@googlegroups.com>
In reply to#2544
I love bcd computers. If I ever finish the 704 emulator I want to do a NORC emulator.

[toc] | [prev] | [next] | [standalone]


#2548

FromMichael J. Mahon <mjmahon@aol.com>
Date2016-03-18 17:37 -0500
Message-ID<QMKdnauk4eK_HnHLnZ2dnUU7-bfNnZ2d@giganews.com>
In reply to#2545
<wssimms@gmail.com> wrote:
> I love bcd computers. If I ever finish the 704 emulator I want to do a NORC emulator.
> 
> 

...or a 705!

-- 
-michael - NadaNet 3.1 and AppleCrate II:  http://michaeljmahon.com

[toc] | [prev] | [next] | [standalone]


#2553

FromMichael Pohoreski <michael.pohoreski@gmail.com>
Date2016-03-20 10:52 -0700
Message-ID<eabd9e3d-624c-49ce-a733-dd03a39a6905@googlegroups.com>
In reply to#2535
On Friday, March 18, 2016 at 8:50:36 AM UTC-7, wss...@gmail.com wrote:
> No problem, I found the thread interesting enough.

You guys will love this! Not only visualization of sorting but also sonification! :-)

15 Sorting Algorithms in 6 Minutes
https://www.youtube.com/watch?v=kPRA0W1kECg

[toc] | [prev] | [next] | [standalone]


#2555

FromMichael J. Mahon <mjmahon@aol.com>
Date2016-03-20 13:42 -0500
Message-ID<vaqdnZDVdOK4cnPLnZ2dnUU7-LXNnZ2d@giganews.com>
In reply to#2553
Michael Pohoreski <michael.pohoreski@gmail.com> wrote:
> On Friday, March 18, 2016 at 8:50:36 AM UTC-7, wss...@gmail.com wrote:
>> No problem, I found the thread interesting enough.
> 
> You guys will love this! Not only visualization of sorting but also sonification! :-)
> 
> 15 Sorting Algorithms in 6 Minutes
> https://www.youtube.com/watch?v=kPRA0W1kECg
> 

Fun!

One of the first interactive graphics programs I wrote was for nuclear data
analysis on a Burroughs B220 computer fitted with a DEC 1000x1000 point
'scope.   There were several different sorts in the program, with widely
varying numbers of elements. 

The graphical terminal was located up one floor from the computer and about
a 2-1/2 minute walk, making it hard to tell what the computer was actually
doing while waiting at the display. 

The solution was a small transistor radio placed near the display. It was
driven by a kind of DMA from the memory of the B220, so all the loops were
very audible (including infinite loops ;-), and the heap sort was
especially recognizable because of the quasi-random (high branch entropy)
noise it made!  

After a few hours of use, the "tunes" of various kinds of processing
initiated interactively from the display (using a light pen) were easily
recognizable, making testing much more efficient--though I still had to
make the round trip to the computer if I hit a bug. 

The audio feedback was sufficiently interesting and reassuring that it
continued to be used after the system was fully operational!
-- 
-michael - NadaNet 3.1 and AppleCrate II:  http://michaeljmahon.com

[toc] | [prev] | [next] | [standalone]


#2556

FromD Finnigan <dog_cow@macgui.com>
Date2016-03-20 19:05 +0000
Message-ID<dog_cow-1458500924@macgui.com>
In reply to#2555
Michael J. Mahon wrote:
>
> The audio feedback was sufficiently interesting and reassuring that it
> continued to be used after the system was fully operational!
>

Can that still be done on an Apple II? I don't think I have a portable radio
to test it, but I might consider buying one just as a debugging aid.

[toc] | [prev] | [next] | [standalone]


#2564

FromMichael J. Mahon <mjmahon@aol.com>
Date2016-03-20 15:37 -0500
Message-ID<CsednY1PkPiPl3LLnZ2dnUU7-XvNnZ2d@giganews.com>
In reply to#2556
D Finnigan <dog_cow@macgui.com> wrote:
> Michael J. Mahon wrote:
>> 
>> The audio feedback was sufficiently interesting and reassuring that it
>> continued to be used after the system was fully operational!
>> 
> 
> Can that still be done on an Apple II? I don't think I have a portable radio
> to test it, but I might consider buying one just as a debugging aid.
> 

I tried it once and was disappointed, though it could still be useful. The
Apple II executes an instruction every 3 microseconds or so, while the B220
took 40-250 microseconds to execute an instruction. So a short B220 loop
ran at audio speed, while a short 6502 loop runs at ultrasonic rate. 
-- 
-michael - NadaNet 3.1 and AppleCrate II:  http://michaeljmahon.com

[toc] | [prev] | [next] | [standalone]


#2563

FromMichael Pohoreski <michael.pohoreski@gmail.com>
Date2016-03-20 13:33 -0700
Message-ID<e6afe523-a2dc-4c90-bd16-47b2b16a2b9d@googlegroups.com>
In reply to#2555
On Sunday, March 20, 2016 at 11:42:46 AM UTC-7, mjm...@aol.com wrote:
> One of the first interactive graphics programs I wrote was for nuclear data
> analysis on a Burroughs B220 computer fitted with a DEC 1000x1000 point
> 'scope.   There were several different sorts in the program, with widely
> varying numbers of elements. 
> 
> The graphical terminal was located up one floor from the computer and about
> a 2-1/2 minute walk, making it hard to tell what the computer was actually
> doing while waiting at the display. 
> 
> The solution was a small transistor radio placed near the display. It was
> driven by a kind of DMA from the memory of the B220, so all the loops were
> very audible (including infinite loops ;-), and the heap sort was
> especially recognizable because of the quasi-random (high branch entropy)
> noise it made!  
> 
> After a few hours of use, the "tunes" of various kinds of processing
> initiated interactively from the display (using a light pen) were easily
> recognizable, making testing much more efficient--though I still had to
> make the round trip to the computer if I hit a bug. 
> 
> The audio feedback was sufficiently interesting and reassuring that it
> continued to be used after the system was fully operational!

See, it's great stories like this that continue to make this a fun place to visit after all these years -- you just never know what cool hacks people have done. :-)

I take it you've seen this great oscilloscope audio/video hack :-)

Oscillofun on Tektronix 2245A
https://www.youtube.com/watch?v=J1ylMJwfLmM

[toc] | [prev] | [next] | [standalone]


#2567

FromMichael J. Mahon <mjmahon@aol.com>
Date2016-03-20 15:53 -0500
Message-ID<JPqdnUFbC8YzkHLLnZ2dnUU7-VPNnZ2d@giganews.com>
In reply to#2563
Michael Pohoreski <michael.pohoreski@gmail.com> wrote:
> On Sunday, March 20, 2016 at 11:42:46 AM UTC-7, mjm...@aol.com wrote:
>> One of the first interactive graphics programs I wrote was for nuclear data
>> analysis on a Burroughs B220 computer fitted with a DEC 1000x1000 point
>> 'scope.   There were several different sorts in the program, with widely
>> varying numbers of elements. 
>> 
>> The graphical terminal was located up one floor from the computer and about
>> a 2-1/2 minute walk, making it hard to tell what the computer was actually
>> doing while waiting at the display. 
>> 
>> The solution was a small transistor radio placed near the display. It was
>> driven by a kind of DMA from the memory of the B220, so all the loops were
>> very audible (including infinite loops ;-), and the heap sort was
>> especially recognizable because of the quasi-random (high branch entropy)
>> noise it made!  
>> 
>> After a few hours of use, the "tunes" of various kinds of processing
>> initiated interactively from the display (using a light pen) were easily
>> recognizable, making testing much more efficient--though I still had to
>> make the round trip to the computer if I hit a bug. 
>> 
>> The audio feedback was sufficiently interesting and reassuring that it
>> continued to be used after the system was fully operational!
> 
> See, it's great stories like this that continue to make this a fun place
> to visit after all these years -- you just never know what cool hacks people have done. :-)
> 
> I take it you've seen this great oscilloscope audio/video hack :-)
> 
> Oscillofun on Tektronix 2245A
> https://www.youtube.com/watch?v=J1ylMJwfLmM
> 
I hadn't seen that one. 

Things to do with a stereo sound card!  (Or a couple of DACs and an Apple.)

The DEC 'scope we used was a 17" round CRT with fast magnetic deflection.
The slew rates weren't controlled, so it couldn't draw vectors, but it
could accurately position to a point on a 1000x1000 grid and unblank the
"dot" every 20 uS. Drawing a line meant drawing a lot of dots in a row. 

The image could only have up to a couple thousand points or the refresh
rate would get to be annoying. At any instant, all the points to be
displayed were in (linked) display lists in the (5000 word) memory of the
computer. 

If the light pen "saw" a point when it was drawn, the current refresh was
interrupted with the word containing the point seen in the accumulator.
This was enough to support selection and tracking. 
-- 
-michael - NadaNet 3.1 and AppleCrate II:  http://michaeljmahon.com

[toc] | [prev] | [next] | [standalone]


#2568

Fromgids.rs@sasktel.net
Date2016-03-20 18:40 -0700
Message-ID<b956d924-2ed8-4ffd-ace3-ae81df29d971@googlegroups.com>
In reply to#2553
> You guys will love this! Not only visualization of sorting but also sonification! :-)
> 
> 15 Sorting Algorithms in 6 Minutes
> https://www.youtube.com/watch?v=kPRA0W1kECg



On that same youtube page I came across some MIT training classes on the Radix Sort.

https://www.youtube.com/watch?v=Nz1KZXbghj8

But I swear, if I didn't understand the sort before watching this, I would have failed that class.

I think I would would have understood it better if it was taught using ascii values instead of using integers.

According to a comment made by the instructor, all of the students have a laptop in front of them.  I don't know if this is for purely note taking, or if the students get to play with actual algorithms.

The Radix sort starts at about the 44 minute mark if you want to skip ahead.

[toc] | [prev] | [next] | [standalone]


#2575

FromMichael J. Mahon <mjmahon@aol.com>
Date2016-03-21 01:40 -0500
Message-ID<SZ6dnTW6yeTdCnLLnZ2dnUU7-VXNnZ2d@giganews.com>
In reply to#2568
<gids.rs@sasktel.net> wrote:
>> You guys will love this! Not only visualization of sorting but also sonification! :-)
>> 
>> 15 Sorting Algorithms in 6 Minutes
>> https://www.youtube.com/watch?v=kPRA0W1kECg
> 
> 
> 
> On that same youtube page I came across some MIT training classes on the Radix Sort.
> 
> https://www.youtube.com/watch?v=Nz1KZXbghj8
> 
> But I swear, if I didn't understand the sort before watching this, I
> would have failed that class.
> 
> I think I would would have understood it better if it was taught using
> ascii values instead of using integers.
> 
> According to a comment made by the instructor, all of the students have a
> laptop in front of them.  I don't know if this is for purely note taking,
> or if the students get to play with actual algorithms.
> 
> The Radix sort starts at about the 44 minute mark if you want to skip ahead.
> 

Think of a card sorter...

It runs through a deck of cards, sensing the punched digit (say) in column
80, and dropping all the 0s in bin 0, all the 1s in bin 1, and so forth, up
to bin 9. 

Then the operator picks up all the bins, stacking them so that bin 0 is on
top and bin 9 is on the bottom. She then puts the stack back in the hopper,
moves the sensing element to column 79, and presses "start" again. 

She repeats this "restack with bin 0 on top, reload the hopper, decrease
the sort column, press start" sequence until the column containing the most
significant digit has been sorted. 

Now the whole deck is sorted in ascending sequence on the column X to
column 80 field. 

That's a radix sort with radix 10. 

The same principle applies for any radix (though a physical card sorter
with 256 bins is unlikely ;-). 

If the "deck" of items is a linked list, this process is quite easy, and
the links make it simple to "restack" the records. You'll find that it's
much faster to keep two arrays of size radix: the pointer to the top of
each "bin", and the pointer to the bottom (first record) of each bin. That
way, restacking the deck only takes "radix" operations, independent of the
number of records. 
-- 
-michael - NadaNet 3.1 and AppleCrate II:  http://michaeljmahon.com

[toc] | [prev] | [standalone]


Page 3 of 3 — ← Prev page 1 2 [3]

Back to top | Article view | comp.sys.apple2.programmer


csiph-web