tag:blogger.com,1999:blog-58556422609935568182024-03-14T18:21:09.033+09:00Joel's Fantasy Economics(Aspirations of being a novelist ..)零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.comBlogger238125tag:blogger.com,1999:blog-5855642260993556818.post-33021838185680845002022-01-16T21:34:00.001+09:002022-01-20T00:03:57.211+09:00Backup: The Other OS-9, an Alternate Reality -- Calculations and Revelations<i>Current working version: <a href="https://joelrees-novels.blogspot.com/2022/01/the-other-os-9-alternate-reality-calculations.html">https://joelrees-novels.blogspot.com/2022/01/the-other-os-9-alternate-reality-calculations.html</a>.</i><br />
<hr /><p>
<a href="https://joelrees-novels.blogspot.com/2022/01/the-other-os-9-alternate-reality.html">Prologue/TOC</a>
</p>
<p>
"Whoa, Mary, look who's here!" Jim said too loudly, pretend sotto voce. He,
Roderick, and I were at our lab desk working on multi-byte addition in
hand-written assembly. <br />
</p>
<p>
Everybody looked at the door. I looked over at Jim instead, and he raised his
hands with a grin, backing away on his stool.
</p>
<p>"Hi guys."</p>
<p>I rolled my eyes and shook my head and turned to the door. "Hi, Beryl."</p>
<p>
She came in and walked over, greeting Trina with a touch of the fingertips and
a "Hi" on the way. <br />
</p>
<p>Roderick shifted over to an empty stool, and Beryl sat down by me.</p>
<p>"How was practice?" I asked.</p>
<p>
"Good enough. Whacha doin'?" Beryl looked at the scratch paper where we had
diagrammed what we understood of the problem and were writing tentative
sequences of assembly language.
</p>
<p>"Working out how to add big numbers," Roderick answered before I could.</p>
<p>
"Bigger than what fits in the eight bits we showed you yesterday," I added.
</p>
<p>
She looked at the diagrams with a bit of interest, then shrugged. "Greek to
me."
</p>
<p>Chuckles came from various directions. </p>
<p>"Got time to wait while we test this?"</p>
<p>"Sure. If it's not more than half an hour."</p>
<p>
Chuck looked up from where he and his group were helping Mister Forrest test
the serial I/O board in the computer. "Can we let them try their code?" he
asked.<br />
</p>
<p>
Mr. Forrest nodded. "Time to take a break and see what we've figured out so
far, anyway."
</p>
<p>I looked at Jim and Roderick, and they both shook their heads. </p>
<p>"Let's use your code," Jim said.</p>
<p>
Todd moved an empty stool over for me and I sat down at their lab desk. Jim
and Roderick stood at either side of me to watch while I used the front panel
interface to toggle in the code.
</p>
<p>
Beryl came over and stood behind me, resting her hands on my shoulders. I
stopped working the switches long enough to give one hand a squeeze,
deliberately squelching the nervous thrill that tried to course through me and
stop my brain from working. I also ignored the murmurs around me.
</p>
<p>"So what are these numbers in real num -- uhm, decimal?"</p>
<p>"Decimal. 123,456,789 plus 987,654,321 equals --"</p>
<p>
"One billion, one hundred eleven million, one hundred eleven thousand, one
hundred ten," she finished for me.
</p>
<p>More murmurs around us. <br /></p>
<p>
I turned and grinned at her. "And you pretend you don't know what we're doing
here."
</p>
<p>"Just arithmetic." She grinned back.</p>
<p>Chuckles and quiet groans. Trina snickered. "Genius attracts genius?"</p>
<p>Beryl turned and they exchanged finger waves.</p>
<p>
I looked at the ceiling. "How am I supposed to respond to that?" I muttered,
and looked back at the computer. <br />
</p>
<p>
Beryl gave my shoulders a squeeze. My stomach jumped, ever so slightly.<br />
</p>
<p>
"Okay, let's see if it flies." I stepped through, reading the input numbers
and results aloud.
</p>
<blockquote>00010101 plus<br />10110001 equals<br />11000110</blockquote>
<p>
I checked the status register LEDs. "-- with no carry. Good," I breathed.
<br />
</p>
<blockquote>11001101 plus<br />01101000 equals<br />00110101 <br /></blockquote>
<p>"-- again, with no carry. Okay," I nodded, cautious.<br /></p>
<blockquote>01011011 plus<br />11011110 equals<br />00111010,</blockquote>
<p>
The carry bit in the status register array of LEDs lit up. "-- with a carry.
So far, so good. Okay,"
</p>
<p></p>
<blockquote>
The carry, plus<br />00000111 plus<br />00111010 equals<br />01000010
</blockquote>
<p></p>
<p>And everybody clapped. <br /></p>
<p>
"Let's see your code." Mr. Forrest checked my work. "Lots of repeated
instructions. That's faster than a loop, but it takes more program space, and
we only have 4K that we know is working just yet. Try a loop?"
</p>
<p>
"Well, that's what Jim is working on, but we weren't comfortable with where we
put the loop count or with what happened to the carry while counting the
loop."
</p>
<p>"Let me see that, Jim." </p>
<p>
Jim handed Mr. Forrest his work, and he checked through it, nodded, and handed
it back. "Want to give it a try?"
</p>
<p>"No confidence."</p>
<p>"Results might be interesting?"</p>
<p>"I'm not sure I'd have any idea what went wrong."</p>
<p>
"We can all think about it. Joe, write your code up on the board for everyone
to look at. And Jim, you can write yours on the board next to Joe's. Try to
line up instructions that do the same things."
</p>
<p>
Jim and I went to the board and put our code up. We consulted about what lined
up where, and where I needed to leave empty lines so we could line things up.
</p>
<p>"Still hesitant to try it, Jim?" Mr. Forrest asked.</p>
<p>
Jim went back to our lab desk and looked through the summary of 8080 machine
code instructions and their effects which Mr. Forrest had handed out for each
lab group. He looked up and said, "It might work."
</p>
<p>
"Hot seat." Mr. Forrest indicated the stool I had been sitting on to use the
computer.
</p>
<p>
"Do I get a back rub from Beryl?" Jim asked, with a wink at me. I grinned and
looked at Beryl.
</p>
<p>She grinned back. "Oh, since you're Joey's lab partner, why not?"</p>
<p>
Jim looked surprised, but pleased, and sat down. Beryl stood behind him and
rubbed his shoulders, then gave them a hard squeeze.
</p>
<p>"Ouch. Feels good!"</p>
<p>Everyone laughed.</p>
<p>JIm's code ran successfully, as well, and we all applauded.</p>
<p>
"Okay, I'm thinking we can leave the teletype for tomorrow and just let the
rest of you try your code, and then maybe I can get home by midnight tonight."
</p>
<p>We all laughed.</p>
<p>
After discussing the results we got with Jim and Roderick, I packed up my
stuff and left with Beryl. We turned left out the door, and she slipped her
left hand into my right.<br />
</p>
<p>
At the first cross hall, I started to turn right and almost bumped into her. I
corrected course quickly and followed her straight across.
</p>
<p>"This is the long way to the library." <br /></p>
<p>"My house tonight. Dad and Mom are home."</p>
<p>This time I couldn't squelch the butterflies in my stomach, and stopped.</p>
<p>Beryl looked up and back at me, challenging me. </p>
<p>
"Erm, okay." I started moving again, not quite feeling the faux granite floor
under my tennis shoes. I couldn't say anything as we walked, Beryl gently but
playfully swinging our hands between us. She was doing the swinging. My
muscles wouldn't have obeyed me if I had tried.
</p>
<p>
"Cat got your tongue?" she asked playfully as we left the south wing. The
fence wouldn't go up around the campus for another couple of years, and we
headed unimpeded for the street where she lived, less than ten minutes away.
<br />
</p>
<p>"The cat or the butterflies she's chasing."</p>
<p>She giggled. </p>
<p>"Meeting your dad?"</p>
<p>"And Mom and Donna."</p>
<p>"Donna?"</p>
<p>"Kid sister."</p>
<p>"You've never told me about your family."</p>
<p>
"You haven't told me much about yours. I remember you're the youngest and you
have, what, four sisters?"
</p>
<p>"And one brother."</p>
<p>
"... and one brother." She paused, suddenly quiet. "My big brother died when I
was kind of young."
</p>
<p>"Oh." I didn't know what to say to that. "Sorry to hear about that."</p>
<p>"I miss him sometimes. But I think he's happy in heaven."</p>
<p>"That's a good hope to have. I believe in the afterlife, too."</p>
<p>"Yeah. Heaven's a good place."</p>
<p>
We came too soon to her house, and her dad faced me at the front door. Her
mother took Beryl's hand and pulled her in, hugging her closely.<br />
</p>
<p>
"So. This is the Mormon boy that has been stalking my daughter for four
years."
</p>
<p>I couldn't tell if he was joking or not.</p>
<p>"Dad!"</p>
<p>"Yes, sir." I said, not cracking a smile.</p>
<p>
"What about this polygamy thing? How many wives besides my daughter do you
plan on marrying?"
</p>
<p>
"No, sir. Beryl and I have not discussed marriage in the first place. No plans
about that at all at this time. And, in the second place, we Mormons don't do
polygamy any more."
</p>
<p>"Any more?" her mom asked.<br /></p>
<p>
"One of my great-grandfathers lost his wife on crossing the plains to Utah,
and when he got to Utah he married a widow with six kids who lost her husband
on the way. With the second wife's permission, he married a third woman."
</p>
<p>
"So why don't you do that any more?" her dad asked, in a tone that broached no
nonsense.<br />
</p>
<p>
"Well, there are several reasons. One is that God told us that, rather than go
to war with all the people who thought that polygamy was a capital offense,
polygamy would no longer be required of us."
</p>
<p>"Required?" Beryl asked, puzzled.</p>
<p>
"It was a different world. A single woman back then was looked on with
suspicion and misunderstanding."
</p>
<p>Her dad cleared his throat.<br /></p>
<p>Beryl's puzzlement increased. "Huh?"</p>
<p>Beryl's mother hugged Beryl tighter, whispering something to her. </p>
<p>Beryl's face drained color. She turned to her mother. "No!"<br /></p>
<p>
I continued, "Anyway, when polygamy worked well, it helped prevent the worst
options. It didn't always work well, but the leaders of the Church were rather
strict that a polygamous wife who felt that she was in a bad marriage could be
released from the bad marriage and be free to seek someone better. In
marriage. Without having to leave her children or her belongings behind."
</p>
<p>
Beryl's mom suddenly relaxed, and her dad's stern expression softened
slightly.
</p>
<p>
I continued. "Unfortunately, the members with fundamentalist inclinations who
sometimes leave us, leave us before they understand what polygamy was supposed
to be. And that can cause some pretty abusive family situations for them.
Which brings up a third reason we quit. By the end of the last century, too
many of our regular members were beginning to practice it without
understanding it."
</p>
<p>Her dad and mom both relaxed at the same time. </p>
<p>
"Son," her dad said, "I've heard enough good about you from Beryl that I'm
going to give you a chance to prove yourself."
</p>
<p>
I took a deep breath. "I hope you will not be offended that I won't be trying
to prove myself. I always do my best to live a moral life and treat all people
with respect, and I hope that will be good enough."
</p>
<p>
He grinned. "We'll see. We shall see. Well, come in so you and Beryl can
study. That's what you came for, I think?"
</p>
<p>"Yes, sir."</p>
<p>
Donna was standing in the front room, watching the drama wide-eyed, and Beryl
introduced us. The two of them exchanged looks and giggles and grins, and
Donna dragged Beryl off into the kitchen to talk for a minute.
</p>
<p>
While they were gone, I introduced myself to Karl and May, and they introduced
themselves to me. <br />
</p>
<p>
Then they came back, and Beryl dragged me over to the couch, where we sat,
spread out our books on the coffee table, and dug in.<br />
</p>
<p style="text-align: right;">TV or Not TV (Typewriter)<br /></p>
<br />
零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-81750651641463865552022-01-10T11:53:00.012+09:002022-01-19T23:09:21.614+09:00Backup: The Other OS-9, an Alternate Reality<i>Current working version: <a href="https://joelrees-novels.blogspot.com/2022/01/the-other-os-9-alternate-reality.html">https://joelrees-novels.blogspot.com/2022/01/the-other-os-9-alternate-reality.html</a>.</i><br />
<hr />
<h4 style="text-align: left;">Prologue, part I: <br /></h4>
<p>
God has told me not to look back at the things I have done wrong. He has not
told me not to look back at things I haven't done wrong.
</p>
<p>
This story is something in the vein of the
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html" target="_blank">33209 story</a>, but with a simpler technology timeline than that. More like the one I laid
out in
<a href="https://defining-computers.blogspot.com/2021/10/alternate-reality-early-microcomputer.html" target="_blank">this blogpost about the first OS-9</a>:
<a href="https://defining-computers.blogspot.com/2021/10/alternate-reality-early-microcomputer.html">https://defining-computers.blogspot.com/2021/10/alternate-reality-early-microcomputer.html</a>.
</p>
<p>
I think I'll use a simpler story and plot, as well, as well as the
simpler technology roadmap.
</p>
<p>
I'll go back to Japan almost immediately after my mission to chase Satomi, and
end up meeting Chika while she is still in high school. And she will make
herself obnoxious so that I have to invite her for a year of home-stay high
school studies with my parents. And she will be one of the women who push me
to develop my interest in the nascent microcomputer industry.
</p>
<p>
And I'll have to push Jeff Raskin ahead on that text-based Apple IX in 1980
somehow. That's a tough one, but not nearly as tough as inventing reasons for
Motorola to keep a double flagship market profile with the 68000 and 6809, and
to evolve both more rapidly.
</p>
<p>
In order to do that, and to clear up how the whole mess started, I guess I'll
have to back up to my senior year in high school.
</p>
<p> </p>
<h1 style="text-align: center;">The Other OS-9<br />an Alternate Reality</h1>
<p style="text-align: center;">
by Joel Matthew Rees<br />Copyright 2022, Joel Matthew Rees<br />
</p>
<p><br /></p>
<h4 style="text-align: left;">Prologue, part II:<br /></h4>
<p>
Beryl looked over at me with puzzlement in her blue eyes. "The lights flash. I
don't get it."
</p>
<p>Jim snickered. </p>
<p>
I sighed and looked aside, searching the wall of the electronics lab for
clues.
</p>
<p>
"Your eyes just turned green." Beryl smiled at me with a quiet laugh.<br />
</p>
<p>
Roderick laughed out loud. "Mary, buddy, you're wasting Beryl's time looking
at this Altair here."
</p>
<p>
"Shoosh!" Trina let out in exasperation. "No, he's not. Beryl's being patient,
everyone just shut up and let Joe show Beryl what we're doing. Go ahead, Joe."
</p>
<p>"Who's Merry?" Beryl asked me. "Oh. Wait. Marion. You."</p>
<p>I glanced at the ceiling and nodded. </p>
<p>She frowned and turned to Roderick.</p>
<p>He backed off his stool, raising his hands in defense. "It's a nickname."</p>
<p>"Yeah," I laughed. "Only my best friends get to call me that." </p>
<p>
Roderick sat back down as Beryl turned back to query me silently, those blue
eyes confusing me, as usual. I shrugged. She wrinkled her nose and her puzzled
expression turned into a wry grin.
</p>
<p>
"Anyway, we start out putting forty-nine in the accumulator." I pointed at the
hand written program listing again,
</p>
<code>
<blockquote>
3E 31 MVI A, 49 ; 00110001<br />
</blockquote>
</code>
<p>
and then used the microcomputer's front panel switches to set the starting
address back to zero. "The shining LEDs are ones and dark LEDs are zeroes, and
that was binary 0-0 1-1-0 0-0-1 on these lights here after it did the first
instruction." I stepped into the first instruction and the lights that showed
the accumulator value lit up again with the 00 110 001 pattern. <br />
</p>
<p>
"You showed me how forty-nine decimal is that long string of ones and zeroes
in base two. And for some reason," she pointed at the listing, "you write
forty-nine after A, instead of before where it ought to be if it's going to be
put in."
</p>
<p>"Intel's backwards assembler grammar," I shrugged apologetically.<br /></p>
<p>Beryl shook her head. "I don't get it, but I'll play along."</p>
<p>"Yeah," Todd complained. "Play along. That's what we all do."<br /></p>
<p>
The students gathered around us broke out in laughter, and Mr. Forrest, our
teacher, chuckled.
</p>
<p>
She tilted her head. "And then you move the number from accumulator A to
register B, right?" She put her finger on the next line.<br />
</p>
<code>
<blockquote> 47 MOV B, A<br /></blockquote>
</code>
<p>I hit the step switch on the front panel. "Right. You're getting it."</p>
<p>"No I'm not." She pouted, then giggled.</p>
<p>Trina laughed. "That's the way, Beryl. Keep these guys in their place."</p>
<p>Beryl grinned and raised her elbow towards Trina, and they bumped elbows.</p>
<p>
"And you move nineteen into the accumulator so I can see the pretty lights
change," she continued.
</p>
<p>She pointed at the listing,<br /></p>
<code>
<blockquote> 3E 13 MVI A, 19<br /></blockquote>
</code>
<p>
And I stepped the instruction. "Yeah. Binary 00 011 001." The front panel
showed the value in the accumulator output array. <br />
</p>
<p>
"I guess I see that. Maybe. And you move it to register C to get it out of the
way for some reason?" She pointed at the next line.<br />
</p>
<code>
<blockquote> 4F MOV C, A<br /></blockquote>
</code>
<p>"Pretty much exactly. I thought it would make it easier to watch."</p>
<p>
"And then you move the forty-nine in B back to the accumulator for the same
reason."
</p>
<p></p>
<code>
<blockquote> 78 MOV A, B<br /></blockquote>
</code>
<p>"Right." </p>
<p>"And add the two numbers." <br /></p>
<code>
<blockquote> 81 ADD C<br /></blockquote>
</code>
<p>"Uh, huh."</p>
<p>
"And stop so we can think about what the pretty lights say." She pointed to
the last instruction. <br />
</p>
<code>
<blockquote> 76 HLT<br /></blockquote>
</code>
<p>
"And the result is binary," she read from the front panel, "01 000 100." She
took a deep breath. "Which you showed me is sixty-eight."<br />
</p>
<p></p>
<p>Chuck showed her the conversion on his HP calculator again.</p>
<p>"Thanks, Chuck."</p>
<p>"Any time you want to look at my calculator, just ask."</p>
<p>
"Careful!" Todd warned him. "Mary, I mean, Joe, might have something to say
about that."
</p>
<p>
I gave Todd a look. "Last I checked I don't give orders to anyone in this
room." I looked back at Beryl apologetically.
</p>
<p>
She wrinkled her forehead at me. "Thanks for the offer, anyway, Chuck." She
didn't turn to look at him.<br />
</p>
<p>
Some of the guys in the room started to give wolf whistles, but Mr. Forrest
cleared his throat and they stopped.<br />
</p>
<p>"But I still don't see the point."</p>
<p>
Mr. Forrest stood up. "Well, I think I've arranged for the university to loan
us a teletype, and I got a package with the free software Tiny BASIC language
interpreter on tape, so we might have something more interesting to look at in
a couple of days."
</p>
<p>
"Thank you, Mr. Forrest. And thanks, everyone, for showing me what Joey gets
all excited about."
</p>
<p>
"Whoa." Jack pulled his head back in mock horror. "Nobody gets to call him
Joey."
</p>
<p>
I rolled my eyes and raised my hands to the sky in mock resignation as the
guys in the class broke out in laughter again.<br />
</p>
<p>
Beryl looked over and gave me a wry smile and a wrinkle of the nose. "Now are
you going to help me with the political science homework?"
</p>
<p>"Sure. Let's go."</p>
<p>
The show over, the other students started to pack up, amid a buzz of
conversation. <br />
</p>
<p>
"Wait a minute, Joe. I have another announcement." Mr. Forrest stopped me.<br />
</p>
<p>We all quieted down.</p>
<p>
"I have an opportunity to go to a microcomputer show in San Francisco, April
16th and 17th, and I can take a couple or three students with me. If more than
three want to go, we'll have to figure out a way to choose who goes. Maybe a
programming or electronics problem to solve. We can talk about that tomorrow,
but anyone who's interested, please check with your parents tonight."
</p>
<p>"Whoa, yeah."</p>
<p>"Alright!"</p>
<p>"Cool!"</p>
<p>"I'm in!"</p>
<p>
Amid other excited responses there were a few less enthusiastic responses such
as<br />
</p>
<p>"Count me out," </p>
<p>as well. <br /></p>
<p>
Beryl looked at me with a question in her eyes as she picked up her books.<br />
</p>
<p>
"Shoot yeah, I'm interested." I switched the power off on the microcomputer
and picked up my sample program listing, slipping it back into my notebook,
before picking up my own books. Then I stopped. "Oh. Wait."
</p>
<p>
She looked down quickly as she stood up. "Well, let's go study poli-sci," she
said, disappointment tinging her voice.
</p>
<p>
I followed her out of the electronics lab into the hall. "That's when the
cheering squad's year-end competition is, isn't it?"
</p>
<p>
"Never mind." She didn't turn back to look at me. "You need to go where you
need to go."
</p>
<p>She never let me bring the subject back up again.<br /></p>
<p><br /></p>
<h4 style="text-align: left;">Chapters:</h4>
<ol style="text-align: left;">
<li>
<a href="https://joelrees-novels.blogspot.com/2022/01/the-other-os-9-alternate-reality-calculations.html" target="_blank">Calculations and Revelations</a><br />To be written (tentative list):
</li>
<li>TV or Not TV (Typewriter)<br /></li>
<li>Faire Enough<br /></li>
<li>BASICally Proceed Forth<br /></li>
<li>Surveying the Field<br /></li>
<li>Sacrifice and Service</li>
<li>Picking up Threads</li>
<li>Rotating Media and Braun's Tube<br /></li>
<li>Unique OSses</li>
<li>Splitting Their Stacks </li>
<li>Ken Thompson's Trusting Trust vs. Bootstrapping Your Own<br /></li>
<li>FM and Other Oriental Interests</li>
<li>I Been Moved to PCs -- Microware, not MicroSoft<br /></li>
<li>A Piece of the Orient in Texas <br /></li>
<li>2809 and 68010</li>
<li>68451 -- and Motorola Eats Their Own Dogfood</li>
<li>Simulating Circuits and Automatic Layout</li>
<li>Bounding Stacks and Other Segments</li>
<li>68RISC <br /></li>
<li>Segments and Bounds -- 3XX09 <br /></li>
<li>... </li>
<li>Chikako on Her Mission, Marion in post-grad<br /></li>
<li>...</li>
<li>No Phishing</li>
<li>...</li>
<li>Social Engineering</li>
<li>Straits<br /></li>
</ol>
<p></p>
<p><br /></p>
<p style="text-align: right;">
<a href="https://joelrees-novels.blogspot.com/2022/01/the-other-os-9-alternate-reality-calculations.html" target="_blank">Calculations and Revelations</a><br />
</p>
<p><br /></p>
零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-78000006431787712562020-09-29T12:06:00.011+09:002020-09-29T13:45:03.139+09:00Backup: 33209: Rocks -- An Evening TogetherBackup of <a href="https://joelrees-novels.blogspot.com/2020/09/33209-rocks-evening-together.html">https://joelrees-novels.blogspot.com/2020/09/33209-rocks-evening-together.html</a>.<br />
<hr />
<p> <a href="https://joelrees-novels.blogspot.com/2020/09/33209-rocks-2801.html">Chapter 14.2 Rocks -- Moving Ahead</a><br /> </p><div style="text-align: center;"><h4>
Chapter 14.3: Rocks -- An Evening Together<br /></h4></div>
<p>"I'm glad they had the Micro Chroma kits so we can take them home."
Pat was examining the kit she was carrying as we entered the front door.<br /></p><p>"I don't know about you guys, but I'm watching <i>Hello Dolly</i> tonight." Denise looked up from where she was watching TV and grinned as we came in the front door. </p><p>I went to the kitchenette and set the bags I was carrying down.</p><p>Pat looked from her kit to the TV with a perplexed frown.<br /></p><p>"Joe?" Julia looked over at me with a question in her eyes.</p><p>I shook my head. "No complaints from me."</p><p>Julia
happily sat herself on the couch beside Denise, and I sat on the floor
in front of her, leaning back against the couch beside her knees. </p><p>Denny carried a couple of flat boxes into the kitchenette muttering something amusingly inane about TV.</p><p>Pat
sat beside Julia. George and Mike took the flat boxes they were
carrying into the kitchenette and returned to sit on the floor in front
of her, dividing their attention between the TV and their kits.</p><p>"Somebody help me with the pizza I brought home!" Denny called out.</p><p>"Pizza?" Denise looked up from the TV hopefully. "I thought I smelled pizza. You brought some home?"</p><p>I got back up and went into the kitchen area, and George and Mike followed. <br /></p><p>"On the company tab. Leftover from recruitment party."</p><p>We
quickly had plates out and filled, and we passed them back into the
living room, then passed out cups and soft drink bottles and returned to
sitting on the floor.<br /></p><p>"Tell your boss I thank him," Denise
said between bites. "Very considerate, and better than the fried chicken
I thought you had forgotten."</p><p>Denny grinned and joined us, giving
Denise's rounding abdomen a caress before he sat down in front of her
on the floor. "Kids asleep?"</p><p>"I doubt it."</p><p>The older boy
peeked in through the boys' room door. I motioned to him to join us, and
he came in and sat beside me. Denny stood back up and brought the
younger one in, letting him lie in his lap and go back to sleep.</p><p style="text-align: center;">*****</p><p>"Money
is like manure." Julia gave me a glance and look as quiet as her voice.
Denny and Denise had invited us to join in their family prayers, and,
that done, Julia and I had carried the boys back to their beds and were
now returning to the living room.<br /></p>"Horace. Prompted evidently by
Dolly's late husband from the other side." I also spoke quietly. "Spread
it around and make green things grow. Not a bad metaphor, in a country
where the banknotes are green."<p>She gave that a quiet laugh. "I guess it's not quite the same metaphor if the paper money isn't green."</p><p>"Still a useful principle."<br /></p><p>Mike and George looked into the boys' room behind us. </p><p>"Tight
squeeze with three of us," George muttered. He turned back to the
living room. "In my economics class, the teacher compared money to air.
Pointed out that it's a medium of communication and essential to
society's functioning."</p><p>"Essential?" Pat raised an eyebrow.</p><p>"You need something that can be used to communicate about value," he replied. </p><p>"And any medium for communicating value just ends up looking like money," I added for him. </p><p>"Probably." <br /></p><p>Pat asked, "Then how about blood as a metaphor, since it has to circulate, and it carries stuff with it?"</p><p>Mike suppressed a snort. "More like pus."</p><p>I glanced up at him. "Because it tends to accumulate most in the wounds of society."</p><p>He nodded. "Exactly."</p><p>"Pus?" Julia scrunched her face. "Yuck. I could hate you for that, Mike." She shook her head and chuckled.</p>He just grinned back.<br /><p>George groaned, but Pat nodded her head appreciatively. </p><p>"Are you guys sure you're not already all related to the Reeves clan?" Denise asked.<br /></p><p>"What?"</p><p>"Huh?"</p><p>"Philosophizing when we should be getting ready hit the hay," I explained.<br /></p><p>"All the Reeveses do it," she laughingly complained.<br /></p><p>Denny and I chuckled, and Julia reached out to take my hand. I gave her a smile and hug in reply.</p><p style="text-align: center;">*****<br /></p><p>"Joe." </p><p>Mike's low voice from beside me broke into my pre-dream thoughts. </p><p>George's breathing from the other side of him was deep and regular.<br /></p><p>"Yeah?"</p><p>"Julia tell you about her and me?"</p><p>"Somewhat."</p><p>"I wish I'd known you in high school."</p><p>"Oh?"</p><p>"I think I needed better role models."</p><p>"Heh.
I was not much of a role model in high school. Two years as a
missionary helped, but, ..." and I stopped, in the realization that what
I was about to say might be rather painful to Mike.</p><p>"Then maybe it's just that you and Julia are a better match than I'd have been for her." <br /></p><p>"Maybe." I guessed he'd understood -- from his point of view -- some, if not all, of what I hadn't said.<br /></p><p>"Even if ...," he trailed off.<br /></p><p> I waited for him to finish.</p><p>"Even though I can't expect to win Julia back, I want to be your friend."</p><p>"I hope we can be friends. I think Julia has some unhealed wounds that could be healed if we could all be friends."</p><p>"I think we can. But that's what it is. What I want to learn from you. I want to be able to think like that."</p><p>"I think it has something to do with religion."</p><p>"I know."</p><p>I waited for him to say something more. <br /></p><p>"Thanks for letting us come along."</p><p>"Thanks for coming."</p><p>Mike grunted an affirmative, and slowly his breathing became regular and deep.</p><p>I
was reminded of listening to my missionary companions' breathing in the
middle of the night. There's something companionable about sharing a
room to sleep in.<br /></p><p style="text-align: center;">***** <br /></p><p>In
the morning, we met the others at the park and spent a half hour
walking and wading in the water before heading out for breakfast and to
the surplus store.<br /></p><p>John was happy to have the group of
students browsing his selection of surplus, and he was happy to talk
with me about the controller circuit. He was worried about Motorola
wanting to prevent him from passing the diagram and code out with the
drives he sold, but Denny and assured him Motorola had agreed to keep it
openly usable. </p><p>Denny had already put copyright notice, notice of
intent to patent, with notice of license and disclaimer of liability on
the diagrams he passed out among his friends, and John was leaving the
notices intact on the copies he kept to pass out.</p><p>About lunchtime,
we went back to the park and met the other group coming in. Motorola's
recruiters found us there, bringing more pizza and the remainder of the
Micro Chroma 68 kits. But they kept the recruitment activities short, to
leave the second group as much time at the surplus store as possible.</p><p>Julia and I spent a couple of hours with Denny and his boss at
Motorola, learning how to use the test equipment to go through the
reject bin and fish out parts that were functional enough, even though the batch
they had come from had not qualified as product. We were able to
collect a couple of rails of parts that members of our group could use
in their projects.<br /></p><p>By
the time we got ready to leave, we had, in addition to the Micro Chroma
68 kits and the hardware we had purchased, something of an agreement
that many of the students in our group would be working on projects for
Motorola over spring break and the summer holidays.<br /></p><p style="text-align: center;">*****<br /></p><p>Julia
wrapped my arms around her as we stood facing the moon on the sidewalk
outside her house about a half hour before midnight. Neither of us spoke
for maybe a couple of minutes, then she turned and gave me a kiss that
must have lasted as long. It tore me up to tear myself away so we could
unload her hardware.</p><p>Her mother was sitting on the couch with some knitting when we entered the front door.</p><p>"Mom, don't say a thing."</p><p>"About what?"</p><p>"About it would be faster and easier for me to stay over in Joe's spare room. </p><p>"But
that would mean Dad wouldn't be able to help you build your computer."
She smiled. "We're putting enough pressure on you two. Take your time
and don't mind us."<br /></p><div style="text-align: right;">
Chapter 14.4: Rocks -- what? <br /></div>
<div style="text-align: center;"><a href="https://www.blogger.com/#">TOC</a></div><br />
<hr />
[Backed up at <a href="https://joel-rees-economics.blogspot.com/2020/09/bk-33209-rocks-evening-together.html">https://joel-rees-economics.blogspot.com/2020/09/bk-33209-rocks-evening-together.html</a>.]<br />
零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-74459895120497808162020-09-14T10:05:00.005+09:002020-09-29T12:25:32.782+09:00Backup: 33209: Rocks -- Moving AheadBackup of <a href="https://joelrees-novels.blogspot.com/2020/09/33209-rocks-moving-ahead.html">https://joelrees-novels.blogspot.com/2020/09/33209-rocks-moving-ahead.html</a>.<br />
<hr />
<p> <a href="https://joelrees-novels.blogspot.com/2020/09/33209-rocks-bit-multiply.html">Chapter 14.1 Rocks -- Bit Multiply<br /></a> </p><div style="text-align: center;"><h4>
Chapter 14.2: Rocks -- Moving Ahead </h4></div>
<p><i>[Please pardon the layout change. Google is being the 800 pound
prima donna and making all blogspot users use a buggy blog editor now.]</i> <br /></p><p>"Are
you sure that there's nothing in what you and Julia just went over that
you won't be claiming as IP?" Bill wrinkled his forehead. </p>
<p>
I shrugged. "Trying to claim IP on this kind of thing is only one step
beyond trying to claim IP on binary addition. No real circuitry to base
claims on, nothing but ideas and math."</p>
<p>
(We won't mention a very famous, wealthy corporation that did, in fact,
attempt patent claims on binary addition in an ALU, buried in its claims
concerning a programming language and programming environment they
developed and sold. We also won't dwell too much here on the fact that,
once upon a time, ideas, math, and algorithms were considered outside
the domain of patents in the USA.)</p>
<p>
"Would it be possible," I asked, pressing my own agenda, "to reduce the
cycle count to one on reads and two on writes in the direct page RAM,
without blowing the transistor budget on a 6805 or 6801? That alone
could better than double the speed of software multiply and divide."</p>
<p>
There was a bit of uncomfortable chuckling and clearing of throats.</p>
<p>
"No?"</p>
<p>
Several engineers looked at Pete. He shrugged.</p>
<p>
Tobias tilted his head apologetically. "We'd have to fix the prefetch/decode circuit so it's a real pipeline of depth one."</p><p>"It's not a real pipeline?"</p><p> "The
eight-bit designs don't have a place to keep the instruction in its
partial and fully-decoded states, so we go back and redo the prefetch if
we don't use it immediately." </p><p>"Oh."<br /></p><p>"And then we'd
have to test it. Testing is what we get stuck on budgeting time for. You
should talk with your brother about that."</p>
<p>
"Denny's not in charge of test, is he?"</p>
<p>
"No, but he could tell you something about the backlog."</p>
<p>
Our Bob spoke up, "Could interns help with the grunt work?"</p>
<p>
Motorola's Bob exchanged glances with Bill, then turned to Jesse. "Should we look at that?"</p>
<p>
"Maybe we should," Jesse frowned. "I'll discuss it with my group on
Monday, see if we can separate something out that a non-engineering tech
could handle."</p><p>"Remember that these guys seem to have a bit more of a handle on the tech than our usual crop of interns."</p><p>"We'll take that into consideration." <br /></p>
<p>
I ventured a bit further. "I'm not just thinking of fast direct-page
RAM, though. The 6809 and the 68000 have enough index registers to
support separating the parameter stack from the return pointer stack,
and that means one might profitably attach a hysteric cache to both
pointers, with the appropriate control signals."</p>
<p>
That got me looks of confusion and amusement.</p>
<p>
"A cache that tracks the stack pointer with hysteresis." I borrowed Julia's notepad again and sketched out something like this:<br /></p>
<p>
</p>
<p>
</p>
<p>
</p><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-uRPBUe2i5_c/X129Mxvq6aI/AAAAAAAAC14/21xdaFlGt78gUhcnz-2swAm4ZG7CjGMaQCPcBGAYYCw/s793/hysteric_cache.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="793" data-original-width="760" height="400" src="https://1.bp.blogspot.com/-uRPBUe2i5_c/X129Mxvq6aI/AAAAAAAAC14/21xdaFlGt78gUhcnz-2swAm4ZG7CjGMaQCPcBGAYYCw/w384-h400/hysteric_cache.png" width="384" /></a></div><p>Ms. Philips reached over and lifted the notepad and waved it at me. "I am sure this is IP."<br /></p><p>"It's
just a lousy diagram of spill-fill cache tied to a stack pointer.
Calling it hysteric is a bit of a pun, is all. Not even a really good
pun, at that." <br /></p><p>Jesse started chuckling. "If it works," he commented, "it'd be more appropriate to call it an anti-histrionic stack cache." </p><p>A number of other engineers echoed his chuckles of appreciation.<br /></p><p>Ms.
Philips and Ms. Steward put their heads together and started working on
something. Bill and Motorola's Bob refrained from comment, keeping an
unobtrusive eye on what they were working out.<br /></p><p>I added, "If
the cache could also be accessed in single-cycle reads and two-cycle
writes, local variables would be almost as good as registers."</p><p>Bill
leaned forward. "We've taken a lot of your time on this blue-sky
brainstorming, but Bob and I wanted to get your opinion on something."</p><p>I let the amusing, but perhaps meaningful mixed metaphor pass and nodded.</p><p>"If you were designing a mass-market personal computer using an existing CPU, would you use Intel's 8086 or 8088?"</p><p>It
was my turn to be confused. "Sloppy segments. Instruction set is an
improvement over the 8080, but not much. No. I'd use the 6809 for the
instruction set and register set before I'd use the 8088, even though
it's a bit slower on multiplies and a lot slower on divides, and would
require bank-switching or the 6844 MMU for a PC. </p><p>(PC? I had
become familiar with the abbreviation in Japan while I was there as a
missionary. How quickly people forgot, in our real world, that there was
more than half a decade of PCs before the IBM PC.)<br /> </p><p>"And I'd
use the 68000 over the 8086 even though the 68000 costs significantly
more, because the 8086 just doesn't make sense. It requires 16 bit wide
memory, but it still gives only 16 bit addresses without playing bad
programming practice games with your code. Sloppy segments are a
security booby-trap, and a bug generator."</p><p>Bob nodded. "Are you
sure your antipathies are not colored by family loyalties? Tech doesn't
forgive misplaced family loyalties."<br /></p><p>"Family loyalties may
induce some of the heat, but, really, if they want to map 16-bit logical
addresses into a 20-bit physical address space, they should make the
segments fully 20 bits wide. 24 or 32 bits wide would make more sense,
even if the top four or twelve bits aren't brought out of the package or
don't even physically exist. And the segments should have limit
registers, as well, if they're going to mean anything besides crude
bank-switching with the improvement of being able to tie specific banks
of memory to specific index registers, including the instruction
pointer. Half-baked MMU."</p><p>"But potentially useful, no?"</p><p>"With extreme caution."</p><p>"How about segment registers for the 6809 or 68000?"</p><p>"You
can use the 68000's address registers for segmentation if you want,
although the segment limit problem remains, and there is a memory cycle
penalty if you don't handle the segments well."</p><p>I stopped to think my next words through.</p><p>"If
I were adding segmentation to the 6809, I'd want full 32-bit segment
registers. The limit registers would be as wide as the index registers,
so if you had a derivative with only 16-bit wide index registers, the
limit registers would also be 16-bit. Instead of a segment override
prefix like the 8086, I'd just have the register-to-register transfer
instructions move the segment and limit registers, as well."<br /></p><p>Bill and Bob were both nodding. Bill asked, "You've taken a look at the 68008, haven't you?"</p><p>"Yeah. But I'm letting Mike be the one to have fun with it."</p><p>Mike snickered.</p><p>"If it were available in, say, three months, in small lots, would you use it?"</p><p>"There
are a lot of things that a 4 megahertz 68000 is going to be no faster
doing than a 1 megahertz 6809, because of the memory cycle speed, the
extra width of instructions, and other things. Many of those things are
precisely what a personal computer is going to be used for. A 4
megahertz 68008 is going to be about half to two thirds of the speed of
the 68000, I think. The only advantage is the megabyte address space,
which really won't be quite enough in the near future."</p><p>Bill and Bob both frowned.</p><p>I
continued, "Now, if we had a further evolution of the 6801 with an
additional 8 bits on the top of the index register and program counter, a
long jump, and either a long load of X or a transfer A to XHi or some
such, at a price not too much higher than the 6801, that would make a
good cheap personal computer. Or that evolved 6809 with PC, X, Y, U, and
S extended by 16 bits, and new load effective address modes to make the
long addresses accessible, again, at a price not much higher than the
6809, that would be ideal for the current market."</p><p>"One megabyte is too tight?" Bob asked.</p><p>"64 kilobytes is too tight?" Bill asked.</p><p>"Look
at the 6847. Julia and I and my sister write reports using that because
we are patient with the narrow window on the text, and we like the
ability to type, think, erase, and type again. But my mom just gets
frustrated, and my dad barely avoids going to sleep. People with no
reason to be patient won't get it, and they are the ones who will be
buying most of the personal computers sold. A personal computer has to
be able to show the equivalent of a typewritten page on its screen, at
minimum, or at least have a clear upgrade path to get there. That's
what's stalling Radio Shack's Color Computer in the market right now.
Besides lack of MMU."</p><p>Pete said, "But that would only be a 2
kilobyte screen buffer. I've seen the Japanese personal computers, and
they're pretty functional with only 16 bits of address."</p><p>"How functional?"</p><p> "All the useful characters."</p><p>"Not
by a long shot. Less than two thousand. The real count for a good
newspaper is estimated at over 3,000 characters, but they aren't taking
into account that what will be included in that 3000 will vary from
month to month. And even newspapers will use really oddball characters
regularly, when they need something more precise in meaning, and if you
include the ability to display all the oddball characters, you're well
into 9,000 characters or more. Add historical characters and you easily
triple that count. Chinese is on the order of a hundred thousand
characters. Sixteen bits doesn't cut it, except for very limited
purposes like cash register receipts and utility bills."</p><p>"You can't be serious."</p><p>"I've
lived over there. I know the hype they give the current crop of PCs and
the sell-job they give the new student of the language, and I know the
reality when you start reading serious literature."</p><p>"How does anyone remember them all?"</p><p>"They
don't, but that's going to be one of the things a real personal
computer will be good for, helping them find and use the ones that they
have trouble remembering. The personal computers they have now are very
limited in scope relative to what they need, and what they will have in
the future. They sell because they don't have anything better." <br /></p><p>I
continued after a moments' thought, "If the characters are to have
decently defined glyphs, you want bit-mapped characters that are 32 by
32 pixels, not 16 by 16. 10,000 characters at 128 bytes per glyph is
going to eat up a megabyte of address spaced pretty quickly." (Vector
glyphs were still a bit exotic for a conversation like this, that year.)
<br /></p><p>"And graphics." I pointed at the TV. "How many kilobytes is
the graphics mode screen buffer on the 6847, for just fuzzy monochrome
on a color TV?"</p><p>"Six."</p><p>"How would the same resolution
graphics in four colors be, if the 6847 supported it, or if you modified
the output and added the RAM?"</p><p>"An extra bit per pixel, so twelve."</p><p>"That
takes 12K out of the program space on the 6801 or 6809, just for four
colors, and everyone will want a much bigger gamut of color. And
resolution at least double what the 6847 offers. 64K was tight to start
with, and a megabyte will soon be tight for color graphics. One
advantage, I guess, to the 68008 is the implicit upgrade path to the
68000, but 24 bits of address will shortly be too few, also."</p><p>"16 megabytes too tight? RAM is expensive," Sharon pointed out.</p><p>"If
you don't want to be a foundry for other companies' designs, you have
to have a base technology where you develop your testing and
manufacturing techniques. That's RAM. It pays for itself without even
being on the market by helping you get your other products right,
faster."</p><p>"That kind of thinking'll push the price of RAM right through the floor," Motorola's Bob said with a frown.</p><p>"But
you won't care, because RAM pays for itself in shortening your
development cycles for your profitability products. RAM should be like
candy, anyway."<br /></p><p>"RAM should be like candy." Bill harrumphed.
"I think you've said that before." He reached into his briefcase and
pulled out an advanced information datasheet and handed it to me. "Has
Denny shown you this?"</p><p>The datasheet described the 68010. I scanned it quickly. "No. Can Julia and Mike also take a look at this?"</p><p>"Sure. And anyone else in this room, really."</p><p>I showed Julia the changes in the addressing mode, allowing 32 bit constant offsets, and the short loop cache mode. </p><p>She tilted her head grinned apologetically. "I guess it's an improvement?"</p><p>"Definitely. And the exception frame looks more manageable."</p><p>I passed it to Mike, and Bob and Jennifer looked over his shoulder. </p><p>After
a quick scan, he looked up. "Why isn't the 68008 based on this? The
short loop execution mode would be especially useful when memory's only
eight bits wide."<br /></p><p>"Timing. Market and management." Bob shrugged.<br /></p><p>"If
I were you guys, I'd hold the 68008 off until I could make it an 8-bit
version of the 68010. In spite of the fact that I personally really want
to get my hands on one."</p><p>I nodded my agreement with Mike. "Or, if
you just have to have an eight-bit 68000 now and this allows testing to
complete more quickly, plan and advertise a 68018 that will be an 8-bit
68010."</p><p>"What if we have plans for adding more addressing modes
and wider math, and dropping the loop mode for a small general cache, in
a CPU in the early planning stages?" Bill's face was unreadable. "Not
saying we do, but what if?"<br /></p><p>I took a deep breath. "You know,
extended mode was added to the index post-byte for doing memory indirect
on absolute addresses. I'm wondering how much more it would have cost
to included direct page in the index post-byte, as well. That would
allow using the load effective address instruction to get the address of
a direct page variable without using the accumulator. But adding much
more would get into negative trade-offs."</p><p>"You're not talking about the 6809?"</p><p>"Exactly.
The 6502 needs two kinds of memory indirect because it's so register
poor. And those two kinds were a very strategic choice. The 68000
already effectively has both kinds, because it has lots of indexable
registers. It doesn't need more, not considering how much it will cost
to test and get right. And it especially doesn't need addressing modes
that can be as quickly executed using existing instructions and a
register or two. Sure, eight address registers is a shade tight for some
uses, but you don't want to clutter the upgrade path to a 64-bit CPU
with a bunch of untestable addressing mode."<br /></p><p>There was a chorus of cleared throats and exchanged glances. <br /></p><p>"Instead,
would it cost too much to somehow allow engineers to experiment with
variations of your primary designs, to push the envelope?"</p><p>"What do you mean?" asked Bill.</p><p>"Like a skunkworks, but officially supported."</p><p>Motorola's Bob leaned forward. "Assuming we dare put our fab facilities at risk, where are we going to get the manpower?"</p><p>"Just let your engineers take up to eight hours a week on blue-sky projects on company time, no questions asked."</p><p>Sharon shook her head. "We're already short of time."<br /></p><p>"Blue-sky
projects give you a chance to figure out better ways to do things.
You'll end up being more efficient and closer to on-schedule."</p><p>"Hard to believe," Pete complained.</p><p>I shrugged. "Well, you guys have the experience, not me. I've said my opinion."<br /></p><p>"Okay,
we have another addendum." Ms. Philips and Ms. Steward looked up from
their writing and interrupted, and Ms. Philips showed Bill what they
had. He passed the addendum to Bob, and Bob looked it over and passed it
to me.</p><p>It consisted of mutual permission to use ideas and
concepts we had talked about over the course of a couple of hours that
night with a promise of best effort to offer each other consideration.
The five of us figured that was more than agreeable, and added it to our
agreement contracts.<br /></p><p>As we wrapped up, Jesse asked me, "Could you put a Forth interpreter on a 6805?"
</p><p>
"Self-hosted?"</p>
<p>
"Of course."</p>
<p>
Julia looked up from the notes she and Ms. Steward were arranging to make copies of. </p><p>"Self-hosted?" she asked. "That's where the language
runs on the same processor that compiles the code, kind of the opposite
of the cross-assembler that runs on the 6800 but produces code for the
6805?"</p>
<p>
I nodded. "Yeah. Maybe self-hosted could be done, if you have enough ROM and RAM. The virtual
instruction pointer needs more than 8 bits, but self-modifying code
might work -- using an extended mode jump where the code writes over the
jump address before executing the jump. Cheating, but it might work."</p>
<p>
Jesse smirked and I chuckled.</p>
<p>
Julia asked, "Can you show me an example?"</p>
<p>
She handed me her pad again, and I wrote out some code:</p>
<p>
</p>
<blockquote>
NEXTIP <br /> LDA IP+1<br /> STA SELFMO+2 ; direct-threaded<br /> LDA IP <br /> STA SELFMO+1<br />SELFMO <br /> JMP $EEEE ; provisional target address<br />* The 16 bit address $EEEE just got overwritten by the target address. </blockquote><p>She looked at it with a frown. "What's the purpose in this?"</p>
<p>
"It's the part of the virtual machine emulator where the CPU calls the
code to emulate each virtual instruction. And each emulation routine
ends in a jump back to NEXT."</p><p>She tilted her head. "Sorry. I'm totally lost."</p><p>"For example, the routine to add two numbers on the stack would look something like this:</p><blockquote>PLUS<br /> LDX USP ; parameter stack<br /> LDA 3,X ; low bytes<br /> ADDA 1,X<br /> STA 3,X<br /> LDA 2,X ; high bytes<br /> ADCA ,X<br /> STA 2,X<br /> INX ; drop argument<br /> INX<br /> STX USP ; update the stack pointer<br /> JMP NEXT</blockquote>"The routine for a jump would look something like this:"<br /><blockquote>BRANCH<br /> LDX IP ; IP is pointing at the in-line offset.<br /> LDA IP+1<br /> ADDA #2 ; bump past offset<br /> BCC BRANC0<br /> INC IP<br />BRANC0<br /> ADDA 1,X ; add the low byte of the offset<br /> STA IP+1<br /> LDA IP<br /> ADCA ,X ; and the high byte<br /> STA IP<br /> JMP NEXT</blockquote><p>"And the routine for nesting calls would look something like this:"<br /></p><blockquote>CALL<br /> LDX RSP ; return address stack<br /> DEX ; room for old IP<br /> DEX<br /> STX RSP<br /> LDA IP+1<br /> ADDA #2 ; bump past call address<br /> BCC CALL0<br /> INC IP<br />CALL0<br /> STA 1,X ; tuck the address to return to away<br /> LDA IP<br /> STA ,X</blockquote><p>And then I was stuck. </p><p> "Wait. This isn't going to work."</p><p>Jesse chuckled again. <br /></p><p>I
went back to the NEXT routine. "Yep. I'm forgetting to actually get the
jump address in the NEXT routine, and maybe a bit more."</p><p>Jesse agreed with a grunt. </p><p>I
shook my head and laughed. After staring at the code for NEXTIP for a
minute or two while Jesse smirked and Julia looked puzzled, I shook my
head. "Not having a sixteen-bit pointer is a real pain." </p><p>Julia
met my eyes and sighed. "Don't worry about it. I don't think the eight
kilobyte maximum address space is going to leave much room for a program
to run in, anyway."</p><p>"Yeah, but they're going to eventually make a chip with a full sixteen-bit wide CPU. I want to convince myself of this."</p><p>Her forehead creased.</p><p>"We need to grab two bytes pointed at by the sixteen bit IP in the direct page."<br /></p><blockquote>NEXTIP<br /> CLR NXADD1+1<br /> LDA IP+1<br /> STA NXADD1+2<br /> INCA <br /> STA NXADD2+2<br /> BNE NEXT00<br /> INC NXADD2+1<br />NEXT00<br /> LDA IP<br /> STA NXADD1+1<br /> ADDA NXADD2+1<br /> STA NXADD2+1<br />NXADD1<br /> LDA #$EEEE<br /> STA NXJMP+1<br />NXADD2<br /> LDA #$EEEE<br /> STA NXJMP+2<br />NXJMP<br /> JMP $EEEE ; provisional target address<br />* Had to overwrite lots of addresses.</blockquote>I sighed. "And that's going to run us out of RAM."<p>Jesse let out a horse laugh.</p><p>"I guess this needs to be done a bit more simply."</p><p>"No.
I think you nailed it. But put the code up to NXADD1 in ROM, followed
by a jump to NXADD1 in RAM." He continued to chuckle. <br /></p><p>Julia said, "It's okay. I don't care. We're all tired. Let's go home, or, well, back to your brother's place."</p><p>"But I want to work the rest of this out. Borrow from ..." </p><p>She
took the Forth listing I had picked back up and her pencil and the
sheet of paper I was trying to work on out of my hands while Jesse
laughed. </p><p>"You got a real jewel there, Joe," he said. "You better
listen to her. And don't worry about the Forth on the 6805. That's about
as good as it gets, and as Julia says, it's not much use until we have a
6805 MPU with fourteen bits of address. And I look forward to working
with you as an intern, and having you join us when you graduate. I like
the way you think. I think we all do." He looked around at the engineers
and his managers, and everyone nodded in agreement.</p><p>I suddenly turned Japanese and ducked my head. "Sorry. I mean, thanks."<br /></p>
<div style="text-align: right;">
Chapter 14.3: Rocks -- what? <br /></div>
<div style="text-align: center;"><a href="https://www.blogger.com/#">TOC</a></div><br />
<hr />
[Backed up at <a href="https://joel-rees-economics.blogspot.com/2020/09/bk-33209-rocks-moving-ahead.html">https://joel-rees-economics.blogspot.com/2020/09/bk-33209-rocks-moving-ahead.html</a>.]<br />
零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0Osaka, Japan34.6937249 135.50225352.827251186359657 100.3460035 66.560198613640338 170.6585035tag:blogger.com,1999:blog-5855642260993556818.post-36688035933032032742020-09-08T21:57:00.002+09:002020-09-14T10:23:32.275+09:00Backup: 33209: Rocks -- Bit MultiplyBackup of <a href="https://joelrees-novels.blogspot.com/2020/09/33209-rocks-bit-multiply.html">https://joelrees-novels.blogspot.com/2020/09/33209-rocks-bit-multiply.html</a>.<br />
<hr />
<a href="https://joelrees-novels.blogspot.com/2020/08/33209-rocks-2805.html">Chapter 14.0 Rocks -- 2805</a><br />
<br />
<h4 style="text-align: center;">
Chapter 14.1: Rocks -- Bit Multiply </h4>
<br />
Julia caught my eye with a puzzled look.<br />
<br />
"Gotta question?"<br />
<br />
She nodded. "The 6805 doesn't have a multiply instruction."<br />
<br />
"True."<br />
<br />
"Neither does the 6800."<br />
<br />
"Right."<br />
<br />
"Tiny BASIC and Forth don't multiply 12 by 10 by adding twelve up ten times, do they?"<br />
<br />
"No, ..."<br />
<br />
"Does it have something to do with that bit multiply you were talking about?" <br />
<br />
I looked around at the group of engineers, managers, legal staff, and students, and asked, "Can we take a detour?"<br />
<br />
Bill leaned back with has hands behind his head, and an expectant smile, and nodded.<br />
<br />
Motorola's Bob said, "Go ahead."<br />
<br />
"Can I borrow that Forth listing back?"<br />
<br />
Bill picked it up and handed it to me without comment.<br />
<br />
I
opened it up and leafed through it until I found the USTARS routine on
page 17 (SCR 23). I read through the routine, thought for a moment, then
set it back down, reaching for a pencil that wasn't there in my shirt
pocket.<br />
<br />
Julia turned her notepad to a blank page and handed it and her pencil to me.<br />
<br />
"Thanks.
Say we want to multiply two eight-bit numbers. I'm going to arbitrarily
pick eleven and five." I wrote the two numbers down in binary and
decimal, vertically, for multiplying by hand, then proceeded to work the
product out. "I'll use the method we usually use for decimal,
multiplying the multiplicand on top by each column of the multiplier on
bottom, and adding them up:<br />
<br />
<blockquote class="tr_bq">
<code> 00001011 => 11 (8+2+1)</code><br />
<code> x 00000101 => 5 (4+1)</code><br />
<code>-- -------- -------- ---</code><br />
<code> c</code><br />
<code> 00001011 => 11</code><br />
<code> 0 00000000 => 0</code><br />
<code> 00 00101100 => 44 (32+8+4)</code><br />
<code>(Abbreviating the zeroes.)</code><br />
<code>-- -------- -------- ---</code><br />
<code> 0 00000000 00110111 => 55 (32+16+4+2+1)</code></blockquote>
<br />
Julia held her hand out and I gave her back her notepad and pencil.<br />
<br />
She proceeded to write out a decimal product:<br />
<br />
<blockquote class="tr_bq">
<code> 5678<br /> x 4321<br />
---------</code><br />
<code> 5678</code><br />
<code> 113560</code><br />
<code> 1703400</code><br />
<code> 22712000</code><br />
<code>---------</code><br />
<code> 24534638<br />
</code>
</blockquote>
<br />
Mike grumbled, "Grade school."<br />
<br />
Julia
gave him a glare. "Looking at the fundamentals so I can understand what
the computer has to do, Mike!"<br />
<br />
He shrugged. <br />
<br />
She turned back to me. "Okay, I think I
can see how you're doing basically the same thing both ways. So
multiplying each column in binary is what you are calling a bit
multiply?"<br />
<br />
"Sort-of. Maybe. Perhaps more a bit multiply-and-accumulate instruction."<br />
<br />
She shook her head with a blank look and handed me back her notepad and pencil.<br />
<br />
"Hmm.
Let's look at how the Forth multiply routine works. It says it
multiplies the top two 16-bit words on the stack, and puts the low
16 bits of the result back on the stack, keeping the high 16 bits in A
and B." I picked the Forth Listing back up and copied the routine out,
modifying the comments:<br />
<br />
<hr />
USTARS<br />
LDA A #16 ; bits in a word<br />
PSH A ; counter in temporary on stack<br />
CLR A ; ready to accumulate the product<br />
CLR B ; clears carry<br />
TSX ; point X to the parameter stack<br />
USTAR2 ; top of loop<br />
ROR 5,X ; shift multiplier, pull last carry in from result<br />
ROR 6,X ; leaves low bit of multiplier in carry<br />
DEC 0,X ; count down, leaves carry alone<br />
BMI USTAR4 ; counted out?<br />
BCC USTAR3 ; skip add if low bit is 0<br />
ADD B 4,X ; low bit is 1, add<br />
ADC A 3,X ; now carry is carry from add<br />
USTAR3 <br />
ROR A ; shifts carry from add into result<br />
ROR B ; shifts low bit in accumulator into carry <br />
BRA USTAR2 ; next bit<br />
USTAR4 ; counted out<br />
INS ; remove counter from stack<br />
RTS
<br />
<hr />
<br />
Julia shook her head.<br />
<br />
I grinned.
"Yeah, it looks like it's out of phase with itself, but that's because
it's reusing the multiplier variable to pick up the low bits of the
result. Saves space on stack and saves some shifting instructions."<br />
<br />
"Out of phase?" Now she gave me a moue.<br />
<br />
"Like
the loop starts part-way through, because it kind of does. Hmm. Let's
write a loop that would look more like what we do on paper." I stopped
to think, then started to write and erase and rewrite.<br />
<br />
"To
avoid confusion, let's not use any tricks. In fact, let's not use the S
stack for parameters, either. But there will be one sort-of-trick,
shifting the value down in the accumulator is the same as shifting the
calculation window up."<br />
<br />
"Oh-kay ..." But she looked even more perplexed.<br />
<br />
Here's what I ended up with:<br />
<br />
<hr />
* Multiplicand at 2,X:3,X<br />
* Multiplier at 0,X:1,X<br />
USTAR<br />
LDX PSP ; parameter stack<br />
DEX ; allocate work space<br />
DEX<br />
DEX <br />
DEX<br />
DEX <br />
STX PSP ; just in case <br />
* Multiplicand at 7,X:8,X<br />
* Multiplier at 5,X:6,X<br />
LDAA #15<br />
STAA 4,X ; bit count<br />
CLR 3,X<br />
CLR 2,X ; result low word<br />
CLR 1,X<br />
CLR 0,X ; accumulator, result high word <br />
USTARL<br />
CLC ; known state<br />
LDAA #1<br />
BITA 6,X ; low bit of multiplier <br />
BEQ USTARN<br />
LDAB 1,X<br />
ADDB 8,X ; multiplicand low byte<br />
STAB 1,X<br />
LDAB 0,X<br />
ADCB 7,X ; multiplicand high byte<br />
STAB 0,X<br />
USTARN<br />
DEC 4,X<br />
BMI USTARD<br />
* Relativity -- <br />
* shifting the contents right is same as<br />
* shifting the calculation window left.<br />
ROR 0,X ; moves carry into accumulator<br />
ROR 1,X<br />
ROR 2,X ; shift into low word<br />
ROR 3,X<br />
LSR 5,X ; shift multiplier down<br />
ROR 6,X ; for next bit test (relative shift)<br />
BRA USTARL<br />
USTARD<br />
LDAA #3 ; 4 bytes to copy<br />
USTARC ; copy result back into stack<br />
LDAB 0,X<br />
STAB 5,X<br />
INX<br />
DECA<br />
BPL USTARC<br />
INX ; drop count from stack<br />
STX PSP ; restore parameter stack pointer<br />
RTS<br />
<hr />
<br />
She looked the code over. "Do you have to save and load
accumulator B every time through? Nothing else seems to be happening to
it and it would save instructions and time."<br />
<br />
"Yep."<br />
<br />
"And,"
she paused, "could you use an ANDA instead of a TSTA to test the low
bit of the multiplier, since you reload it each time through?"<br />
<br />
"Sure."<br />
<br />
"Hmmm.
In the Forth code, shifting the multiplier right and testing the carry
is another way of testing the lowest bit, isn't it?"<br />
<br />
"That's right, and it does save a few more instructions."<br />
<br />
"On the 6805, you could use a branch if set instruction, couldn't you?"<br />
<br />
"I was afraid you were going to ask that."<br />
<br />
"It wouldn't work?"<br />
<br />
"Well,
the multiplier has to be addressed as a direct page variable if you use
the BRSET or BRCLR instruction. I assume you would use BRCLR. Other
than that, it should work."<br />
<br />
She thought for a minute. "Well, using global parameters, ...," and started writing.<br />
<br />
<hr />
ORG $80 <br />
MCAND RMB 2<br />
MPLIER RMB 2<br />
BITCT RMB 1<br />
ACCM RMB 4<br />
*<br />
ORG $200 <br />
USTAR <br />
LDA #15<br />
STA BITCT<br />
CLR ACCM<br />
CLR ACCM+1<br />
CLR ACCM+2<br />
CLR ACCM+3<br />
USTARL<br />
CLC ; known state<br />
BRCLR #0,MPLIER,USTARN<br />
LDA ACCM+1<br />
ADD MCAND+1<br />
STA ACCM+1<br />
LDA ACCM<br />
ADC MCAND<br />
STA ACCM<br />
USTARN DEC BITCT<br />
BMI USTARD<br />
ROR MCAND<br />
ROR MCAND+1<br />
ROR MCAND+2<br />
ROR MCAND+3<br />
LSR MPLIER<br />
ROR MPLIER+1<br />
BRA USTARLUSTARD<br />
RTS<br />
<hr />
<br />
"And an 8-bit multiply probably wouldn't have to save and load the accumulator?"<br />
<br />
"I think it wouldn't. Looks good, let's test it later."<br />
<br />
She thought some more and started writing again.<br />
<br />
<hr />
USTAR LDX PSP ; parameter stack<br />
DEX ; allocate work space<br />
DEX DEX <br />
* Multiplicand at 5,X:6,X* Multiplier at 3,X:4,X<br />
LDAA #15<br />
STAA 2,X ; bit count<br />
LDD #0 <br />
STD 2,X ; result low word<br />
STD 0,X ; accumulator, result high word <br />
USTARL<br />
LSR MPLIER<br />
ROR MPLIER+1<br />
BCC USTARN <br />
BEQ USTARN<br />
ADDD 7,X <br />
USTARN DEC 4,X<br />
BMI USTARD<br />
RORA ; moves carry into accumulator RORB <br />
ROR 0,X ; shift into low word<br />
ROR 1,X<br />
BRA USTARLUSTARD<br />
STD 3,X <br />
LDD 0,X <br />
STD 5,X<br />
INX<br />
INX<br />
INX ; drop count from stack<br />
RTS<br />
<hr />
<br />
"Did I get that right?"<br />
<br />
"I think so. Pretty close if not."<br />
<br />
"So, would an instruction that adds the source to the accumulator if the carry is set be your bit multiply?"<br />
<br />
"Yes and no. If you want to extend the multiply to 32 bits, I'm pretty sure you'll have conflicting uses of the carry."<br />
<br />
"Oh. Adding the multiplicand is going to set the carry and overwrite the state of bit 0, so it would only work once."<br />
<br />
"Myep.
The bit multiply would need to be based on the branch if bit 0 clear or
bit test immediate 1 instruction, instead of testing the carry. And
we'd want to be able to specify both the multiplier and multiplicand
independently, too, if it's going to be extendable."<br />
<br />
"And it'd replace just the branch and the add, so it wouldn't really speed things up that much."<br />
<br />
"Right.
If it's going to speed things up, it also has to shift the multiplier
and the accumulator. And the carry out of the bottom bit of the
accumulator has to go somewhere, so there's a third memory argument. And
shifting into low-order fields after the low-order fields have already
been added and shifted is going to double-shift the low-order fields, so
I guess trying to make it extendable is just not going to work."<br />
<br />
"What if you don't shift the accumulator fields in memory?"<br />
<br />
"That's going to make it hard to do one bit at a time."<br />
<br />
Ms. Philips cleared her throat. "Bob, have these two just shared things that should have been trade secrets?"<br />
<br />
I looked up. "I'm sure your engineers have been down this road before."<br />
<br />
Greg
nodded. "We have. I must admit, it took me longer, but I was working by
myself and making sure I had enough notes to explain what would happen
to my manager."<br />
<br />
"Gate counts, power dissipation, that kind of thing?"<br />
<br />
"Right."<br />
<br />
Jesse leaned forward with a grin. "Dang. And you two do this kind of thing for fun."<br />
<br />
I grinned back.<br />
<br />
Julia
sighed. "He does." And she smirked. "Oh, it's kind of fun watching him
go down the rabbit holes, and sometimes going down there with him."<br />
<br />
That got more whistles and some "Hey, hey, hey!" comments. <br />
<br />
<code><code></code></code><code><code></code></code><code><code></code></code><br />
<div style="text-align: right;">
<code><code><a href="https://joelrees-novels.blogspot.com/2020/09/33209-rocks-moving-ahead.html">Chapter 14.2: Rocks -- Moving Ahead</a><br /></code></code></div>
<code><code>
</code></code>
<br />
<div style="text-align: center;">
<code><code><a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></code></code></div>
<code><code>
</code></code>
<br />
<hr />
<code><code>
<i>[Backed up at <a href="https://joel-rees-economics.blogspot.com/2020/09/bk-33209-rocks-bit-multiply.html">https://joel-rees-economics.blogspot.com/2020/09/bk-33209-rocks-bit-multiply.html</a>.]</i><br />
<br />
<i> </i><i> </i><br />
<i> </i></code></code>零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-80500146539788285822020-08-24T21:40:00.000+09:002020-09-06T19:58:34.183+09:00Backup01: 33209: Rocks -- 2805Third version backup of <a href="https://joel-rees-economics.blogspot.com/2020/08/bk-33209-rocks-2805.html">https://joel-rees-economics.blogspot.com/2020/08/bk-33209-rocks-2805.html</a>.<br />
<hr />
<a href="https://joelrees-novels.blogspot.com/2020/08/33209-straits-intellectual-property-agreements.html">Chapter 13.8 Straits -- Intellectual Property Agreements</a><br />
<br />
<h4 style="text-align: center;">
Chapter 14.0: Rocks -- 2805 </h4>
<br />
Bill grinned sardonically. "Well, I think this will work out well."<br />
<br />
(You may want to put your BS meter away for this chapter, or at least set the threshold level pretty high.) <br />
<br />
Bob
chuckled. "Stephanie, can you get together with Carrie and see that
what these three signed gets replaced with a more appropriate
agreement?"<br />
<br />
"I'd be happy to, sir."<br />
<br />
"The same as Joe and Julia's agreements, with an addendum for their projects?" Ms. Philips asked.<br />
<br />
Bill answered for him. "Yes, yes, of course."<br />
<br />
And Bob nodded.<br />
<br />
Ms. Steward, Ms. Philips, Mike, our Bob, and Jennifer got together at one end of the table.<br />
<br />
As
Julia and I connected her mainboard to one of the TVs, I whispered to
her. "I thought the two guys were from Motorola's legal department."<br />
<br />
"I did, too," she whispered back. "Must be much higher up in management."<br />
<br />
I nodded my agreement.<br />
<br />
(No, I never even came close to meeting Motorola's Bob and Bill in the real world.)<br />
<br />
A number of engineers came in, bringing in pizza and liquid refreshment.<br />
<br />
"Your
friends," Motorola's Bob said to me with a grin, "are having pizza
elsewhere. I think we should have some pizza in here, too." He turned to
one of the engineers. "Jess, I hope there's something non-alcoholic to
drink?"<br />
<br />
The engineer named Jesse started, and looked up guiltily from the six-packs he was carrying. "Erm ...."<br />
<br />
An
engineer on the other side of the room called out, "Denny made sure we
had root beer, and I made sure we had some other options." He held up
two-liter bottles of soft drinks. "Not all of us are fueled by beer."<br />
<br />
"Good job, Tobe."<br />
<br />
Tobias gave Bob a thumbs-up.<br />
<br />
As we ate pizza and talked, we demonstrated what we had done so far -- the ROM
menus, BASIC, TSC's debug system, and Flex, and using Flex to run Motorola's
assemblers.<br />
<br />
We shared some comments and discussion of the process of getting Flex to run on the Micro Chroma 68, and I
described my dynamic RAM refresh circuit, explaining how I borrowed the video
scan counter of the 6847, and mentioning the problems I had run into with my original design. I also explained the simplistic
bank switching that made it possible to run Flex.<br />
<br />
Several of the engineers commented on how my refresh circuit sounded similar
to a circuit the engineers who worked with Radio Shack on the Color Computer had produced before
they designed the sequential address multiplexor as a separate circuit. Not yet being familiar with the SAM, I couldn't comment.<br />
<br />
Jennifer,
our Bob, and Mike had taken care of their paperwork by then. Bob knew
something about the SAM already, and he discussed it a bit with the
engineers. <br />
<br />
We showed them the 6801
daughterboard on Julia's mainboard, and her keyboard, and she described
the way we were using the 6805 and its timer to scan and debounce the
keyboard and control the hexadecimal display, augmenting the I/O with
either latch or multiplexor.<br />
<br />
Then she loaded Forth on her computer from
tape and used it to send numbers out to her keyboard's hexadecimal
display.<br />
<br />
We stopped for a few minutes while Bob, Bill,
and some of the engineers discussed whether Motorola wanted to ask us
for permission to use the keyboard decoder/numeric display design and
code for an application note, and the upshot was that they did, and the
five of us agreed to discuss that with the rest of the group.<br />
<br />
Most
of the engineers were appreciative of Julia's Forth examples, and I
explained what I had done to get the drivers to work, mentioning that we
hadn't solved the disk problems yet for Forth.<br />
<br />
My disk
interface was the topic of considerable discussion, and Ms. Philips and
Ms. Steward quickly produced a sharing addendum to allow us to get the
schematics out for everyone to look at. Before long, Julia and I had
another addendum to our agreements -- an internship contract for
producing several tech notes on the use of the 6801 as a floppy disk
controller. The addendum allowed Motorola the option of building a
semi-custom "system on a chip" SOC floppy disk controller based on my
circuits.<br />
<br />
Denny had already shared the schematics Julia
had drawn up from my scrawls with some of his friends. But now the
context was Motorola, so the addendum was deemed wise.<br />
<br />
"Ah,
to be an undergrad with all the time in the world again," Tobias
reflected jocularly. "Do you think you could get a 6805 to handle the
floppy controller functions?" <br />
<br />
I tilted my head and
thought. "That would probably limit sector size, with X being only eight
bits. Come to think of it, the size of X might require enough extra
code to prevent the processor from keeping up with the data."<br />
<br />
Another engineer, Sharon, asked, "What's your general impression of the 6805?"<br />
<br />
"It does the job for little things like the keyboard controller," our Bob volunteered.<br />
<br />
I concurred. <br />
<br />
There was general approval of that analysis.<br />
<br />
"But I miss stack support," I added.<br />
<br />
"On an eight-bitter?" Jesse queried. "You'd prefer the 6502, maybe?"<br />
<br />
Jennifer noted, "The 6502 is a clever design, but it belongs to MOS Technologies and Commodore, doesn't it?" <br />
<br />
(In
the real world, Motorola might have been smart to use their patent
agreements with MOS Technologies and second-source the 6502 in the late
1970s. They did offer to produce SOC chips with the 6502 as the CPU core
in the mid-to-late 1980s. But that history is not for this story.)<br />
<br />
"The
6502 is a good chip," I asserted. "It straddles some boundaries like
the 6809, but I think the way it does so constrains compatible upgrade
paths." I paused for thought and emphasis. "Every application wants room
to grow. Maybe some shouldn't, but many can profitably grow in scope
and function. And growing software reliably wants things like code
re-use by re-entrant subroutine call, and keeping subroutines re-entrant
requires something like a stack that you can push to and pop from, for
parameters and local variables. There's no push or pop on the 6805."<br />
<br />
Julia
added, "Even if you aren't calling subroutines a lot, a stack helps
manage RAM. Global RAM is harder to keep track of, even if you never
re-use any variables."<br />
<br />
I turned and raised my eyebrows. "You're picking this stuff up."<br />
<br />
"A little. Dad has been explaining things you haven't."<br />
<br />
"Oh. Sorry. I'll have to do better."<br />
<br />
"It's okay." She smiled. "He enjoys it. He always wanted his oldest child to be an engineer."<br />
<br />
"Now I know why he likes me so much."<br />
<br />
We grinned at each other, then Julia coughed discreetly.<br />
<br />
I
ducked my head and turned back to the engineers, several of whom were
quietly clapping their hands, rolling their eyes, or pretending to give
us wolf-whistles.<br />
<br />
"Anyway, as Julia points out, a stack
you can reference makes RAM much easier to manage. Of course, you can
synthesize a stack, but synthesizing is slow, and a disincentive, and
the code to support the synthesized stack is a distraction."<br />
<br />
An engineer named Pete objected. "Moving up to the 6801 is not that hard."<br />
<br />
"But
it does require reworking a lot of the code, and checking all of it for
side-effects of the differences between the two," I parried. "And there
are the bit manipulation instructions in the 6805 that the 6801 does
not have, easy enough to synthesize on the 6801, but still requiring
time and effort. Adding stack support to the 6805 ought not to be that
much of a change, and it would support quite a bit of application
growth. That would give the customers' engineers much more confidence in
choosing the improved 6805 for small projects with the potential to
become large."<br />
<br />
(The 68HC11, an evolutionary step from
the 6801 that Motorola introduced in 1984, did have bit manipulation
instructions. And the 6805 itself later evolved to the confusingly named
68HC08, which did introduce more complete stack support via instruction
pre-byte escape -- single stack with stack indexing, as opposed to the
dual stack and index marking I suggest below. In the real world.
Several years later.) <br />
<br />
Jesse countered, "Okay, how do
you propose to add stack support with minimal change? Pre-bytes like on
the 6809 are too expensive for a pure eight-bitter."<br />
<br />
(Well, they were just a little too expensive in the early 1980s.)<br />
<br />
"Add
a second stack register. Maybe call it U for user stack, following the
6809's register naming. Add push and pop instructions that push and pop
to the U stack, and transfer instructions that allow moving U to X and
back. And instructions to save U and restore it using the S stack. Eight
instructions should do the trick."<br />
<br />
Julia handed me a sheet of scratch paper, and I wrote down the additional instructions:<br />
<blockquote class="tr_bq">
PSHUA, PULUA<br />
PSHUX, PULUX<br />
PSHSU, PULSU<br />
TUX, TXU </blockquote>
I drew out a map of the registers of the 6805, except for the condition codes:<br />
<br />
<table border="1">
<tbody>
<tr>
<th>6805 register</th>
<th width="5%">b<sub>15</sub></th><th width="5%">b<sub>14</sub></th><th width="5%">b<sub>13</sub></th><th width="5%">b<sub>12</sub></th>
<th width="5%">b<sub>11</sub></th><th width="5%">b<sub>10</sub></th><th width="5%">b<sub>9</sub></th><th width="5%">b<sub>8</sub></th>
<th width="5%">b<sub>7</sub></th><th width="5%">b<sub>6</sub></th><th width="5%">b<sub>5</sub></th><th width="5%">b<sub>4</sub></th>
<th width="5%">b<sub>3</sub></th><th width="5%">b<sub>2</sub></th><th width="5%">b<sub>1</sub></th><th width="5%">b<sub>0</sub></th>
</tr>
<tr>
<th>A:</th><td colspan="8"><br /></td>
<td>A<sub>7</sub></td><td>A<sub>6</sub></td><td>A<sub>5</sub></td><td>A<sub>4</sub></td>
<td>A<sub>3</sub></td><td>A<sub>2</sub></td><td>A<sub>1</sub></td><td>A<sub>0</sub></td>
</tr>
<tr>
<th>X:</th><td colspan="8"><br /></td>
<td>X<sub>7</sub></td><td>X<sub>6</sub></td><td>X<sub>5</sub></td><td>X<sub>4</sub></td>
<td>X<sub>3</sub></td><td>X<sub>2</sub></td><td>X<sub>1</sub></td><td>X<sub>0</sub></td>
</tr>
<tr>
<th>SP:</th><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td>
<td>1</td><td>(SP<sub>6)</sub></td><td>SP<sub>5</sub></td><td>SP<sub>4</sub></td>
<td>SP<sub>3</sub></td><td>SP<sub>2</sub></td><td>SP<sub>1</sub></td><td>SP<sub>0</sub></td>
</tr>
<tr>
<th>PC:</th>
<td><sub>--</sub></td><td>--</td><td>--</td><td>PC<sub>12</sub></td>
<td>PC<sub>11</sub></td><td>PC<sub>10</sub></td><td>PC<sub>9</sub></td><td>PC<sub>8</sub></td>
<td>PC<sub>7</sub></td><td>PC<sub>6</sub></td><td>PC<sub>5</sub></td><td>PC<sub>4</sub></td>
<td>PC<sub>3</sub></td><td>PC<sub>2</sub></td><td>PC<sub>1</sub></td><td>PC<sub>0</sub></td>
</tr>
</tbody></table>
<br />
Then I drew out a modified map, including the U stack:<br />
<br />
<table border="1">
<tbody>
<tr>
<th>2805 register</th>
<th width="5%">b<sub>15</sub></th><th width="5%">b<sub>14</sub></th><th width="5%">b<sub>13</sub></th><th width="5%">b<sub>12</sub></th>
<th width="5%">b<sub>11</sub></th><th width="5%">b<sub>10</sub></th><th width="5%">b<sub>9</sub></th><th width="5%">b<sub>8</sub></th>
<th width="5%">b<sub>7</sub></th><th width="5%">b<sub>6</sub></th><th width="5%">b<sub>5</sub></th><th width="5%">b<sub>4</sub></th>
<th width="5%">b<sub>3</sub></th><th width="5%">b<sub>2</sub></th><th width="5%">b<sub>1</sub></th><th width="5%">b<sub>0</sub></th>
</tr>
<tr>
<th>A:</th><td colspan="8"><br /></td>
<td>A<sub>7</sub></td><td>A<sub>6</sub></td><td>A<sub>5</sub></td><td>A<sub>4</sub></td>
<td>A<sub>3</sub></td><td>A<sub>2</sub></td><td>A<sub>1</sub></td><td>A<sub>0</sub></td>
</tr>
<tr>
<th>X:</th><td colspan="8"><br /></td>
<td>X<sub>7</sub></td><td>X<sub>6</sub></td><td>X<sub>5</sub></td><td>X<sub>4</sub></td>
<td>X<sub>3</sub></td><td>X<sub>2</sub></td><td>X<sub>1</sub></td><td>X<sub>0</sub></td>
</tr>
<tr>
<th>U:</th><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td>
<td>1</td><td>(U<sub>6</sub>)</td><td>U<sub>5</sub></td><td>U<sub>4</sub></td>
<td>U<sub>3</sub></td><td>U<sub>2</sub></td><td>U<sub>1</sub></td><td>U<sub>0</sub></td>
</tr>
<tr>
<th>SP:</th><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td>
<td>0</td><td>0</td><td>SP<sub>5</sub></td><td>SP<sub>4</sub></td>
<td>SP<sub>3</sub></td><td>SP<sub>2</sub></td><td>SP<sub>1</sub></td><td>SP<sub>0</sub></td>
</tr>
<tr>
<th>PC:</th>
<td><sub>--</sub></td><td>--</td><td>--</td><td>PC<sub>12</sub></td>
<td>PC<sub>11</sub></td><td>PC<sub>10</sub></td><td>PC<sub>9</sub></td><td>PC<sub>8</sub></td>
<td>PC<sub>7</sub></td><td>PC<sub>6</sub></td><td>PC<sub>5</sub></td><td>PC<sub>4</sub></td>
<td>PC<sub>3</sub></td><td>PC<sub>2</sub></td><td>PC<sub>1</sub></td><td>PC<sub>0</sub></td>
</tr>
</tbody></table>
<br />
"Keeping the stacks separate will allow
moving the return stack out of the direct page. It could then be given
its own port to the CPU, in its own address space, with separate on-chip
address and data lines. That would allow proceeding to the next
instruction while the call instruction stacks the return address. That
way, calls should end up costing no more than jumps, and it should be
possible to make the return operator faster, as well."<br />
<br />
The comment about calls taking less time got some discussion of a nature too technical to bore you with here.<br />
<br />
Except for the subroutine entry and exit protocol. "Subroutines," I continued, "could look like this:"<br />
<blockquote class="tr_bq">
ROUTINEA<br />
TUX<br />
LDA 0,X ; 1st parameter<br />
LDX 1,X ; 2nd parameter<br />
...<br />
TUX<br />
LDA 2,X ; 3rd parameter<br />
...<br />
INX ; clear all parameters<br />
INX<br />
INX<br />
TXU<br />
RTS</blockquote>
"But X is only eight bits," an engineer named Wayne objected.<br />
<br />
"The
S register is only six or seven bits in the 6805. The return stack is
so small it that it will run out of memory before it cycles through the
addresses allocated to it in the direct page. But you can move it out of
the direct page and no one would notice, and it could still be
effectively less than eight bits to be decremented and incremented by
the push and pop.<br />
<br />
"If it weren't for wanting to
sometimes directly shift local variables, and the lack of sixteen-bit
index offsets for the unary instructions in the 6805, you could put the
parameter stack outside the direct page, too. Putting it where the
return stack is now should be no problem, at any rate, and allow access
by unary instructions."<br />
<br />
Several of the engineers started scribbling on scratch paper.<br />
<br />
Sharon said, "This could be useful."<br />
<br />
An engineer named Chuck intoned, "Room in the design for improvement is good engineering."<br />
<br />
Bill asked, "Are you taking notes on this, Julia?"<br />
<br />
"Is that okay?"<br />
<br />
"Can we get a copy, and can we mark parts we don't want shared outside?"<br />
<br />
"Sure."<br />
<br />
"In that case, thank you, make sure you get Chuck's comment about room for improvement in, too, and please continue."<br />
<br />
He and Motorola's Bob again exchanged silent words, and both nodded in agreement.<br />
<br />
I shook my head and said quietly, "Julia, I presume upon you too much."<br />
<br />
Julia grinned. "I'll claim my pay when we get back home."<br />
<br />
I grinned back.<br />
<br />
"Get a room!" There was a bit of chuckling. We had an audience again. <br />
<br />
An engineer named Jack objected. "Isn't dedicating RAM to a second stack a waste?" <br />
<br />
I
shook my head. "RAM is easy to make and relatively easy to test, isn't
it? Shouldn't it be cheap? Like candy. And the call stack doesn't have
to be completely inaccessible. If it's in the extended address space, it
would be accessible via extended addressing or 16-bit index offsets."<br />
<br />
An
engineer named Monty grumbled to himself. "Testing RAM is a good way to
bring up new processes, too. Forcing the customer to scrimp on RAM is
just a little anti-social."<br />
<br />
Motorola's Bob chuckled at that, and asked Julia to quote Monty on it.<br />
<br />
Jesse
was also sketching something on note paper. "Separate address spaces.
We could put part of the direct page RAM in its own address space and
give it its own port to the ALU, and shave a cycle of access time for
that area in direct page RAM," he muttered, half to himself.<br />
<br />
Julia repeated, sub-vocalizing, "... shave a cycle for the direct page RAM access."<br />
<br />
Jennifer overheard Jesse, and asked him, "Could that be done without making it difficult to speed the processor up?"<br />
<br />
Jesse scratched his head. "Actually, if we're careful, it should make it easier to keep things in sync in a process shrink."<br />
<br />
"I was thinking about overclocking."<br />
<br />
Jesse
chuckled. "Overclocking is one of those dirty secrets we don't talk
about, but it can be used to predict whether certain aspects of a
process shrink will work."<br />
<br />
Our Bob joined him in chuckling.<br />
<br />
"Is a process shrink where you make the masks smaller?" Jennifer asked.<br />
<br />
Our Bob nodded.<br />
<br />
Jesse answered, "It's more than that, but, yeah."<br />
<br />
"Could that be used to improve access time to the parameter stack?" I asked.<br />
<br />
"That would be a bit more complicated," he replied. "Might be too much beyond the concept of an eight-bit micro-controller."<br />
<br />
"You
know," I commented, "one thing I'd like to have is a way for the CPU to
catch things when calls or interrupts try to push too much on the
stack, and when return instructions try to pull too much off."<br />
<br />
"How can you save state on the stack when the stack isn't valid?" Wayne asked in a tone that was almost rhetorical.<br />
<br />
"Could
you have a limit register for S that could trigger an interrupt when a
call or interrupt would decrement S below it? The limit register could
be set by the program, high enough to allow the stack interrupt room to
save state without walking on variables."<br />
<br />
Jesse looked
up from his scratch calculations. "Shadow register sets that get
switched in when handling interrupts could be a rather more elegant
solution to the stack overflow conundrum."<br />
<br />
Julia held her hand up. "Can you help me write that as a note?"<br />
<br />
"Interrupts
work like calls on our processors. They save the processor state on the
call stack. That allows interrupts to nest, to a certain extent. A
stack overflow interrupt would fundamentally be unable to nest anyway,
so saving state somewhere else might make sense. Some processors have
shadow registers --"<br />
<br />
Our Bob cleared his throat and
said, in a loud whisper, "Z-80. And the 68000's A7 system stack,
although that's just one register."<br />
<br />
"-- for fast
context switches." Jesse chuckled before continuing. "Shadow registers
might be one place where you could save the processor's state on stack
overflow."<br />
<br />
Julia and Ms. Philips conferred with Jesse and our Bob on this and Julia continued with her notes.<br />
<br />
"Speaking
of the interrupt stack," an engineer named Craig pointed out, "stacking
the U stack on interrupts will mess with stack frame compatibility."<br />
<br />
"That's part of the reason I call this ideal processor with conflicting specifications the 2805," I explained.<br />
<br />
"Conflicting specifications," Motorola's Bob chuckled, and all the engineers joined him.<br />
<br />
Julia looked at me in puzzlement.<br />
<br />
Tobias explained with a grin: "Conflicting specifications is part of what makes engineering fun." That got more chuckles.<br />
<br />
"Giving
the processor another name would help let customers know not to expect
perfect compatibility," Wayne nodded. "But it also might make sense to
not automatically save the U stack pointer." He frowned in thought.<br />
<br />
"Assume
the interrupt handler routine will behave nicely with the interrupted
routine's parameter space, or switch it out itself?" I asked.<br />
<br />
"Something like that. There won't be a lot of RAM to switch the stack around in, in a 6805."<br />
<br />
"True."<br />
<br />
"So, while we're critiquing the 6805, is there anything else?" Motorola's Bob asked.<br />
<br />
"Not
enough I/O pins. We had to use either an external 8 bit latch or an
external multiplexor to get enough I/O bits to read 64 keys and
communicate with the main CPU. If we had a package with sixteen more
bits of I/O, we could decode larger keyboards without external parts and
still give a parallel interface to the main processor. A serial
keyboard interface could be done with fewer, but it would still need
more than we have."<br />
<br />
Julia looked up as she handed Ms.
Steward another page-full of notes. "Serial keyboard cables will be
better for office computers anyway, right, Joe?"<br />
<br />
I agreed.<br />
<br />
Jesse
nodded, too. "Flatpack can give 64 pins in a reasonably small package.
Socketing those is expensive for now, but surface mount is cheap."<br />
<br />
Julia
stopped him for explanation, and he drew pictures for her. "Flat-pick
looks more like a square black chip than a millipede. Contacts on the
edges like this. Sockets for them look like cups, but they are often
soldered flat on top of the circuit board." <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-34iotovgxAE/X1Mn1bQqO8I/AAAAAAAAC00/ZsbCCkYZFcYMCUHW_73MknulLOm6IEZ1QCLcBGAsYHQ/s1600/dip_flat64.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="258" data-original-width="299" src="https://1.bp.blogspot.com/-34iotovgxAE/X1Mn1bQqO8I/AAAAAAAAC00/ZsbCCkYZFcYMCUHW_73MknulLOm6IEZ1QCLcBGAsYHQ/s1600/dip_flat64.png" /></a></div>
<br />
"So separate parts might actually be a better engineering option?" I asked.<br />
<br />
"Maybe."<br />
<br />
"Anything else?" Motorola's Bob prompted.<br />
<br />
"Daydreams?" I laughed.<br />
<br />
"Sure." He grinned.<br />
<br />
"The
6801's eight-bit multiply is useful. A pair of eight-bit divides --
integer and fractional -- might be useful, too. But I'm thinking about a
complete one-bit multiply and one-bit divide."<br />
<br />
He furrowed his brow. "Single bit? That seems like swimming against the current." <br />
<br />
"Software
multiplies spend a lot of time in branch instructions. If you could do a
full single-bit multiply with one instruction and stack those
instructions up, you could cut the time for a multiply to maybe a
quarter of the time of a software multiply on the 6805 and 6801, without
the complexity of a full multiplier circuit. You could get similar
improvements with a single-bit divide."<br />
<br />
(Again, many
versions of the 6805 ended up getting a full 8-bit multiplier circuit,
and the 68HC11 ended up getting both the 8-bit integer and fractional
divides, in the real world.)<br />
<br />
Craig responded. "Which
algorithm, and how are the arguments addressed? Several known pits to
fall into, but it might be worth looking at again."<br />
<br />
Bill had picked up the Forth listing, and was looking at the first page.<br />
<br />
"This is the license for using Forth?" he asked.<br />
<br />
"For the Forth Interest Group's model interpreter," I replied <br />
<br />
Monty
explained, "There are many Forth development systems with more
traditional licensing. The Forth Interest Group uses the liberal license
and some of the models are known to be a little buggy in places. In
some cases, it's almost as if they just threw code over the wall and
abandoned it."<br />
<br />
"How do you mean?" Bob asked.<br />
<br />
"A
liberal license requires an active development team to be useful. The
development team can charge to fix bugs. But their model interpreter for
our 6800 has nobody following up on it."<br />
<br />
Bill laughed. "There's something cynical about giving code away for free and charging to fix bugs."<br />
<br />
Monty
shrugged. "On the other hand, the user is also able to look for and fix
bugs himself. I saw this work at MIT. The group that works with the
liberally licensed LISP interpreters only allows contributions that are
liberally licensed into their code base. It's a rather elegant approach
to sharing. Code that doesn't get used doesn't get fixed."<br />
<br />
Bill's forehead wrinkled. "Elegant and efficient. Survival of the fittest. Hmm." <br />
<br />
(I
should note, I was actually as prescient as the me of this chapter -- two or three years
later in my college career in the real world.<br />
<br />
And we should also assure ourselves that the real engineers
who worked for the real Motorola were aware of pretty much all of this.<br />
<br />
Which
path is best is often not clear. Motorola's management in the real
world made decisions that, in hindsight, appear to have been
counterproductive. Examining certain of those decisions is part of my
reason for writing this story.<br />
<br />
Hindsight does appear to be clearer than foresight, which is precisely the
reason that this story is something of a waste of time, in effect, an idolatry of idealized abstract mathematical machines.<br />
<br />
But
if we are comparing ways to destructively waste time, I think
it's less a waste of time than body pornography -- that's essentially an
idolatry of idealized bodies. Modern pornography adds saccharin
personality to the mix. Some rich person's ideal, not real, imaginary
value only. <br />
<br />
Speaking of the real world, of course you
know, in the real world, Motorola's management and engineers had no
reason to do blue-sky brainstorming like this with me, much less believe
my ideas. But for this experiment to work, in the world of this novel,
they must.)<br />
<br />
<div style="text-align: right;">
Chapter 14.1: Rocks -- what?</div>
<div style="text-align: center;">
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></div>
<hr />
<i>[Backed up at <a href="https://joel-rees-economics.blogspot.com/2020/08/bk-33209-rocks-2805.html">https://joel-rees-economics.blogspot.com/2020/08/bk-33209-rocks-2805.html</a>.]</i><br />
<br />
<i> </i><i> </i><br />
<i> </i>零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-8234133343878473932020-08-24T21:04:00.000+09:002020-09-06T19:59:05.542+09:00Backup: 33209: Rocks -- 2805Backup of <a href="https://joelrees-novels.blogspot.com/2020/08/33209-rocks-2805.html">https://joelrees-novels.blogspot.com/2020/08/33209-rocks-2805.html</a>.<br />
<hr />
<a href="https://joelrees-novels.blogspot.com/2020/08/33209-straits-intellectual-property-agreements.html">Chapter 13.8 Straits -- Intellectual Property Agreements</a><br />
<br />
<h4 style="text-align: center;">
Chapter 14.0: Rocks -- 2805 </h4>
[202008262244 -- 2nd edit, with register maps:]<br />
<br />
Bill grinned sardonically. "Well, I think this will work out well."<br />
<br />
(You may want to put your BS meter away for this chapter, or at least set the threshold level pretty high.) <br />
<br />
Bob
chuckled. "Stephanie, can you get together with Carrie and see that
what these three signed gets replaced with a more appropriate
agreement?"<br />
<br />
"I'd be happy to, sir."<br />
<br />
"The same as Joe and Julia's agreements, with an addendum for their projects?" Ms. Philips asked.<br />
<br />
Bill answered for him. "Yes, yes, of course."<br />
<br />
And Bob nodded.<br />
<br />
Ms. Steward, Ms. Philips, Mike, our Bob, and Jennifer got together at one end of the table.<br />
<br />
As
Julia and I connected her mainboard to one of the TVs, I whispered to
her. "I thought the two guys were from Motorola's legal department."<br />
<br />
"I did, too," she whispered back. "Must be much higher up in management."<br />
<br />
I nodded my agreement.<br />
<br />
(No, I never even came close to meeting Motorola's Bob and Bill in the real world.)<br />
<br />
A number of engineers came in, bringing in pizza and liquid refreshment.<br />
<br />
"Your
friends," Motorola's Bob said to me with a grin, "are having pizza
elsewhere. I think we should have some pizza in here, too." He turned to
one of the engineers. "Jeff, I hope there's something non-alcoholic to
drink?"<br />
<br />
The engineer named Jeff started, and looked up guiltily from the six-packs he was carrying. "Erm ...."<br />
<br />
An
engineer on the other side of the room called out, "Denny made sure we
had root beer, and I made sure we had some other options." He held up
two-liter bottles of soft drinks. "Not all of us are fueled by beer."<br />
<br />
"Good job, Tobe."<br />
<br />
Tobias gave Bob a thumbs-up.<br />
<br />
As we ate pizza and talked, we demonstrated what we had done so far -- the ROM
menus, BASIC, TSC's debug system, and Flex, and using Flex to run Motorola's
assemblers.<br />
<br />
We shared some comments and discussion of the process of getting Flex to run on the Micro Chroma 68, and I
described my dynamic RAM refresh circuit, explaining how I borrowed the video
scan counter of the 6847, and mentioning the problems I had run into with my original design. I also explained the simplistic
bank switching that made it possible to run Flex.<br />
<br />
Several of the engineers commented on how my refresh circuit sounded similar
to a circuit the engineers who worked with Radio Shack on the Color Computer had produced before
they designed the sequential address multiplexor as a separate circuit. Not yet being familiar with the SAM, I couldn't comment.<br />
<br />
Jennifer,
our Bob, and Mike had taken care of their paperwork by then. Bob knew
something about the SAM already, and he discussed it a bit with the
engineers. <br />
<br />
We showed them the 6801
daughterboard on Julia's mainboard, and her keyboard, and she described
the way we were using the 6805 and its timer to scan and debounce the
keyboard and control the hexadecimal display, augmenting the I/O with
either latch or multiplexor.<br />
<br />
Then she loaded Forth on her computer from
tape and used it to send numbers out to her keyboard's hexadecimal
display.<br />
<br />
We stopped for a few minutes while Bob, Bill,
and some of the managing engineers discussed whether Motorola wanted to
ask us for permission to use the keyboard decoder/numeric display design
and code for an application note, and the upshot was that they did, and
the five of us agreed to discuss that with the rest of the group.<br />
<br />
Most
of the engineers were appreciative of Julia's Forth examples, and I
explained what I had done to get the drivers to work, mentioning that we
hadn't solved the disk problems yet for Forth.<br />
<br />
My disk
interface was the topic of considerable discussion, and Ms. Philips and
Ms. Steward quickly produced a sharing addendum to allow us to get the
schematics out for everyone to look at. Before long, Julia and I had an
addendum to our agreement, an internship contract for producing several
tech notes on the use of the 6801 as a floppy disk controller. The
addendum allowed Motorola the option of building a semi-custom "system
on a chip" SOC floppy disk controller based on my circuits.<br />
<br />
Denny
had already shared the schematics Julia had drawn up from my scrawls
with some of his friends. But now the context was Motorola, so the
addendum was deemed wise.<br />
<br />
"Ah, to be an undergrad with
all the time in the world again," Tobias reflected jocularly. "Do you
think you could get a 6805 to handle the floppy controller functions?" <br />
<br />
I
tilted my head and thought. "That would probably limit sector size,
with X being only eight bits. Come to think of it, the size of X might
require enough extra code to prevent the processor from keeping up with
the data."<br />
<br />
Another engineer, Sharon, asked, "What's your general impression of the 6805?"<br />
<br />
"It does the job for little things like the keyboard controller," our Bob volunteered.<br />
<br />
I concurred. <br />
<br />
There was general approval of that analysis.<br />
<br />
"But I miss stack support," I added.<br />
<br />
"On an eight-bitter?" Jeff queried. "You'd prefer the 6502, maybe?"<br />
<br />
Jennifer noted, "The 6502 is a clever design, but it belongs to MOS Technologies and Commodore, doesn't it?" <br />
<br />
(In
the real world, Motorola might have been smart to use their patent
agreements with MOS Technologies and second-source the 6502 in the late
1970s. They did offer to produce SOC chips with the 6502 as the CPU core
in the mid-to-late 1980s. But that idea is not for this story.)<br />
<br />
"The
6502 is a good chip," I asserted. "It straddles some boundaries like
the 6809, but I think the way it does so constrains compatible upgrade
paths." I paused for thought and emphasis. "Every application wants room
to grow. Maybe some shouldn't, but many can profitably grow in scope
and function. And growing software reliably wants things like code
re-use by re-entrant subroutine call, and keeping subroutines re-entrant
requires something like a stack that you can push to and pop from, for
parameters and local variables. There's no push or pop on the 6805."<br />
<br />
Julia
added, "Even if you aren't calling subroutines a lot, a stack helps
manage RAM. Global RAM is harder to keep track of, even if you never
re-use any variables."<br />
<br />
I turned and raised my eyebrows. "You're picking this stuff up."<br />
<br />
"A little. Dad has been explaining things you haven't."<br />
<br />
"Oh. Sorry. I'll have to do better."<br />
<br />
"It's okay." She smiled. "He enjoys it. He always wanted his oldest child to be an engineer."<br />
<br />
"Now I know why he likes me so much."<br />
<br />
We grinned at each other, then Julia coughed discreetly.<br />
<br />
I
ducked my head and turned back to the engineers, several of whom were
quietly clapping their hands, rolling their eyes, or pretending to give
us wolf-whistles.<br />
<br />
"Anyway, as Julia points out, a stack
you can reference makes RAM much easier to manage. Of course, you can
synthesize a stack, but synthesizing is slow, and a disincentive, and
the code to support the synthesized stack is a distraction."<br />
<br />
An engineer named Pete objected. "Moving up to the 6801 is not that hard."<br />
<br />
"But
it does require reworking a lot of the code, and checking all of it for
side-effects of the differences between the two," I parried. "And there
are the bit manipulation instructions in the 6805 that the 6801 does
not have, easy enough to synthesize on the 6801, but still requiring
time and effort. Adding stack support to the 6805 ought not to be that
much of a change, and it would support quite a bit of application
growth. That would give the customers' engineers much more confidence in
choosing the improved 6805 for small projects with the potential to
become large."<br />
<br />
(The 68HC11, an evolutionary step from
the 6801 that Motorola introduced in 1984, did have bit manipulation
instructions. And the 6805 itself later evolved to the confusingly named
68HC08, which did introduce more complete stack support via instruction
pre-byte escape -- single stack with stack indexing, as opposed to the
dual stack and index marking I suggest below. In the real world.
Several years later.) <br />
<br />
Jeff countered, "Okay, how do
you propose to add stack support with minimal change? Pre-bytes like on
the 6809 are too expensive for a pure eight-bitter."<br />
<br />
(Well, they were too expensive in the early 1980s.)<br />
<br />
"Add
a second stack register. Maybe call it U for user stack, following the
6809's register naming. Add push and pop instructions that push and pop
to the U stack, and transfer instructions that allow moving U to X and
back. And instructions to save U and restore it using the S stack. Eight
instructions should do the trick."<br />
<br />
Julia handed me a sheet of scratch paper, and I wrote down the additional instructions:<br />
<blockquote class="tr_bq">
PSHUA, PULUA<br />
PSHUX, PULUX<br />
PSHSU, PULSU<br />
TUX, TXU </blockquote>
I drew out a map of the registers of the 6805, except for the condition codes:<br />
<br />
<table border="1">
<tbody>
<tr>
<th>6805 register</th>
<th width="5%">b<sub>15</sub></th><th width="5%">b<sub>14</sub></th><th width="5%">b<sub>13</sub></th><th width="5%">b<sub>12</sub></th>
<th width="5%">b<sub>11</sub></th><th width="5%">b<sub>10</sub></th><th width="5%">b<sub>9</sub></th><th width="5%">b<sub>8</sub></th>
<th width="5%">b<sub>7</sub></th><th width="5%">b<sub>6</sub></th><th width="5%">b<sub>5</sub></th><th width="5%">b<sub>4</sub></th>
<th width="5%">b<sub>3</sub></th><th width="5%">b<sub>2</sub></th><th width="5%">b<sub>1</sub></th><th width="5%">b<sub>0</sub></th>
</tr>
<tr>
<th>A:</th><td colspan="8"><br /></td>
<td>A<sub>7</sub></td><td>A<sub>6</sub></td><td>A<sub>5</sub></td><td>A<sub>4</sub></td>
<td>A<sub>3</sub></td><td>A<sub>2</sub></td><td>A<sub>1</sub></td><td>A<sub>0</sub></td>
</tr>
<tr>
<th>X:</th><td colspan="8"><br /></td>
<td>X<sub>7</sub></td><td>X<sub>6</sub></td><td>X<sub>5</sub></td><td>X<sub>4</sub></td>
<td>X<sub>3</sub></td><td>X<sub>2</sub></td><td>X<sub>1</sub></td><td>X<sub>0</sub></td>
</tr>
<tr>
<th>SP:</th><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td>
<td>1</td><td>(SP<sub>6)</sub></td><td>SP<sub>5</sub></td><td>SP<sub>4</sub></td>
<td>SP<sub>3</sub></td><td>SP<sub>2</sub></td><td>SP<sub>1</sub></td><td>SP<sub>0</sub></td>
</tr>
<tr>
<th>PC:</th>
<td><sub>--</sub></td><td>--</td><td>--</td><td>PC<sub>12</sub></td>
<td>PC<sub>11</sub></td><td>PC<sub>10</sub></td><td>PC<sub>9</sub></td><td>PC<sub>8</sub></td>
<td>PC<sub>7</sub></td><td>PC<sub>6</sub></td><td>PC<sub>5</sub></td><td>PC<sub>4</sub></td>
<td>PC<sub>3</sub></td><td>PC<sub>2</sub></td><td>PC<sub>1</sub></td><td>PC<sub>0</sub></td>
</tr>
</tbody></table>
<br />
Then I drew out a modified map, including the U stack:<br />
<br />
<table border="1">
<tbody>
<tr>
<th>2805 register</th>
<th width="5%">b<sub>15</sub></th><th width="5%">b<sub>14</sub></th><th width="5%">b<sub>13</sub></th><th width="5%">b<sub>12</sub></th>
<th width="5%">b<sub>11</sub></th><th width="5%">b<sub>10</sub></th><th width="5%">b<sub>9</sub></th><th width="5%">b<sub>8</sub></th>
<th width="5%">b<sub>7</sub></th><th width="5%">b<sub>6</sub></th><th width="5%">b<sub>5</sub></th><th width="5%">b<sub>4</sub></th>
<th width="5%">b<sub>3</sub></th><th width="5%">b<sub>2</sub></th><th width="5%">b<sub>1</sub></th><th width="5%">b<sub>0</sub></th>
</tr>
<tr>
<th>A:</th><td colspan="8"><br /></td>
<td>A<sub>7</sub></td><td>A<sub>6</sub></td><td>A<sub>5</sub></td><td>A<sub>4</sub></td>
<td>A<sub>3</sub></td><td>A<sub>2</sub></td><td>A<sub>1</sub></td><td>A<sub>0</sub></td>
</tr>
<tr>
<th>X:</th><td colspan="8"><br /></td>
<td>X<sub>7</sub></td><td>X<sub>6</sub></td><td>X<sub>5</sub></td><td>X<sub>4</sub></td>
<td>X<sub>3</sub></td><td>X<sub>2</sub></td><td>X<sub>1</sub></td><td>X<sub>0</sub></td>
</tr>
<tr>
<th>U:</th><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td>
<td>1</td><td>(U<sub>6</sub>)</td><td>U<sub>5</sub></td><td>U<sub>4</sub></td>
<td>U<sub>3</sub></td><td>U<sub>2</sub></td><td>U<sub>1</sub></td><td>U<sub>0</sub></td>
</tr>
<tr>
<th>SP:</th><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td>
<td>0</td><td>0</td><td>SP<sub>5</sub></td><td>SP<sub>4</sub></td>
<td>SP<sub>3</sub></td><td>SP<sub>2</sub></td><td>SP<sub>1</sub></td><td>SP<sub>0</sub></td>
</tr>
<tr>
<th>PC:</th>
<td><sub>--</sub></td><td>--</td><td>--</td><td>PC<sub>12</sub></td>
<td>PC<sub>11</sub></td><td>PC<sub>10</sub></td><td>PC<sub>9</sub></td><td>PC<sub>8</sub></td>
<td>PC<sub>7</sub></td><td>PC<sub>6</sub></td><td>PC<sub>5</sub></td><td>PC<sub>4</sub></td>
<td>PC<sub>3</sub></td><td>PC<sub>2</sub></td><td>PC<sub>1</sub></td><td>PC<sub>0</sub></td>
</tr>
</tbody></table>
<br />
"Keeping the stacks separate will allow
moving the return stack out of the direct page. It could also be given
its own port to the CPU, in its own address space, with separate address
and data lines. That would allow proceeding to the next instruction
while the call instruction stacks the return address. That way, calls
should end up costing no more than jumps, and it should be possible to
make the return operator faster, as well."<br />
<br />
The comment about calls taking less time got some attention and discussion. <br />
<br />
"Subroutines," I continued, could look like this:<br />
<blockquote class="tr_bq">
ROUTINEA<br />
TUX<br />
LDA 0,X ; 1st parameter<br />
LDX 1,X ; 2nd parameter<br />
...<br />
TUX<br />
LDA 2,X ; 3rd parameter<br />
...<br />
INX ; clear all parameters<br />
INX<br />
INX<br />
TXU<br />
RTS</blockquote>
"But X is only eight bits," an engineer named Wayne objected.<br />
<br />
"S
is only six or seven bits in the 6805. The return stack is so small it
that it will run out of memory before it cycles through the addresses
allocated to it in the direct page. But you can move it out of the
direct page and no one would notice, and it could still be effectively
less than eight bits to be decremented and incremented by the push and
pop.<br />
<br />
"If it weren't for wanting to sometimes directly
shift local variables, and the lack of sixteen-bit index offsets for the
unary instructions in the 6805, you could put the parameter stack
outside the direct page, too. Putting it where the return stack is now
should be no problem, at any rate, and allow access by unary
instructions."<br />
<br />
Several of the engineers started scribbling on scratch paper.<br />
<br />
Sharon said, "This could be useful."<br />
<br />
An engineer named Chuck intoned, "Room in the design for improvement is good engineering."<br />
<br />
Bill asked, "Are you taking notes on this, Julia?"<br />
<br />
"Is that okay?"<br />
<br />
"Can we get a copy, and can we mark parts we don't want shared outside?"<br />
<br />
"Sure."<br />
<br />
"In that case, thank you, make sure you get that bit about room for improvement in, and please continue."<br />
<br />
He and Motorola's Bob again exchanged silent words, and both nodded in agreement.<br />
<br />
I shook my head and said quietly, "I presume upon you too much."<br />
<br />
Julia grinned. "I'll claim my pay when we get back home."<br />
<br />
I grinned back.<br />
<br />
"Get a room!" There was a bit of chuckling. We had an audience again. <br />
<br />
An engineer named Jack objected. "Isn't dedicating RAM to a second stack a waste?" <br />
<br />
I
shook my head. "RAM is easy to make and relatively easy to test, isn't
it? Shouldn't it be cheap? Like candy. And the call stack doesn't have
to be completely inaccessible. If it's in the extended address space, it
would be accessible via extended addressing or 16-bit index offsets."<br />
<br />
An
engineer named Monty grumbled to himself. "Testing RAM is a good way to
bring up new processes, too. Forcing the customer to scrimp on RAM is
just a little anti-social."<br />
<br />
Motorola's Bob chuckled at that, and asked Julia to quote Monty on it.<br />
<br />
Jeff
was also sketching something on note paper. "Separate address spaces.
We could put part of the direct page RAM in its own address space and
give it its own port to the ALU, and shave a cycle of access time for
that area in direct page RAM," he muttered, half to himself.<br />
<br />
Julia repeated, sub-vocalizing, "... shave a cycle for the direct page RAM."<br />
<br />
Jennifer overheard Jeff, and asked him, "Could that be done without making it difficult to speed the processor up?"<br />
<br />
Jeff scratched his head. "Actually, if we're careful, it should make it easier to keep things in sync in a process shrink."<br />
<br />
"I was thinking about overclocking."<br />
<br />
Jeff
chuckled. "Overclocking is one of those dirty secrets we don't talk
about, but it can be used to predict whether certain aspects of a
process shrink will work."<br />
<br />
Our Bob joined him in chuckling.<br />
<br />
"Is a process shrink where you make the masks smaller?" Jennifer asked.<br />
<br />
Our Bob nodded.<br />
<br />
Jeff answered, "It's more than that, but, yeah."<br />
<br />
"Could that be used to improve access time to the parameter stack?" I asked.<br />
<br />
"That would be a bit more complicated," he replied. "Might be too much beyond the concept of an eight-bit micro-controller."<br />
<br />
"You
know," I commented, "one thing I'd like to have is a way for the CPU to
catch the condition when calls or interrupts try to push too much on
the stack, and when return instructions try to pull too much off."<br />
<br />
"How can you save state on the stack when the stack isn't valid?" Wayne asked in a tone that was almost rhetorical.<br />
<br />
"Could
you have a limit register for S that could trigger an interrupt when a
call or interrupt would decrement S below it? The limit register could
be set by the program, high enough to allow the stack interrupt room to
save state without walking on variables."<br />
<br />
Jeff looked
up from his scratch calculations. "Shadow register sets that get
switched in when handling interrupts could be a rather elegant solution
to the stack overflow conundrum."<br />
<br />
Julia held her hand up. "Can you help me write that as a note?"<br />
<br />
"Interrupts
work like calls on our processors. They save the processor state on the
call stack. That allows interrupts to nest, to a certain extent. A
stack overflow interrupt would fundamentally be unable to nest, so
saving state somewhere else might make sense. Some processors have
shadow registers --"<br />
<br />
Our Bob cleared his throat and
said, in a loud whisper, "Z-80. And the 68000's A7 system stack,
although that's just one register."<br />
<br />
"-- for fast
context switches. Shadow registers might be one place where you could
save the processor's state on stack overflow."<br />
<br />
Julia and Ms. Philips conferred with Jeff and our Bob on this and Julia continued with her notes.<br />
<br />
"Speaking
of the interrupt stack," an engineer named Greg pointed out, "stacking
the U stack on interrupts will mess with stack frame compatibility."<br />
<br />
"That's part of the reason I call this ideal processor with conflicting specifications the 2805," I explained.<br />
<br />
"Conflicting specifications," Motorola's Bob chuckled, and all the engineers joined him.<br />
<br />
"Giving
the processor another name would help let customers know not to expect
perfect compatibility," Wayne nodded. "But it also might make sense not
to automatically save the U stack pointer." He frowned in thought.<br />
<br />
"So, while we're critiquing the 6805, is there anything else?" Motorola's Bob asked.<br />
<br />
"Not
enough I/O pins. We had to use either an external 8 bit latch or an
external multiplexor to get enough I/O bits to read 64 keys. If we had a
package with sixteen more bits of I/O, we could decode larger keyboards
without external parts and still give a parallel interface to the main
processor. A serial keyboard interface could be done with fewer, but it
would still need more than we have."<br />
<br />
Julia looked up as
she handed Ms. Steward another page-full of notes. "Serial keyboard
cables will be better for office computers anyway, right, Joe?"<br />
<br />
I agreed.<br />
<br />
Jeff
nodded. "Flatpack can give 64 pins in a reasonably small package.
Socketing those is expensive for now, but surface mount is cheap."<br />
<br />
Julia
stopped him for explanation, and he drew pictures for her. "Flat-pick
looks more like a square black chip than a millipede. Contacts on the
edges like this. Sockets for them look like cups, but they are often
soldered flat on the circuit board." <br />
<br />
"So separate parts might actually be a better engineering option?" I asked.<br />
<br />
"Maybe."<br />
<br />
"Anything else?" Motorola's Bob prompted.<br />
<br />
"Daydreaming time?" I laughed.<br />
<br />
"Sure." He grinned.<br />
<br />
"The
6801's eight-bit multiply is useful. A pair of eight-bit divides --
integer and fractional -- might be useful, too. But I'm thinking about a
complete one-bit multiply and one-bit divide."<br />
<br />
He furrowed his brow. "Single bit? That seems like swimming against the current." <br />
<br />
"Software
multiplies spend a lot of time in branch instructions. If you could do a
full single-bit multiply with one instruction and stack those
instructions up, you could cut the time for a multiply to maybe a
quarter of the time of a software multiply on the 6805 and 6801, without
the complexity of a full multiplier circuit. You could get similar
improvements with a single-bit divide."<br />
<br />
(Again, many
versions of the 6805 ended up getting a full 8-bit multiplier circuit,
and the 68HC11 ended up getting both the 8-bit integer and fractional
divides, in the real world.)<br />
<br />
Greg responded. "Which
algorithm, and how are the arguments addressed? Several known pits to
fall into, but it might be worth looking at again."<br />
<br />
Bill had picked up the Forth listing, and was looking at the first page.<br />
<br />
"This is the license for using Forth?" he asked.<br />
<br />
"For the Forth Interest Group's model interpreter," I replied <br />
<br />
Monty
explained, "There are many Forth development systems with more
traditional licensing. The Forth Interest Group uses the liberal license
and some of the models are known to be a little buggy in places. In
some cases, it's almost as if they just threw code over the wall and
abandoned it."<br />
<br />
"How do you mean?" Bob asked.<br />
<br />
"A
liberal license requires an active development team to be useful. The
development team can charge to fix bugs. But their model for our 6800
has nobody following up on it."<br />
<br />
Bill laughed. "There's something cynical about that."<br />
<br />
Monty
shrugged. "On the other hand, the user is also able to look for and fix
bugs. I saw this work at MIT. The group that works with the liberally
licensed LISP interpreters only allows contributions that are liberally
licensed into their code base. It's a rather elegant approach to
sharing. Code that doesn't get used doesn't get fixed."<br />
<br />
Bill's forehead wrinkled. "Elegant and efficient. Survival of the fittest. Hmm." <br />
<br />
(I
should note, I was actually as prescient as the me of this novel -- two or three years
later in my college career in the real world.<br />
<br />
And we should also assure ourselves that the real engineers
who worked for the real Motorola were aware of pretty much all of this.<br />
<br />
Which
path is best is often not clear. Motorola's management in the real
world made decisions that, in hindsight, appear to have been
counterproductive. Examining certain of those decisions is part of my
reason for writing this story.<br />
<br />
Hindsight does appear to be clearer than foresight, which is precisely the
reason that this story is something of a waste of time, in effect, an idolatry of idealized abstract mathematical machines.<br />
<br />
But
I think
it's less a waste of time than body pornography -- that's essentially an
idolatry of idealized bodies. Modern pornography adds saccharin
personality to the mix. Ideal, not real, imaginary value only. <br />
<br />
Speaking
of the real world, of course you know that, in the real world,
Motorola's management and engineers had no reason to do blue-sky
brainstorming like this with me, much less believe my ideas. But for
this experiment to work, in the world of this novel, they must.)<br />
<br />
[202008262244 -- 2nd edit, with register maps.]<br />
<br />
[202008242104 -- original edit:]<br />
Bill grinned sardonically. "Well, I think this will work well."<br />
<br />
(You may want to put your BS meter away for this chapter.) <br />
<br />
Bob
chuckled. "Stephanie, can you get together with Carrie and see that
what these three signed gets replaced with a more appropriate
agreement?"<br />
<br />
"I'd be happy to, sir."<br />
<br />
"The same as Joe and Julia's agreements, with an addendum for their projects?" Ms. Philips asked.<br />
<br />
Bill answered for him. "Yes, yes, of course."<br />
<br />
And Bob nodded.<br />
<br />
Ms. Steward, Ms. Philips, Mike, Bob, and Jennifer got together at one end of the table.<br />
<br />
As
Julia and I connected her mainboard to one of the TVs, I whispered to
her. "I thought the two guys were from Motorola's legal department."<br />
<br />
"I did, too," she whispered back. "Must be much higher up in management."<br />
<br />
I nodded my agreement.<br />
<br />
(No, I never even came close to meeting Bob and Bill in the real world.)<br />
<br />
A number of engineers came in, bringing in pizza and liquid refreshment.<br />
<br />
"Your
friends," Bob said to me with a grin, "are having pizza elsewhere. I
think we should have some pizza in here, too." He turned to one of the
engineers. "Jeff, I hope there's something non-alcoholic to drink?"<br />
<br />
Jeff started and looked up guiltily from the six-packs he was carrying. "Erm ...."<br />
<br />
An
engineer on the other side of the room called out, "Denny made sure we
had root beer, and I made sure we had some other options." He held up
two-liter bottles of soft drinks. "Not all of us are fueled by beer."<br />
<br />
As we ate pizza and talked, we demonstrated what we had done so far -- the ROM
menus, BASIC, TSC's debug system, and Flex, and using Flex to run Motorola's
assemblers.<br />
<br />
We shared some comments and discussion of the process of getting Flex to run on the Micro Chroma 68, and I
described my dynamic RAM refresh circuit, explaining how I borrowed the video
scan counter of the 6847, and mentioning the problems I had run into with my original design. I also explained the simplistic
bank switching that made it possible to run Flex.<br />
<br />
Several of the engineers commented on how my refresh circuit sounded similar
to a circuit the engineers who worked with Radio Shack on the Color Computer had produced before
they designed the sequential address multiplexor as a separate circuit. Not yet being familiar with the SAM, I couldn't comment.<br />
<br />
Bob,
Jennifer, and Mike had taken care of their paperwork by then. Bob knew
something about the SAM already, and he asked the engineers some
questions about it. <br />
<br />
We showed them the 6801
daughterboard on Julia's mainboard, and her keyboard, and she described
the how we were using the 6805 and its timer to scan and debounce the
keyboard and control the hexadecimal display, augmenting the I/O with
either latch or multiplexor.<br />
<br />
Then she loaded Forth on her computer from
tape and used it to send numbers out to her keyboard's hexadecimal
display.<br />
<br />
We stopped for a few minutes while Bob, Bill,
and some of the managing engineers discussed whether Motorola wanted to
ask us for the keyboard decoder code and design for an application note,
and the upshot was that they did, and we agreed to discuss that with
the rest of the group.<br />
<br />
Most of the engineers were
appreciative of the Forth examples, and I explained what I had done to
get the drivers to work, mentioning that we hadn't solved the disk
problems yet for Forth.<br />
<br />
My disk interface was the topic
of considerable discussion, and Ms. Philips and Ms. Steward quickly
produced a sharing addendum to allow us to get the schematics out for
everyone to look at. Before long, Julia and I had an addendum to our
agreement, a contract for producing several tech notes on the use of the
6801 as a floppy disk controller. The addendum allowed Motorola the
option of building a semi-custom "system on a chip" SOC floppy disk
controller based on my circuits.<br />
<br />
Denny had already
shared the schematics Julia had drawn up from my scrawls with some of
his friends, but the context was now Motorola, so the addendum was
deemed wise.<br />
<br />
"Ah, to be an undergrad with all the time
in the world again. Do you think you could get a 6805 to handle that?"
an engineer named Tobias asked.<br />
<br />
I tilted my head and
thought. "That would probably limit sector size, with X being only eight
bits. Come to think of it, the size of X might require enough extra
code to prevent the processor from keeping up with the data."<br />
<br />
Another engineer, named Sharon, asked, "What's your general impression of the 6805?"<br />
<br />
"It does the job for little things like the keyboard controller," Bob volunteered.<br />
<br />
I concurred. <br />
<br />
There was general approval of that analysis.<br />
<br />
"But I miss stack support," I added.<br />
<br />
"On an eight-bitter?" Jeff queried. "You'd prefer the 6502, maybe?"<br />
<br />
Jennifer noted, "The 6502 is a clever design, but it belongs to MOS Technologies and Commodore." <br />
<br />
(In
the real world, Motorola might have been smart to use their patent
agreements with MOS Technologies and second-source the 6502 in the late
1970s. They did offer to produce SOC chips with the 6502 as the CPU core
in the mid-to-late 1980s. But that idea is not for this story.)<br />
<br />
"The
6502 is a good chip. It straddles some boundaries like the 6809, but
the way it does so constrains compatible upgrade paths," I asserted. <br />
<br />
"Every
application wants room to grow," I continued. "Maybe some shouldn't,
but some should, and growth wants things like code re-use by subroutine
call, and keeping subroutines re-entrant requires something like a stack
that you can push to and pop from, for parameters and local variables.
There's no push or pop on the 6805."<br />
<br />
Julia added, "Even
if you aren't calling subroutines a lot, a stack helps manage RAM.
Global RAM is harder to keep track of, even if you never re-use any
variables."<br />
<br />
I turned and raised my eyebrows. "You're picking this stuff up."<br />
<br />
"A little. Dad has been explaining things you haven't."<br />
<br />
"Oh. Sorry. I'll have to do better."<br />
<br />
"It's okay." She smiled. "He enjoys it. He always wanted his oldest child to be an engineer."<br />
<br />
"Now I know why he likes me so much."<br />
<br />
We grinned at each other, then Julia coughed discreetly.<br />
<br />
I
ducked my head and turned back to the engineers, several of whom were
quietly clapping their hands, rolling their eyes, or pretending to give
us wolf-whistles.<br />
<br />
"Anyway, as Julia points out, a stack
you can reference makes RAM much easier to manage. Of course, you can
synthesize a stack, but synthesizing is slow, and a disincentive, and
the code to support the synthesized stack is a distraction."<br />
<br />
An engineer named Pete objected. "Moving up to the 6801 is not that hard."<br />
<br />
"But
it does require reworking a lot of the code, and checking all of it.
And there are the bit instructions in the 6805 that the 6801 does not
have," I parried. "Adding stack support to the 6805 ought not to be that
much of a change, and it would support quite a bit of project growth.
That would give the customers' engineers much more confidence in
choosing the 6805 for small projects with the potential to become
large."<br />
<br />
(The 68HC11, an evolutionary step from the 6801
that Motorola introduced in 1984, did have bit instructions. And the
6805 itself later evolved to the confusingly named 68HC08, which did
introduce more complete stack support -- single stack with stack
indexing via pre-byte, as opposed to the ideas I present below. In the
real world. Years later.) <br />
<br />
Jeff countered, "Okay, how
do you propose to add stack support with minimal change? Prebytes like
on the 6809 are too expensive."<br />
<br />
(Well, they were too expensive in the early 1980s.)<br />
<br />
"Add
a second stack register, maybe call it U for user stack, following the
6809's register naming. Add push and pop instructions that push and pop
to the U stack, and transfer instructions that allow moving U to X and
back. And instructions to save U and restore it using the S stack. Eight
instructions should do the trick."<br />
<br />
Julia handed me a sheet of scratch paper, and I wrote down the additional instructions:<br />
<blockquote class="tr_bq">
PSHUA, PULUA<br />
PSHUX, PULUX<br />
PSHSU, PULSU<br />
TUX, TXU </blockquote>
"Keeping
the stacks separate will allow moving the return stack out of the
direct page. It could also be given its own port to the CPU, its own
address space, with separate address and data lines. That would allow
proceeding to the next instruction while the call stacks the return
address. It should cost no more than jumps, and it should enable faster
returns."<br />
<br />
The comment about calls taking less time got some attention and discussion. <br />
<br />
"Subroutines," I continued, could look like this:<br />
<blockquote class="tr_bq">
ROUTINEA<br />
TUX<br />
LDA 0,X ; 1st parameter<br />
LDX 1,X ; 2nd parameter<br />
...<br />
TUX<br />
LDA 2,X ; 3rd parameter<br />
...<br />
INX ; clear all parameters<br />
INX<br />
INX<br />
TXU<br />
RTS</blockquote>
"But X is only eight bits," an engineer named Wayne objected.<br />
<br />
"S
is only eight bits in the 6805. The return stack is so small it that it
will run out of memory before it cycles through the addresses in the
direct page. But you can move it out of the direct page and no one would
notice, and it would still be effectively less than eight bits that
would change.<br />
<br />
"If it weren't for wanting to sometimes
directly shift local variables, and the lack of sixteen-bit index
offsets for the unary instructions in the 6805, you could put the
parameter stack outside the direct page, too. Putting it where the
return stack is now should be no problem, at any rate, and allow access
by unary instructions."<br />
<br />
Several of the engineers started scribbling code out on scratch paper.<br />
<br />
Sharon said, "This could be useful."<br />
<br />
An engineer named Chuck intoned, "Room in the design for improvement is good engineering."<br />
<br />
Bob asked, "Are you taking notes on this, Julia?"<br />
<br />
"Is that okay?"<br />
<br />
"Can we get a copy, and can we mark parts we don't want shared outside?"<br />
<br />
"Sure."<br />
<br />
"In that case, thank you, and please continue."<br />
<br />
I shook my head and said quietly, "I presume upon you too much."<br />
<br />
She grinned. "I'll claim my pay when we get back home."<br />
<br />
I grinned back.<br />
<br />
"Get a room!" There was a bit of chuckling. We had an audience again. <br />
<br />
An engineer named Jack objected. "Isn't dedicating RAM to a second stack a waste?" <br />
<br />
I
shook my head. "RAM is easy to make and relatively easy to test, isn't
it? Shouldn't it be cheap? Like candy. But it doesn't have to be
completely inaccessible. It might be accessible via extended addressing
or 16-bit index offsets."<br />
<br />
An engineer named Monty
grumbled, "Testing RAM is a good way to bring up new processes, too.
Forcing the customer to scrimp on RAM is just a little anti-social."<br />
<br />
Jeff
was also sketching something on note paper. "Separate address spaces.
We could put part of the direct page RAM in its own address space and
shave a cycle of access time for that RAM," he muttered, half to
himself.<br />
<br />
"One thing I'd like to see in CPUs in general
is a way to catch things when calls or interrupts try to push too much
on the stack, and when return instructions try to pull too much off."<br />
<br />
"How can you save state on the stack when the stack isn't valid?" Wayne asked in a tone that was almost rhetorical.<br />
<br />
"I've
thought about limit registers that can be set to trigger when any
further push will leave no more room for an interrupt to save full state
without walking on variables."<br />
<br />
Jeff looked up from his
sketching. "Shadow register sets that get switched in when handling
interrupts are a rather elegant solution to the stack overflow
conundrum."<br />
<br />
"Speaking of the interrupt stack," an
engineer named Greg said, "stacking the U stack on interrupts will mess
with stack frame compatibility."<br />
<br />
"That's part of the reason I call this ideal processor with conflicting specifications the 2805."<br />
<br />
This drew chuckles from the engineers.<br />
<br />
"Maybe it makes sense to not stack the parameter stack pointer
automatically, or maybe you need to use another name so the developers
know they need to make changes," Wayne nodded. <br />
<br />
Bob chuckled. "So, while we're critiquing the 6805, is there anything else?"<br />
<br />
"Not
enough I/O pins. We had to use either an external 8 bit latch or an
external multiplexor to read 64 keys. If we had a package with sixteen
more bits of I/O, we could decode larger keyboards without external
parts and still give a parallel interface to the main processor. Eight
more would work if the interface is serial."<br />
<br />
Jeff
nodded. "Flatpack can give 64 pins in a reasonably small package.
Socketing those is expensive for now, but surface mount is cheap."<br />
<br />
"Separate parts might be preferred?" I asked.<br />
<br />
"Maybe."<br />
<br />
"Anything else?" Bob prompted.<br />
<br />
"Daydreaming time?" I laughed.<br />
<br />
"Sure." He grinned.<br />
<br />
"The
6801's eight-bit multiply is useful. An eight-bit pair of divides,
integer and fractional, might be useful, too. But I'm thinking about a
complete one-bit multiply and one-bit divide."<br />
<br />
Bob furrowed his brow. "Single bit? That seems like swimming against the current." <br />
<br />
"Software
multiplies spend a lot of time in branch instructions. If you could do a
full single-bit multiply with one instruction and stack those
instructions up, you could cut the time for a multiply in maybe a
quarter of the time of a software multiply, without the complexity of a
full multiplier circuit."<br />
<br />
Greg responded. "Which
algorithm, and how are the arguments addressed? Several known pits to
fall into, but it might be worth looking at again."<br />
<br />
Bill had picked up the Forth listing, and was looking at the first page.<br />
<br />
"This is the license for using Forth?" he asked.<br />
<br />
"For the Forth Interest Group's model interpreter," I replied <br />
<br />
Monty
explained, "There are many Forth development systems with more
traditional licensing. The fig uses the liberal license and some of the
models are known to be a little buggy in places. In some cases, it's
almost as if they just threw code over the wall and abandoned it."<br />
<br />
"How do you mean?" Bob asked.<br />
<br />
"A liberal license requires an active development team to be useful. The development team can charge to fix bugs."<br />
<br />
Bill laughed. "There's something cynical about that."<br />
<br />
Monty
shrugged. "On the other hand, the user is also able to look for and fix
bugs. I saw this work at MIT. The group that works with the liberally
licensed LISP interpreters only allows contributions that are liberally
licensed into their code base. It's a rather elegant approach to
sharing. Code that doesn't get used doesn't get fixed."<br />
<br />
Bill's forehead wrinkled. "Elegant and efficient. Hmm." <br />
<br />
(I
should note, I was actually this prescient -- two or three years
later in my college career. And we must also assure ourselves that the
real engineers
who worked for the real Motorola were aware of pretty much all of this.
Which path was not clear. Management made decisions that, in hindsight,
were counterproductive.<br />
<br />
Motorola's management and
engineers had no reason to talk with me like this in the real world,
much less believe me. But for this experiment to work, in the world of
this novel, they must.<br />
<br />
Hindsight does seem to be
clearer than foresight, which is precisely the reason that this story is
something of a waste of time. But I think it's less a waste of time
than certain very popular classes of fiction that a lot of people waste a
lot of money on. Idolatry of idealized bodies and saccharin
personalities can't be more healthy than idolatry of idealized abstract
mathematical machines.)<br />
[202008242104 -- original edit.]<br />
<br />
<div style="text-align: right;">
Chapter 14.1: Rocks -- what?</div>
<div style="text-align: center;">
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></div>
<hr />
<i>[Backed up at <a href="https://joel-rees-economics.blogspot.com/2020/08/bk-33209-rocks-2805.html">https://joel-rees-economics.blogspot.com/2020/08/bk-33209-rocks-2805.html</a>.]</i><br />
<br />
<i> </i><i> </i><br />
<i> </i><br />
<br />零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-60673451076061973992020-08-24T12:40:00.000+09:002020-08-24T13:36:56.953+09:00Backup: 33209: Straits -- Intellectual Property AgreementsBackup of <a href="https://joelrees-novels.blogspot.com/2020/08/33209-straits-intellectual-property-agreements.html">https://joelrees-novels.blogspot.com/2020/08/33209-straits-intellectual-property-agreements.html</a>.<br />
<hr />
<a href="https://joelrees-novels.blogspot.com/2020/08/33209-straits-road-to-austin.html">Chapter 13.7 Straits -- The Road to Austin</a><br />
<br />
<h4 style="text-align: center;">
Chapter 13.8: Straits -- Intellectual Property Agreements </h4>
<br />
"Ms. Philips."<br />
<br />
"Hi, Joe, Julia. We're glad you could both make it." <br />
<br />
We
were in a conference room that seemed large for just Julia, me, Ms.
Philips, and the two men in suits flanking her, whom I supposed were
from Motorola's legal department. Two small stacks of papers and a
legal-size note pad lay in front of Ms. Philips.<br />
<br />
"We seem to be underdressed," I began.<br />
<br />
"No
problem. You've been on the road, we didn't tell you what to expect.
But if it's okay, we want to take video of our meeting again for
management." She pointed out the cameras. <br />
<br />
Julia and I both nodded.<br />
<br />
"Sure." <br />
<br />
"No problem." <br />
<br />
Ms.
Philips continued, "Management also wanted to get non-disclosures and some
other IP agreements signed."<br />
<br />
I checked with Julia and she gave me an inquisitive look.<br />
<br />
I shrugged and turned back to Ms. Philips. "I guess we missed something here. We need NDAs and IP agreements?"<br />
<br />
"Ahh ..." Now it was Ms. Philips turn to look puzzled. She turned to the man on her right.<br />
<br />
"There are some chicken-and-egg problems here," he replied to her unasked question.<br />
<br />
"Can't talk without agreeing not to talk?" Julia asked.<br />
<br />
I
nodded once in concurrence. "I don't know why we should need that kind
of agreement. I'm just some guy taking tech courses at a podunk college
in west Texas ..."<br />
<br />
"Hey!" Julia gave me an elbow and a sharp look.<br />
<br />
I
returned her reproach with look of chagrin. "Okay, not podunk, but
definitely not a big name like MIT, or even moderately well-known like
Renssalaer Poly or Texas Tech."<br />
<br />
She gave me another
sharp look and I closed my eyes and nodded resignedly."I don't mean to
disparage OC. It's a good school. But I don't think I'm doing anything
special. Whose toes did I tread on?"<br />
<br />
Ms.
Philips laughed. "Not treading on toes. Just, well, it's a competitive
industry, lots of players, not enough customers to support them all."<br />
<br />
"<i>Masaka."</i>
I shook my head.
"Amortize the development cost and push the price down, and people'll
be putting microcontrollers in everything. There won't be
any bounds to the market."<br />
<br />
None of the three sitting across the table from us commented on that. <br />
<br />
"But
I guess boards of directors start talking about market limits when they
want control, and computers do carry that cachet of the mirage of
control. I really must have tread somewhere too close to
something, but I assume we can't expect an answer to that without a
non-disclosure agreement?"<br />
<br />
The man to Ms. Philips's right cleared his throat with a cough.<br />
<br />
The man to her left said simply, "Please don't jump to conclusions."<br />
<br />
"I
guess I should have gotten Denny to give me more specifics." Julia and I
both leaned forward to stand. "I'm not sure what I, uhm, we expected,
but I feel like we've been caught out of position." <br />
<br />
Now
the man to her left smiled and waved for us to sit back down. "I must
apologize. We should have coordinated better. Carrie, can I get a look
at the paperwork?"<br />
<br />
The man at her right frowned.<br />
<br />
Julia and I both hesitated between sitting and standing. <br />
<br />
"Sir." Ms. Philips handed him the stacks of papers.<br />
<br />
He scanned them quickly. "Stock NDAs for new hires. Not appropriate here."<br />
<br />
"Bob,
..." the man to her left began, and they exchanged an unspoken word or
two before he leaned back with an air of dissatisfaction.<br />
<br />
"Sir,"
Carrie pointed to certain paragraphs on the first page of one stack, "I
edited certain clauses appropriately, made some substitutions and
deletions, and changed the document ID." She turned to the next page.<br />
<br />
Bob stopped her. "I'm sorry, Carrie, I should have taken a more direct hand in this. Do you have a legal pad?"<br />
<br />
She handed him her legal pad <br />
<br />
took
out some blank pages and wrote too quickly for me to follow upside-down
without making myself too obvious. "Make it simple, limit it to best
effort to avoid representing themselves as being privy to Motorola's
plans until two years or superseded by other agreement. And state that
we'll give our best effort to refrain from using their work without
permission."<br />
<br />
He looked up at me. "We'll take the
responsibility of avoiding exposing you to sensitive materials, if
you'll be responsible for not sharing things you don't want us to see.
And if we need to share something, we can make specific agreements." He
turned again to Ms. Philips. "You can add a clause about special
agreements, as well."<br />
<br />
Julia and I exchanged looks again.<br />
<br />
Julia said, "I might be able to sign something like that."<br />
<br />
I nodded in agreement, and Carrie stood and moved to a stenographer's typewriter in a corner.<br />
<br />
The other man cleared his throat again.<br />
<br />
"Okay, Bill, Let's hear it."<br />
<br />
"Bob,
you know that's going to be a lot of work to go through every time we
want to work together on something new. Clumsy. And the board will raise
Cain about lost revenue." <br />
<br />
"Bill, you know as well as I
that expected revenue can't be dealt with as revenue until we have
legitimate reason to expect it, and NDAs and NCAs do not provide that
reason. The board may not want to listen to sound economic principles,
but there is no loss until there is something to be gained."<br />
<br />
"I agree with that." Bob nodded.<br />
<br />
"We have some good processors."<br />
<br />
"Of course." <br />
<br />
"But
every time we get some grass-roots excitement going about our
processors, we've been having the engineers sign non-disclosures and
non-competes, and suddenly all the market excitement evaporates into the
long tail of big projects. I think we've been cutting off our corporate
nose to spite our corporate face --"<br />
<br />
"You've said that before."<br />
<br />
"-- killing the goose that lays the golden egg." He turned to me. "Pardon the expression."<br />
<br />
I
grinned. "I don't see a problem with the expression, as long as it
remains metaphor. And I probably agree about NDAs and NCAs as not being
what they appear to be. I'll need a lot of leeway if I'm going to keep
the group we've got motivated."<br />
<br />
I checked with Julia, and she smiled and nodded. "I'm with Joe on that." She reached out and gave my hand a squeeze.<br />
<br />
"Thanks for being patient with us."<br />
<br />
Bill nodded with a still-dissatisfied attempt at a smile. "Well, while we're waiting for some new documents, how was the trip?"<br />
<br />
We
offered a few details of the road down and the weather, but didn't
mention the undercurrents. Both men were amused at the idea of five
adults packed into a subcompact station wagon for six hours. Even Ms.
Philips chuckled a bit while she typed.<br />
<br />
"You didn't happen to bring the computer you're working on?" Bill asked, somewhat out of the blue.<br />
<br />
Bob lifted an eyebrow. "I don't suppose there was room in that car."<br />
<br />
"Actually, we did." <br />
<br />
"Would you be willing to let us take a look at it?"<br />
<br />
"Bill, I don't know if we want to expose the company to their work just yet."<br />
<br />
"There's nothing I consider proprietary in it. How about you, Julia?"<br />
<br />
She nodded. "I trust your judgement."<br />
<br />
Carrie took the page from the typewriter, and brought it to Bob. "What do you think?"<br />
<br />
He read it carefully, then handed it to me. I put it between Julia and me, and we read it together.<br />
<br />
"I think," I said, "it'll give us the room we need to work and allow you to protect Motorola's interests."<br />
<br />
"Joe, shouldn't it mention existing work, and avoid making claims for the group?" <br />
<br />
"Ah, yes. Of course."<br />
<br />
With
Julia's input, we added wording for existing work, a disclaimer
relative to the group, and an addendum describing what we and the group
had done to that point. With a bit of discussion we found wording we
could all agree on. Then Julia joined Ms. Philips at the typewriter. <br />
<br />
Bill asked, "So, can we get a peek at what you've done?"<br />
<br />
"I think it's okay, Joe," Julia said from where she and Ms. Philips were working. "Why don't you go ahead and bring them in?"<br />
<br />
"Them?" Bob asked.<br />
<br />
"Julia's and mine."<br />
<br />
Bill
and I went out to the car and brought the computers in. When we
returned, Bob had brought in a couple of color TVs to use as displays. <br />
<br />
Julia and I looked over the completed agreement together, then faced each other, communicating silently.<br />
<br />
"If you'll excuse us a minute," Julia said.<br />
<br />
"Sure," Bob nodded.<br />
<br />
"Do you need a place to talk alone?" Bill asked.<br />
<br />
"If it's okay."<br />
<br />
Ms. Philips opened a door to an office connected to the conference room and left us alone.<br />
<br />
We
both knelt down and joined hands, and Julia offered her prayer for
wisdom and blessings in making decisions. I added to that a prayer that
the directions we took would be guided for our own benefit and for all
involved.<br />
<br />
"I feel like we can sign this," Julia's face showed mixed trepidation and confidence.<br />
<br />
"I feel similarly impressed."<br />
<br />
Julia's expression cleared, and we shared a hug.<br />
<br />
After we returned to the conference room and had both signed the agreement, Julia and I unpacked our computers and set them up.<br />
<br />
[JMR202008241334 edits -- new:]<br />
<br />
While we did so, the door opened, and Ms. Steward showed Mike, Bob, and Jennifer in. <br />
<br />
Mike
looked at us a bit uncertainly. "We signed," he said, more as a
question than a statement. "The internship seemed too good to pass up."<br />
<br />
[JMR202008241334 edits -- old: ]<br />
<br />
While we did so, the door opened, and Ms. Steward showed Mike in. <br />
<br />
Mike
looked at us a bit uncertainly. "I signed," he said, more as a question
than a statement. "The internship seemed too good to pass up."<br />
<br />
[JMR202008241334 edits end.]<br />
<br />
<br />
<div style="text-align: right;">
Chapter 13.9: Straits -- what?</div>
<div style="text-align: center;">
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></div>
<hr />
<i>[Backed up at <a href="https://joel-rees-economics.blogspot.com/2020/08/bk-33209-straits-intellectual-property-agreements.html">https://joel-rees-economics.blogspot.com/2020/08/bk-33209-straits-intellectual-property-agreements.html</a>.]</i><br />
<br />
<i> </i><i> </i><br />
<i> </i>零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-13787599173729636422020-08-17T10:18:00.000+09:002020-08-17T13:23:32.603+09:00[Backup] PHR: Pink Heels and Rusty -- Title Page and Table of ContentsBackup of <a href="https://joelrees-novels.blogspot.com/2020/08/phr-title-toc-pink-heels-and-rusty.html">https://joelrees-novels.blogspot.com/2020/08/phr-title-toc-pink-heels-and-rusty.html</a>.<br />
<hr />
<br />
<h2 style="text-align: center;">
Pink Heels and Rusty</h2>
<div style="text-align: center;">
by Joel Matthew Rees,<br />
Amagasaki, Japan, October 2017<br />
Copyright 2017 Joel Matthew Rees. </div>
<div style="text-align: center;">
All rights reserved.</div>
<br />
<ol>
<li><a href="https://joelrees-novels.blogspot.com/2017/10/phr-01-paperboy.html">Paperboy</a></li>
<li><a href="https://joelrees-novels.blogspot.com/2017/10/phr-02-udp-packets.html">UDP Packets</a></li>
<li><a href="https://joelrees-novels.blogspot.com/2017/10/phr-03-invitation.html">Invitation</a></li>
<li><a href="https://joelrees-novels.blogspot.com/2017/10/phr-04-swimmingly.html">Swimmingly</a></li>
<li>Deeper Water</li>
<li>New School </li>
</ol>
<br />
Author's note (17 August 2020):<br />
<br />
This is derived from a <a href="https://joels-random-eikaiwa.blogspot.com/2017/10/pink-heels-and-rusty.html">pseudo-flash fiction piece I wrote</a> from a writing prompt that Jenny Flake Rabe posted in the LDS Beta Readers group on Facebook (<a href="https://joels-random-eikaiwa.blogspot.com/2017/10/pink-heels-and-rusty.html">https://joels-random-eikaiwa.blogspot.com/2017/10/pink-heels-and-rusty.html</a>). <br />
<br />
I
started writing the rest of the story just before I ran into an open
car door on my bicycle, sheering a couple of ribs and shattering my
elbow. The accident and the recovery afterwards effectively hid the plot
and the world it takes place in from me. (I could read my notes, but I
couldn't immerse myself in them deeply enough to continue.)<br />
<br />
Other
things take priority now, for reasons I don't have time to delineate. I
don't know when I might have the spare time, budget, and energy to
rebuild the world and the plot and finish it, but I decided to put the
chapters I had up in my novels blog anyway.<br />
<br />
If you
think it's interesting, leave me a note. If enough people like it, I'll
see if I can shift some things around, but no promises.<br />
<br />
<br />零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-5290259839522762292020-08-10T10:58:00.000+09:002020-08-10T11:03:46.911+09:00Backup: 33209: Straits -- The Road to AustinBackup of <a href="https://joelrees-novels.blogspot.com/2020/08/33209-straits-road-to-austin.html">https://joelrees-novels.blogspot.com/2020/08/33209-straits-road-to-austin.html</a>.<br />
<hr />
<br />
<a href="https://joelrees-novels.blogspot.com/2020/08/33209-straits-proceeding-forth.html">Chapter 13.6 Straits -- Proceeding Forth</a><br />
<br />
<h4 style="text-align: center;">
Chapter 13.7: Straits -- Road to Austin </h4>
<br />
Friday morning, I drove over early to pick Julia up.<br />
<br />
"Are you sure you don't want to take Julia's car?"<br />
<br />
"Mom, it's really yours, and you need it tomorrow." Daughter gave mother a hug and a kiss.<br />
<br />
<i>"Bien, bien."</i>
She sighed, letting Julia loose with some reservation. "Drive
carefully, and call us when you get there or if you have problems."<br />
<br />
<i>"Prometemos."</i> I gave her a hug and a kiss to both cheeks.<br />
<br />
<i>"En tus manos."</i><br />
<br />
<span class="tlid-translation translation" lang="es"><span class="" title="">"We'll pray before we go."</span></span><br />
<br />
<span class="tlid-translation translation" lang="es"><span class="" title="">Julia's dad gave me a hug and a hand-clasp, and a stern look, with a <i>"Vaya con Dios,"</i> before giving his daughter her hug and kiss.</span></span><br />
<br />
At
my house, we got in a half hour of exercises and and showers, and then
we packed the computers and road food, said a quick prayer, and headed
to school.<br />
<br />
After our last classes for the morning, we met the rest of the Friday group in the parking lot.<br />
<br />
They
had decided to pool in Suzanne's Impala, so there would be only her car
and mine to keep track of. Campus security had been notified about the
trip, and we had the okay to leave cars in the parking lot over the
weekend. <br />
<br />
I suggested a prayer before we leave, and no one objected. Julia
suggested I be voice for the group, and I offered a prayer for our
safety, and that the trip would have good results for all. Everyone
responded with, "Amen."<br />
<br />
Mike, Pat, and George had
prepared a bit of their own food and drinks for the road down, but we
had room in the cooler for what needed cooling. We had all packed light,
mostly relying on making grocery store raids in Austin for Saturday and
the ride back. We left most of the space in the station wagon bed open
for whatever we might be bringing back.<br />
<br />
The plan was
for me to drop by Denny's place on the way to Motorola, their apartment
being within three miles of the Motorola building I needed to go to.
Then Julia and the others could go shopping, visit with Denny and
Denise, and maybe go see the campground where the rest of the Friday
group were parking themselves.<br />
Of course things never really go according to plan, even when they go according to plan.<br />
<br />
Suzanne didn't stay anywhere close to the double-nickel speed limit. We lost
sight of them within a minute of hitting the Interstate, even though I kicked the speed up to 62.<br />
<br />
"There's
the turn-off to the airport." I kept trying to get conversation
started, but it kept dying before it started. Julia squeezed my hand
again on the gearshift lever.<br />
"Are you okay, back there, Pat? The middle of that seat is not comfortable, I know."<br />
<br />
"I'm okay." I'm sure she was being stoic.<br />
<br />
"Beautiful scenery, huh?"<br />
<br />
George laughed, at least.<br />
<br />
"It has its own beauty," Julia commented, but no one in the rear seat took the bait.<br />
<br />
"Peanut butter and cheese sandwich?" Julia asked, and I nodded.<br />
<br />
Pat
fished the bread, cheese, and peanut butter from the cooler, handing
them to Julia, and then she and George and Mike dug into the bologna,
pressed pork and other fixings from the cooler.<br />
<br />
"Can you pass me the lettuce and tomatoes, too?"<br />
<br />
"Ah. Sure." Pat handed the lettuce and tomatoes forward, and food changed hands.<br />
<br />
"Are you making your own?" I asked.<br />
<br />
Julia nodded and took a bite of my sandwich, frowning as she handed it to me. "Needs something. Mayonnaise?"<br />
<br />
I took a bite and nodded, glancing in the rear-view mirror to see Mike's reaction. He was busy with food.<br />
<br />
Pat handed her the jar of Mayonnaise. "Joe has perverted your taste buds, Julia."<br />
<br />
"Yep."<br />
<br />
That got chuckles from everyone.<br />
<br />
Julia mixed grape and lemon-lime soda in a cup.<br />
<br />
"Where'd you get that from?" George complained.<br />
<br />
"Not from Joe."<br />
<br />
"No?"<br />
<br />
"From his dad."<br />
<br />
"Oh."<br />
<br />
She
shared her cup with me, too, trading it for the sandwich and taking a
bite while I was taking a sip, so I would have a hand to keep on the
wheel. I glanced at Mike again, but he was looking out the window
absently while he chewed on his sandwich.<br />
<br />
<div style="text-align: center;">
***** </div>
<br />
"Turn-off
for Garden City." I moved to the exit ramp and slowed down and we
turned right. "This always feels like I'm turning south, but we're
actually turning more east than south. We've been going north-east."<br />
<br />
"Can I drive from Garden City?" Julia asked as we left the Interstate behind.<br />
<br />
"I don't know why not." <br />
<br />
<div style="text-align: center;">
*****</div>
<br />
"There's Suzanne," Pat announced.<br />
<br />
The whole group was out of the car, sitting at a road-side table. They waved as we pulled up.<br />
<br />
George,
Mike, and Pat extracted themselves from the back seat, and Julia and I
got out of the front, and we exchanged status with the other group
before they climbed in and started off again ahead of us.<br />
<br />
"Take a short jog?" Julia suggested.<br />
<br />
"Mmm. Yeah."<br />
<br />
All five of us jogged about a half minute back the way we had come, then walked back to the car. Julia took the driver's seat.<br />
<br />
"I'm riding shotgun!" Pat called out, claiming the passenger-side front seat.<br />
<br />
I looked at Mike and George. "I think that's fair, if we're up to this?"<br />
<br />
They both nodded, so I got in first and moved to the middle.<br />
<br />
"With five of us, she's not going to be as responsive as when it's just you and me," I coached from my backseat position.<br />
<br />
"I
know." Julia started the engine and babied the clutch maybe just a
little too much, but got us going smoothly down the highway. <br />
<br />
"Much better scenery here," Pat commented.<br />
<br />
"Should get greener as we go to San Angelo," George added absently.<br />
<br />
"Somewhere
along here, my church used to try to farm pecans," I said. "I think
they only got a couple of years of good crop before the climate or
insects got to the trees." <br />
<br />
"Too bad," Mike said. "I like pecans."<br />
<br />
Conversation was less strained after Garden City.<br />
<br />
We
met Suzanne's group again at a rest stop just before San Angelo. Again,
they went ahead as we took a break to stretch, jog, and walk.<br />
<br />
"Can I take the wheel next?" Mike asked.<br />
<br />
I looked at Julia and she shrugged and smiled. "That means you and I get to ride in back."<br />
<br />
George gave Mike a look of consolation and Mike shrugged.<br />
<br />
Pat's tilted head ceded temporary defeat.<br />
<br />
"I'll
take navigator." George took the passenger-side front seat, and I got
in the back, oving to the middle again. Julia climbed in beside me. <i> </i><br />
<br />
<i>"Ryō-te ni hana,"</i> I grinned, patting the empty seat as Pat hesitated on the other side of the car.<br />
<br />
"Huh?" George raised an eyebrow. <i>"Benihana?</i> Japanese?"<br />
<br />
"Yeah. <i>Ryō-te ni hana. </i>Flower
in each hand. But not literally in hand, or even meta-literally. It's
what a guy can say when he gets to sit between two beautiful women."<br />
<br />
"Maybe Julia should sit in the middle?" Pat was not climbing in.<br />
<br />
"Joe's
just joking," Julia explained. "It's the kind of joke his dad would
make, too. Neither of them would ever presume anything."<br />
<br />
"Are you sure?"<br />
<br />
"Sorry. I was just recalling a Japanese phrase that seemed to fit. I didn't think it would be offensive."<br />
<br />
Mike started the engine. "Pat, it is a compliment, you know."<br />
<br />
Pat bent down and gave him a sharp through the front window.<br />
<br />
"I'll sit in the middle," Julia sighed and started to climb out.<br />
<br />
"Why can't you sit in the front?" Pat asked Julia, wheedling.<br />
<br />
"Pat!" Julia said with more than a bit of exasperation.<br />
<br />
"Okay, okay, I'll sit in the navigator's seat." I moved to the side.<br />
<br />
"No!" Pat and Julia exclaimed in unison.<br />
<br />
George laughed, and climbed out. "I think that's the best idea for now."<br />
<br />
I climbed out of the back and got in the front.<br />
<br />
Pat sighed, but gave in, again taking the center because she was the smallest.<br />
<br />
Mike had no problems getting the car moving, and we drove in silence for the first few minutes.<br />
<br />
Then Pat spoke up. "I guess I was being silly."<br />
<br />
"You were," Mike confirmed with a wry grin. "Let me fight my own battles."<br />
<br />
I reached over for a fist bump, and this time he responded in kind.<br />
<br />
"Rivals," he said, and I nodded.<br />
<br />
"Rivals." <br />
<br />
Julia looked a little put-out, but not angry.<br />
<br />
By
the time we put San Angelo behind us, fishing had become a topic of
conversation, discussing the best lakes in central Texas for different
kinds of fish and such. I mostly listened, not having much experience.<br />
<br />
We
took another rest stop at Eden, and Pat took a turn at the wheel. Julia
sat between Mike and me in the back, and conversation turned to sports
and school.<br />
<br />
George took the wheel at Brady, and this
time Mike took the navigator seat, and Pat let me sit between her and
Julia. I mostly enjoyed listening to Julia and her friends reconnecting,
talking about things they had done together and about plans for the
future. I guessed that her breakup with Mike had been the cause of some
distancing between her and Pat and George, as well.<br />
<br />
"Your mom couldn't lend you her car for this?" Pat idly asked Julia when other topics had subsided for a bit.<br />
<br />
"She
wanted us to take it, but she needs it tomorrow. Even if she didn't,
bucket seats are a bit less conducive to romance on the road."<br />
<br />
I grinned and unobtrusively kissed her cheek. We both turned away when our lips got too close.<br />
<br />
When I glanced at Mike, he rolled his eyes, but nodded. He was beginning to understand.<br />
<br />
At
Llano, Suzanne's group waited for us to finish our quick rest stop so
that I could take the lead into Austin. I took the wheel, with Mike
riding navigator and Julia sitting behind me, Pat in the middle again.
Leading the way down through the Barton Creek area.<br />
<br />
Julia rested her hand on my shoulder, and when my shifting hand was free, we held hands.<br />
<br />
"Both
hands on the wheel!" Mike grinned to let me know he was joking, and we
bumped fists again. Pat looked disappointed, but seemed to have given up
being angry at me.<br />
<br />
It was about five thirty when we
pulled into Denny and Denise's apartment complex, parking first in front
of their apartment. We made quick introductions, and Suzanne and her
group turned to head for her car.<br />
<div>
<br /></div>
"Don't rush off just yet," Denise said.<br />
<br />
Denny
explained, "There are a couple of recruiters waiting at Motorola to
talk with anyone who wants to listen and talk. I can help you find a
good campsite after."<br />
<br />
We looked at each other.<br />
<br />
"I understand there'll be pizza, too."<br />
<br />
"Ah, well, yeah."<br />
<br />
"Sure."<br />
<br />
"Let's do it."<br />
<br />
"Well, except, Julia, the people who want to talk with Joe also want to talk with the person who has been taking notes for him."<br />
<br />
"Me?"<br />
<br />
I caught her eye. "Makes sense." <br />
<br />
After
some quick discussion, we followed Denny to Motorola, and Pat, George,
and Mike joined Suzanne's group to listen to the recruiters.<br />
<br />
<br />
<div style="text-align: right;">
Chapter 13.8: Straits -- what?</div>
<div style="text-align: center;">
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></div>
<hr />
<i>[Backed up at <a href="https://joel-rees-economics.blogspot.com/2020/08/bk-33209-straits-road-to-austin.html">https://joel-rees-economics.blogspot.com/2020/08/bk-33209-straits-road-to-austin.html</a>.]</i><br />
<br />
<i> </i><i> </i><br />
<i> </i>零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-28606524882996783662020-08-02T16:13:00.003+09:002020-08-02T16:14:22.826+09:00Backup: 33209: Straits -- Proceeding ForthBackup of <a href="https://joelrees-novels.blogspot.com/2020/08/33209-straits-proceeding-forth.html">https://joelrees-novels.blogspot.com/2020/08/33209-straits-proceeding-forth.html</a>.<br />
<hr />
<br />
<a href="https://joelrees-novels.blogspot.com/2020/07/33209-straits-exercises-exercises.html">Chapter 13.5 Straits -- Exercises, Exercises</a><br />
<br />
<h4 style="text-align: center;">
Chapter 13.6: Straits -- Proceeding Forth </h4>
<br />
Tanya looked up from her keyboard circuit board. "How long do you think it will take them to get us those Micro Chromas?"<br />
<br />
Julia
and Bob were helping her debug her work. The rest of us with working
keyboards were spread out helping those whose keyboards were not yet
working.<br />
<br />
Julia looked over at me and said, "Do you think they'll have them on Friday?"<br />
<br />
I blinked and she winced. She mouthed a silent "Woops, sorry."<br />
<br />
I gave her a wry smile and a wink.<br />
<br />
"Denny hasn't said," I replied.<br />
<br />
For
a minute, work proceeded, then Suzanne looked up from where she was
working with a group. "Friday?" She looked over at Dr. Brown. "Friday?
Something happening Friday?"<br />
<br />
He raised his eyebrows and
shook his head. "I heard Joe may be going to Austin to talk with some
people at Motorola. Other than that, who knows?"<br />
<br />
"That's cool," said Wallace.<br />
<br />
"Be
fun to go check out that surplus shop this weekend," Bob commented. "I
don't suppose you're going to have time for that, Joe?"<br />
<br />
"No,
actually, that's part of the plan. Rolling out on my nephews' floor
Friday evening and hitting the surplus store on Saturday." I
deliberately left grammar incomplete, too.<br />
<br />
"Hey,"
Winston spoke up. "We could caravan down. I'm sure Julia wants to go,
too. Leaving in the morning? We could skip classes."<br />
<br />
That got a ripple of laughter and chatter.<br />
<br />
"Leaving
as soon as my last class of the morning is done. Eating on the road so I
can get to Motorola in time without speeding." <br />
<br />
"They're not flying you out?" Bob asked.<br />
<br />
"Denny pointed out the strategic benefit of me being able to visit the surplus store, so they gave me the option."<br />
<br />
Chuck asked, "So what time should we meet to caravan?" <br />
<br />
I looked at Julia and she tilted her head and shrugged. I looked at Doctor Brown and he just shrugged, too.<br />
<br />
"Julia's going with you, right?" Suzanne didn't ask, didn't really accuse, just said it like she was confirming a known fact.<br />
<br />
"Uhm, ..."<br />
<br />
The whole class was suddenly quiet.<br />
<br />
"Look.
I'll be under a really tight schedule. If I had a CB radio in the car,
we probably could caravan, but I don't, and I really won't have time to
wait for anyone. I'm not saying you guys can't caravan, and I'm not
saying we won't see anyone on the road, either, just that I don't want
to speed and I won't be able to slow down or stop. Well, except for
emergencies, of course."<br />
<br />
I stopped for breath and
thought and glanced at Mike, who was shaking his head, his expression
hard with doubt and distrust. Pat and George were whispering together
beside him.<br />
<br />
"Julia is planning on going with me so she
can look at disk drives and such, unless she changes her mind. My
brother said it was okay for her to sleep on the couch in their living
room. As I said, I'll be in with my nephews. And," I glared at everyone
and no one in particular, "my brother and his wife will kick me out on
the street if I try to move to the living room in the middle of the
night."<br />
<br />
That got laughs. <br />
<br />
"They don't
have any extra room beyond that," I added. "So anyone who goes Friday
will have to find their own place to spend the night." <br />
<br />
"It might be a better approach to leave early Saturday and meet up in Austin," Doctor Brown suggested, quietly.<br />
<br />
We
discussed logistics for several minutes, and I promised I'd bring the
address and phone number of the surplus shop on Thursday before we
returned to working on keyboards and talk turned to expanding the
computers and figuring out what kind of enclosures to put the
electronics in.<br />
<br />
More than half the students had their
keyboards working by the time I needed to go deliver my newspapers, and,
at Doctor Brown's suggestion, we broke the lab session up so I would
have time I needed to get ready for Friday. The rest of the group
agreed, albeit some seemed reluctant.<br />
<br />
As Julia and I
loaded her car with our computers, Mike, Pat, and George approached us.
That Mike was unhappy was clear from his expression.<br />
<br />
"Julia, I need to talk to you."<br />
<br />
Julia looked at me and I raised my eyebrows and tilted my head.<br />
<br />
"Joe needs to get back," she replied.<br />
<br />
Mike fixed me with an angry stare. "I'd like to talk with Julia alone."<br />
<br />
"If you're not going to say it in front of Joe, don't even bother."<br />
<br />
Pat pursed her lips. "Julia, I don't think you're being fair to Mike. At best."<br />
<br />
Julia shut the back seat door and turned to me. "Let's go." She handed me her keys. "I'd like you to drive."<br />
<br />
I
took the keys, gave her a hug, and leaned close to her ear. In a low
voice only she could hear, I said, "We're still a little early, maybe we
should listen to what he has to say."<br />
<br />
She gave me a moue, then turned to Mike. "Two minutes. Here, now."<br />
<br />
Mike looked at me hesitantly, then took a deep breath.<br />
<br />
"What are you doing?"<br />
<br />
Julia
gave him a look I was glad I was not on the receiving end of. "What
makes you think you have a right to ask such a question?"<br />
<br />
"It seems to me like Joe gets a free pass I never got."<br />
<br />
"So what if he does? I have a right to make my own choices, and he never asks me for what I'm not willing to give."<br />
<br />
I could tell that hurt going down.<br />
<br />
"Just for the record, Mike, can I ask how far you tried to go with Julia?"<br />
<br />
That earned me a burning look from both Mike and Julia.<br />
<br />
"I think it's a relevant question," I added<br />
<br />
"He couldn't keep his hands out from under my clothes."<br />
<br />
"You said you liked it."<br />
<br />
"I changed my mind."<br />
<br />
"Why?"<br />
<br />
"I
thought you wouldn't like me if I said no. Then I prayed and I realized
that, if being turned down was going to turn you off, I shouldn't have
been saying yes in the first place."<br />
<br />
"If God told you to turn me down, why wouldn't he tell me I shouldn't date you? And why doesn't he tell you to turn Joe down?"<br />
<br />
"Joe has never once tried to put his hands on me where they don't belong. He respects me."<br />
<br />
"Then what is this going to Austin alone with him?"<br />
<br />
I broke in. "My brother and his wife will literally kick me out in the street if I try anything."<br />
<br />
"What if she tries for it?"<br />
<br />
"I'll
still be the one to go out in the street, since guys are better able to
defend themselves. But if I couldn't trust Julia, and If I couldn't
trust them, I wouldn't be letting Julia go with me."<br />
<br />
"What about on the road?"<br />
<br />
"We've promised each other not to even kiss on the road."<br />
<br />
"I don't believe that."<br />
<br />
Julia sneered. I'd never seen her do that before, and it disturbed me.<br />
<br />
"You never did believe me, or in me, or in my ability to make up my own mind."<br />
<br />
"Okay, I was a stupid high-school kid. I guess I wasn't mature enough. But ...," Mike trailed off.<br />
<br />
"Yeah,
high school kids think love is all about hormones and emotions." I
regretted the words the moment they came out of my mouth, but they were
not words I could recall without consequences.<br />
<br />
I prayed again, in my heart, for forgiveness and guidance, not just for myself, but for all five of us.<br />
<br />
"Uhm,
maybe I should ask Denny if we can squeeze two more guys in on the
boys' floor in sleeping bags, and an air mattress on the living room
floor for Pat."<br />
<br />
Mike gave me a shocked look, but it did not compare to the look of surprise and confusion Julia gave me.<br />
<br />
"Hey.
We're just here to ...," George began, but he, too, trailed off. "Uhm,
maybe that would be a good idea, even though I'm not sure I want to get
to know you that well, Joe." He chuckled.<br />
<br />
I gave him a wry half-smile. <br />
<br />
Pat
was looking very thoughtful. "That olive green compact station wagon of
yours is gonna be a tight squeeze, but maybe I can put up with being
squeezed between two of my best friends for two six-hour trips over one
weekend."<br />
<br />
The doubts in Julia's face began to resolve
themselves, and Julia nodded slowly. "Maybe it's a good idea. If Mike
promises to accept what he sees."<br />
<br />
Mike took some visible effort to pick his jaw back up off the metaphorical floor.<br />
<br />
"I, uhm, I'll think about it."<br />
<br />
"I'm still too upset to drive, Joe."<br />
<br />
I held the door for Julia.<br />
<br />
"See you guys tomorrow." I nodded to the three of them as I slid into the drivers side.<br />
<br />
Julia scooted over on the bench seat and nestled against me. "Pat, we'll call you when we found out what Denny says."<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
While I folded newspapers and stuffed them in my carrier bags, Julia drew up some more sketches for enclosures.<br />
<br />
"If my keyboard is separate from the computer box, I'll need a longer cable."<br />
<br />
"Yeah."<br />
<br />
"And a ribbon cable isn't going to work."<br />
<br />
"True. Too stiff, too many conductors spaced too far apart to bend well. Too easily broken."<br />
<br />
"Is this why a keyboard controller might have a serial port instead of a parallel port?"<br />
<br />
"Yup."
I took one of the newspapers and set it in front of me, sideways.
"Keyboard." I pointed to the bags. "Computer." I drew a line in the air
from the bags to the newspaper in front of me, twirling my finger as I
did. "Maybe a coiled telephone handset cord. Two or four wires inside
instead of nine or more, and flexible." I stretched a rubber band from
the bag to the newspaper, and it snapped. "Ouch."<br />
<br />
We both laughed. <br />
<br />
"Maybe that's what I should do. I think I want the disk drives in the same box as the mainboard."<br />
<br />
"We can do it, if you think it's a good idea."<br />
<br />
After
I got back from delivering the newspapers, she showed me her new
sketches. Then we went into the kitchen and put something together for
dinner. After dinner, we went to the piano in the den and Julia played
so I could practice for my recital.<br />
<br />
It was late enough
for evening rates to apply when we were done with that, so I called
Denny and asked about the Micro Chroma 68 boards, and about the
possibility of putting Mike, George, and Pat up for a night, as well.
Denny and Denise sounded a bit skeptical, but they decided it could be
done, but that would be the absolute limit.<br />
<br />
And Denny
said he knew they had gathered some Micro Chroma 68 kits, but he didn't
know how many, or whether they'd be turning them over to me on Friday.<br />
<br />
We called Pat, and George and Mike were there, too, so she let them know it would be possible.<br />
<br />
"What now?"Julia asked as we sat down on the sofa in the living room.<br />
<br />
"I need to study the 8086 and the 9900 a bit more. But I also need to figure out that Forth stuff."<br />
<br />
"What you were looking at when we both fell asleep night before last?"<br />
<br />
"That."<br />
<br />
"I think that's what you should work on now." <br />
<br />
"You might be inspired." I got out the package and looked through it again. I had ordered a printed copy of the<i> fig-FORTH FOR 6800 ASSEMBLY SOURCE LISTING</i> and a copy of the source on tape, with a copy of the <i>fig-FORTH Installation Manual, Glossary, and Model</i>, and a copy of an introductory textbook, Leo Brodie's <i>Starting Forth. </i><br />
<br />
I picked the baby blue cover <i>Installation Manual</i> up again, thought about it for a moment, and put it down.<br />
<br />
"What?"<br />
<br />
"I dunno. I seem more inclined to look at the source than at the instructions."<br />
<br />
"You definitely seem to be inspired today." <br />
<br />
I opened up the pink cover <i>Source Listing</i> and scanned through it.<br />
<br />
"Me?"<br />
<br />
"You got the same answer to prayer I got, and you followed through."<br />
<br />
"Oh. Mike. I think he'll be okay."<br />
<br />
"Oh, Joe, I'm scared."<br />
<br />
I looked up from the listing.<br />
<br />
"What if God says I can't marry you, that I have to get back together with Mike?"<br />
<br />
The lyrics to a hymn came to mind.<br />
<br />
<blockquote class="tr_bq">
Know this, that every soul is free<br />
To choose her husband and whom she'll marry.</blockquote>
"Boop-boop!" Giselle called out from her room. My singing was loud enough for her to hear.<br />
<br />
"Is that really a song?"<br />
<br />
"Almost."<br />
<br />
"It's in the hymnbook." Giselle came in and headed through the kitchen to the den. <br />
<br />
"How does it really go?"<br />
<br />
I grinned and stood, and took Julia's hand. She stood, too, and we followed Giselle.<br />
<br />
Giselle had the hymnbook open to number 240, and she gave it to Julia.<br />
<br />
Julia
took it and set it in the music tray of the old upright, and sat down
on the piano bench. She checked the key and ran through the intro, and
we started singing:<br />
<blockquote class="tr_bq">
Know this, that ev’ry soul is free<br />
To choose his life and what he’ll be;<br />
For this eternal truth is giv’n:<br />
That God will force no man to heav’n.<br />
<br />
He’ll call, persuade, direct aright,<br />
And bless with wisdom, love, and light,<br />
In nameless ways be good and kind,<br />
But never force the human mind.<br />
<br />
Freedom and reason make us men;<br />
Take these away, what are we then?<br />
Mere animals, and just as well<br />
The beasts may think of heav’n or hell.<br />
<br />
May we no more our pow’rs abuse,<br />
But ways of truth and goodness choose;<br />
Our God is pleased when we improve<br />
His grace and seek his perfect love.</blockquote>
Julia stood up with eyes bright and moist, and we shared a three-way hug.<br />
<br />
"Now I should leave you two alone." Giselle returned to her room.<br />
<br />
"Anonymous, from around 1805," Julia read from the notes.<br />
<br />
"About the year Joseph Smith was born." <br />
<br />
"Included in your first hymnal. You guys have some really cool hymns."<br />
<br />
"That's one I wish we sang more often."<br />
<br />
She put the hymnal back and we shared a gentle kiss before returning to the living room.<br />
<br />
Reluctantly, I released her hand and picked the listing back up.<br />
<br />
"Well, there's the place to customize the I/O routines."<br />
<br />
"Oh?"<br />
<br />
"Keyboard,
display, disk. No, that says virtual disk, so it'll take a bit more
work. We aren't likely to be doing real disk just yet."<br />
<br />
"What can you do without disks?"<br />
<br />
"Not sure. Let's load the source in from tape, then save that to disk."<br />
<br />
That took a few minutes.<br />
<br />
"Now I'll fix the I/O routines to match the Micro Chroma 68's hardware."<br />
<br />
That took a bit longer.<br />
<br />
"Save the resulting source and assemble it."<br />
<br />
The
assembler kicked out a few errors for me, so I fixed my mistakes and
save and assembled it again. This time, it assembled cleanly. <br />
<br />
Julia watched me patiently.<br />
<br />
I saved the binary file to
both disk and tape, and loaded and ran it. It came up nicely, first
time.<br />
<br />
<blockquote class="tr_bq">
<span style="background-color: #cccccc;">F<span style="color: #cccccc;"><span style="background-color: #666666;">ORTH</span></span>-68 </span><br />
<span style="background-color: #cccccc;"> OK </span><br />
<span style="background-color: #cccccc;"><span style="background-color: #eeeeee;"> </span> </span></blockquote>
<br />
Julia went in to ask Giselle if she could borrow her TV, and
Giselle came back out to watch as she loaded the binary from tape into her
Micro Chroma 68+6801 and ran it. It came up nicely for her, too.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-LwP66U5NZLM/XxQYA5VjC5I/AAAAAAAACyc/bd1BtssxgCITkTmuEHS64Cqa-tC2WpkIQCLcBGAsYHQ/s1600/fig_FORTH_boot_screen_cursors.gif" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="549" data-original-width="718" height="305" src="https://1.bp.blogspot.com/-LwP66U5NZLM/XxQYA5VjC5I/AAAAAAAACyc/bd1BtssxgCITkTmuEHS64Cqa-tC2WpkIQCLcBGAsYHQ/s400/fig_FORTH_boot_screen_cursors.gif" width="400" /></a></div>
<br />
For
a half hour or so, we played with the examples from Leo Brodie's book.<br />
<br />
"No way to save our work?"<br />
<br />
"Not without the disk I/O. Let's see if I can figure that out."<br />
<br />
I let Giselle play on my computer while I went back to the manuals
to try to understand what Forth was all about.<br />
<br />
The parameter stack, I understood. But the virtual machine was Greek to me for the evening.<br />
<br />
"No decimal point," Giselle muttered.<br />
<br />
"I think Joe is going to have to program that himself."<br />
<br />
"Probably so," I agreed.<br />
<br />
"Making your own words is fun." Giselle smiled. "Can we make this work with my word processor?"<br />
<br />
"I think I'd have to rewrite the entire interpreter." I showed her the pink-covered program listing.<br />
<br />
"A hundred pages? It'll take some time?"<br />
<br />
"Seven thousand lines of code or so. It'd definitely take some time."<br />
<br />
(fig
Forth
took the real me a full six months to get
running, but that was because I did it the wrong way, hand assembling
the source and entering the object in hexadecimal, also by hand. I saved
the object to the fast cassette. I learned a lot, but I also learned a
lot of bad habits in the process. DIY-everything has limits.<br />
<br />
No,
the reason the me in this story progresses much more quickly is that he
doesn't try to do everything himself. Even if you think that's what
he's doing.<br />
<br />
Forth, by the way, was a revelation,
but I'm not sure it wasn't a revelation of the dark arts.<br />
<br />
The power you
feel when you write your first BASIC program can be a little
intoxicating.<br />
<br />
The power you feel with Forth is more direct, stronger,
more full of promise. But the details of implementation
still bite you in the end, just like with any computer language, and they bite in ways that the majority of
programmers and software engineers, unfamiliar with Forth, do not
understand.<br />
<br />
The me in this story was immune to the power effects, even though the real me was not. Giselle
was not, but lack of floating point math muted the effects. Julia
wasn't immune either, but I think she mentally hid herself behind the me
of this story.<br />
<br />
If you want to play with a more modern Forth interpreter than the one I used back then, look up <i>Gforth</i>.
Disk I/O is working in that one, and it includes floating point numbers
and a number of other useful features. Or if you want a feel of what I
was working with, the fig Forth interpreters can be found on-line, along
with emulators to try them out on. An emulator for the Micro Chroma 68
itself has even recently been added to the MAME/MESS project. I should
write up a blog post of how to get those running, some day.<br />
<br />
I do have a partially useful description up of how to get my BIF-6809 interpreter running on the XRoar Color Computer emulator.)<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
In
the lab the next day, we got the all the rest of the keyboards running,
and those with Micro Chroma 68+6801s played with Forth a bit. Several
of us tried to work out the disk emulator stubs in the 6800 model, but
the bug in the model and the narrow screen of the Micro Chroma 68
defeated us.<br />
<br />
More than BASIC and Flex, Forth got everyone excited to get their own mainboards running.<br />
<br />
The
discussion included enclosures, and somebody pointed out that the
surplus shop might have some, which raised the interest level in the
trip to Austin. Ultimately, two caravans were planned, one leaving at
the same time as Julia and me and another leaving at six Saturday
morning. Several knew the Austin area, and they discussed campgrounds.<br />
<br />
For
Institute that night, two sister missionaries stationed in Midland came
to talk about how they prepared for their missions. Julia and Giselle
both listened intently. I was also asked to give an impromptu testimony,
and I spoke frankly, as I felt inspired.<br />
<br />
Back at my
house, Julia and I prepared lunch and dinner for the trip with help and
advice from Mom, Dad, and Giselle. We pre-packed the computers, as well.<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
"No,
Mamá, it would not make more sense for me to spend the night at Joe's
house, even in their spare room. We already have enough rumors going
around at school as it is."<br />
<br />
Mrs. Cisneros gave her own daughter a moue. "I suppose you're right. I don't know why Mike had to go and meddle in things."<br />
<br />
<i>"Mamá, paciencia. <span class="tlid-translation translation" lang="es"><span class="" title="">Todas las cosas buenas vendrán."</span></span></i><br />
<br />
I reiterated what Julia said: "All good things will come, Mom."<br />
<br />
Mrs. Cisneros turned to me with a shrewd, but pleased look and nodded. <i>"Muy bien, hijo mio."</i><br />
<br />
Julia looked at me with wide, surprised eyes. <i>"Besas."</i><br />
<br />
I complied.<br />
<br />
<br />
<div style="text-align: right;">
Chapter 13.7: Straits -- 2801, 3801</div>
<div style="text-align: center;">
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></div>
<hr />
<i>[Backed up at <a href="https://joel-rees-economics.blogspot.com/2020/08/bk-33209-straits-proceeding-forth.html">https://joel-rees-economics.blogspot.com/2020/08/bk-33209-straits-proceeding-forth.html</a>.]</i><br />
<br />
<i> </i><i> </i><br />
<i> </i>零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-74395031980927955042020-08-01T13:56:00.002+09:002020-08-02T16:16:19.691+09:00Notes: 33209: Straits -- Proceeding ForthNotes for <a href="https://joelrees-novels.blogspot.com/2020/08/33209-straits-proceeding-forth.html">https://joelrees-novels.blogspot.com/2020/08/33209-straits-proceeding-forth.html</a>.<br />
May contain spoilers, both real and false.<br />
<hr />
<a href="https://joelrees-novels.blogspot.com/2020/07/33209-straits-exercises-exercises.html">Chapter 13.5 Straits -- Exercises, Exercises</a><br />
<br />
<h4 style="text-align: center;">
Chapter 13.6: Straits -- Proceeding Forth </h4>
<br />
Tanya looked up
from her keyboard control board. "How long do you think it will take
them to get us those Micro Chromas?" Julia and Bob were helping her
debug her work.<br />
<br />
The rest of us with working keyboards were spread out helping those whose keyboards were not yet working.<br />
<br />
Julia looked over at me and said, "Do you think they'll have them Friday?"<br />
<br />
I blinked and she winced. She mouthed a silent "Woops", and I gave her a wry smile and a wink.<br />
<br />
"Denny didn't say." <br />
<br />
Julia wants to take her car to Austin? In Exercises?<br />
<br />
Julia
and I already know she might want a serial interface for the keyboard,
we can start in the lab talking about it, and about options for the
physical port.<br />
<br />
The big box with EXORcisor bus and disk
drives leads to the trip. (This is Wednesday.) Need to get Mike in the
same car with us going to Austin?<br />
<br />
<br />
"Dad
really thinks I should build the computer as one box for the circuit
boards and disk drives, with a separate keyboard and display."<br />
<br />
In the lab after classes, we were discussing our next steps while we helped those whose keyboards were not yet working. <br />
<br />
Julia and I had met at Dad's offices after classes, and were on our way to the lab. <br />
<br />
"Since the display is connected to the computer by an antenna wire, I guess we already have the separate display."<br />
<br />
"If it's a separate keyboard, I guess that flat ribbon cable won't work very well."<br />
<br />
"Too stiff. Too easily broken."<br />
<br />
"Yesterday we talked about a serial port for the keyboard. Does that have something to do with it?"<br />
<br />
"If
the keyboard interface is a serial port, we don't need as many
conductors. We could even use coiled telephone handset wire for the
keyboard."<br />
<br />
"Like the wire between the phone base and the handset?"<br />
<br />
"Right."<br />
<br />
The ribbon cable for the keyboard isn't very <br />
<br />
<br />
This morning, Dad insisted that I should look again at a separate keyboard."<br />
<br />
We were on our way to the lab after classes.<br />
<br />
"Yeah?"<br />
<br />
"The ribbon cable for the keyboard will break if we do that, won't it?" <br />
<br />
<br />
<br />
In
the lab after classes, those whose keyboards worked helped those who
didn't have theirs working yet, and we tested them on the computers and
explored the monitor ROM as we went.<br />
<br />
Discussion turned to the next steps.<br />
<br />
"How long will it take to get the rest of the Micro Chromas?" Tanya complained.<br />
<br />
"Joe, do you think they'll have those ready on Friday?"<br />
<br />
I looked over at Julia where she was helping Tanya, and she gave me a "Woops! Help?" look.<br />
<br />
"I should have asked Denny. He didn't mention it."<br />
<br />
"Friday?" Wallace asked.<br />
<br />
Julia looked down at Tanya's keyboard, and I looked at the chalkboard.<br />
<br />
Suzanne's intuition must have kicked in. "What's happening Friday?"<br />
<br />
Julia and I looked at each other again. She tilted her head in resignation and I shrugged.<br />
<br />
<br />
"Just heading down to Austin to see if we can find disk drives for my computer."<br />
<br />
"Just the two of you?" Suzanne probed.<br />
<br />
"Ditchin' the rest of us?" Wallace complained.<br />
<br />
"There's
definitely not enough room for everyone in our group at my brother's
house. Barely room for Julia on the front couch and me on the floor of
my nephews' room."<br />
<br />
-----------<br />
Also, Julia gets the couch in my brother's living room, but he
really doesn't have room for anyone else, so you'll all need to make
your own plans about where to stay for the night."<br />
<br />
"Julia and I are heading down, literally as soon as our last classes end."<br />
<br />
"Ohhh!"<br />
<br />
"She's going to sleep on the couch <br />
------------<br />
<br />
"Oh, yeah. You'll both be on that couch in the morning, is my bet," Torrence jested.<br />
<br />
"Not with my brother and sister-in-law watching, or we wouldn't be doing this."<br />
<br />
"Uh, huh, sure!" <br />
<br />
"Hey,
look, if some of you want to go check out the surplus shop down there,
you could leave at six in the morning, and we could meet you at the
state capitol building or Barton Creek, or UT, or someplace everyone
knows. Or the highway turnoff closest to the shop, if everyone going
knows the city well enough."<br />
<br />
That moved the
conversation away from dangerous places, and Julia and I exchanged
relieved glances while we participated in the discussion of who could
change their plans on such quick notice and where we could meet.<br />
<br />
Mike caught my eye and gave me a look of disappointment.<br />
<br />
I shook my head, but he turned away.<br />
<br />
From there, discussion moved to enclosures.<br />
<br />
"Doctor Brown," Javier asked, "Do you think we could borrow tools from the school?"<br />
<br />
"I've been begging the teachers in charge, but they don't none of them seem to be in a very cooperative mood."<br />
<br />
"I'll bet that surplus store has some pre-built boxes to look at," Jeff suggested.<br />
<br />
"Now that you mention it, I wasn't looking for them, but there were some enclosures."<br />
<br />
We had about half the keyboards working by the time I had to go take care of my newspaper route, and we called it a day.<br />
<br />
After
I threw the newspapers, Julia and I sat down and drew up better plans
for a box like mine, under the assumption that the computer would either
be a typewriter or a utility tool for her. And we drew up tentative
plans for an enclosure for the disk drives, both for mine and for hers.<br />
<br />
And
Julia said she was hungry, so we stopped and put something quick
together for dinner. Then we called Denny to ask about the Micro Chroma
68 kits, but he said he hadn't heard. And we practiced for my recital
for about twenty minutes.<br />
<br />
"What now?" <br />
<br />
"I need to study the 8086 and the 9900 a bit more. But I also need to figure out that Forth stuff."<br />
<br />
"The stuff you ordered, that you were looking at when we both fell asleep night before last?"<br />
<br />
"That."<br />
<br />
"I think you should do it now." <br />
<br />
So I got out the package and looked through it again. I had ordered a printed copy of the<i> fig-FORTH FOR 6800 ASSEMBLY SOURCE LISTING</i> (pink cover) and a copy of the source on tape, a copy of the <i>fig-FORTH Installation Manual, Glossary, and Model</i> (baby blue cover), and a copy of the introductory textbook, Leo Brodie's <i>Starting Forth. </i><br />
<br />
I picked the Baby blue cover <i>Installation Manual</i> up again, but I thought about it for a moment, and without any good reason put it back down. Instead, I opened up the <i>Source Listing.</i>
This time, I fairly quickly found the I/O routines to customize, so I
loaded the source into the Micro Chroma from tape, saved a copy of the
original to disk, edited the terminal I/O routines as suggested, to
match the Micro Chroma 68's hardware, and assembled it. <br />
<br />
Julia watched me patiently.<br />
<br />
I
had to correct some typing mistakes, then I saved the binary file to
both disk and tape, and loaded and ran it. It came up nicely, first
time.<br />
<br />
<blockquote class="tr_bq">
<span style="background-color: #cccccc;">F<span style="color: #cccccc;"><span style="background-color: #666666;">ORTH</span></span>-68 </span><br />
<span style="background-color: #cccccc;"> OK </span><br />
<span style="background-color: #cccccc;"><span style="background-color: #eeeeee;"> </span> </span></blockquote>
<br />
Julia went in to ask Giselle if she could borrow her TV, and
Giselle came out to watch as she loaded the binary from tape into her
Micro Chroma 68+6801 and ran it. It came up nicely for her, too.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-LwP66U5NZLM/XxQYA5VjC5I/AAAAAAAACyc/bd1BtssxgCITkTmuEHS64Cqa-tC2WpkIQCLcBGAsYHQ/s1600/fig_FORTH_boot_screen_cursors.gif" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="549" data-original-width="718" height="305" src="https://1.bp.blogspot.com/-LwP66U5NZLM/XxQYA5VjC5I/AAAAAAAACyc/bd1BtssxgCITkTmuEHS64Cqa-tC2WpkIQCLcBGAsYHQ/s400/fig_FORTH_boot_screen_cursors.gif" width="400" /></a></div>
<br />
For
a half hour or so, we played with the examples from Leo Brodie's book,
then I let Giselle play on my computer while I went back to the manuals
to try to understand what Forth was all about.<br />
<br />
The parameter stack, I understood, but the virtual machine was Greek to me.<br />
<br />
"No decimal point," Giselle muttered.<br />
<br />
"I think Joe is going to have to program that himself."<br />
<br />
"Probably so," I agreed.<br />
<br />
"Making your own words is fun." Giselle grinned. "Can we make this work with my word processor?"<br />
<br />
"I think I'd have to rewrite the entire interpreter." I showed her the pink program listing.<br />
<br />
"It'll take some time?"<br />
<br />
"It'd take some time."<br />
<br />
(Forth
took the real me another six months or maybe a year and a half to get
running. I did it the wrong way, hand assembling the source and entering
it in hexadecimal, also by hand.<br />
<br />
It was a revelation,
but I'm not sure it wasn't a revelation of the dark arts. The power you
felt back then when you write your first BASIC program could be a little
intoxicating. The power you felt with Forth was more direct, stronger,
more full of promise.<br />
<br />
But the details of implementation
still bit you in the end, and they bit in ways that the majority of
programmers and software engineers, unfamiliar with Forth, did not
understand.<br />
<br />
The me in this story was immune. Giselle
was not, but lack of floating point math buffered the effects. Julia
wasn't immune either, but I think she mentally hid herself behind the me
of this story.)<br />
<br />
Thursday's lab was a mix of getting
the rest of the keyboards working and letting other students play with
Forth. None of them seemed to know what to make of it.<br />
<br />
Thursday
evening, Giselle, Julia, and I went to Institute again. It was a better
lesson than the last week, and Julia said it answered some of her
questions.<br />
<br />
We played with the postfix syntax, and discussed <br />
<br />
the program listing for Forth.<br />
<br />
<br />
By
Thursday afternoon, we had all the keyboards working. Some of the
students were working on plans to turn their controllers into standalone
trainers, and others were working on plans to <br />
<br />
<br />
<br />
<br />
Planning enclosures while finishing keyboards and working on trainer designs.<br />
<br />
Discussion of whether to build more Micro Chroma 68+6801s<br />
<br />
Exorbus<br />
<br />
Running Forth<br />
<br />
bank switching, 8086 segment offsets<br />
<br />
<br />
<br />
Mention of the trip to the surplus store for disk drives, everyone plans to go, plans for picnic?<br />
Framework makes debouncing easy<br />
Having to use the anodes port for the column strobes? Add one-of-eight selects instead?<br />
Using the interrupt input for system request<br />
<br />
<br />
<br />
****<br />
<br />
"We want to be
able to have the CPU do other things besides display numbers, so we're
going to use the timer built into the 6805 to count instead of having
the CPUx count, and we'll have the timer interrupt the program to
actually display the numbers."<br />
<br />
"Is this only for displaying numbers?" Tanya asked in a slightly petulant tone.<br />
<br />
"Well,
the numbers might mean things. For instance, if something goes wrong
during boot, we could put an error code and an address on the display,
to give clues about the error state. Or we might say that a blank
display is an all-operational status."<br />
<br />
I can tell your
eyes are glazing over now, so, rather than walk you through it with us
I'll just note that we read in the manual about the timer, and I walked
them through initialization, using the pre-scaler to set the
granularity, calculating the value to initialize the timer and
pre-scaler to interrupt the CPU once every millisecond, and constructing
the interupt routine to display the digits one place at a time.<br />
<br />
Someday,
somewhere in my blogs, I'll show the complete keyboard debounce and
status display routine, complete with display suppression and other
features that we evenutally added. Suffice it to say that we had Julia's
status display functional at a usable level on Monday before I went
home to deliver newspapers, and that about half of the group had theirs
functional by the time I got back.<br />
<br />
<br />
Tuesday I
explain that we need more computers running, so Julia's is not just
Julia's. Then we forge ahead into the keyboard decoding.<br />
<br />
Wednesday,
while students are catching up, Julia, Mark, Jeff, Winston, and Suzanne
dig in and get their computers ready for RAM, ROM, burners, disk
controllers, etc., while I study the Forth manual and the TMS 9940
datasheets.<br />
<br />
<br />
<br />
Which is what we did. Again, Doctor
Brown let them work while I was delivering my newspapers, and Julia,
Mark, and Jeff helped those who needed help with the tools on the Micro
Chroma 68.<br />
<br />
About half of the group had their display routines working well by the time I returned to pack things up.<br />
<br />
From
Monday to Wednesday, in lab, I let the others work while I helped Julia
program her keyboard controller. Someone was watching over our
shoulders as we worked, and the structure of the code made the rounds --
the interrupt handlers, the state tables for the keyboard matrix, the
translation matrix for the LEDs, etc.<br />
<br />
Bob and Jennifer pretty much got it worked out for themselves, and we compared notes.<br />
<br />
Mark,
Jeff, and Mike picked up what we were doing, and also had their
keyboard controllers working shortly after Bob, Jennifer, and Julia and I
had ours working.<br />
<br />
<br />
<br />
<br />
It's tempting to go into great detail on the keyboard decoding and
the status display. Maybe, one day, I'll write a book on how to do it
with parts you can buy now. 6805s are kind of hard to get now. (It would
fill an entire book, yes.)<br />
<br />
I'll note that I walked the
group through several ways of keeping keyboard state for use in
debouncing. Some of the students understood when I <br />
<br />
<br />
<br />
<br />
<br />
<br />
Pascal, book of Ether, keyboard with Julia<br />
Ed Snyder's black stealth keyboard<br />
<br />
monday<br />
Julia and I work out the keyboard and seven-segment status display <br />
class also progressing, work on 68705 trainer monitor <br />
home evening with Julia's family and missionaries, second discussion, <br />
recital practice every evening all week<br />
<br />
tuesday, wiring Julia's with memory switches, DMA controller, ROMs, full RAM<br />
continued work on trainer monitor<br />
communicating with TSC about drivers <br />
(evening?)<br />
<br />
wednesday,<br />
Julia's EPROM/MCU burners, my daughterboard starts<br />
class continues with trainer monitor, etc. <br />
her scripture study group<br />
<br />
thursday,<br />
diagramming,<br />
first peek at forth<br />
class completes trainer monitor. <br />
our institute<br />
<br />
friday,<br />
trip to austin<br />
meeting with motorola, Julia asked to join<br />
discussion of<br />
-- floppy controllers<br />
-- 2801 address spaces, I/O based memory banking, call stack cache<br />
-- RISC concepts<br />
-- 2809 similar to 2801<br />
-- 31609 with 32 bit addressing<br />
-- 38000 with stack caching<br />
<br />
saturday<br />
Julia's disk drives<br />
<br />
<span class="tlid-translation translation" lang="es"><span class="" title="">(Nos) besaremos cuando y como queramos. </span></span><br />
<span class="tlid-translation translation" lang="es"><span class="" title=""><span class="tlid-translation translation" lang="es"><span class="alt-edited" title="">cuándo y cómo</span></span></span></span><br />
<br />
Trip back, too much heavy kissing, discussion of information sharing?<br />
Managers and bishops who don't know what to do with information that comes up.<br />
<br />
(In notes for bringing up flex:)<br />
<br />
Denny
called about the time we were wrapping up, and Julia got on the
extension in Dad's study to say hi. It seemed it would be appropriate to
make a run to Austin the next weekend, and to leave immediately after
our last morning classes so I could visit with some of the management at
Motorola Friday evening.<br />
<br />
"You, know," Julia said, "if I
went with, maybe I could look for floppy disk drives at that surplus
shop on Saturday before coming back."<br />
<br />
Denny checked
with Denise, and they decided Julia could sleep on the couch in the
living room and I could sleep on the floor in a sleeping bag in the
boys' room. Julia's parents said they thought it would be okay, and Mom
and Dad suggested we pray about it.<br />
<br />
Which we did. No one felt inspired to object, <br />
<br />
Julia suggested she go with me, so she could go looking for her own disk drives. <br />
<br />
<br />
Talk about duty cycle and mention DtoA as a way to adjust brightness.<br />
<br />
<br />
Julia returned to working on her keyboard/trainer, while I dug back into my test routines. <br />
<br />
<br />
Watching
the students work on the keyboard and keypad matrix decoding,
became clear to me that, while the bit I/O instructions might be useful
for certain singular, non-generalized kinds of code, a keyboard or
keypad matrix contained a lot of repeated elements. Ultimately, shifts
and logical instructions would provide the more
general scalable solution.<br />
<br />
I
stood up and demonstrated the concept of a state array for the matrix,
then suggested we put it on a back burner and look at the seven-segment
LED displays. This time, the bit I/O instructions were ignored, and
several groups formed around defining an array of the segment patterns
for each integer. Some of the students wanted to turn the translation
array upside down for some reason, but I didn't stop them. <br />
<br />
Suzanne's
and Winston's and Winston's mainboards were both up enough to display
the TV-BUG prompt by this point, and the four of them joined the rest on
the keyboard/trainers.<br />
<br />
It's tempting to go into great detail on the keyboard decoding and
the status display. Maybe, one day, I'll write a book on how to do it
with parts you can buy now. 6805s are kind of hard to get now. (It would
fill an entire book, yes.)<br />
<br />
I'll note that I walked the
group through several ways of keeping keyboard state for use in
debouncing. Some of the students understood when I <br />
<br />
<br />
Since Flex was running on my
Micro Chroma 68, I was able to load the cross-assembler, and we had
several students burn code into their 68705s for testing before time to
shut down.<br />
<br />
Mike kept trying to work out how to set the keyboard state up as an array, but he couldn't seem to quite pin it down.<br />
<br />
I shook my head, and she led me out the back door. There was a large tree with a tire swing<br />
<br />
I
guess there were no surprises on Sunday, unless you would consider it
surprising that Pat and George attended Julia's congregation again. They
slipped out before we could talk with them. We didn't see Mike.<br />
<br />
Or you might consider it surprising that Julia and I joined the choir in my ward, preparing for Easter Sunday. No?<br />
<br />
I
suppose it would be no surprise that Julia insisted on calling Denny
and Denise to ask if there were room for her to stay overnight Friday.
With a bit of discussion, it was determined that she could have the
couch in their living room, and I would roll a sleeping bag out on the
floor of the boys room, and both our parents approved that plan.<br />
<br />
That Sunday was about as one might expect, I think. In the morning, I
visited Julia's congregation. Pat and George came and sat in the back.
Mike slipped in before the sermon started, and all three slipped out
before we had a chance to talk with them.<br />
<br />
In the afternoon,
Julia visited mine. This time, she joined our choir practice in between
meetings and young adult family home evening.<br />
I told her about needing to go to Austin before her meetings, and by
the time we were finished with mine, she had decided she was going with
me.<br />
<br />
<br />
"Floppies multiplying like rabbits," I grumbled.<br />
<br />
She laughed. <br />
<br />
<br />
<br />
<br />
tendency to idealize/idolize foreign<br />
<br />
<br />
<br />
<div style="text-align: right;">
Chapter 13.7: Straits -- what?</div>
<div style="text-align: center;">
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></div>
<hr />
<i>[Backed up at </i><i><a href="https://joel-rees-economics.blogspot.com/2020/08/bk-33209-straits-proceeding-forth.html">https://joel-rees-economics.blogspot.com/2020/08/bk-33209-straits-proceeding-forth.html</a>.]</i><br />
<br />
<i> </i><i> </i><br />
<i> </i>零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-64145914321048709182020-07-26T23:06:00.001+09:002020-07-26T23:08:29.443+09:00Backup: 33209: Straits -- Exercises, ExercisesBackup of <a href="https://joelrees-novels.blogspot.com/2020/07/33209-straits-exercises-exercises.html">https://joelrees-novels.blogspot.com/2020/07/33209-straits-exercises-exercises.html</a>.<br />
<hr />
<br />
<a href="https://joelrees-novels.blogspot.com/2020/07/33209-straits-keyboard-decoding.html">Chapter 13.4 Straits -- Keyboard Decoding</a><br />
<br />
<h4 style="text-align: center;">
Chapter 13.5: Straits -- Enclosures? </h4>
<br />
The doorbell rang as I was changing into gym shorts and a tee shirt for my morning exercises.<br />
<br />
Giselle called out, "I think you should get it, Joe."<br />
<br />
Puzzled, I pulled my tee on and carried my gym shoes into the living room.<br />
<br />
Julia was waiting at the screen door in exercise gear when I rounded the hall doorway into the living room. <br />
<br />
"Oh.
So that's why you wanted to drive today." I gave her a cheesy grin and
went to the door, lifting the screen door latch so she could come in.
"You wanted to come early and see what I do for exercise." <br />
<br />
"Well, more to join you than to watch." She loosened her shoelaces and left her shoes inside the door as she came in.<br />
<br />
I set my shoes by hers. "I could have gone to your house early."<br />
<br />
"And exercise with my parents watching? No way. Not the first time we exercise together, anyway. How do you usually start?"<br />
<br />
"Warmups
and stretches. The carpet in here is easy on the bones, but it's also
easy to slip on. The floor in the den is hard, but you don't slide
unless you're wearing socks."<br />
<br />
"Barefoot it is, then."<br />
<br />
We both left our socks with our shoes, saying good morning to my mom on our way through the kitchen to the den.<br />
<br />
"You two focus on your exercises and I'll fix breakfast this morning."<br />
<br />
Mom must have also been in on the plan.<br />
<br />
We faced each other in the middle of the den. "And?" Julia looked at me expectantly. <br />
<br />
"Uhm, I usually start with plié to warm up. Other than that, it's pretty random, and I'm open to suggestions."<br />
<br />
"From ballet?"<br />
<br />
"I
learned a little from Louise and Giselle, but it's a hodge-podge mix. I
wanted to take a class in modern dance this semester, but they told me I
already had more than the usual limit of credit hours."<br />
<br />
She laughed. "Like I say, you work too hard."<br />
<br />
I had to chuckle.<br />
<br />
I stood with my feet and arms in a rough approximation of first and second positions, respectively, and Julia mirrored me.<br />
<br />
"One.
Two." We did shallow knee bends. "Three, two, three, four." Once
deeper, and back to standing. Four, two, three, four." Up to relevé and
back. And we repeated four times: plie, plié, grand plié, relevé.<br />
<br />
Julia
broke into jumping jacks. "One, two, three, four" I caught up and
mirrored her. "Two, two, three, four. Three, two, three, four. Four,
two, three, four." She stopped. "That's base four, isn't it?"<br />
<br />
I stopped and nodded.<br />
<br />
"But it ends at four, not three." She wrinkled her forehead.<br />
<br />
"Because
it starts at one. Using different symbols doesn't really change the
ring. It would be more the symbolic arithmetic base four if we started
at zero, of course."<br />
<br />
"But no one does that when exercising."<br />
<br />
"Most people forget math when they exercise."<br />
<br />
She chuckled. "We've stalled. One-zero --" She started the jumping jacks again. "-- one-one, one-two, one-three."<br />
<br />
"Trying to say all that breaks your concentration, doesn't it?" I joined in and we continued through three-three and on.<br />
<br />
"One-one-zero,
one, two, three. One-two-zero, one, two, three. One-three-zero, one,
two three." She shook her head and stopped again. "Can't keep it going
past three-three. Uhm, that's fifteen, right?"<br />
<br />
I stopped, too. "Right. Do it in hex? <br />
<br />
"Zero, one, two, three, four, five, six, seven, eight, nine, aye, bee, cee, dee, ee, eff."<br />
<br />
Somehow, we kept up the exercises and the counting in hexadecimal, in spite of the laughter, up to 100<sub>sixteen</sub>.<br />
<br />
"Exercising with you gets my heart beating."<br />
<br />
Julia rolled her eyes and slapped me gently over the head. "That was a lot of jumping jacks. What next?"<br />
<br />
"Push-ups to relax?"<br />
<br />
"Does not sound relaxing." <br />
<br />
"Exercising different muscles."<br />
<br />
Julia pursed her lips and got down into push-ups position, and I followed, and we did seven together.<br />
<br />
"My limit," she said.<br />
<br />
"Mine, too."<br />
<br />
"Don't be nice."<br />
<br />
"Seriously.
I can't even do more then seven at once from the knees." This was true.
I ididn't learn how to do push-ups until a modern dance teacher
explained visualizing muscle use to the class once. "Sit-ups?" <br />
<br />
We matched each other for twenty sit-ups, or 1A<sub>sixteen</sub>.<br />
<br />
"Whew." She sat up. "We should take modern dance together."<br />
<br />
I wonder if I'll have time for any summer classes, with the internships."<br />
<br />
"Next fall."<br />
<br />
"I thought you were moving on to Texas Christian. Up for a run?" <br />
<br />
"Maybe. Mom thinks I should postpone the associate's degree." <br />
<br />
"You need to do what you need to do."<br />
<br />
She gave me a perplexed look. "That's right. And I think I agree with my mom."<br />
<br />
"Oh."<br />
<br />
"Where do you usually run?"<br />
<br />
"Lots of places. I learned how to pace myself and go for distance on my mission."<br />
<br />
"Sounds scary."<br />
<br />
"Sometimes I run past your house."<br />
<br />
"And you don't stop in?"<br />
<br />
"I think I will, next time."<br />
<br />
"How long does it take?"<br />
<br />
"About fifteen minutes, round trip."<br />
<br />
"I think I can handle that. Better stretch first."<br />
<br />
We both started doing stretches. <br />
<br />
"I guess, if postponing your associate's is what you need to do, I'm not going to complain." <br />
<br />
She turned and gave me an air kiss. I grinned and returned it.<br />
<br />
"Can you study your Japanese at UTPB?"<br />
<br />
"They don't have any courses to take, just like OC. I'd be the teacher."<br />
<br />
"I've been thinking about finishing my bachelor's degree at UTPB."<br />
<br />
"Me, too. I think I can do the Japanese by correspondence through BYU, if UT doesn't want to help me with it."<br />
<br />
Our
conversation lagged for a couple of minutes while we focused on the
stretches. Then we stood, and she gave me a quick real kiss before we
went in to the kitchen to tell my mom where we were going.<br />
<br />
"Have fun. Be sure to get back in time to get cleaned up before classes."<br />
<br />
We
headed out, crossing 42nd at Dixie Boulevard, passing the shopping
center on our right on our way to the park, heading east from there past
her church, and stopping to surprise her mom at her house. From there
we headed back south, crossing 42nd at the Lindale intersection where
Lindale turns into 38th Street, then following 38th back home.<br />
<br />
We stretched some more and cooled down in the den.<br />
<br />
"I think you can borrow the shower on my parents' side of the house to wash off the swe-- uh, glow."<br />
<br />
"South side bathroom's ready," my mom informed us from the kitchen.<br />
<br />
I rolled my eyes. "Glad somebody here is good at planning."<br />
<br />
Julia laughed and leaned over to give me another kiss. "Planning is something I'm good at."<br />
<br />
"You're good at many things."<br />
<br />
She gave me a smirk.<br />
<br />
"Maybe we should agree before the trip to Austin, not to kiss during the trip."<br />
<br />
Her
smirk changed to a look of hurt, then a pout. Then she sighed. "You're
probably right. Are you sure about your temples being hard to elope to?"<br />
<br />
"Very hard. We both have to be members in good standing, and there's a year wait for new members."<br />
<br />
"A what?"<br />
<br />
"Temples
are serious business. Promises to God. We want the members to be sure
that they are willing to follow through on the promises."<br />
<br />
"What are the promises?"<br />
<br />
"Can't be specific, but basically to do our best to follow a godly walk and live a Christian life."<br />
<br />
"That shouldn't be so hard." But she stopped and thought. "At least, it wouldn't be hard for me." <br />
<br />
"The
promises are easy to misunderstand without preparation, and the only
ones who can really know if you're prepared are God and you, yoursefl.
So I guess it seems better to just have everyone wait at least a year."<br />
<br />
"Hmm. And I'm not really a member of your church yet, anyway. Darn."<br />
<br />
I chuckled, and she sighed, then joined me in chuckling.<br />
<br />
"I need to ... wash off the glow."<br />
<br />
I shook my head. "Anything I say about that, I'm dead in the water." <br />
<br />
She laughed.<br />
<br />
Mom
made sure Julia had what she needed for her shower on the south side of
the house, and I took a quick shower in the other bathroom, on
Giselle's and my side, and we packed our stuff in her car and headed to
school.<br />
<br />
<div style="text-align: right;">
Chapter 13.6: Enclosures?</div>
<div style="text-align: center;">
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></div>
<hr />
<i>[Backed up at <a href="https://joel-rees-economics.blogspot.com/2020/07/bk-33209-straits-exercises-exercises.html">https://joel-rees-economics.blogspot.com/2020/07/bk-33209-straits-exercises-exercises.html</a>.]</i><br />
<br />
<i> </i><i> </i><br />
<i> </i>零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-77754899534256698282020-07-24T11:41:00.000+09:002020-08-01T13:53:17.647+09:00Notes: 33209: Straits -- Keyboard Decoding, ExercisesNotes for <a href="https://joel-rees-economics.blogspot.com/2020/07/bk-33209-straits-keyboard-decoding.html">https://joel-rees-economics.blogspot.com/2020/07/bk-33209-straits-keyboard-decoding.html</a> and <a href="https://joel-rees-economics.blogspot.com/2020/07/bk-33209-straits-exercises-exercises.html">https://joel-rees-economics.blogspot.com/2020/07/bk-33209-straits-exercises-exercises.html</a>.<br />
May contain spoilers, both real and false. <br />
<hr />
<br />
Chapter 13.3: Straits --Display<br />
<br />
<h4 style="text-align: center;">
Chapter 13.4: Straits -- Keyboard Decoding</h4>
"Much improvement last night."<br />
<br />
I chuckled and gave Julia's mom an air kiss on the cheek as I ducked in the door. "Somebody was peeking through the blinds?" <br />
<br />
She just answered with a smile that might have been a little smug.<br />
<br />
Julia
came into the living room from the hallway, carrying her backpack on a
shoulder. "I threatened to do all our kissing somewhere else, and Mom
didn't even bat an eyelash," she complained. <br />
<br />
"You
two belong together. You can kiss anywhere." Mrs, Cisneros gave her
daughter a quick hug and a kiss and sent us off with a "Have a good time
studying together today." <br />
<br />
I held the passenger-side front door of the Colt open and Julia climbed in. <br />
<br />
She
leaned around and put her backpack in the back seat as I went around
and climbed in the driver's seat. "How about if I drive tomorrow?"<br />
<br />
"Your folks don't need the car?"<br />
<br />
I started the engine and the radio came on. <br />
<br />
"Yeah. Well, I want to drive."<br />
<br />
"Sure. I'll be waiting for you."<br />
<br />
The radio played in the background as we talked about the day's schedule and other things.<br />
<br />
"I
don't like this song," she said as the radio played the chorus of Mary
MacGregor's hit rendition of "Torn between Two Lovers".<br />
<br />
"Mmmyeah. It does kind of get stuck in the head, and the lyrics aren't all that great."<br />
<br />
Julia was silent for a moment, then asked, "Do you think it would be breaking rules to love two people?"<br />
<br />
I had to think for a minute. "My automatic reaction is that's not the right kind of love if it's breaking any real rules."<br />
<br />
Julia
reached over to the radio and changed the station. The station she
picked was playing Boston's "More Than a Feeling", and we listened to it
in silence the rest of the way to school, holding hands on the gearshift lever.<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
"Has
anybody noticed that 24 bits of parallel I/O aren't enough to do both
the keyboard and the displays?" I was sitting down in front of the
computer when I asked this, and several hands raised.<br />
<br />
"Two separate 68705s?" Bob asked.<br />
<br />
I nodded. "The 24 bit I/O varient we are using, yeah, that would work."<br />
<br />
Kyle laughed. "So we didn't need to bother with the timer and interrupts."<br />
<br />
"We got 'em," Tim replied. "Might as well use 'em."<br />
<br />
"Yeah,"
I agreed. "Especially in this little club or ours. But what else can we
do besides using two separate controllers? Two controllers would have
the disadvantage of needing either another port on the mainboard CPU, or
some way of sharing a single port."<br />
<br />
Jennifer and Bob
discussed between themselves for a moment, then Jennifer turned around
and said, "How many bits of I/O do we need?"<br />
<br />
"Excellent question. Let's get our diagrams out, add the CPU interface, and count. Can you guys draw that on the board?"<br />
<br />
The two of them went to the chalkboard, and shortly they had this up: <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-x5-drUVbIsE/Xv3jFuUvfDI/AAAAAAAACvM/E0VMyxdjPW8PX3qgGP0HUz_K3OGOkGR1wCPcBGAYYCw/s1600/keyboard_display_block_diagram_wrong.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="744" data-original-width="1098" height="432" src="https://1.bp.blogspot.com/-x5-drUVbIsE/Xv3jFuUvfDI/AAAAAAAACvM/E0VMyxdjPW8PX3qgGP0HUz_K3OGOkGR1wCPcBGAYYCw/s640/keyboard_display_block_diagram_wrong.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
They
stood back and looked at it with doubt. Then Jennifer said, "But we
need some way for the mainboard CPU to tell the controller whether to
read the keyboard or output to the display."<br />
<br />
"Add a control line to the main CPU port for direction, maybe?" Bob suggested, and Jennifer did so.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-uZp89rnSXB4/Xv3jyyu9DiI/AAAAAAAACvY/sD6hmvB0SA8oIpatlL1bJqIrkvrH9E9dQCLcBGAsYHQ/s1600/keyboard_display_block_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="744" data-original-width="1098" height="432" src="https://1.bp.blogspot.com/-uZp89rnSXB4/Xv3jyyu9DiI/AAAAAAAACvY/sD6hmvB0SA8oIpatlL1bJqIrkvrH9E9dQCLcBGAsYHQ/s640/keyboard_display_block_diagram.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
"Either
a control line, or we need to have some fancy tri-stating buffering and
signaling protocol on the interface. Or, if we were talking about a new
design instead of the Micro Chroma 68, we could trade the parallel
interface with the main CPU for a serial interface."<br />
<br />
Carlos asked, "Which are you going to use?" <br />
<br />
"I'll
ask Julia later. Before we get back to figuring out how to debounce the
keyboard, what if this weren't the Micro Chroma 68? Could we use some
other interface for the keyboard/status display controller?"<br />
<br />
Chuck responded first. "Serial should work, right?"<br />
<br />
"Does the 6805 have a serial port?"<br />
<br />
"No, but can't we use a bit from the parallel port for it like the Color Computer does?"<br />
<br />
"We
can, indeed. Thank you. So, back to the debounce -- can we use the same
timer setup that we're using for the display to sample the keyboard
matrix and debounce it?" <br />
<br />
----------------<br />
<br />
<br />
<br />
I was going to ask first off if anyone had
noticed that 32 pins of parallel I/O wasn't really enough, but, when
Julia and I arrived, a group was gathered around Winston, where he was
testing his keyboard and seven-segment displays. When he held a key
down, it would interfere with the display.<br />
<br />
He looked up at me. "I don't think we have enough output lines."<br />
<br />
"Yeah, ...," I hedged. <br />
<br />
Bob
looked up, too. "I'm thinking we could add two 'LS138s and control them
from port C to do the scanning, one for the displays and one for the
keyboard matrix."<br />
<br />
"Oh. That might work." I nodded absently. "Can we get a look at the problem before we go looking for solutions?" <br />
<br />
"It's a bug." Winston half-asserted, half-asked.<br />
<br />
"Oh, yeah. I was planning on looking at it first thing today when everyone comes. Can you do the explanation, Winston?"<br />
<br />
"Why
me?" he complained, half-joking, half-resigned, as he picked up his
schematics and went to the chalkboard. He started by putting up the
working diagram from the day before while we waited for more of the
group to come.<br />
<br />
When he was done, and most of our group
was there, he looked at me and I nodded to Doctor Brown, and Doctor
Brown said, "Any time you're ready."<br />
<br />
Winston went back
to his lab table and picked up his keyboard and controller, and
announced, "Ground control, we have a problem."<br />
<br />
Several
of us chuckled as Winston proceeded to demonstrate how holding certain
keys down would change a number on the display to something else.<br />
<br />
"That's cool!" Carlos enthused.<br />
<br />
"Solution one," Doctor Brown intoned. "It's not a bug, it's a feature."<br />
<br />
Everyone
laughed except Winston, who rolled his eyes before grinning lopsidedly.
"That is one way of looking at it," he grudgingly admitted.<br />
<br />
"Yeah," Doctor Brown grinned, "but I guess let's not use that solution this time." <br />
<br />
"So, why does this happen?" I asked. "Show us what your circuit looks like."<br />
<br />
Winston erased and redrew part of the circuit:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-x5-drUVbIsE/Xv3jFuUvfDI/AAAAAAAACvM/E0VMyxdjPW8PX3qgGP0HUz_K3OGOkGR1wCPcBGAYYCw/s1600/keyboard_display_block_diagram_wrong.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="744" data-original-width="1098" height="432" src="https://1.bp.blogspot.com/-x5-drUVbIsE/Xv3jFuUvfDI/AAAAAAAACvM/E0VMyxdjPW8PX3qgGP0HUz_K3OGOkGR1wCPcBGAYYCw/s640/keyboard_display_block_diagram_wrong.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
"So,
we could ask Winston why he added another buffer, or we could ask
everyone if we all understand why. Suzanne, can you tell us why?"<br />
<br />
She hesitated, than suggested, "If we don't have that, how does the computer know what key the controller decoded?"<br />
<br />
"Exactly. Thanks. So, Winston, now what's the problem?"<br />
<br />
"We
don't have enough bits of I/O, and I have used one of the buffers for
the displays as one of the buffers for the keyboard matrix." He erased
and redrew another part of the diagram to show what he had.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-qw9Ppvm0lIE/XwFvQgPJ97I/AAAAAAAACwI/_P4FQPv6zeooi8kx2c5dAyk_yY9Uf1t6gCLcBGAsYHQ/s1600/keyboard_display_buffer_doubledup_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="744" data-original-width="1098" height="432" src="https://1.bp.blogspot.com/-qw9Ppvm0lIE/XwFvQgPJ97I/AAAAAAAACwI/_P4FQPv6zeooi8kx2c5dAyk_yY9Uf1t6gCLcBGAsYHQ/s640/keyboard_display_buffer_doubledup_diagram.png" width="640" /></a></div>
<br />
"I was hoping that the scan could be done quickly enough to not interfere, but just holding the keys down messes things up."<br />
<br />
"So, Bob, you had a suggestion, right?"<br />
<br />
"Jennifer thinks we should be able to do it without any additional parts, but I think we need two 74LS138s."<br />
<br />
"Can you diagram that?"<br />
<br />
"Well, first, I think we need another bit for the main CPU interface."<br />
<br />
"Why's that?"<br />
<br />
Jennifer
replied, "Main CPU has to be able to tell the controller what it's
supposed to do, so it needs at least one bit of control."<br />
<br />
Bob and Jennifer worked quickly to put the following diagram up:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-uZp89rnSXB4/Xv3jyyu9DiI/AAAAAAAACvY/sD6hmvB0SA8oIpatlL1bJqIrkvrH9E9dQCLcBGAsYHQ/s1600/keyboard_display_block_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="744" data-original-width="1098" height="432" src="https://1.bp.blogspot.com/-uZp89rnSXB4/Xv3jyyu9DiI/AAAAAAAACvY/sD6hmvB0SA8oIpatlL1bJqIrkvrH9E9dQCLcBGAsYHQ/s640/keyboard_display_block_diagram.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
"Hmm. Let's keep that in mind. So, what about the 'LS138 one-of-eight demultiplexors?"<br />
<br />
Bob modified parts of the diagram, to add the two demultiplexors: <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-k7Yb86BK6xU/XwF6wdIHwqI/AAAAAAAACwU/AawRjCw3cdQG6wKOJ8BXjhobZFdOcme5gCLcBGAsYHQ/s1600/keyboard_display_74ls138_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="744" data-original-width="1098" height="432" src="https://1.bp.blogspot.com/-k7Yb86BK6xU/XwF6wdIHwqI/AAAAAAAACwU/AawRjCw3cdQG6wKOJ8BXjhobZFdOcme5gCLcBGAsYHQ/s640/keyboard_display_74ls138_diagram.png" width="640" /></a></div>
<br />
"This
would allow both the keyboard and the display to be accessed at the
same time," Bob explained. "If I shut down the displays for a hundred
microseconds or so, I can share the select lines, and save a couple of
port bits."<br />
<br />
"Okay. Now I think Jennifer is right that,
with a bit of really careful timing, and a bit of care in how we set up
the ports for the matrix and displays, we could reduce the interference
so that you could hardly tell that holding a key down is causing stray
LEDs to light. But it would be kind of sensitive to resistor values, and
cheap parts might not work."<br />
<br />
Jennifer looked a little put-out.<br />
<br />
"I'm
not saying she shouldn't do it, just that that there are trade-offs,
and I'm not prepared to dig into that right now. Back to the 'LS138s,
how do they affect our code? Bob and Jennifer, let someone else answer."<br />
<br />
Bob and Jennifer both nodded in agreement. <br />
<br />
Javier finally spoke up. "Instead of shifting the matrix strobe and the display select on their ports, we count them?"<br />
<br />
"Good. What does the counting look like?"<br />
<br />
Everyone
thought for a bit, and then Javier answered: "Counting for one of those
can be just an INC instruction, but the other is going to be adding
sixteen or something, depending on the bits used, right?"<br />
<br />
"Exactly. So we'll look at that, but anyone have another way to do this?" <br />
<br />
Mike
said, "I'm planning on sharing a port between the keyboard and the
displays, but I'll use a single eight-bit buffer to disable the keyboard
when I'm using the displays. I'll use the extra bit from the display
select port to shut off the keyboard matrix except when I'm reading it."<br />
<br />
"How about the control line for the main CPU?"<br />
<br />
"The
Micro Chroma 68 keyboard interface only uses seven bits of data, so
that leaves one bit that can be used as a strobe or control signal. I
think that'll be enough." Mike stood up to a blank panel and sketched
out his idea.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-R0aw0itJL0Q/XwG4U6anEEI/AAAAAAAACwg/uuAO86qKUREYAJoXmj5RSpHMxBhoFaoJwCLcBGAsYHQ/s1600/keyboard_display_buffered_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="744" data-original-width="1098" height="432" src="https://1.bp.blogspot.com/-R0aw0itJL0Q/XwG4U6anEEI/AAAAAAAACwg/uuAO86qKUREYAJoXmj5RSpHMxBhoFaoJwCLcBGAsYHQ/s640/keyboard_display_buffered_diagram.png" width="640" /></a></div>
<br />
"Very good. Now we have at least a couple of different approaches that might
work."<br />
<br />
Larry asked, "Would it work to use two 6805s?"<br />
<br />
"What do you think?"<br />
<br />
"I guess we'd need a way for the main CPU to talk to the second controller."<br />
<br />
"Sure. And that may have some advantages, as well."<br />
<br />
Kyle laughed. "So we wouldn't need to bother with the timer and interrupts."<br />
<br />
"We got 'em," Tim replied. "Might as well use 'em."<br />
Terry asked, "How about using a serial port for talking to the main CPU?"<br />
"The
Micro Chroma 68 design is looking for the keyboard on a parallel port,"
I explained. "But if we modify the design and the monitor ROM, we
should be able to get a serial interface to work, as well."<br />
<br />
Chuck objected, "The 6805 doesn't have a serial port."<br />
<br />
"True."<br />
<br />
After
a moment of thought, he said, "But I guess a single bit of a parallel
port could work, the way it's done on the Color Computer."<br />
<br />
"Bit-banging. We could put the 6805's bit operators to good use there, I think."<br />
<br />
Carlos asked, "Which are you going to use?" <br />
<br />
"I'll ask Julia later."<br />
<br />
Several of the group chuckled.<br />
<br />
"Because it's her keyboard, not mine."<br />
<br />
Lupe raised a question -- "Does the Micro Chroma 68 use the status display?"<br />
<br />
"Not with the current software, but, again, we can modify the software to use it."<br />
<br />
"Then maybe we don't really want the display on the keyboard controllers we're building now?"<br />
<br />
"That
is definitely a design option," I concurred. "Or, if you want the
display but want to do it another way, you could add a 6821 to the
mainboard and have the mainboard
CPU control it directly."<br />
<br />
Tanya complained, "So, basically, for the last three days, we've been on a wild goose chase."<br />
<br />
"Exploring
options," I reinterpreted. "And learning how to use a timer interrupt,
so we can use timed samples instead of riding the port to debounce the keyboard
matrix. And looking deeper into what we might want to build."<br />
<br />
Larry
said, "Okay. Can we get back to debouncing the keyboard, now? Can we
use the same timer setup that we're using for the display to sample the
keyboard
matrix and debounce it?"<br />
<br />
"Explain."<br />
<br />
"The
whole point of the debounce is to be sure we read one keypress as one
keypress? We could remember which key we saw in a variable, and check it
on the next timer interrupt?"<br />
<br />
"How long do we wait to accept a keypress?"<br />
<br />
Julia
recited, "300 words per minute is five words per second. At six letters
per word, that's thirty keys pressed a second, or one thirtieth of a
second."<br />
<br />
Terry added, "That's about thirty-three milliseconds, so it's about thirty-three interrupts."<br />
<br />
Freddie asked, "Can a key bounce take more than a millisecond to settle?"<br />
<br />
Suzanne suggested, "We can count interrupts to time a keypress. Maybe sixteen interrupts is good to call it debounced."<br />
<br />
I
added, "We can experiment with that, and we might even want to add
keyboard repeat functions based on counting timer interrupts."<br />
<br />
<br />
<br />
Discussion of multiple simultaneous keys pressed.<br />
<br />
<br />
State is sparse matrix -- matrix algebra<br />
<br />
"Good, but let's think about it a bit further. What if we want to see keys that repeat?"<br />
<br />
"We'd need to time it."<br />
<br />
Suzanne suggested, "We could count interrupts as a way to time it?"<br />
<br />
"Yep.
Next question, what if we press one key, then another before we release
the first? Can we figure out a way to let the keyboard key rollover, so
to speak, to the next key?"<br />
<br />
"Have some sort of memory buffer?" Terry suggested.<br />
<br />
---------------<br />
<br />
Then Carlos asked, "Okay, we've recorded all this state, now what?"<br />
<br />
"How do we check to see if something changed?"<br />
<br />
From
there we talked about using the interrupt counter to tell when we
needed to check whether the state had changed, and the about using bit
masking and bit counting to tell which keys had been pressed and
released, and so forth.<br />
<br />
And somebody pointed out that
the state table naturally kept track of key rollover, so we talked about
adding a type-ahead buffer.<br />
<br />
I had to leave to deliver
newspapers, and, by the time I got back, Winston, Jeff, and Mark had
their keyboards working with their Micro Chroma 68+6801s. Bob, Jennifer,
Mike, also had their keyboards working, and those who had theirs
working were going around helping others.<br />
<br />
Suzanne had
joined Julia, so I sat down with them and we got both of their keyboards
working and interfaced with their Micro Chroma 68+6801s before time to
shut down.<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
"I need to make a stop in the library." I helped Julia wrap her computer in aluminum foil for protection.<br />
<br />
"Can I come with?" <br />
<br />
"Well, of course."<br />
<br />
<div style="text-align: center;">
***** </div>
<br />
"Intel 8086? What do you need that for?"<br />
<br />
"Ammunition."<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
After
studying and singing, Julia played with her Micro Chroma 68+6801 while I
studied the i8086/8088 manual and the TMS 9900 and 9940 manuals.<br />
<br />
When I took her home and we shared a quick kiss on her doorstep, her mother opened the door and cleared her throat.<br />
<br />
"Mom, not tonight. I've been studying stuff that is completely foreign to me. Joe calls it playing, but I'm tired."<br />
<br />
"I
have to admit to being a bit tired myself," I added. "Julia's keyboard
is now talking to her computer. Tomorrow's going to be another long day,
I think."<br />
<br />
"Speaking of her computer," Mr. Cisneros spoke up from the couch, "I think she needs a box to put it in."<br />
<br />
"True."<br />
<br />
I
went in and sat down, and we discussed plans for an enclosure for her
computer. We talked about a box like mine, and we also talked about
putting her keyboard in a separate enclosure so she move it around, and
several other options, sketching up some plans, but making no decisions.<br />
<br />
<br />
<br />
--------------- <br />
<br />
Lupe raised a question -- "Does the Micro Chroma 68 use the display?"<br />
<br />
"Not with the current software, but we might ft ."<br />
<br />
"Then maybe we don't really want the display on the keyboard controllers we're building now?"<br />
<br />
"That
is definitely a design option," I concurred. "Or, another way to add a
display, you could add a 6821 to the mainboard and have the mainboard
CPU control it directly."<br />
<br />
Tanya complained, "So, basically, for the last three days, we've been on a wild goose chase."<br />
<br />
"Exploring
options," I reinterpreted. "And learning how to use a timer interrupt,
so you can use the timer interrupt method of decoding the keyboard
matrix. Or taking a side-tour to start designing a trainer."<br />
<br />
Larry said, "Okay, let's get back to debouncing the keyboard. I guess
we can use the same timer setup that we're using for the display to
sample the keyboard
matrix and debounce it?"<br />
<br />
"Explain."<br />
<br />
"The
whole point of the debounce is to be sure we read one keypress as one
keypress? We could remember which key we saw in a variable, and check it
on the next timer interrupt?"<br />
<br />
"Good, but let's think about it a bit further. What if we want to see keys that repeat?"<br />
<br />
"We'd need to time it."<br />
<br />
Suzanne suggested, "We could count interrupts as a way to time it?"<br />
<br />
"Yep.
Next question, what if we press one key, then another before we release
the first? Can we figure out a way to let the keyboard key rollover, so
to speak, to the next key?"<br />
<br />
"Have some sort of memory buffer?" Terry suggested.<br />
<br />
<br />
<br />
<br />
----------------<br />
<br />
"In my ideal world, people could be lovers without having, you know, sexual relations."<br />
<br />
"Do
you think it would make it alright, to be torn between two uhm,
platonic lovers? I don't think that even makes sense as a question."<br />
<br />
"Heh. I'm not a fan of the song, either, but, like a jingle for fast food, it gets stuck in the brain."<br />
<br />
<br />
picking
julia up in the morning, talk about exercise, julia says she will drive
Wednesday (but does not say reason is to to arrive early and exercise
with Joe)<br />
<br />
in lab, discussing how to deal with needing 8 more port lines because of seven segment display,introduce ls138<br />
<br />
<br />
The doorbell rang as I was changing into gym shorts and a tee shirt for my morning exercises.<br />
<br />
Giselle called out, "I think you should get it, Joe."<br />
<br />
Puzzled, I pulled my tee on and carried my gym shoes into the living room.<br />
<br />
Julia was waiting at the screen door in exercise gear when I rounded the hall doorway into the living room. <br />
<br />
"Oh.
So that's why you wanted to drive today. You wanted to come early and
see what I do for exercise?" I gave her a cheesy grin and went to the
door, ligting the screen door latch so she could come in.<br />
<br />
"Well, more to join you than to watch." She loosened her shoelaces and left her shoes inside the door as she came in.<br />
<br />
I set my shoes by hers. "I could have gone to your house early."<br />
<br />
"And exercise with my parents watching? No way. Not the first time we exercise together. How do you usually start?"<br />
<br />
"Warmups
and stretches. The carpet in here is easy on the bones, but can slide
about underfoot. The floor in the den is hard, but it doesn't slide you
unless you're wearing socks."<br />
<br />
"Barefoot it is, then."<br />
<br />
We both left our socks on our shoes, saying good morning to my mom on our way through the kitchen to the den.<br />
<br />
"You two focus on your exercises and I'll fix breakfast this morning."<br />
<br />
Mom must have also been in on the plan.<br />
<br />
We faced each other in the middle of the den. "And?" Julia looked at me expectantly. <br />
<br />
"Uhm, I usually start with plié to warm up. Other than that, it's pretty random, and I'm open to suggestions."<br />
<br />
"Ballet?"<br />
<br />
"I
learned a little from Louise and Giselle. I wanted to take a class in
modern dance this semester, but they told me I already had more than the
usual limit of credit hours."<br />
<br />
She laughed. "You work too hard. I've picked up some things from creative dance classes."<br />
<br />
For about ten minutes, we shared ideas about warmups and stretches.<br />
<br />
I showed her the first three minutes of NHK <i>rajio taisō</i>,
the Japanese public broadcasting system's radio (and TV) exercise
routine. (You can probably find videos of people doing it, by searching
for <i>"NHK Rajio Taisō".</i>)<br />
<br />
"The hands and legs are opposite of plié."<br />
<br />
"Yeah. In ballet's Plié, the beat of the hands and legs is in opposition, but in <i>rajio taisō,</i> they start together and beat in the same direction."<br />
<br />
"So you learned all this dance from Louise?"<br />
<br />
"And Giselle. I wanted to take a class in modern dance this term, but there was no time for it."<br />
<br />
"Let's take it together."<br />
<br />
"I wonder if I'll have time for summer classes, with the internships. I thought you were moving on to Texas Christian."<br />
<br />
"Mom thinks I should postpone the associate's degree."<br />
<br />
"You need to do what you need to do."<br />
<br />
She didn't look happy with that thought.<br />
<br />
"Of course, if that happens to be sticking around and doing undergraduate work at UTPB with me, that might work, too."<br />
<br />
"Can you study your Japanese at UTPB?"<br />
<br />
"Nope. Push-ups and sit-ups?"<br />
<br />
"Sure. What'll you do about Japanese?"<br />
<br />
"I should probably talk to somebody at UT or BYU about correspondence work."<br />
<br />
Our conversation lagged for a couple of minutes while we focused on the exercises.<br />
<br />
"Up for a run?"<br />
<br />
"Sure."<br />
<br />
"Want
to run past your house? I think we can make it in ten minutes. I think
you can borrow the shower on my parents' side of the house to wash the
swe-- glow off."<br />
<br />
She laughed. "That might make my mom's day. And I already checked with you mom on the shower."<br />
<br />
"Glad somebody here is good at planning."<br />
<br />
We
told my mom we'd be back in ten and headed out the front door, running
north to cross 42nd at Dixie Boulevard, then past the shopping center to
run along the south edge of the park. We rounded her block, stopping at
her house to say hi to her mom, then back around her church, following
Lindale back to the intersection with 42nd, where Lindale turns into
38th, then followed 38th home.<br />
<br />
Mom made sure Julia had
what she needed for her shower, and I took a quick shower in the bath on
Giselle's and my side of the house, and we packed our stuff in her car
and headed to school.<br />
<br />
<br />
<br />
<br />
Mention of the trip to the surplus store for disk drives, everyone plans to go, plans for picnic?<br />
Framework makes debouncing easy<br />
Having to use the anodes port for the column strobes? Add one-of-eight selects instead?<br />
Using the interrupt input for system request<br />
<br />
<br />
<br />
****<br />
<br />
"We want to be
able to have the CPU do other things besides display numbers, so we're
going to use the timer built into the 6805 to count instead of having
the CPU count, and we'll have the timer interrupt the program to
actually display the numbers."<br />
<br />
"Is this only for displaying numbers?" Tanya asked in a slightly petulant tone.<br />
<br />
"Well,
the numbers might mean things. For instance, if something goes wrong
during boot, we could put an error code and an address on the display,
to give clues about the error state. Or we might say that a blank
display is an all-operational status."<br />
<br />
I can tell your
eyes are glazing over now, so, rather than walk you through it with us
I'll just note that we read in the manual about the timer, and I walked
them through initialization, using the pre-scaler to set the
granularity, calculating the value to initialize the timer and
pre-scaler to interrupt the CPU once every millisecond, and constructing
the interupt routine to display the digits one place at a time.<br />
<br />
Someday,
somewhere in my blogs, I'll show the complete keyboard debounce and
status display routine, complete with display suppression and other
features that we evenutally added. Suffice it to say that we had Julia's
status display functional at a usable level on Monday before I went
home to deliver newspapers, and that about half of the group had theirs
functional by the time I got back.<br />
<br />
<br />
Tuesday I
explain that we need more computers running, so Julia's is not just
Julia's. Then we forge ahead into the keyboard decoding.<br />
<br />
Wednesday,
while students are catching up, Julia, Mark, Jeff, Winston, and Suzanne
dig in and get their computers ready for RAM, ROM, burners, disk
controllers, etc., while I study the Forth manual and the TMS 9940
datasheets.<br />
<br />
<br />
<br />
Which is what we did. Again, Doctor
Brown let them work while I was delivering my newspapers, and Julia,
Mark, and Jeff helped those who needed help with the tools on the Micro
Chroma 68.<br />
<br />
About half of the group had their display routines working well by the time I returned to pack things up.<br />
<br />
From
Monday to Wednesday, in lab, I let the others work while I helped Julia
program her keyboard controller. Someone was watching over our
shoulders as we worked, and the structure of the code made the rounds --
the interrupt handlers, the state tables for the keyboard matrix, the
translation matrix for the LEDs, etc.<br />
<br />
Bob and Jennifer pretty much got it worked out for themselves, and we compared notes.<br />
<br />
Mark,
Jeff, and Mike picked up what we were doing, and also had their
keyboard controllers working shortly after Bob, Jennifer, and Julia and I
had ours working.<br />
<br />
<br />
<br />
<br />
It's tempting to go into great detail on the keyboard decoding and
the status display. Maybe, one day, I'll write a book on how to do it
with parts you can buy now. 6805s are kind of hard to get now. (It would
fill an entire book, yes.)<br />
<br />
I'll note that I walked the
group through several ways of keeping keyboard state for use in
debouncing. Some of the students understood when I <br />
<br />
<br />
<br />
<br />
<br />
<br />
Pascal, book of Ether, keyboard with Julia<br />
Ed Snyder's black stealth keyboard<br />
<br />
monday<br />
Julia and I work out the keyboard and seven-segment status display <br />
class also progressing, work on 68705 trainer monitor <br />
home evening with Julia's family and missionaries, second discussion, <br />
recital practice every evening all week<br />
<br />
tuesday, wiring Julia's with memory switches, DMA controller, ROMs, full RAM<br />
continued work on trainer monitor<br />
communicating with TSC about drivers <br />
(evening?)<br />
<br />
wednesday,<br />
Julia's EPROM/MCU burners, my daughterboard starts<br />
class continues with trainer monitor, etc. <br />
her scripture study group<br />
<br />
thursday,<br />
diagramming,<br />
first peek at forth<br />
class completes trainer monitor. <br />
our institute<br />
<br />
friday,<br />
trip to austin<br />
meeting with motorola, Julia asked to join<br />
discussion of<br />
-- floppy controllers<br />
-- 2801 address spaces, I/O based memory banking, call stack cache<br />
-- RISC concepts<br />
-- 2809 similar to 2801<br />
-- 31609 with 32 bit addressing<br />
-- 38000 with stack caching<br />
<br />
saturday<br />
Julia's disk drives<br />
<br />
<span class="tlid-translation translation" lang="es"><span class="" title="">(Nos) besaremos cuando y como queramos. </span></span><br />
<span class="tlid-translation translation" lang="es"><span class="" title=""><span class="tlid-translation translation" lang="es"><span class="alt-edited" title="">cuándo y cómo</span></span></span></span><br />
<br />
Trip back, too much heavy kissing, discussion of information sharing?<br />
Managers and bishops who don't know what to do with information that comes up.<br />
<br />
(In notes for bringing up flex:)<br />
<br />
Denny
called about the time we were wrapping up, and Julia got on the
extension in Dad's study to say hi. It seemed it would be appropriate to
make a run to Austin the next weekend, and to leave immediately after
our last morning classes so I could visit with some of the management at
Motorola Friday evening.<br />
<br />
"You, know," Julia said, "if I
went with, maybe I could look for floppy disk drives at that surplus
shop on Saturday before coming back."<br />
<br />
Denny checked
with Denise, and they decided Julia could sleep on the couch in the
living room and I could sleep on the floor in a sleeping bag in the
boys' room. Julia's parents said they thought it would be okay, and Mom
and Dad suggested we pray about it.<br />
<br />
Which we did. No one felt inspired to object, <br />
<br />
Julia suggested she go with me, so she could go looking for her own disk drives. <br />
<br />
<br />
Talk about duty cycle and mention DtoA as a way to adjust brightness.<br />
<br />
<br />
Julia returned to working on her keyboard/trainer, while I dug back into my test routines. <br />
<br />
<br />
Watching
the students work on the keyboard and keypad matrix decoding,
became clear to me that, while the bit I/O instructions might be useful
for certain singular, non-generalized kinds of code, a keyboard or
keypad matrix contained a lot of repeated elements. Ultimately, shifts
and logical instructions would provide the more
general scalable solution.<br />
<br />
I
stood up and demonstrated the concept of a state array for the matrix,
then suggested we put it on a back burner and look at the seven-segment
LED displays. This time, the bit I/O instructions were ignored, and
several groups formed around defining an array of the segment patterns
for each integer. Some of the students wanted to turn the translation
array upside down for some reason, but I didn't stop them. <br />
<br />
Suzanne's
and Winston's and Winston's mainboards were both up enough to display
the TV-BUG prompt by this point, and the four of them joined the rest on
the keyboard/trainers.<br />
<br />
It's tempting to go into great detail on the keyboard decoding and
the status display. Maybe, one day, I'll write a book on how to do it
with parts you can buy now. 6805s are kind of hard to get now. (It would
fill an entire book, yes.)<br />
<br />
I'll note that I walked the
group through several ways of keeping keyboard state for use in
debouncing. Some of the students understood when I <br />
<br />
<br />
Since Flex was running on my
Micro Chroma 68, I was able to load the cross-assembler, and we had
several students burn code into their 68705s for testing before time to
shut down.<br />
<br />
Mike kept trying to work out how to set the keyboard state up as an array, but he couldn't seem to quite pin it down.<br />
<br />
I shook my head, and she led me out the back door. There was a large tree with a tire swing<br />
<br />
I
guess there were no surprises on Sunday, unless you would consider it
surprising that Pat and George attended Julia's congregation again. They
slipped out before we could talk with them. We didn't see Mike.<br />
<br />
Or you might consider it surprising that Julia and I joined the choir in my ward, preparing for Easter Sunday. No?<br />
<br />
I
suppose it would be no surprise that Julia insisted on calling Denny
and Denise to ask if there were room for her to stay overnight Friday.
With a bit of discussion, it was determined that she could have the
couch in their living room, and I would roll a sleeping bag out on the
floor of the boys room, and both our parents approved that plan.<br />
<br />
That Sunday was about as one might expect, I think. In the morning, I
visited Julia's congregation. Pat and George came and sat in the back.
Mike slipped in before the sermon started, and all three slipped out
before we had a chance to talk with them.<br />
<br />
In the afternoon,
Julia visited mine. This time, she joined our choir practice in between
meetings and young adult family home evening.<br />
I told her about needing to go to Austin before her meetings, and by
the time we were finished with mine, she had decided she was going with
me.<br />
<br />
<br />
"Floppies multiplying like rabbits," I grumbled.<br />
<br />
She laughed. <br />
<br />
<br />
<br />
<br />
tendency to idealize/idolize foreign<br />
<br />
<br />
<br />
<div style="text-align: right;">
Chapter 13.5: what?</div>
<div style="text-align: center;">
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></div>
<hr />
<i>[Backed up at .]</i><br />
<br />
<i> </i><i> </i><br />
<i> </i>零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-35684708740499174432020-07-12T21:11:00.000+09:002020-07-12T21:20:23.586+09:00Backup: 33209: Straits -- Keyboard DecodingBackup of <a href="https://joelrees-novels.blogspot.com/2020/07/33209-straits-keyboard-decoding.html">https://joelrees-novels.blogspot.com/2020/07/33209-straits-keyboard-decoding.html</a>.<br />
<hr />
<br />
<a href="https://joelrees-novels.blogspot.com/2020/06/33209-straits-status-display.html">Chapter 13.3: Straits -- Status Display</a><br />
<br />
<h4 style="text-align: center;">
Chapter 13.4: Straits -- Keyboard Decoding </h4>
<br />
"Much improved last night." Julia's mom gave me an approving smile as she met me at their front door.<br />
<br />
I grinned lopsidedly and bussed her cheek as I ducked in. "Somebody must have been peeking through the blinds?" <br />
<br />
The smile she gave me in answer might have been a little smug.<br />
<br />
Julia
came into the living room carrying her backpack on a shoulder. "I
threatened to do all our kissing somewhere else, and Mom didn't even bat
an eyelash," she complained. <br />
<br />
"You two belong
together. You can kiss anywhere." Mrs. Cisneros gave her daughter a
quick hug and a kiss and sent us off with a "Have a good time studying
together today." <br />
<br />
I held the passenger-side front door of the Colt open and Julia climbed in. <br />
<br />
She leaned her seat back and put her backpack in the back seat as I walked around and climbed in the driver's seat.<br />
<br />
"How about if I drive tomorrow?"<br />
<br />
"Your folks won't need your car?"<br />
<br />
The radio came on as I started the engine. <br />
<br />
"I can usually, I just want to drive. tomorrow."<br />
<br />
"Okay. I'll be waiting for you."<br />
<br />
DJ talk and music played in the background as I drove and we talked about the day's schedule and other things.<br />
<br />
"I
don't particularly like this song," Julia said as the radio played the
chorus of Mary MacGregor's hit rendition of "Torn between Two Lovers".<br />
<br />
"Mmmyeah. It does kind of get stuck in the head, and the lyrics aren't all that great" <br />
<br />
Julia was silent for a moment, then asked, "Do you think it would be breaking rules to love two people?"<br />
<br />
I thought for a minute. "My automatic reaction is that's not the right kind of love if it's breaking any real rules."<br />
<br />
"Platonic okay, Plutonic no." She gave me a shy-sly grin as she reached over to the radio to change stations.<br />
<br />
"Heh." <br />
<br />
The
station she picked was playing Boston's "More Than a Feeling", and we
listened to it in silence for a bit, holding hands on the gearshift
lever.<br />
<br />
"Hey. I'm going to make everyone rewire their keyboard controllers today. I hope they won't be too mad."<br />
<br />
"Why's that?"<br />
<br />
"Not
enough port bits. Need to add a buffer and share one port between the
keyboard and display, to free up a port to talk with the main CPU."<br />
<br />
"I might be a little put out, too."<br />
<br />
She tickled my palm, and I missed a downshift, letting the engine lug for a moment while I returned the tickle. <br />
<br />
<div style="text-align: center;">
*****</div>
<br />
In
the lab after classes, I was going to ask first off if anyone in our
group had ideas about how to shorten the interrupt handling routines for
the displays, and ask after that if anyone had noticed that 32 pins of
parallel I/O wasn't really enough. But, when Julia and I arrived, a
group was gathered around Winston. He was testing his keyboard and
seven-segment displays, and when he held a key down, it would interfere
with the display, causing it to show stray segments.<br />
<br />
He looked up at me. "I don't think we have enough output lines."<br />
<br />
"Yeah, ...," I hedged. <br />
<br />
Bob
had a suggestion. "I'm thinking we could add two 'LS138s and control
them both from one parallel port to do the scanning -- one for the
display anodes and one for one side of the keyboard matrix."<br />
<br />
"Oh. That could work." I nodded absently. "Can we get a look at the problem before we go looking for solutions?" <br />
<br />
"Then it is a bug." Winston half-asserted, half-asked.<br />
<br />
"Oh,
yeah. I was planning on looking at it first or second thing today when
everyone comes. Can you explain it to everyone, Winston?"<br />
<br />
"Why
me?" he complained, half-joking, half-resigned, as he picked up his
schematics and went to the chalkboard. He started by putting up the
working diagram from the day before while we waited for more of the
group to come.<br />
<br />
When he was done with that, and most of
our group had arrived, he gave me a nod, and I nodded to Doctor Brown,
and Doctor Brown said, "Any time you're ready."<br />
<br />
Winston
went back to his lab table and picked up his keyboard and controller,
and announced, "Ground control, we have a problem."<br />
<br />
Several
of us chuckled as Winston proceeded to demonstrate how holding keys
down would change a number shown on the display to some unintended
shape.<br />
<br />
"That's cool!" Carlos enthused.<br />
<br />
"Solution one," Doctor Brown intoned with raised eyebrows. "It's not a bug, it's a feature."<br />
<br />
Everyone
laughed except Winston, who rolled his eyes before grinning lopsidedly.
"That is one way of looking at it," he grudgingly admitted.<br />
<br />
"Yeah," Doctor Brown grinned, "but I guess let's not use that solution this time." <br />
<br />
"So, why does this happen?" I asked. "Show us what your circuit looks like."<br />
<br />
Winston erased and redrew part of the circuit:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-x5-drUVbIsE/Xv3jFuUvfDI/AAAAAAAACvM/E0VMyxdjPW8PX3qgGP0HUz_K3OGOkGR1wCPcBGAYYCw/s1600/keyboard_display_block_diagram_wrong.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="744" data-original-width="1098" height="432" src="https://1.bp.blogspot.com/-x5-drUVbIsE/Xv3jFuUvfDI/AAAAAAAACvM/E0VMyxdjPW8PX3qgGP0HUz_K3OGOkGR1wCPcBGAYYCw/s640/keyboard_display_block_diagram_wrong.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
"So,
we could ask Winston why he added another buffer," I pointed out,
semi-rhetorically. "Or we could ask everyone if we all understand why.
Suzanne, can you tell us why?"<br />
<br />
She hesitated, than suggested, "If we don't have that, how does the computer know what key the controller decoded?"<br />
<br />
"Exactly. Thanks. So, Winston, now what's the problem?"<br />
<br />
"We
don't have enough bits of I/O, and I have used one of the buffers for
the displays as one of the buffers for the keyboard matrix." He erased
and redrew another part of the diagram to show what he had.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-qw9Ppvm0lIE/XwFvQgPJ97I/AAAAAAAACwI/_P4FQPv6zeooi8kx2c5dAyk_yY9Uf1t6gCLcBGAsYHQ/s1600/keyboard_display_buffer_doubledup_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="744" data-original-width="1098" height="432" src="https://1.bp.blogspot.com/-qw9Ppvm0lIE/XwFvQgPJ97I/AAAAAAAACwI/_P4FQPv6zeooi8kx2c5dAyk_yY9Uf1t6gCLcBGAsYHQ/s640/keyboard_display_buffer_doubledup_diagram.png" width="640" /></a></div>
<br />
"I was hoping that the scan could be done quickly enough to not interfere, but just holding the keys down messes things up."<br />
<br />
"Yeah. So, Bob, you had a suggestion, right?"<br />
<br />
"Jennifer thinks we should be able to do it without any additional LSI chips, but I think we need two 74LS138s."<br />
<br />
"Can you diagram that?"<br />
<br />
"Well, first, I think we need another bit for the main CPU interface."<br />
<br />
"Why's that?"<br />
<br />
Jennifer
replied, "Main CPU has to be able to tell the controller what it's
supposed to do, so it needs at least one bit of control."<br />
<br />
Bob and Jennifer worked together to quickly put the following diagram up:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-uZp89rnSXB4/Xv3jyyu9DiI/AAAAAAAACvY/sD6hmvB0SA8oIpatlL1bJqIrkvrH9E9dQCLcBGAsYHQ/s1600/keyboard_display_block_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="744" data-original-width="1098" height="432" src="https://1.bp.blogspot.com/-uZp89rnSXB4/Xv3jyyu9DiI/AAAAAAAACvY/sD6hmvB0SA8oIpatlL1bJqIrkvrH9E9dQCLcBGAsYHQ/s640/keyboard_display_block_diagram.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
"Hmm. Let's keep that in mind. So, what about the 'LS138 one-of-eight demultiplexors?"<br />
<br />
Bob modified parts of the diagram, to add the two demultiplexors: <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-k7Yb86BK6xU/XwF6wdIHwqI/AAAAAAAACwU/AawRjCw3cdQG6wKOJ8BXjhobZFdOcme5gCLcBGAsYHQ/s1600/keyboard_display_74ls138_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="744" data-original-width="1098" height="432" src="https://1.bp.blogspot.com/-k7Yb86BK6xU/XwF6wdIHwqI/AAAAAAAACwU/AawRjCw3cdQG6wKOJ8BXjhobZFdOcme5gCLcBGAsYHQ/s640/keyboard_display_74ls138_diagram.png" width="640" /></a></div>
<br />
"This
would allow both the keyboard and the display to be addressed at the
same time," Bob explained. "But if I shut down the displays for a
hundred microseconds or so for the keyboard scan, I can share the select
lines for the 'LS138s, and save a couple of port bits."<br />
<br />
"Great.
Thanks. Now I think Jennifer is right that, with a bit of really
careful timing, and a bit of care in how we set up the ports for the
matrix and displays, we could reduce the interference so that you could
hardly tell that holding a key down is causing stray LEDs to light. But
it would be kind of sensitive to pull-up or pull-down resistor values,
and cheap parts might not work. And we might need to add diodes, as
well."<br />
<br />
Jennifer looked a little put-out at my conjecture.<br />
<br />
"I'm
not saying she shouldn't do it, just that that there are trade-offs,
and I'm not prepared to dig into that right now. Back to the 'LS138s,
how will they affect our code? Bob and Jennifer, let someone else
answer."<br />
<br />
Bob and Jennifer both nodded in agreement. <br />
<br />
Javier finally spoke up. "Instead of shifting the matrix strobe bit and the display select bit on their ports, we count them?"<br />
<br />
"Good. What does the counting look like?"<br />
<br />
Everyone
thought for a bit, and then Javier answered: "Counting for one of those
can be just an INC instruction, but the other is going to be adding
sixteen or something, depending on the bits used, right?"<br />
<br />
"Exactly. So we'll look at that, but anyone have another way to do this? Jeff? Mark?"<br />
<br />
"We're kind of with Mike on this," Jeff replied.<br />
<br />
I
turned to Mike, and he responded, "I'm planning on sharing a port
between the keyboard and the displays, but I'll use a single eight-bit
buffer to disable the keyboard when I'm using the displays. There are
only seven digits, so only seven anode selects, and I can use the extra
bit from the display select port to shut off the keyboard matrix except
when I'm reading it."<br />
<br />
"How about the control line for the main CPU to read the keyboard?"<br />
<br />
"The
Micro Chroma 68 keyboard interface only uses seven bits of data, so the
high bit can be the key value strobe, like the Micro Chroma 68
documentation shows. I think that'll be enough." Mike stood up at a
blank panel and sketched out his idea.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-R0aw0itJL0Q/XwG4U6anEEI/AAAAAAAACwg/uuAO86qKUREYAJoXmj5RSpHMxBhoFaoJwCLcBGAsYHQ/s1600/keyboard_display_buffered_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="744" data-original-width="1098" height="432" src="https://1.bp.blogspot.com/-R0aw0itJL0Q/XwG4U6anEEI/AAAAAAAACwg/uuAO86qKUREYAJoXmj5RSpHMxBhoFaoJwCLcBGAsYHQ/s640/keyboard_display_buffered_diagram.png" width="640" /></a></div>
<br />
"Very good. Now we have at least a couple of different approaches that might
work."<br />
<br />
Larry asked, "Would it work to use two 6805s?"<br />
<br />
"What do you think?"<br />
<br />
"I guess we'd need a way for the main CPU to talk to the second controller."<br />
<br />
"Sure. And that may have some advantages, as well."<br />
<br />
Kyle laughed. "So we wouldn't need to bother with the timer and interrupts."<br />
<br />
"We got 'em," Tim replied. "Might as well use 'em."<br />
<br />
Terry asked, "How about using a serial port for talking to the main CPU?"<br />
<br />
"The
Micro Chroma 68 design is looking for the keyboard on a parallel port,"
I pointed out. "But if we modify the design and the monitor ROM, we
should be able to get a serial interface to work, as well."<br />
<br />
Chuck objected, "The 6805 doesn't have a serial port."<br />
<br />
"True."<br />
<br />
After
a moment of thought, he said, "But I guess a single bit of a parallel
port could work, the way it's done on the Color Computer."<br />
<br />
"Bit-banging. We could put the 6805's bit operators to good use there, I think."<br />
<br />
Chuck nodded.<br />
<br />
Carlos asked, "Which are you going to use?" <br />
<br />
"I'll ask Julia later."<br />
<br />
Several of the group chuckled.<br />
<br />
"Because it's her keyboard and computer, not mine."<br />
<br />
I turned and grinned at Julia, and she creased her brow and gave me a quizzical look.<br />
<br />
Lupe raised a question -- "Does the Micro Chroma 68 use this status display we're adding?"<br />
<br />
"Not with the current software, but, again, we can modify the software to use it, if we want to."<br />
<br />
"Then maybe we don't really want the display on the keyboard controllers we're building now?"<br />
<br />
"That
is definitely a design option," I concurred. "Or, if you want the
display but want to do it another way, you could add a 6821 to the
mainboard and have the mainboard
CPU control it directly."<br />
<br />
Tanya complained, "So, basically, for the last three days, we've been on a wild goose chase."<br />
<br />
"Make that exploring
options," I reinterpreted. "And learning how to use a timer interrupt,
so we can use timed samples instead of riding the port to debounce the keyboard
matrix. And looking deeper into what we might want to build."<br />
<br />
Larry
said, "Okay, so can we get back to debouncing the keyboard now? I'm
kind of interested in that. Can we use the same timer setup that we're
using for the display to sample the keyboard
matrix and debounce it?"<br />
<br />
"Explain."<br />
<br />
"The
whole point of the debounce is to be sure we read one keypress as one
keypress? We could remember which key we saw in a variable, and check it
on the next timer interrupt?"<br />
<br />
"How long do we wait to accept a keypress?"<br />
<br />
Julia
dug into her notes and recited, "300 words per minute is five words per
second. At six letters per word, that's thirty keys pressed a second,
or one thirtieth of a second."<br />
<br />
I reached over and squeezed her hand, and she gave me a lopsided smile and a sigh.<br />
<br />
Terry
added, "That's about thirty-three milliseconds, so it's about
thirty-three interrupts, the way we've set up the timer for the
displays."<br />
<br />
Freddie asked, "Can a key bounce take more than a millisecond to settle?"<br />
<br />
Suzanne suggested, "We can count interrupts to time a keypress. Maybe sixteen interrupts is good to call it debounced."<br />
<br />
I
added, "Counting interrupts is good, and we can experiment with the
duration, and we might even want to add keyboard repeat functions based
on counting timer interrupts."<br />
<br />
"Don't make things too complicated," Doctor Brown warned me.<br />
<br />
"Hmm.
Maybe we should try to describe the steps the interrupt handler routine
is going to go through before we talk about keyboard repeat and
rollover."<br />
<br />
"Flowchart?" Tanya asked.<br />
<br />
"How about you draw it?"<br />
<br />
"I don't know what to draw."<br />
<br />
"We can figure that out as a class."<br />
<br />
Pat suggested, "How about pseudo-code?"<br />
<br />
"Okay, you write pseudo-code while Tanya draws the flow-chart."<br />
<br />
George laughed. "If you keep making people who suggest things work, everybody'll quit suggesting things."<br />
<br />
I tilted my head. "I think we're all here to work, and taking notes is an opportunity for work, like any other." <br />
<br />
I
don't know if that was a very good sales line, but Tanya and Pat both
stood up and cleaned up panes of the chalkboard to work on. <br />
<br />
"What's the first thing our interrupt response routine does?"<br />
<br />
"Clear the interrupt mask?" Larry suggested.<br />
<br />
"What happens if the next interrupt comes before we're done?"<br />
<br />
Everyone thought for a bit.<br />
<br />
"Should I try to answer that?" Bob asked.<br />
<br />
"Sure, go ahead."<br />
<br />
"We lose track of part of the start of what the first interrupt was trying to work on."<br />
<br />
"That's the underlying problem. What does the user see happening?"<br />
<br />
"Uhm, I think there would be missed keys. And the display might lose digits."<br />
<br />
"I think you're on target."<br />
<br />
"So
when should we enable interrupts?" Suzanne asked. "If we keep them
disabled too long, that will also cause missed interrupts and missed
keys."<br />
<br />
Mike responded, "Missed interrupts, but keys can
still be caught and display digits are less likely to be dropped, I
think. So, enabling should be just before we return, I guess."<br />
<br />
I agreed.<br />
<br />
"And," he continued, we need to keep the interrupt routine as short as possible."<br />
<br />
"Exactly."<br />
<br />
"If that's the case, I guess we probably don't want to be translating the display digits to segment images at interrupt time."<br />
<br />
"Okay."<br />
<br />
"What did Mike just say?" Julia asked.<br />
<br />
"Thank you again, Julia," Tanya applauded.<br />
<br />
Bob
replied, "SEGTBL has the segment images. I think Mike is suggesting
that, instead of keeping a buffer full of the numeric values to display,
we should keep a buffer full of the corresponding element of SEGTBL."<br />
<br />
"Yeah," Mike confirmed. Although, I think it's just one or two instructions saved."<br />
<br />
I
added, "I think it also makes the display more flexible, but we'll talk
about that later. Right now, it's the principle of the thing. Do we
want to take time in the interrupt response to decode the keyboard?"<br />
<br />
Pat hesitantly raised her hand, and Mike said, "Just ask, Pat."<br />
<br />
"No? But how do we remember what key we're trying to debounce?" <br />
<br />
I looked at Doctor Brown, and he shrugged.<br />
<br />
I hesitated. "Well, maybe we don't exactly want to remember which key."<br />
<br />
<div style="text-align: center;">
*~*~*~*~*</div>
<br />
Again, just how prescient should I imply, or claim, that I might have been?<br />
<br />
Sure,
I was prescient. I understood far more than the limited exposure I had
in high school and during my time at Radio Shack might explain. I'm sure
I brought a lot of that with me from the pre-existence -- from the
world before birth -- into this world. But would I really have been able
to work this one out in this world's technology without more
experience?<br />
<br />
Experience wins over theory any time you want to make something that actually works, and what I had in the previous world
would have been more theory and principle, not so much application and
experience, and definitely not experience colored and transmorgrified by the
real-world reductions into -- implementations of -- real technology that
were invented in this world since the time I was born.<br />
<br />
Even
had I been one of the in-crowd there which prepped the individuals who
would be leaders of the industry in our present world, things changed
drastically in the implementation. If you've ever worked on a systems development team, you know they always do.<br />
<br />
And I suspect I was a rebel there, too.<br />
<br />
I
always had trouble in school with the question of how much I wanted to
sully my understanding of principle with the details of real-world
implementations. I knew my hesitance was worrying too much about what I would ultimately find relevant,
but without experience who knows what is irrelevant?<br />
<br />
Our
best theories in this world fall so far short, even of what we knew
then, not to mention falling so completely short of what God knows,
understands, and does. <br />
<br />
It doesn't matter. For the
purposes of this novel, the me of this story must have been able to lead
this discussion, or he could not have done what he had to do. But he
has good company. There are other superhumans in this group.<br />
<br />
<div style="text-align: center;">
*~*~*~*~*</div>
<br />
Sheryl voiced the doubts most of the group had -- "How do we debounce a keypress we don't know we've seen?"<br />
<br />
"Good question." I turned it back to her. "What is that microprocessor going to see when it scans the keyboard matrix?"<br />
<br />
Sheryl thought and then replied. "A whole bunch of zeroes and one one."<br />
<br />
"One one? Sounds like a dog barking."<br />
<br />
Everyone looked at me questioningly.<br />
<br />
"Japanese joke. Woof-woof is wan-wan in Japanese. Sorry. Never mind."<br />
<br />
Sheryl wasn't the only one shaking her head, but she replied. "Just one, I think."<br />
<br />
"Does everyone agree?"<br />
<br />
We had some nods and some blank looks.<br />
<br />
"Okay,
let's look at some possible code for this. We'll assume Mike's buffer
for separation, with the keyboard matrix enabled. SHARED is the port
shared for strobing the keyboard and setting the display segments, and
KBDIN is the other edge of the matrix." I pointed to the buffers as I
mentioned them. "Scanning will begin something like this," I erased a
panel and wrote<br />
<blockquote class="tr_bq">
SEC <br />
STBLUP<br />
ROL SHARED<br />
LDA KBDIN</blockquote>
"What happens next?"<br />
<br />
"Mike?" Winston probed.<br />
<br />
"I know what I'm doing. We all need to think."<br />
<br />
Larry
said, "Well, the natural response is to wait for a one, but we have to
look on seven other rows, too. And Joe keeps harping about busy-waiting,
so I don't think that's what he thinks we should do."<br />
<br />
"You can busy-wait if you choose. I'm just trying to point out how to sample instead."<br />
<br />
"Sample?" Terry piped up. "If we're going to sample, we need to record all the samples."<br />
<br />
I held up the chalk, and she stood and took it, then went to the chalkboard and added to what I had written:<br />
<blockquote class="tr_bq">
KBDST RMB 8 <br />
* <br />
LDX KBDST ; STATE ARRAY<br />
CLR SHARED<br />
SEC ; READY TO STROBE <br />
STBLUP<br />
ROL SHARED ; STROBE<br />
BCS KBDDUN ; DONE YET?<br />
LDA KBDIN ; COLUMN STATE<br />
STA ,X ; SAVE IT<br />
INX ; NEXT<br />
BRA STBLUP<br />
KBDDUN</blockquote>
"That
records the entire keyboard state. First I point X to the keyboard
state array in page zero, I mean, direct page, RAM. Then I clear the
shared port so we can shift the strobe across it. Then I set the carry
flag to be shifted in.<br />
<br />
"Rotate left shifts the carry
flag in the SHARED port for the strobe. First time, it shifts the carry
flag in. Branch on carry set will stop us when the carry flag is rotated
out of the high bit."<br />
<br />
"Note," I pointed out, "that branch on zero, BEQ, will also work and may be more resistant to hardware failures."<br />
<br />
Julia raised her hand. "What? Is that supposed to go in the notes?"<br />
<br />
"In case of short circuits or other bad things that could happen to the keyboard," I explained.<br />
<br />
Wallace was writing the notes. "Got it."<br />
<br />
Julia gave me a perplexed look. "I guess we can go on, but explain that tonight, please." <br />
<br />
"Well,
if the strobe bit is shifted out, the carry will be set, but so will
the zero flag, because there will be no ones left in the port output
register. It's a different way to test for the end of the loop, and we
might want to take the time to consider which will be less likely to
have problems when there are hardware failures." <br />
<br />
"Does it matter on a keyboard?" asked Javier.<br />
<br />
"Maybe, maybe not."<br />
<br />
Doctor Brown cleared his throat. "Leave it in the notes, and add that we really don't have the tools for the analysis yet."<br />
<br />
I exchanged glances with him.<br />
<br />
"Right," I concurred. "Something to think about later."<br />
<br />
"I can continue?" Terry asked.<br />
<br />
"Please."<br />
<br />
"Then
we load the column state from the KBDIN port and store it where X
points into the state table, and bump X before branching back. I don't
think I need to clear the carry bit after incrementing X because there's
nothing in the loop that would set it besides the rotate."<br />
<br />
"Good, --"<br />
<br />
Wallace interrupted. "But why check them all? Why not jump out of the loop on the first scan that's not all zeroes?"<br />
<br />
Terry pointed out, "There may be other ones, as well. You don't always release one key before pressing another."<br />
<br />
"I guess that's true." Winston tilted his head. "But can we handle that?" <br />
<br />
"I think we can. Terry, can you walk us through how that would work?"<br />
<br />
"What
we want to see is which bits changed." She thought for a moment. "So we
need to keep a record of the previous sample, too."<br />
<br />
"I think so. It uses a lot of the MCU's little bit of RAM, but I think we need to keep three records." <br />
<br />
"Do we have time to copy all of it?"<br />
<br />
"Maybe.
I think we can do it without copying three times, but let's look at
copying first. I think it would be easier to understand."<br />
<br />
Terry nodded, erased her code and started over. <br />
<blockquote class="tr_bq">
KBDST0 RMB 8 ; NEWEST<br />
KBDST1 RMB 8<br />
KBDST2 RMB 8 ; OLDEST<br />
* <br />
CLX ; FIRST COLUMN <br />
LDA #1<br />
STA SHARED ; STROBE<br />
STBLUP<br />
LDA KBDST1,X ; COPY 2ND<br />
STA KBDST2,X ; TO OLDEST<br />
LDA KBDST0,X ; COPY PREVIOUS<br />
STA KBDST1,X ; TO 2ND<br />
LDA KBDIN ; GET STATE<br />
STA KBDST0,X ; SAVE CURRENT<br />
INX ; NEXT COLUMN<br />
ROL SHARED ; NEXT STROBE<br />
BCC STBLUP ; UNTIL CARRY</blockquote>
"That's pretty tight programming."<br />
<br />
"Thank you."<br />
<br />
"After finishing the copying, is there anything left to do before returning from the interrupt handler routine?"<br />
<br />
"Wait," Julia said. "Pat and Tanya are stuck."<br />
<br />
I
laughed. "Sorry. I'm getting carried away. This little routine should
be called 'Copy Keyboard State' or something." I paused until they were
ready.<br />
<br />
"It starts with zeroing your index and prepare
the strobe for the first column. Then you enter a loop with no tests at
the entry point." Again, I paused.<br />
<br />
"Copy the previous state over the oldest state for this column. <br />
<br />
"Copy the most recent state over the previous state for this column.<br />
<br />
"Read the new current state and save it."<br />
<br />
"Bump index and shift strobe for next column.<br />
<br />
"Finally, if the strobe bit has shifted out, we're done."<br />
<br />
Pat's pseudo code looked like this:<br />
<blockquote class="tr_bq">
Copy Keyboard State:<br />
Zero column index;<br />
Prepare column strobe;<br />
Loop --<br />
Overwrite oldest state for this column with 2nd oldest;<br />
Overwrite 2nd oldest state with most recent;<br />
Overwrite most recent state with current;<br />
Bump column index;<br />
Shift strobe bit left; <br />
Until no columns left to strobe.</blockquote>
Tanya's flow chart looked like this:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-9L5UxiRN66M/XwpvXQgDnnI/AAAAAAAACxo/bfueKcDJf1sId1SAhlVV3wxCqRw6IrqWQCLcBGAsYHQ/s1600/keyboard_copy_flowchart.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1159" data-original-width="431" height="640" src="https://1.bp.blogspot.com/-9L5UxiRN66M/XwpvXQgDnnI/AAAAAAAACxo/bfueKcDJf1sId1SAhlVV3wxCqRw6IrqWQCLcBGAsYHQ/s640/keyboard_copy_flowchart.png" width="236" /></a></div>
<br />
"So, Terry, is there anything left to do?" <br />
<br />
"If we've already done the display stuff when we get here, I don't think of anything else." <br />
<br />
"Very nicely done. And that was no idle compliment. Let's count the cycles to see if that can all happen withing a millisecond."<br />
<br />
Everybody got involved in digging into the cycle counts from the specsheets and adding them up.<br />
<br />
"CLX is four cycles."<br />
<br />
"Three cycles for CMOS."<br />
<br />
"These are CMOS chips aren't they?"<br />
<br />
"Yeah."<br />
<br />
"I'm counting HMOS cycles, just to be safe." <br />
<br />
And so forth, some using the detailed timing charts and others using the summary in the op-code table.<br />
<br />
"Fifty cycles through one loop."<br />
<br />
"Roughly, worst case."<br />
<br />
"Times eight is four hundred cycles worst case."<br />
<br />
"That's not quite half the time between interrupts."<br />
<br />
"Is that too much?"<br />
<br />
"It'll only happen once every sixteen milliseconds, or so, right?"<br />
<br />
"We'll have to test it."<br />
<br />
"Joe said we could avoid all the copying."<br />
<br />
"Well,
we can avoid copying the previous and second previous. It's a little
less straightforward, because we have to keep track of which one is the
oldest and only overwrite that one. Then remember which is the new
oldest. I think that should cut the time down under a hundred cycles.
But I think four hundred cycles, plus the time for the interrupt
counting, etc., isn't too much. Some of you might want to try both. Or
you could also adjust the timer interrupt, to two or four milliseconds."
<br />
<br />
That gave everyone something to work with for a bit, fitting the processes to their own circuits.<br />
<br />
Then Carlos asked, "Okay, we've recorded all this state, now what? How do we check for someone hitting a key?"<br />
<br />
"Good question." I checked the time before asking, "Any suggestions?" <br />
<br />
Carlos frowned. "Looking for ones is not the answer, I guess."<br />
<br />
"Almost." <br />
<br />
"Look for changes."<br />
<br />
"Right."<br />
<br />
"Compare instruction, CMP?"<br />
<br />
"That'll
only tell us if there's a change. It won't tell us which changed.
There's a way that can tell us which of eight bits changed with just one
instruction," I prompted.<br />
<br />
"The exclusive-or instruction?"<br />
<br />
"Bingo."<br />
<br />
"Does that mean we have to use eight more bytes to remember which bits went high?"<br />
<br />
"Yes
-- or to remember which changed and are no longer bouncing. We can
check the most current state to figure out whether the change was a
press or release."<br />
<br />
"And this is not in the interrupt routine?"<br />
<br />
"Right."<br />
<br />
"How do we know when to look?"<br />
<br />
"How about checking the interrupt count?"<br />
<br />
Carlos shrugged. "Uhm, explain that?" <br />
<br />
"After
the interrupt routine counts or so and records the new samples, it can
leave the count at sixteen, and the non-interrupt code can see that
sixteen, check and record which changed, and subtract the sixteen from
the count to start over. Or clear the count if we are sure we don't get
interrupted. But subtracting would be safer."<br />
<br />
"Hmm. I guess I need to think about that."<br />
<br />
I
checked the clock again. "Well, I need to go deliver my newspapers. Who
wants to lead the discussion of how to turn this into code, and how to
work out the key codes from the bits that changed, and how to buffer key
codes that the main CPU hasn't read yet? Mike?"<br />
<br />
"I vote for letting Jennifer lead it."<br />
<br />
"Why not? I'll let you guys work it out. I have to run."<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
When
I got back, they had worked out recording the changed bits, and were
working out out to turn a changed bit into a bit number, to figure out
which key was pressed. I suggested not loading the bit or count into the
index or accumulator, to avoid having to save and restore them:<br />
<blockquote class="tr_bq">
KBIT RMB 1 ; BIT TO COUNT<br />
KBITCT RMB 1 ; BIT # COUNTER <br />
*<br />
CLR KBITCT ; START AT BIT 0<br />
KBITLP<br />
SHR KBIT ; SHIFT DOWN<br />
BEQ KBITDN ; DONE IF OUT<br />
INC KBITCT ; COUNT BIT<br />
BRA KBITLP ; DO IT AGAIN<br />
KBITDN <br />
* BIT NUMBER NOW KNOWN</blockquote>
There
were several using math to convert the keyboard matrix to ASCII codes,
but some had keyboard matrices that varied enough from ASCII to make
that hard. So I showed them how to put the key codes in an array to
match the keyboard matrix they had, using the bit number concatenated
with the column number times eight to index the array.<br />
<br />
<blockquote class="tr_bq">
* COLUMN INDEX IN X<br />
SHLX ; TIMES 8<br />
SHLX<br />
SHLX<br />
TXA ; COLUMN NUMBER TO A <br />
ORA KBIT ; KBIT <= 7<br />
<br />
TAX ; MATRIX ELEM #<br />
* USE THIS TO INDEX<br />
* ASCII CONVERSION TABLE</blockquote>
George complained, "I've heard that global variables are bad, but we're using globals all over the place."<br />
<br />
Jennifer complained, as well. "Doctor Brown just laughs at us when we worry about it."<br />
<br />
"I'm
only here to make sure you don't destroy the lab." If anything, his
grin was even broader. "And steal ideas for my lesson plans next year."<br />
<br />
That provoked much laughter, and a release of stress.<br />
<br />
"Seriously,
though. I'm getting a lot of good ideas from watching you guys. And I
want to see what Joe has to say before I weigh in."<br />
<br />
"I'm
not sure what I have to say, but it seems to me there are several
problems in organizing our variables. One is where you declare them in
the source program. We've been declaring them as we invent code
snippets, then moving the actual declarations into the direct page
variable list when we put the snippets into our code.<br />
<br />
Jennifer tilted her head. "What about variables on the stack? Doesn't the 6805 have a way to put variables on the stack?"<br />
"First question, which stack?"<br />
<br />
"Now it gets interesting," Doctor Brown intoned.<br />
<br />
"Which stack?" Winston echoed. "Is there more than one?"<br />
<br />
"The 6805 doesn't have a parameter stack, perhaps because Motorola
figures, if the code is complex enough for re-entrant parameters,
it's complex enough to use something more powerful."<br />
<br />
"Then why," asked Jennifer, "the jump subroutine instruction?"<br />
<br />
"Cheap
on transistor count and allows some simple code reuse? I guess. Anyway,
that appears to be the approach we should take, graduating to a more
powerful processor when we want to put parameters on a stack."<br />
<br />
Julia shook her head. "I don't think I'm the only one who's lost."<br />
<br />
"Can we talk about this tomorrow? I'm kind of hoping we can get some of the keyboards working today."<br />
<br />
Doctor Brown laughed. "Classic maneuver, but I agree. Too early for a lot of you to talk about re-entrance and stacks."<br />
<br />
Having
only one computer to program 68705s on was a bottleneck, but we were
able to get Winston's, Mark's, Jeff's, and Suzanne's keyboards working,
and they plugged them into their Micro Chroma 68+6803s and started
playing with the TV-BUG monitor. Some of the students who were waiting
watched the fun.<br />
<br />
Julia declined to use group time to program her keyboard. "I didn't bring the Micro Chroma today, anyway."<br />
<br />
"Oh, is that why tomorrow?" I asked, and she just gave me a kind of thoughtful look.<br />
<br />
"Sure. That's why." And she winked at me, but wouldn't explain further.<br />
<br />
"Okay."<br />
<br />
We got a few more keyboards running before time to shut down.<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
"Intel 8086?" Julia looked at the book I was borrowing from the library. "What do you need that for?"<br />
<br />
"Ammunition."<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
After
studying and singing, Julia programmed her keyboard, then plugged it
into my Micro Chroma 68 to test and play with it while I studied the
i8086/8088 manual and the TMS 9900 and 9940 manuals.<br />
<br />
"Remember that BLWP instruction I was looking for last night?"<br />
<br />
"Yeah."<br />
<br />
"You can use it to allocate variables on a stack. When you leave a subroutine, you deallocate the variables."<br />
<br />
"Allocate, I think I can understand. That's like reserving space for working on things?"<br />
<br />
"Right. Reserving space to work on things."<br />
<br />
"So deallocate would be giving the space up?"<br />
<br />
"Right again."<br />
<br />
"I guess that makes better use of RAM."<br />
<br />
"It
also means that, if you have more than one process running, the
variables on the stack are local -- kind of private -- to the the
process that owns the stack.<br />
<br />
"I'll have to think about that. So what kind of ammunition are you getting from the 8086 book?"<br />
<br />
"Registers
that have limited uses. It's better than the 8080, but they are still
pretty limited, compared to the 6800's use of memory."<br />
<br />
"Do you think they have a reason for that?"<br />
<br />
"Simplifying their circuitry, mostly, I'm sure. Add special purpose features in the transistors that become extra." <br />
<br />
"Marketing?"<br />
<br />
"Yeah."<br />
<br />
I read in silence for a bit more. "Really weird address registers. It's like they deliberately put holes in addresses."<br />
<br />
"Huh?"<br />
<br />
I showed her a diagram of the 8086 segment registers and how addresses are assembled in the original 8086 segmentation.<br />
<br />
"I can't even begin to understand what they are trying to do."<br />
<br />
"The
actual address registers are sixteen bit. So are the segment registers.
But the segment registers are slid over four bits, before being added,
so you can play address games and use two megabytes of RAM, if you do it
right."<br />
<br />
"So you can add more RAM. Do Motorola processors do that?"<br />
<br />
"There
is a memory management unit for the 6809, and, I think, the 6800, that
allows a megabyte of memory to be addressed, and allows memory to be
moved around in two kilobyte pieces to mix and match. The 8086 gives a
cheaper, half-baked approach that doesn't really allow mixing and
matching, except in sixty-four kilobyte sliding frames."<br />
<br />
"Hmm."<br />
<br />
"The 68000 allows completely linear segmentation, if you want to use it. No shifting things around."<br />
<br />
"I'll have to figure out what this is all about later."<br />
<br />
"Ah.
The 8086 has instructions to support stack frames, kind of like the
9900. And it becomes clear to me why I don't like the idea of keeping
return addresses in the stack frame."<br />
<br />
"Return addresses?"<br />
<br />
"So
you can get back to the code that called a subroutine, you save the
program counter on the stack. With parameters and locals on the same
stack, you're going to have return addresses and parameters and locals
colliding. And bad things will happen, like returning to data instead of
code, and then who knows what happens next."<br />
<br />
"Who knows? I'm getting sleepy."<br />
<br />
"Like
when my Micro Chroma's reset switch bounced and it would cause random
text and flashing meaningless graphics to show on the screen."<br />
<br />
"Oh."<br />
<br />
"Let's get you home."<br />
<br />
We shared a quick kiss on her doorstep, and her mother opened the door and cleared her throat.<br />
<br />
"Mom, not tonight. I've been studying stuff that is completely foreign to me. Joe calls it playing, but I'm tired."<br />
<br />
"I
have to admit to being a bit tired myself," I added. "Julia's keyboard
will now talk to her computer. Tomorrow's going to be another long day, I
think."<br />
<br />
"Speaking of her computer," Mr. Cisneros spoke up from the couch, "I think she needs a box to put it in."<br />
<br />
"True."<br />
<br />
I
went in and sat down, and we discussed plans for an enclosure for her
computer for maybe a quarter of an hour, Julia and I holding hands in
between making sketches and using our hands to talk about the shapes of
things. We talked about a box like mine, and we also talked about
putting her keyboard in a separate enclosure so she could move it around
separately from the computer.<br />
<br />
Julia put the sketches with her notes, and we shared another kiss before I left.<br />
<br />
<div style="text-align: right;">
Chapter 13.5: what?</div>
<div style="text-align: center;">
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></div>
<hr />
<i>[Backed up at <a href="https://joel-rees-economics.blogspot.com/2020/07/bk-33209-straits-keyboard-decoding.html">https://joel-rees-economics.blogspot.com/2020/07/bk-33209-straits-keyboard-decoding.html</a>.]</i><br />
<br />
<i> </i><i> </i><br />
<i> </i>零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-78827347841011366602020-06-29T22:10:00.003+09:002020-06-29T22:13:30.057+09:00Backup01: 33209: Straits -- Status DisplaySecond version backup of <a href="https://joelrees-novels.blogspot.com/2020/06/33209-straits-status-display.html">https://joelrees-novels.blogspot.com/2020/06/33209-straits-status-display.html</a>.<br />
<hr />
<br />
<a href="https://joelrees-novels.blogspot.com/2020/06/33209-straits-sabbath.html">Chapter 13.2: Straits -- Sabbath</a><br />
<br />
<h4 style="text-align: center;">
Chapter 13.3: Straits -- Status Display </h4>
<br />
"Okay,
guys, I have to focus on Julia's computer, so let's
all work on the keyboard controllers on our own for a while."<br />
<br />
"Focus on your girlfriend, huh?" Tanya was apparently feeling a little catty.<br />
<br />
"So you're finally owning up to it!", Suzanne pouted. "What did it take?"<br />
<br />
"Oh, shutup, Suzanne," Mike grumbled. "I, for one, don't want to hear about it."<br />
<br />
Wallace also complained. "Leading us on, and then jumping ship for your girlfriend?"<br />
<br />
Winston admonished, "We can handle this. Bob and Jennifer almost have it worked out, anyway." <br />
<br />
Jennifer shook her head. "It's time for us all to work on our own for a bit. That's what we're here for."<br />
<br />
"Should you just abandon everyone for me?" Julia asked.<br />
<br />
"I'm not abandoning anybody, and Jennifer's right."<br />
<br />
Doctor Brown just watched in amusement. <br />
<br />
There
was more grumbling, and some of the members of the group parked
themselves where they could watch as I used scratch
paper to show Julia how the display translation tables would be put
together. But I ignored them and proceeded to recreate a diagram from
Saturday.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-VT-rUM8jSoc/Xug3ZrsAOXI/AAAAAAAACp4/cTmtDlFWnZ8ojjIJRtUY23B7fopFzJGkQCPcBGAYYCw/s1600/seven_segment_block_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="742" data-original-width="599" height="640" src="https://1.bp.blogspot.com/-VT-rUM8jSoc/Xug3ZrsAOXI/AAAAAAAACp4/cTmtDlFWnZ8ojjIJRtUY23B7fopFzJGkQCPcBGAYYCw/s640/seven_segment_block_diagram.png" width="516" /></a></div>
<br />
"Others
have theirs wired up differently, but the way you ended up wiring yours
is the same order as the diagram I drew. Bottom left is the high bit,
and decimal is the low bit. Let's name those."<br />
<br />
"Name them?"<br />
<br />
"Give them names in the program."<br />
<br />
"Okay."<br />
<br />
"We'll call the bottom left segment BLS, and it will be binary 10000000."<br />
<br />
"You and Dad both told me about converting to hexadecimal four bits at a time, so that's 1000 and 0000, which comes out as $80?"<br />
<br />
I gave her a thumbs-up and scrawled<br />
<blockquote class="tr_bq">
BLS EQU $80 ; 1000 0000 </blockquote>
"Instead of BLS, BLT would not be a good name?"<br />
Julia and I chuckled at her joke, and so did the students who were listening.<br />
<br />
"No?"<br />
<br />
"Well, I was thinking S for segment, but why not? T for the last letter of 'bit'. How about the rest?" <br />
<br />
"Like this?" Julia wrote out code, intuiting the permutations from the line I'd written:<br />
<blockquote class="tr_bq">
BLT EQU $80 ; 1000 0000<br />
BT EQU $40 ; 0100 0000<br />
BRT EQU $20 ; 0010 0000<br />
MT EQU $10 ; 0001 0000<br />
TLT EQU $08 ; 0000 1000<br />
TT EQU $04 ; 0000 0100<br />
TRT EQU $02 ; 0000 0010<br />
DT EQU $01 ; 0000 0001 </blockquote>
"Yep." <br />
<br />
"Oh, maybe T is a little confusing."<br />
<br />
"It's okay. We'll keep it. As long as we can read it and understand it."<br />
<br />
"Then we'll need comment lines to help us remember?"<br />
<br />
"Such as?"<br />
<br />
She wrote, <br />
<blockquote class="tr_bq">
* BOTTOM, TOP, MIDDLE<br />
* LEFT, RIGHT, DECIMAL </blockquote>
"Looks good, and it keeps it short for the screen we're working on."<br />
<br />
"Do the last four lines need the dollar sign and the zero?"<br />
<br />
"No,
they're the same in decimal and hex, with or without the leading zero.
But removing them would make the form less obvious, so let's keep them.
Now, let's use those to make a table of segments, like we figured out on
Saturday. The zero will be the first entry. Which bits does it use?"<br />
<br />
"All but the middle and the decimal?"<br />
<br />
"Okay. We can use '.OR.' to put bits together, so it can look like this:" <br />
<blockquote class="tr_bq">
TABLE<br />
FCB BLT.OR.BT.OR.BRT.OR.TRT.OR.TT.OR.TLT</blockquote>
"That's not going to fit in the 32 column screen."<br />
<br />
"True, but that's okay. But it's also ugly -- hard to read, and that is not okay. Maybe I can think of something to help."<br />
<br />
After some thought, I wrote<br />
<blockquote class="tr_bq">
CUP EQU BLT.OR.BT.OR.BRT<br />
CAP EQU TRT.OR.TT.OR.TLT<br />
* <br />
TABLE<br />
FCB CUP.OR.CAP </blockquote>
"It sort of helps."<br />
<br />
"Heh. Okay, there's zero. One is easy."<br />
<br />
She scribbled her guess, "BRT.OR.TRT". "Is that it?"<br />
<br />
"Right."<br />
<br />
With a bit of scribbling, erasing, and rescribbling, we had this: <br />
<blockquote class="tr_bq">
BCUP EQU BLT.OR.BT.OR.BRT<br />
TCAP EQU TRT.OR.TT.OR.TLT<br />
ONET EQU BRT.OR.TRT <br />
TRCUP EQU TT.OR.TRT.OR.MT<br />
BLCUP EQU MT.OR.BLT.OR.BT<br />
BRCUP EQU MT.OR.BRT.OR.BT<br />
TCUP EQU TLT.OR.MT.OR.TRT<br />
TLCUP EQU TT.OR.TLT.OR.MT<br />
BCAP EQU BLT.OR.BT.OR.BRT<br />
VBAR EQU TLT.OR.BLT<br />
* <br />
SEGTBL<br />
FCB BCUP.OR.TCAP ; 0<br />
FCB ONET ; 1<br />
FCB TRCUP.OR.BLCUP ; 2<br />
FCB TRCUP.OR.BRCUP ; 3<br />
FCB TCUP.OR.BRT ; 4<br />
FCB TLCUP.OR.BRCUP ; 5<br />
FCB TLCUP.OR.BCUP ; 6<br />
FCB TT.OR.ONET ; 7<br />
FCB BCUP.OR.TCAP.OR.MT ; 8<br />
FCB TCAP.OR.BRCUP ; 9<br />
FCB TCAP.OR.BCAP ; A<br />
FCB VBAR.OR.BRCUP ; b<br />
FCB BLCUP ; c<br />
FCB BLCUP.OR.ONET ; d<br />
FCB TCAP.OR.BLCUP ; e<br />
FCB VBAR.OR.TLCUP ; F</blockquote>
"I can sort of see what the table is, but how does that get into the LEDs?" Julia asked me.<br />
<br />
"I've
been avoiding that question for a whole week. I want to use a parameter
stack, but we're a little tight on both RAM and registers. I guess
we're not going to be trying to run two displays at once, so global
variables should work."<br />
<br />
Julia looked at me with a blank expression.<br />
<br />
I
proceeded anyway. "We'll have a variable for the current number to
display and a variable for the current column to display in, and --" I
scribbled:<br />
<blockquote class="tr_bq">
NUMDSP RMB 1<br />
CLMDSP RMB 1</blockquote>
"We can squeeze those into a single byte if we need to, but let's do it simple first."<br />
<blockquote class="tr_bq">
PUTDIG<br />
LDX NUMDSP ; HIGH BITS ZERO!<br />
LDA SEGTBL,X<br />
LDX CLMDSP ; HIGH BITS ZERO!</blockquote>
"I'm lost."<br />
<br />
The
lab erupted in applause, and I looked around and realized that everyone
was gathered around listening, and Mark, Jeff, Mike, and even Bob and
Jennifer had been taking turns transferring our scribblings and musings
to the chalkboard.<br />
<br />
I looked over at Doctor Brown, and he gave just gave me a "Who, me?" look.<br />
<br />
I chuckled in embarrassment.<br />
<br />
"Okay.
Maybe we should do this as a group after all, and then you can all
adjust it for how you wired yours. But I guess we need to use teamwork
on the notes and explanations. Who followed how we put the table
together?"<br />
<br />
Bob, Jennifer, Mark, Jeff, and Mike said
they were good on it, some of the others raised their hands hesitantly.
There was a lot of doubt.<br />
<br />
George apologized, "I don't seem t do hexadecimal math in my head. Can someone explain it?"<br />
<br />
Mike started scribbling on some scratch paper. "It's like this, --"<br />
<br />
Doctor Brown suggested, "Mike, could you do that at the board for those who need some review?"<br />
<br />
After a moment of hesitation, Mike stood up to the chalkboard and quickly wrote out a conversion table:<br />
<br />
<table>
<tbody>
<tr><th style="text-align: right;">decimal</th><td><br /></td><th style="text-align: right;">hexadecimal</th><td><br /></td><th style="text-align: right;">binary</th></tr>
<tr><td style="text-align: right;">0</td><td>:</td><td style="text-align: right;">$00</td><td>=</td><td style="text-align: right;">0000 0000</td></tr>
<tr><td style="text-align: right;">1</td><td>:</td><td style="text-align: right;">$01</td><td>=</td><td style="text-align: right;">0000 0001</td></tr>
<tr><td style="text-align: right;">2</td><td>:</td><td style="text-align: right;">$02</td><td>=</td><td style="text-align: right;">0000 0010</td></tr>
<tr><td style="text-align: right;">3</td><td>:</td><td style="text-align: right;">$03</td><td>=</td><td style="text-align: right;">0000 0011</td></tr>
<tr><td style="text-align: right;">4</td><td>:</td><td style="text-align: right;">$04</td><td>=</td><td style="text-align: right;">0000 0100</td></tr>
<tr><td style="text-align: right;">5</td><td>:</td><td style="text-align: right;">$05</td><td>=</td><td style="text-align: right;">0000 0101</td></tr>
<tr><td style="text-align: right;">6</td><td>:</td><td style="text-align: right;">$06</td><td>=</td><td style="text-align: right;">0000 0110</td></tr>
<tr><td style="text-align: right;">7</td><td>:</td><td style="text-align: right;">$07</td><td>=</td><td style="text-align: right;">0000 0111</td></tr>
<tr><td style="text-align: right;">8</td><td>:</td><td style="text-align: right;">$08</td><td>=</td><td style="text-align: right;">0000 1000</td></tr>
<tr><td style="text-align: right;">9</td><td>:</td><td style="text-align: right;">$09</td><td>=</td><td style="text-align: right;">0000 1001</td></tr>
<tr><td style="text-align: right;">10</td><td>:</td><td style="text-align: right;">$0A</td><td>=</td><td style="text-align: right;">0000 1010</td></tr>
<tr><td style="text-align: right;">11</td><td>:</td><td style="text-align: right;">$0B</td><td>=</td><td style="text-align: right;">0000 1011</td></tr>
<tr><td style="text-align: right;">12</td><td>:</td><td style="text-align: right;">$0C</td><td>=</td><td style="text-align: right;">0000 1100</td></tr>
<tr><td style="text-align: right;">13</td><td>:</td><td style="text-align: right;">$0D</td><td>=</td><td style="text-align: right;">0000 1101</td></tr>
<tr><td style="text-align: right;">14</td><td>:</td><td style="text-align: right;">$0E</td><td>=</td><td style="text-align: right;">0000 1110</td></tr>
<tr><td style="text-align: right;">15</td><td>:</td><td style="text-align: right;">$0F</td><td>=</td><td style="text-align: right;">0000 1111</td></tr>
<tr><td style="text-align: right;">16</td><td>:</td><td style="text-align: right;">$10</td><td>=</td><td style="text-align: right;">0001 0000</td></tr>
<tr><td style="text-align: right;">17</td><td>:</td><td style="text-align: right;">$11</td><td>=</td><td style="text-align: right;">0001 0001</td></tr>
<tr><td style="text-align: right;">21</td><td>:</td><td style="text-align: right;">$15</td><td>=</td><td style="text-align: right;">0001 0101</td></tr>
<tr><td style="text-align: right;">32</td><td>:</td><td style="text-align: right;">$20</td><td>=</td><td style="text-align: right;">0010 0000</td></tr>
<tr><td style="text-align: right;">37</td><td>:</td><td style="text-align: right;">$25</td><td>=</td><td style="text-align: right;">0010 0101</td></tr>
<tr><td style="text-align: right;">128</td><td>:</td><td style="text-align: right;">$80</td><td>=</td><td style="text-align: right;">1000 0000</td></tr>
<tr><td style="text-align: right;">133</td><td>:</td><td style="text-align: right;">$85</td><td>=</td><td style="text-align: right;">1000 0101</td></tr>
</tbody></table>
<br />
"We got groups of four binary digits on
the right, and they match up with single digits of hexadecimal in the
middle. It's not a coincidence. It's a rule."<br />
<br />
After a bit of discussion, George just shrugged. "I guess I'm just not seeing something. Maybe we should keep going."<br />
<br />
I
offered my own suggestions. "Mike can help you, and we'll be showing a
lot of examples, I think. Let's see if moving ahead works." <br />
<br />
After
making new arrangements to make sure Julia would not be so busy taking
notes that she couldn't think and ask questions, I started over, working
through the 6805 assembler language as I used it.<br />
<br />
"'EQU'
is short for equate. It equates the label on the left to the expression
on the right. Hopefully we don't need to know when the expression is
evaluated, because I don't know and I don't want to waste time figuring
that out.<br />
<br />
"So when we write<br />
<blockquote class="tr_bq">
BLT EQU $80 ; 1000 0000</blockquote>
"that could mean bacon, lettuce, and tomato is flagged by bit seven, or it could mean the bottom left segment bit is bit seven."<br />
<br />
That got some chuckles.<br />
<br />
"'.OR.'
is the logical-or operator. It performs a column-by-column logical or,
keeping the column results in their columns. That means that'<br />
<blockquote class="tr_bq">
ONET EQU BRT.OR.TRT</blockquote>
"equates
the label ONET to the result of 00100000 or-ed with 00000010, which is
00100010, or hexadecimal 22. And if we put $22 on the segments port and
hold one the anode of one of the displays down to 0, it should make the
top and bottom right segments light up, showing us a '1'. If we want to
see that, we could try something like"<br />
<blockquote class="tr_bq">
START<br />
LDA #22<br />
STA CATHODES<br />
LDA #FE<br />
STA ANODES<br />
WAITLP<br />
BRA WAITLP</blockquote>
"'LDA
loads a small value into the accumulator, STA stores the accumulator to
memory or I/O space, BRA means branch always and forever, and it does
so, looping to itself, letting us see the results. This is a CMOS
1468705, so I think we could use a WAIT instruction here, but this loop
forever to itself will do what we need with most CPUs. So it's a good
thing for everyone to see, at least once." <br />
<br />
I decided
to stop and demonstrate it. I asked Julia to type it in, assemble it,
and burn it into her 68705, and run the program. When it produced a 1 on
the rightmost seven segment display, she seemed a bit more confident of
what she was understanding, as also did certain of the other students.<br />
<br />
"Hopefully
everybody's working out your own equate definitions for your own
circuits while we do this. I guess we should put the definitions Julia
and I came up with on the chalkboard, but remember yours will be
somewhat different." And as I copied to the chalkboard, I added more
comments, showing the expected bit values:<br />
<blockquote class="tr_bq">
* BOTTOM, TOP, MIDDLE<br />
* LEFT, RIGHT, DECIMAL <br />
* SEGMENT BIT T<br />
BLT EQU $80 ; 1000 0000<br />
BT EQU $40 ; 0100 0000<br />
BRT EQU $20 ; 0010 0000<br />
MT EQU $10 ; 0001 0000<br />
TLT EQU $08 ; 0000 1000<br />
TT EQU $04 ; 0000 0100<br />
TRT EQU $02 ; 0000 0010<br />
DT EQU $01 ; 0000 0001 <br />
*<br />
BCUP EQU BLT.OR.BT.OR.BRT<br />
* 1110 0000 $E0<br />
TCAP EQU TRT.OR.TT.OR.TLT<br />
* 0000 1110 $0E<br />
ONET EQU BRT.OR.TRT<br />
* 0010 0010 $22<br />
TRCUP EQU TT.OR.TRT.OR.MT<br />
* 0001 0110 $16<br />
BLCUP EQU MT.OR.BLT.OR.BT<br />
* 1101 0000 $D0<br />
BRCUP EQU MT.OR.BRT.OR.BT<br />
* 0111 0000 $70<br />
TCUP EQU TLT.OR.MT.OR.TRT<br />
* 0001 1010 $1A<br />
TLCUP EQU TT.OR.TLT.OR.MT<br />
* 0001 1100 $1C<br />
BCAP EQU BLT.OR.BT.OR.BRT<br />
* 1110 0000 $E0<br />
VBAR EQU TLT.OR.BLT<br />
* 1000 1000 $88<br />
*<br />
SEGTBL<br />
FCB BCUP.OR.TCAP ; 0<br />
FCB ONET ; 1<br />
FCB TRCUP.OR.BLCUP ; 2<br />
FCB TRCUP.OR.BRCUP ; 3<br />
FCB TCUP.OR.BRT ; 4<br />
FCB TLCUP.OR.BRCUP ; 5<br />
FCB TLCUP.OR.BCUP ; 6<br />
FCB TT.OR.ONET ; 7<br />
FCB BCUP.OR.TCAP.OR.MT ; 8<br />
FCB TCAP.OR.BRCUP ; 9<br />
FCB TCAP.OR.BCAP ; A<br />
FCB VBAR.OR.BRCUP ; b<br />
FCB BLCUP ; c<br />
FCB BLCUP.OR.ONET ; d<br />
FCB TLCUP.OR.BLCUP ; E<br />
FCB VBAR.OR.TLCUP ; F</blockquote>
"The
FCB that we use to construct the table of constants stands for 'Form
Constant Byte or some such, and it is used to store a constant value
into the program object code. By putting them into a table in the object
code, we make the patterns available for look-up. <br />
<br />
"Now,
if we shift the anode bit, we can light up one digit at a time, but
it's going to happen so fast it will look like they're all lit up at
once. The LSL instruction shifts the argument one bit to the left, and
we'll use it."<br />
<br />
Eyes were glazing over, so I wrote another bit of demonstration code, directly using the constants I had defined earlier:<br />
<blockquote class="tr_bq">
PAUSE<br />
DECX ; IDLE COUNT<br />
BNE PAUSE<br />
RTS<br />
*<br />
START<br />
CLRX<br />
LDA #FE<br />
STA ANODES <br />
LDA #ONET <br />
STA CATHODES<br />
BSR PAUSE ; LET PORT SETTLE<br />
LSL ANODES <br />
LDA #TCAP<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #VBAR<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #BLCUP<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #TRCUP<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #TCUP<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #BCAP<br />
STA CATHODES<br />
BSR PAUSE<br />
BRA START</blockquote>
"The
PAUSE routine uses the X register as an idle counter. DEC counts X down
one, and BNE loops back to count again until X is zero. 'B' for Branch.
'NE' for Not Equal, or in other words, not zero. I suppose I'll have to
explain that more later. Anyway, we turn a digit on, then we pause for a
bit so the human eye can register it." <br />
<br />
"And get your
minds out of the gutter, guys, BRA really is a BRanch Always. so when we
have displayed all the patterns, one place at a time, we go back and do
it again. <br />
<br />
Suzanne complained, "I suppose some male engineer thought that mnemonic up."<br />
<br />
"You
suppose right. Apparently more than one. I do not defend them. In a
little bit, I'll show you how to use a macro definition to give that
instruction a better mnemonic name."<br />
<br />
"I don't suppose anyone will forget the original mnemonic," Bob commented, and Jennifer slapped him over the head.<br />
<br />
Doctor Brown watched this in amusement, taking no sides. <br />
<br />
Again,
Julia typed it in, assembled it, and burned it, this time into a 68705
she borrowed from Jeff while hers was in the eraser.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-M2JvnK8GUk4/XvHhVZ9ioeI/AAAAAAAACsI/HCiO_G2y8SU83hic0hhSfRAvm04rhNmKQCLcBGAsYHQ/s1600/seven_by_seven_segment_test_output.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="283" data-original-width="1024" height="176" src="https://1.bp.blogspot.com/-M2JvnK8GUk4/XvHhVZ9ioeI/AAAAAAAACsI/HCiO_G2y8SU83hic0hhSfRAvm04rhNmKQCLcBGAsYHQ/s640/seven_by_seven_segment_test_output.png" width="640" /></a></div>
<br />
She
was rather dissatisfied with the cryptic output, so she got back on the
computer and added equates for each digit, using the equates in the
table itself:<br />
<blockquote class="tr_bq">
N0 EQU BCUP.OR.TCAP ; 0<br />
N1 EQU ONET ; 1<br />
N2 EQU TRCUP.OR.BLCUP ; 2<br />
N3 EQU TRCUP.OR.BRCUP ; 3<br />
N4 EQU TCUP.OR.BRT ; 4<br />
N5 EQU TLCUP.OR.BRCUP ; 5<br />
N6 EQU TLCUP.OR.BCUP ; 6<br />
N7 EQU TT.OR.ONET ; 7<br />
N8 EQU BCUP.OR.TCAP.OR.MT ; 8<br />
N9 EQU TCAP.OR.BRCUP ; 9<br />
NA EQU TCAP.OR.BCAP ; A<br />
NB EQU VBAR.OR.BRCUP ; b<br />
NC EQU BLCUP ; c<br />
ND EQU BLCUP.OR.ONET ; d<br />
NE EQU TLCUP.OR.BLCUP ; E<br />
NF EQU VBAR.OR.TLCUP ; F<br />
*<br />
SEGTBL<br />
FCB N0 ; $EE 1110 1110<br />
FCB N1 ; $22 0010 0010<br />
FCB N2 ; $D6 1101 0110<br />
FCB N3 ; $76 0111 0110<br />
FCB N4 ; $3A 0011 1010<br />
FCB N5 ; $7C 0111 1100<br />
FCB N6 ; $FC 1111 1100<br />
FCB N7 ; $26 0010 0110<br />
FCB N8 ; $FE 1111 1110<br />
FCB N9 ; $7E 0111 1110<br />
FCB NA ; $EE 1110 1110<br />
FCB NB ; $F8 1111 1000<br />
FCB NC ; $D0 1101 0000<br />
FCB ND ; $F2 1111 0010<br />
FCB NE ; $DC 1101 1100<br />
FCB NF ; $9C 1001 1100</blockquote>
Then she modified the test code to use her new equates:<br />
<blockquote class="tr_bq">
START<br />
CLRX<br />
LDA #FE<br />
STA ANODES <br />
LDA #N0 <br />
STA CATHODES<br />
BSR PAUSE ; LET PORT SETTLE<br />
LSL ANODES <br />
LDA #N1<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #N2<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #N3<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #N4<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #N5<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #N6<br />
STA CATHODES<br />
BSR PAUSE<br />
BRA START</blockquote>
And she tried it again, borrowing a 68705 from Mark this time.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-AasykIboQzI/XvHmlmhIVII/AAAAAAAACsU/YE5THe3mVpYDeJ1YwjMJW5MF5eia5e_cgCLcBGAsYHQ/s1600/seven_by_seven_series_output.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="283" data-original-width="1024" height="176" src="https://1.bp.blogspot.com/-AasykIboQzI/XvHmlmhIVII/AAAAAAAACsU/YE5THe3mVpYDeJ1YwjMJW5MF5eia5e_cgCLcBGAsYHQ/s640/seven_by_seven_series_output.png" width="640" /></a></div>
<br />
I think everyone cheered. <br />
<br />
"But I have a question."<br />
<br />
"Yeah?"<br />
<br />
"I don't think my code is actually using the table in this test."<br />
<br />
"True.
And I could get a swelled head and imagine I taught you that, but I
think you've done more figuring out than I've done teaching."<br />
<br />
"Oh, give her a kiss," Winston said. "She deserves it."<br />
<br />
"No es para ...," I began, but Julia shook her head just perceptively enough for me to see.<br />
<br />
"Whether I reward him with a kiss or not is my business," she said.<br />
<br />
Wolf
whistles and other unnecessary noises of appreciation ensued, and Julia
and I cleared our throats simultaneously, with lopsided grins.<br />
<br />
Mike did not join in the circus. <br />
<br />
"Back to work," Julia said.<br />
<br />
I continued. "So now we need to try actually using the table. We'll use the X register to pick the pattern to display:"<br />
<blockquote class="tr_bq">
ORG $40 ; VARIABLES<br />
PAUSER RMB 1<br />
ORG ROM ; CODE <br />
PAUSE<br />
CLR PAUSER<br />
PAUSELP<br />
DEC PAUSER<br />
BNE PAUSELP<br />
* <br />
START<br />
LDA #$FE<br />
STA ANODES<br />
LDX #1<br />
SEC<br />
DISPLP <br />
LSL ANODES<br />
LDA SEGTBL,X <br />
STA CATHODES<br />
BSR PAUSE <br />
INCX<br />
CPX #8<br />
BNE DISPLP<br />
BRA START </blockquote>
"ORG
means origin, and it sets the address where the next part is assembled.
RMB Reserves a Memory Byte in low memory, which we will use instead of X
as the idle loop counter. We label that byte PAUSER. CLR clears the
variable in memory here, and DEC decrements it by 1, so it's much the
same as using X for the idle count, just slower.<br />
<br />
"The
indexed addressing mode used in 'LDA SEGTBL,X' adds the constant address
of the base of the SEGTBL table to the value in X and uses the result
as the address from which we load the accumulator.<br />
<br />
"With
a 0 in X, the argument 'SEGTBL,X' points to the bit pattern to display a
zero. With a 1 in X, it points to the bit pattern to display a one. And
so forth."<br />
<br />
I stopped to diagram it on the chalkboard:<br />
<br />
<table border="1">
<tbody>
<tr><td colspan="2">SEGTBL,X</td><td><br /></td><td>(@SEGTBL+X)</td></tr>
<tr><td><br /></td><td>SEGTBL+0</td><td>:</td><td>11101110</td><td>(N0=$EE)</td></tr>
<tr><td>(X=1)=></td><td>SEGTBL+1</td><td>:</td><td>00100010</td><td>(N1=$22)</td></tr>
<tr><td><br /></td><td>SEGTBL+2</td><td>:</td><td>11010110</td><td>(N2=$D6)</td></tr>
<tr><td><br /></td><td>SEGTBL+3</td><td>:</td><td>01110110</td><td>(N3=$76)</td></tr>
<tr><td><br /></td><td>SEGTBL+4</td><td>:</td><td>00111010</td><td>(N4=$3A)</td></tr>
<tr><td><br /></td><td>SEGTBL+5</td><td>:</td><td>01111100</td><td>(N5=$7C)</td></tr>
<tr><td><br /></td><td>SEGTBL+6</td><td>:</td><td>11111100</td><td>(N6=$FC)</td></tr>
<tr><td><br /></td><td>SEGTBL+7</td><td>:</td><td>00100110</td><td>(N7=$26)</td></tr>
<tr><td><br /></td><td>SEGTBL+8</td><td>:</td><td>11111110</td><td>(N8=$FE)</td></tr>
<tr><td><br /></td><td>SEGTBL+9</td><td>:</td><td>01111110</td><td>(N9=$7E)</td></tr>
<tr><td><br /></td><td>SEGTBL+A</td><td>:</td><td>11101110</td><td>(NA=$EE)</td></tr>
<tr><td><br /></td><td>SEGTBL+B</td><td>:</td><td>11111000</td><td>(NB=$F8)</td></tr>
<tr><td><br /></td><td>SEGTBL+C</td><td>:</td><td>11010000</td><td>(NC=$D0)</td></tr>
<tr><td><br /></td><td>SEGTBL+D</td><td>:</td><td>11110010</td><td>(ND=$F2)</td></tr>
<tr><td><br /></td><td>SEGTBL+E</td><td>:</td><td>11011100</td><td>(NE=$DC)</td></tr>
<tr><td><br /></td><td>SEGTBL+F</td><td>:</td><td>10011100</td><td>(NF=$9C)</td></tr>
</tbody></table>
<br />
"So we start with X equal to 1, then count
X up with INC each time through the loop, after we display the number
in that digit for a fraction of a second.<br />
<br />
"We can only
display seven numbers, so we use CMP to CoMPare X to 8, and BNE Branches
back to do another as long as X is Not Equal to 8 at that point in the
loop."<br />
<br />
I looked at Julia, and she nodded hesitantly.<br />
<br />
"I think it sort of makes sense. Should we let someone else do the programming this time?"<br />
<br />
Freddie
volunteered, so Julia traded places with her to let her take a turn
typing and burning, but we still used Julia's circuit so the wiring
would be right. By this time, Julia's 68705 was erased and ready to use,
so she used it, and this demonstration produced the numbers 1 through 7
on the displays.<br />
<br />
When the test proved successful, Freddie returned to helping take notes.<br />
<br />
Mark and Jeff were keeping track of how long each MCU was in the eraser. <br />
<br />
(As
I write this, I don't have hardware to make sure I'm not forgetting
something, but the program should look something like what I'm giving
here.) <br />
<br />
"Anybody who's not comfortable with all of
that, try out some of your own variations later. For now we need to
write the real display code. Bob, Jennifer, are you up to picking up
from here, to give everyone a break from me?"<br />
<br />
Bob looked questioningly at Jennifer, and they stood, hesitantly.<br />
<br />
Jennifer asked, "I guess we need a variable to hold the number, and a routine to convert from binary to hexadecimal?"<br />
<br />
I
thought carefully how far I wanted to push them, and actually stopped
just long enough to pray for help, before responding with, "I wonder how
much time we'll have to do conversions during the interrupt routines."<br />
<br />
"Not much?" Bob asked.<br />
<br />
Doctor Brown spoke up. "Before worrying about that, let's see what you would do." <br />
<br />
I
decided I agreed with Doctor Brown. "Go with what you have in mind and
see how it works. I need to go deliver newspapers pretty soon."<br />
<br />
They took over, and I sat down next to Julia.<br />
<br />
She took my hand under the lab table and whispered, "This is hard!"<br />
<br />
"You're not the only one who thinks so," I whispered back.<br />
<br />
"Are we going to need to do decimal numbers?" Jennifer asked from the chalkboard.<br />
<br />
"Somebody might, but, for now, let's just do hexadecimal," I suggested<br />
<br />
Bob and Jennifer took separate panes of the chalkboard and both started writing: <br />
<blockquote class="tr_bq">
ORG $40<br />
WAITCT RMB 1 ; IDLE COUNTER<br />
CMDOUT RMB 1 ; CMD to DSP <br />
BYTOUT RMB 1 ; BYTE to DISP<br />
ADROUT RMB 2 ; ADR TO DISP<br />
* <br />
ORG $80<br />
* HI BIT DP<br />
* CLOCKWISE FROM TOP<br />
* LO BIT MIDDLE SEG <br />
SEGTBL<br />
FCB $7E ; 0 0111 1110<br />
FCB $30 ; 1 0011 0000<br />
FCB $6D ; 2 0110 1101<br />
FCB $79 ; 3 0111 1001<br />
FCB $33 ; 4 0011 0011<br />
FCB $5B ; 5 0101 1011<br />
FCB $5F ; 6 0101 1111 <br />
FCB $70 ; 7 0111 0000<br />
FCB $7F ; 8 0111 1111<br />
FCB $7B ; 9 0111 1011<br />
FCB $77 ; A 0111 0111<br />
FCB $1F ; b 0001 1111<br />
FCB $3D ; d 0011 1101<br />
FCB $0D ; c 0000 1101<br />
FCB $4F ; E 0100 1111<br />
FCB $47 ; F 0100 0111<br />
*<br />
*<br />
BITTBL<br />
FCB 1<br />
FCB 2<br />
FCB 4<br />
FCB 8<br />
FCB $10<br />
FCB $20<br />
FCB $40<br />
FCB $80 <br />
*<br />
DSPCMD<br />
LDA CMDOUT<br />
GTXNIB <br />
ANDA #$0F<br />
TAX<br />
LDA SEGTBL,X<br />
RTS<br />
*<br />
DSPBYT<br />
* HI NIB <br />
LDA BYTOUT<br />
LSRA<br />
LSRA<br />
LSRA<br />
LSRA<br />
BSR GTXNIB<br />
STA CATHOD<br />
LDX #5<br />
LDA BITTBL,X<br />
STA ANODE<br />
* LO NIB<br />
LDA BYTOUT<br />
BSR GTXNIB<br />
BSR WAIT <br />
STA CATHOD<br />
LDX #4<br />
LDA BITTBL,X<br />
STA ANODE <br />
BSR WAIT<br />
RTS<br />
*<br />
DSPADR<br />
*WAIT<br />
CLR WAITCT<br />
WAIT0<br />
INC WAITCT<br />
BNE WAIT0<br />
RTS<br />
*<br />
INIT<br />
* INIT PORTS<br />
START<br />
LDA #$0C<br />
STA CMDOUT<br />
* BSR DSPCMD <br />
LDA #$5A<br />
STA BYTOUT<br />
BSR DSPBYT <br />
LDA #$10<br />
STA ADROUT<br />
LDA #$00<br />
STA ADROUT+1<br />
* BSR DSPADR<br />
BRA START<br />
*<br />
ORG $1FFE<br />
FDB INIT<br />
END</blockquote>
(Yes, I'm fudging a little, not showing the initialization code.)<br />
<br />
When
they got to this point, Bob and Jennifer both put their chalk down and
turned around, and Bob said, "Filling in the two undefined display
routines feels awkward, and it's going to be a lot of modifying code as
we copy, which is an easy place to make mistakes."<br />
<br />
Doctor
Brown spoke up again. "Let's go ahead and walk us through that and test
it, and see if we get any good ideas while we're typing and testing."<br />
<br />
Jennifer pointed out, "Our segments are wired differently from Joe's and Julia's."<br />
<br />
I
commented, "I think your wiring makes it a bit easier to visualize the
connection between bits and display segments than the wiring I came up
with for Julia."<br />
<br />
Julia snickered and poked me in the ribs. <br />
<br />
"Theirs does follow a more common pattern," Mike pointed out. "Mine uses the same as theirs."<br />
<br />
Tanya asked, "Is WAIT a legal label?"<br />
<br />
"Labels
and op-code mnemonics are in a different symbol space in the assembler,
so it's okay," I explained. "Might confuse humans, though."<br />
<br />
"Maybe
we should use WAITLP like you do," Bob continued. "Other than the
wiring differences, we're just following the same program flow pattern
you've been following. All we've added is splitting up the byte into
four-bit halves, and shifting things into place, and masking the high
bits off so the array reference into the table stays in the table."<br />
<br />
Jennifer
added, "The LSR instruction does a logical shift right, meaning it's
dividing by two but ignoring the sign. It fills the top bit with a zero.
The AND instruction masks off the top byte, for when you do the lookup
without shifting first."<br />
<br />
"I'm doing something completely different than that," Mike asserted.<br />
<br />
"When Bob and Jennifer have tested theirs, how about you taking a turn, Mike?" I suggested.<br />
<br />
He seemed a little surprised that I suggested it, but agreed.<br />
<br />
And
I excused myself to go deliver newspapers. Before I left, I mumbled
something to Julia about hoping Mike had jumped ahead to just storing
the segments in a display buffer, but she just shrugged her shoulders.<br />
<br />
"Sorry, you've lost me again. Tell me what you mean when you get back." <br />
<br />
By the time I got back, Mike was describing his first step.<br />
<br />
Julia
gave me an update in a low voice. "Bob and Jennifer got theirs working,
but we all helped. Torrence noticed that their bit table was inverted
before they burned their first program in, and the fix's on the
chalkboard."<br />
<br />
The corrected bit table looked like this:<br />
<blockquote class="tr_bq">
BITTBL<br />
FCB $FE<br />
FCB $FD<br />
FCB $FB<br />
FCB $F7<br />
FCB $EF<br />
FCB $DF<br />
FCB $BF<br />
FCB $7F </blockquote>
"They had a typing mistake bug, too, and Doctor Brown showed us how to play computer and do a group walk-through to find it."<br />
<br />
"Valuable experience."<br />
<br />
"Helped me a lot." <br />
<br />
"Let's see what Mike's got."<br />
<br />
Mike
was describing how he planned to test his understanding of the built-in
hardware timer by using it to interrupt the CPU so it could make the
segments flash between 1 and E at a fairly precise one second rate.
(Again, I'm fudging a little, not actually giving you his initialization
code. Init code is easy to get wrong if you don't test, and I can't
test. It's also fairly straightforward in cases such as this, if you can
get the hardware and are inclined to try it yourself.)<br />
<blockquote class="tr_bq">
ORG $40<br />
LONGP RMB 1<br />
ORG $100<br />
INIT <br />
* SET UP PORTS<br />
* SET TIMER PRESCALE TO 64<br />
* SET TIMER COUNT TO 125<br />
LDA #125<br />
STA LONGP<br />
LDA #$FE<br />
STA ANODE<br />
LDA #30 ; 1<br />
STA CATHOD<br />
WAIT<br />
TIMINT<br />
BCLR TIMCR7 ; INT FLAG <br />
DEC LONGP<br />
BNE TIMDUN <br />
LDA #125<br />
STA LONGP<br />
LDA CATHOD<br />
XORA #$FF ; 1 INVERTS TO E<br />
STA CATHOD<br />
TIMDUN<br />
RTI<br />
*<br />
ORG $1FF6<br />
FDB TIMINT; CMOS MODE TIMER INT<br />
FDB TIMINT ; ORDINARY TIMER INT<br />
FDB INIT ; INTERRUPT<br />
FDB INIT ; SWI<br />
FDB INIT ; $1FFF RESET<br />
END</blockquote>
"Using
the timer prescaler value of 64 and the timer count of 125, then
counting a hundred twenty-five interrupts, we should get a count of 125
times 125 times 64, which is a million. So if the CPU clock is exactly
one meghertz, this should be exactly a one second flash rate.<br />
<br />
"WAIT clears the CPU's interrupt mask before it puts the CPU in a WAIT state, but lets the timer keep running.<br />
<br />
"The
exclusive-or with hex FF instruction toggles all the bits in the
accumulator, which should show E and the decimal point. And we can see
if the BCLR bit clear instruction works and clears the timer interrupt
flag."<br />
<br />
After Theresa, another of the more quiet
students, typed the code in and burned it, Mike's test worked as
advertised, and Mike proceeded with his next step. <br />
<br />
"What
I'm going to do is have a buffer for the digits to display. I'll just
have have the timer generate a one millisecond interval interrupt, and
it will sequence through displaying each digit for a millisecond. I'm
going to steal Bob and Jennifer's code for the bit table and the segment
table, if they don't mind."<br />
<br />
"No problemo." <br />
<br />
And he proceeded to show his code:<br />
<br />
<blockquote class="tr_bq">
ORG $40<br />
CURDIG RMB 1 ; 1-7<br />
DIGBUF RMB 7 ; 7 DISPLAYS<br />
*<br />
ORG $100<br />
* BIT AND SEGMENT TABLES<br />
TIMINT<br />
BCLR TIMCR7 <br />
LDA CURDIG<br />
ANDA #07 ; SAFE MASKING<br />
STA CURDIG <br />
TAX<br />
LDA BITTBL,X<br />
STA ANODE <br />
LDX CURDIG<br />
LDA DIGBUF,X<br />
ANDA #$0F ; SAFE MASKING<br />
TAX<br />
LDA SEGTBL,X<br />
STA CATHOD<br />
RTI<br />
*<br />
START<br />
LDA #5<br />
STA DIGBUF<br />
LDA #3<br />
STA DIGBUF+1<br />
LDA #7<br />
STA DIGBUF+2<br />
LDA #7<br />
STA DIGBUF+3<br />
LDA #3<br />
STA DIGBUF+4<br />
LDA #8<br />
STA DIGBUF+5<br />
LDA #0<br />
STA DIGBUF+6<br />
WAIT</blockquote>
Burning
the code in produced close to the desired results, but not quite, and
we proceeded, as a group, to debug it, and shortly had it working.<br />
<br />
It
was getting close to dinner time, so I asked everyone, "Should I offer
some wrap-up comments about interrupt routines now, or should we go home
in a euphoria?"<br />
<br />
Mike looked at me in resignation. "Hit me with it."<br />
<br />
I laughed and looked at Doctor Brown, and he said, "Just keep it short." <br />
<br />
So
I turned to the students. "We've done some really good work today,
keeping the steps small and working together to fix bugs. Doctor Brown
will tell us again why bugs are good tomorrow, I think. A couple or
three things to think about tonight -- Is it better to clear the timer
interrupt flag at the front of the interrupt routine or the end? What
could we do with Mike's code to keep the digits available to look at,
but make the interrupt routine itself shorter? And how do we fit the
keyboard code into the framework Mike has given us?"<br />
<br />
I
paused, deliberately, and then added, "By the way, I couldn't have paid
Mike, Bob, or Jennifer to give us better code to work with."<br />
<br />
<div style="text-align: center;">
***** </div>
<br />
Julia leaned against my shoulder across the transmission well, looking out the window at the twilit sky.<br />
<br />
"Either you aren't the jealous kind or you have supreme confidence about my feelings for you."<br />
<br />
"I trust you to figure out what you want." I lifted my hand from the gearshift and gave her a quick hug.<br />
<br />
"Supremely confident."<br />
<br />
I chuckled. "And if I disagree, I'm going to be in a world of hurt."<br />
<br />
She turned her head and bit my shoulder. Gently.<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
After
dinner and home evening, we sang my recital song in duet, English
first, then Julia following along with my pronunciation as I sang in
Japanese for a verse. I wrote out the Romanization, and we sang the
Japanese together. (I've mentioned Latinization before. In Japanese,
it's called ローマ字 -- <i>Rōmaji</i> -- or Romanization.) Then we sat down
and worked on homework. After homework, Julia looking over my shoulder
while I worked through the TMS 9940 documentation.<br />
<br />
"I'm not seeing it."<br />
<br />
"What?<br />
<br />
"The
description of the instruction to call a subroutine. I found the return
instruction, but not the call, and I want to get a look at it."<br />
<br />
Julia gave me a blank look.<br />
<br />
"It's actually a full context switch on this processor, generating a linked list of contexts instead of a straight stack."<br />
<br />
She raised her hands with a smile that said, "I have no idea what you are talking about."<br />
<br />
I grinned back. "Just pretend like your listening to something that makes sense."<br />
<br />
"Hah."<br />
<br />
"I'm going to pretend I'm explaining it to you, but I'm explaining it to myself."<br />
<br />
"Uh, huh." She snickered.<br />
<br />
"The
TMS 9900 has a really unusual register scheme. All the computational
registers are actually in memory, pointed to by the working set
register."<br />
<br />
"Last week, I would have been lost when you said scheme and register."<br />
<br />
"What's a register?"<br />
<br />
"Registers are where the poor little guy does all those calculations, and RAM is where she stores results."<br />
<br />
"Very
good. The 9900 uses RAM for registers. And it calls the RAM it uses the
context, or working set. And it can keep a link to the previous working
set in a memory cell of the current context."<br />
<br />
"I can pretend I might understand that someday."<br />
<br />
We
both laughed. "Thank you. Now you have to know where your registers
are, so the 9900 has one real register that points to the working set.
It's called WP."<br />
<br />
"Working set pointer?"<br />
<br />
"Careful. You might actually understand this."<br />
<br />
"Hah."<br />
<br />
"You also have to know where the instructions are, so the 9900 has a register for that. It's called IP."<br />
<br />
"Instruction pointer."<br />
<br />
"Nice.
Anyway, when you call a new procedure or routine, you usually want to
know how to get back to where you were. That's what the link to the
previous context working set is."<br />
<br />
"I could see that. Someday."<br />
<br />
"So
the 9900's call instruction holds onto the old IP and WP, loads a new
WP to point to a new working set, and stores the old ones in the top of
the new working set."<br />
<br />
Julia frowned. "You know that almost makes sense."<br />
<br />
"Almost.
I don't think it's ideal. I haven't mentioned the status register. I
think it's the status register. But it saves that, too."<br />
<br />
"Now I'm lost again."<br />
<br />
"That's
okay. The status register is where it remembers such things as whether
the last operation resulted in zero or a negative number. I want to see
the instruction that sets up the new context frame, so I'm looking for
the call instruction, and I can't find it. I can find the return, but
not the call. It's called BLWP, for branch and link WP."<br />
<br />
I thumbed through the datasheet pages again, with Julia looking over my shoulder again.<br />
<br />
"These are jumps?" She said.<br />
<br />
"Yeah. Conditional jumps. It's not there."<br />
<br />
I thumbed back and forth a bit more.<br />
<br />
"Single operand instructions. How many operands does this branch and link, uhm, WP instruction have?"<br />
<br />
"That's actually what I want to find out."<br />
<br />
"B for branch."<br />
<br />
"Yeah."<br />
<br />
"BL."<br />
<br />
<br />
"Branch and link, but without WP. It's a quick call."<br />
<br />
"BLWP," we said in unison.<br />
<br />
"Op code 17."<br />
<br />
"Where? I don't see seventeen."<br />
<br />
"Binary." I pointed to it. "One zero zero zero one."<br />
<br />
"Ah. Yeah."<br />
<br />
Shortly
I was satisfied for the night with what I had learned about the 9940,
so I opened up the Forth implementation package and scanne through it.<br />
<br />
Julia fell asleep on my shoulder, and I drifted off, as well. Giselle woke us up at 10:30, and I drove her home.<br />
<br />
"So, what if I decide to reward you with a kiss?"<br />
<br />
We had stopped on her front porch to talk.<br />
<br />
"Who am I to turn down a reward?"<br />
<br />
It was a nice, sweet reward, giving and getting, but not too much.<br />
<br />
<div style="text-align: right;">
Chapter 13.4: Keyboard Decoding</div>
<div style="text-align: center;">
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></div>
<hr />
<i>[Backed up at <a href="https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-status-display.html">https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-status-display.html</a>.]</i><br />
<br />
<i> </i><i> </i><br />
<i> </i>零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-28106499562486415322020-06-24T23:03:00.000+09:002020-06-24T23:23:09.163+09:00Backup: 33209: Straits -- Status DisplayBackup of <a href="https://joelrees-novels.blogspot.com/2020/06/33209-straits-status-display.html">https://joelrees-novels.blogspot.com/2020/06/33209-straits-status-display.html</a>.<br />
<hr />
<br />
<a href="https://joelrees-novels.blogspot.com/2020/06/33209-straits-sabbath.html">Chapter 13.2: Straits -- Sabbath</a><br />
<br />
<h4 style="text-align: center;">
Chapter 13.3: Straits -- Status Display </h4>
<br />
"Okay,
guys, I have to focus on Julia's computer, so let's
all work on the keyboard controllers on our own for a while."<br />
<br />
"For your girlfriend, huh?" Tanya was apparently feeling a little catty.<br />
<br />
"So you're finally owning up to it?", Suzanne pouted. "What did it take?"<br />
<br />
"Oh, shutup, Suzanne," Mike grumbled. "I, for one, don't want to hear about it."<br />
<br />
Wallace also complained, "Leading us on, and then jumping ship for your girlfriend?"<br />
<br />
Winston admonished, "We can handle this. Bob and Jennifer almost have it worked out, anyway." <br />
<br />
Jennifer shook her head. "It's time for us all to work on our own for a bit. That's what we're here for."<br />
<br />
"Should you just abandon everyone for me?" Julia asked.<br />
<br />
"I'm not abandoning anybody, and Jennifer's right."<br />
<br />
Doctor Brown just watched in amusement. <br />
<br />
There
was more grumbling, and some of the members of the group parked
themselves where they could watch as I used scratch
paper to show Julia how the display translation tables would be put
together. But I ignored them and proceeded to recreate a diagram from
Saturday.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-VT-rUM8jSoc/Xug3ZrsAOXI/AAAAAAAACp4/cTmtDlFWnZ8ojjIJRtUY23B7fopFzJGkQCPcBGAYYCw/s1600/seven_segment_block_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="742" data-original-width="599" height="640" src="https://1.bp.blogspot.com/-VT-rUM8jSoc/Xug3ZrsAOXI/AAAAAAAACp4/cTmtDlFWnZ8ojjIJRtUY23B7fopFzJGkQCPcBGAYYCw/s640/seven_segment_block_diagram.png" width="516" /></a></div>
<br />
"Others
have theirs wired up differently, but the way you ended up wiring yours
is the same order as the diagram I drew. Bottom left is the high bit,
and decimal is the low bit. Let's name those."<br />
<br />
"Name them?"<br />
<br />
"Give them names in the program."<br />
<br />
"Okay."<br />
<br />
"We'll call the bottom left segment BLS, and it will be binary 10000000."<br />
<br />
"You and Dad both told me about converting to hexadecimal four bits at a time, so that's $80?"<br />
<br />
I gave her a thumbs-up and scrawled<br />
<blockquote class="tr_bq">
BLS EQU $80 ; 1000 0000 </blockquote>
"BLT would not be a good name?"<br />
<br />
Julia and I chuckled, and so did the students who were listening.<br />
<br />
"No?"<br />
<br />
"Well, I was thinking S for segment, but why not? T for the last letter of 'bit'. How about the rest?" <br />
<br />
"Like this?" Julia wrote out code, intuiting the permutations from the line I'd written:<br />
<blockquote class="tr_bq">
BLT EQU $80 ; 1000 0000<br />
BT EQU $40 ; 0100 0000<br />
BRT EQU $20 ; 0010 0000<br />
MT EQU $10 ; 0001 0000<br />
TLT EQU $08 ; 0000 1000<br />
TT EQU $04 ; 0000 0100<br />
TRT EQU $02 ; 0000 0010<br />
DT EQU $01 ; 0000 0001 </blockquote>
"Yep." <br />
<br />
"Oh, maybe T is a little confusing."<br />
<br />
"It's okay. We'll keep it. As long as we can read it and understand it."<br />
<br />
"Then we need a comment line to help us remember?"<br />
<br />
"Such as?"<br />
<br />
She wrote, <br />
<blockquote class="tr_bq">
* BOTTOM, TOP, MIDDLE<br />
* LEFT, RIGHT, DECIMAL </blockquote>
"Looks good."<br />
<br />
"Do the last four lines need the dollar sign and the zero?"<br />
<br />
"No,
but removing them would make the form less obvious, so let's keep them.
Now, let's use those to make a table of segments, like we figured out
on Saturday. The zero will be the first entry. Which bits does it use?"<br />
<br />
"All but the middle and the decimal?"<br />
<br />
"Okay. We can use '.OR.' to put bits together, so it can look like this:" <br />
<blockquote class="tr_bq">
TABLE<br />
FCB BLT.OR.BT.OR.BRT.OR.TRT.OR.TT.OR.TLT</blockquote>
"That's not going to fit in the 32 column screen."<br />
<br />
"True, but that's okay. But it's also ugly -- hard to read, and that is not okay. Maybe I can think of something to help."<br />
<br />
After some thought, I wrote<br />
<blockquote class="tr_bq">
CUP EQU BLT.OR.BT.OR.BRT<br />
CAP EQU TRT.OR.TT.OR.TLT<br />
* <br />
TABLE<br />
FCB CUP.OR.CAP </blockquote>
"It sort of helps."<br />
<br />
"Heh. Okay, there's zero. One is easy."<br />
<br />
She scribbled her guess, "BRT.OR.TRT". "Is that it?"<br />
<br />
"Right."<br />
<br />
With a bit of scribbling, erasing, and rescribbling, we had this: <br />
<blockquote class="tr_bq">
BCUP EQU BLT.OR.BT.OR.BRT<br />
TCAP EQU TRT.OR.TT.OR.TLT<br />
ONET EQU BRT.OR.TRT <br />
TRCUP EQU TT.OR.TRT.OR.MT<br />
BLCUP EQU MT.OR.BLT.OR.BT<br />
BRCUP EQU MT.OR.BRT.OR.BT<br />
TCUP EQU TLT.OR.MT.OR.TLT<br />
TLCUP EQU TT.OR.TLT.OR.MT<br />
BCAP EQU BLT.OR.BT.OR.BRT<br />
VBAR EQU TLT.OR.BLT<br />
* <br />
SEGTBL<br />
FCB BCUP.OR.TCAP ; 0<br />
FCB ONET ; 1<br />
FCB TRCUP.OR.BLCUP ; 2<br />
FCB TRCUP.OR.BRCUP ; 3<br />
FCB TCUP.OR.BRT ; 4<br />
FCB TLCUP.OR.BRCUP ; 5<br />
FCB TLCUP.OR.BCUP ; 6<br />
FCB TT.OR.ONET ; 7<br />
FCB BCUP.OR.TCAP.OR.MT ; 8<br />
FCB TCAP.OR.BRCUP ; 9<br />
FCB TCAP.OR.BCAP ; A<br />
FCB VBAR.OR.BRCUP ; b<br />
FCB BLCUP ; c<br />
FCB BLCUP.OR.ONET ; d<br />
FCB TCAP.OR.BLCUP ; e<br />
FCB VBAR.OR.TLCUP ; F</blockquote>
"I can sort of see what the table is, but how does that get into the LEDs?" Julia asked me.<br />
<br />
"I've
been avoiding that question all week. I want to use a parameter stack,
but we're short of both RAM and registers. I guess we're not going to be
trying to run two displays at once, so global variables should work."<br />
<br />
Julia looked at me with a blank expression.<br />
<br />
I
proceeded anyway. "We'll have a variable for the current number to
display and a variable for the current column to display in, and --" I
scribbled:<br />
<blockquote class="tr_bq">
NUMDSP RMB 1<br />
CLMDSP RMB 1</blockquote>
"We can squeeze those into a single byte if we need to, but let's do it simple first."<br />
<blockquote class="tr_bq">
PUTDIG<br />
LDX NUMDSP ; HIGH BITS ZERO!<br />
LDA SEGTBL,X<br />
LDX CLMDSP ; HIGH BITS ZERO!</blockquote>
"I'm lost."<br />
<br />
The
lab erupted in applause, and I looked around and realized that everyone
was gathered around listening, and Mark, Jeff, Mike, and even Bob and
Jennifer had been taking turns transferring our scribblings and musings
to the chalkboard.<br />
<br />
I looked over at Doctor Brown, and he gave just gave me a "Who, me?" look.<br />
<br />
I chuckled in embarrassment.<br />
<br />
"Okay.
Maybe we should do this as a group, and then you can all adjust it for
how you wired yours. But I guess we need to use teamwork on the notes,
and explanations. Who followed how we put the table together?"<br />
<br />
Bob,
Jennifer, Mark, Jeff, and Mike said they were good on it, some of the
others raised their hands hesitantly. There was a lot of doubt.<br />
<br />
After
making new arrangements to make sure Julia would not be so busy taking
notes that she couldn't think and ask questions, I started over, working
through the 6805 assembler language and syntax.<br />
<br />
"'EQU'
is short for equate. It equates the label on the left to the expression
on the right. Hopefully we don't need to know when the expression is
evaluated, because I don't know and I don't want to waste time figuring
that out.<br />
<br />
"So when we write<br />
<blockquote class="tr_bq">
BLT EQU $80 ; 1000 0000</blockquote>
"that could mean bacon, lettuce, and tomato is flagged by bit seven, or it could mean the bottom left segment bit is bit seven."<br />
<br />
That got some chuckles.<br />
<br />
"'.OR.'
is the logical-or operator. It performs a column-by-column logical or,
keeping the column results in their columns. That means that'<br />
<blockquote class="tr_bq">
ONET EQU BRT.OR.TRT</blockquote>
"equates
the label ONET to the result of 00100000 or-ed with 00000010, which is
00100010, or hexadecimal 22. And if we put $22 on the segments port and
hold one the anode of one of the displays down to 0, it should make the
top and bottom left segments light up, showing us a '1'. If we want to
see that, we could try something like"<br />
<blockquote class="tr_bq">
START<br />
LDA #22<br />
STA CATHODES<br />
LDA #FE<br />
STA ANODES<br />
WAITLP<br />
BRA WAITLP</blockquote>
"'LDA
loads a small value into the accumulator, STA stores the accumulator to
memory or I/O space, BRA branches always and forever, letting us see
the results. I think we could use a WAIT instruction, but this loop
forever to itself will do what we need with most CPUs, so it's a good
thing for everyone to see." <br />
<br />
I decided to stop and
demonstrate it. I asked Julia to type it in, assemble it, and burn it
into her 68705, and run the program. When it produced a 1 on the
rightmost seven segment display, she seemed a bit more confident of what
she was understanding, and so did certain of the other students.<br />
<br />
"Hopefully everybody's working out the equate definitions for your own circuits while we do this.<br />
<br />
"The
FCB that we use to construct the table of constants stands for 'Form
Constant Byte or some such, and it means store a constant value into the
program object code. By putting them into a table in the object code,
we make the patterns available for look-up. <br />
<br />
"Now, if
we shift the anode bit, we can light up one digit at a time, but it's
going to happen so fast it will look like they're all lit up at once.
The LSL instruction shifts the argument one bit to the left, and we'll
use it."<br />
<br />
Eyes were glazing over, so I wrote another bit of demonstration code, using the defined constants directly:<br />
<blockquote class="tr_bq">
PAUSE<br />
DECX ; IDLE COUNT<br />
BNE PAUSE<br />
RTS<br />
*<br />
START<br />
CLRX<br />
LDA #FE<br />
STA ANODES <br />
LDA #ONET <br />
STA CATHODES<br />
BSR PAUSE ; LET PORT SETTLE<br />
LSL ANODES <br />
LDA #TCAP<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #VBAR<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #BLCUP<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #TRCUP<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #TCUP<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #BCAP<br />
STA CATHODES<br />
BSR PAUSE<br />
BRA START</blockquote>
"The
PAUSE routine uses the X register as an idle counter. DEC counts X down
one, and BNE loops back to count again until X is zero. 'B' for Branch.
'NE' for Not Equal, or in other words, not zero. I suppose I'll have to
explain that more later." <br />
<br />
"Get your minds out of the
gutter, guys, BRA is a BRanch Always. so when we have displayed all the
patterns, one place at a time, we go back and do it again. <br />
<br />
Suzanne complained, "I suppose some male engineer thought that acronym up."<br />
<br />
"You
suppose right. I do not defend him. In a little bit, I'll show you how
to use a macro to give that instruction a better mnemonic name."<br />
<br />
"I don't suppose anyone will forget the original mnemonic," Bob commented, and Jennifer slapped him over the head.<br />
<br />
Doctor Brown watched this in amusement, taking no sides. <br />
<br />
Again,
Julia typed it in, assembled it, and burned it, this time into a 68705
she borrowed from Jeff while hers was in the eraser.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-M2JvnK8GUk4/XvHhVZ9ioeI/AAAAAAAACsI/HCiO_G2y8SU83hic0hhSfRAvm04rhNmKQCLcBGAsYHQ/s1600/seven_by_seven_segment_test_output.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="283" data-original-width="1024" height="176" src="https://1.bp.blogspot.com/-M2JvnK8GUk4/XvHhVZ9ioeI/AAAAAAAACsI/HCiO_G2y8SU83hic0hhSfRAvm04rhNmKQCLcBGAsYHQ/s640/seven_by_seven_segment_test_output.png" width="640" /></a></div>
<br />
She was rather dissatisfied with the cryptic output, so she got back on the computer and added equates for each digit:<br />
<blockquote class="tr_bq">
N0 EQU BCUP.OR.TCAP ; 0<br />
N1 EQU ONET ; 1<br />
N2 EQU TRCUP.OR.BLCUP ; 2<br />
N3 EQU TRCUP.OR.BRCUP ; 3<br />
N4 EQU TCUP.OR.BRT ; 4<br />
N5 EQU TLCUP.OR.BRCUP ; 5<br />
N6 EQU TLCUP.OR.BCUP ; 6<br />
N7 EQU TT.OR.ONET ; 7<br />
N8 EQU BCUP.OR.TCAP.OR.MT ; 8<br />
N9 EQU TCAP.OR.BRCUP ; 9<br />
NA EQU TCAP.OR.BCAP ; A<br />
NB EQU VBAR.OR.BRCUP ; b<br />
NC EQU BLCUP ; c<br />
ND EQU BLCUP.OR.ONET ; d<br />
NE EQU TCAP.OR.BLCUP ; e<br />
NF EQU VBAR.OR.TLCUP ; F<br />
*<br />
SEGTBL<br />
FCB N0<br />
FCB N1<br />
FCB N2<br />
FCB N3<br />
FCB N4<br />
FCB N5<br />
FCB N6<br />
FCB N7<br />
FCB N8<br />
FCB N9<br />
FCB NA<br />
FCB NB<br />
FCB NC<br />
FCB ND<br />
FCB NE<br />
FCB NF</blockquote>
Then she modified the test code:<br />
<blockquote class="tr_bq">
START<br />
CLRX<br />
LDA #FE<br />
STA ANODES <br />
LDA #N0 <br />
STA CATHODES<br />
BSR PAUSE ; LET PORT SETTLE<br />
LSL ANODES <br />
LDA #N1<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #N2<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #N3<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #N4<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #N5<br />
STA CATHODES<br />
BSR PAUSE<br />
LSL ANODES<br />
LDA #N6<br />
STA CATHODES<br />
BSR PAUSE<br />
BRA START</blockquote>
And she tried it again, borrowing a 68705 from Mark.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-AasykIboQzI/XvHmlmhIVII/AAAAAAAACsU/YE5THe3mVpYDeJ1YwjMJW5MF5eia5e_cgCLcBGAsYHQ/s1600/seven_by_seven_series_output.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="283" data-original-width="1024" height="176" src="https://1.bp.blogspot.com/-AasykIboQzI/XvHmlmhIVII/AAAAAAAACsU/YE5THe3mVpYDeJ1YwjMJW5MF5eia5e_cgCLcBGAsYHQ/s640/seven_by_seven_series_output.png" width="640" /></a></div>
<br />
I think everyone cheered. <br />
<br />
"But I have a question."<br />
<br />
"Yeah?"<br />
<br />
"I don't think we're actually using the table in this test."<br />
<br />
"True.
And I could get a swelled head and imagine I taught you that, but I
think you've done more figuring out than I've done teaching."<br />
<br />
"Oh, give her a kiss," Winston said. "She deserves it."<br />
<br />
"No es para ...," I began, but Julia shook her head just perceptively enough to stop me.<br />
<br />
"Whether I reward him with a kiss or not is my business," she said.<br />
<br />
Wolf
whistles and other unnecessary noises of appreciation ensued, and Julia
and I cleared our throats simultaneously, with lopsided grins.<br />
<br />
"Back to work," Julia said.<br />
<br />
I continued. "So now we need to actually use the table. We'll use the X register to pick the pattern to display:"<br />
<blockquote class="tr_bq">
ORG $88 ; VARIABLES<br />
PAUSER RMB 1<br />
ORG ROM ; CODE <br />
PAUSE<br />
CLR PAUSER<br />
PAUSELP<br />
DEC PAUSER<br />
BNE PAUSELP<br />
* <br />
START<br />
LDX #1<br />
SEC<br />
DISPLP <br />
ROL ANODES<br />
LDA SEGTBL,X <br />
STA CATHODES<br />
BSR PAUSE <br />
INCX<br />
CPX #8<br />
BNE DISPLP<br />
BRA START </blockquote>
"ORG
means origin, and it sets the address where the next part is assembled
to. RMB Reserves a Memory Byte in low memory, which we will use instead
of X as the idle loop counter. We label that byte PAUSER. CLR clears the
variable, and DEC decrements it by 1.<br />
<br />
"The indexed
addressing mode used in 'LDA SEGTBL,X' adds the constant address of the
base of the SEGTBL table to the value in X and uses the result as the
address from which to load the accumulator. With a 1 in X, that points
to the bit pattern to display a 1.<br />
<br />
"Then we count X up 1, and use CMP to CoMPare X to the end value, 8. BNE Branches back to do another if X is Not Equal to 8."<br />
Julia
moved over and let Freddie practice typing and burning, but we still
used Julia's circuit so the wiring would be right. This demonstration
produced the numbers 1 through 7 on the displays.<br />
<br />
"If you're not comfortable with all of that, try some of your own later. Now we need to write the real display code.<br />
<br />
"We
want to be able to do other things besides display numbers, so we're
going to use the timer built into the 6805 to count instead of having
the CPU count, and we'll have the timer interrupt the program to
actually display the numbers."<br />
<br />
"Is this only for displaying numbers?" Tanya asked in a slightly petulant tone.<br />
<br />
"Well,
the numbers might mean things. For instance, if something goes wrong
during boot, we could put an error code and an address on the display,
to give clues about the error state. Or we might say that a blank
display is an all-operational status."<br />
<br />
I can tell
your eyes are glazing over now, so, rather than walk you through it with
us I'll just note that we read in the manual about the timer, and I
walked them through initialization, using the pre-scaler to set the
granularity, calculating the value to initialize the timer and
pre-scaler to interrupt the CPU once every millisecond, and constructing
the interupt routine to display the digits one place at a time.<br />
<br />
Someday,
somewhere in my blogs, I'll show the complete keyboard debounce and
status display routine, complete with display suppression and other
features that we evenutally added. Suffice it to say that we had Julia's
status display functional at a usable level on Monday before I went
home to deliver newspapers, and that about half of the group had theirs
functional by the time I got back.<br />
<br />
<div style="text-align: right;">
Chapter 13.4: Keyboard Decoding</div>
<div style="text-align: center;">
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></div>
<hr />
<i>[Backed up at <a href="https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-status-display.html">https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-status-display.html</a>.]</i><br />
<br />
<i> </i><i> </i><br />
<i> </i><br />
<i> </i><i> </i><br />
<i> </i>零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-9030542498286749802020-06-23T13:31:00.000+09:002020-06-23T13:34:30.294+09:00Backup: 33209: Straits -- SabbathBackup of <a href="https://joelrees-novels.blogspot.com/2020/06/33209-straits-sabbath.html">https://joelrees-novels.blogspot.com/2020/06/33209-straits-sabbath.html</a>.<br />
<hr />
<br />
<a href="https://joelrees-novels.blogspot.com/2020/06/33209-straits-bringing-up-flex.html">Chapter 13.1: Straits -- Bringing Up Flex</a><br />
<br />
<h4 style="text-align: center;">
Chapter 13.2: Straits -- Sabbath </h4>
<br />
Sisi met me at the door. "Mom wants to know why you were such a bad boy with Julia last night."<br />
<br />
I
glanced over her head at Julia, who shrugged at me through their
kitchen door, then at her mother, who was curled up on their couch with
the newspaper. Mrs. Cisneros gave me a look that said I should have
known better. <br />
<br />
Then I turned back to Sisi. "Good
question. I guess a hug wasn't much of a way to say good-night. Of
course, I could give you a good morning kiss, instead."<br />
<br />
I made a kissy face at her and she giggled and backed away.<br />
<br />
"Mo-om!"<br />
<br />
Ms. Cisneros laughed. <br />
<br />
Julia gave us all a smirk from the kitchen. <br />
<br />
I
followed Sisi in and made my way over to the kitchen, with a stop to
give Mrs. Cisneros a hug and an air-kiss to the cheek. She patted me on
the back and gave me an approving nod with her kiss.<br />
<br />
I
gave Julia a hug and we spontaneously air-kissed both cheeks. As we went
went cheek-to-cheek the second time, she whispered, "Mom's horrified."<br />
<br />
I chuckled, then without checking her mother's expression, drew back so we could give each other a quick peck, lip-to-lip.<br />
<br />
Behind me, her mother cleared her throat. "That's a little better. Not much." <br />
<br />
"Let
me help you with those tortillas," I suggested, still grinning. Pretty
soon we had a decent Sunday breakfast set out, and Julia's father
wandered in.<br />
<br />
"Julia's putting you to work already? You
need more pay. Nice looking spread." He sat down and proceeded to put
together a breakfast taco.<br />
<br />
I laughed, and Julia rolled her eyes, so I snuck my arm around her waist and drew her in for another, more prolonged kiss.<br />
<br />
"You need a little practice on that, too, Son." <br />
<br />
Julia's shoulders fell, and she turned to face him. "<span class="tlid-translation translation" lang="es"><span class="" title="">No Papá. No es para sus entretenimiento.</span></span> We'll kiss how and when we want."<br />
<br />
"Heh. I'm afraid that one was at least partly for their entertainment, or I would have given it better attention."<br />
<br />
Julia snickered and relaxed back into my arms, and her dad gave me a stern look before breaking into a chuckle.<br />
<br />
"We'd
better eat breakfast if we intend on making your church on time." I
held a chair for her and she sat down. I took a chair next to her, and
we started putting our breakfast tacos together.<br />
<br />
Her mother came in and sat down, still chuckling, and Sisi and her brothers followed, and her dad asked me to say grace. <br />
<br />
After I asked a blessing, we dug into our tacos.<br />
<br />
"By the way, Denny called last night to tell me Motorola wants to talk with me some more down in Austin next Friday."<br />
<br />
"What about classes?" Julia asked between bites.<br />
<br />
"In
the evening. I can leave right after classes and eat lunch on the road.
They offered to fly me in, but Denny pointed out that I'd want to visit
the surplus shop on Saturday, and they said they could pay my mileage
if I wanted to drive."<br />
<br />
Julia chewed thoughtfully for a few moments and swallowed. "Are you going to stay the night with your brother?"<br />
<br />
"That's the plan."<br />
<br />
"Do I get to come, too? -- to look at disk drives. I can sleep on their living-room floor in a sleeping bag, if they'll let me."<br />
<br />
I looked up to see what her parents thought, and they seemed to be waiting for my response.<br />
<br />
"I'll ask Denny. It would be kind of fun to wander around the surplus shop with you."<br />
<br />
Her dad shook his head and gave her mom an inquiring look. "<span class="tlid-translation translation" lang="es"><span class="" title="">¿Qué prioridades tienen?"</span></span><br />
<br />
She shrugged, "<span class="tlid-translation translation" lang="es">Dejarlo a ellos."</span><br />
<br />
"<span class="tlid-translation translation" lang="es">¿Tienen un templo Mormón en Austin?</span>"<br />
<br />
"Dang.
Eloping does sound kind of fun. But no, no temple in Austin. And
eloping to a temple is kind of hard to do, anyway, since we'd have to
ask the bishop for permission and stuff. Ouch."<br />
<br />
Julia was snickering, but she poked me again.<br />
<br />
"Hey. Just answering your dad's question."<br />
<br />
Sisi
and Mario looked a little lost. Tito rolled his eyes. Julia's parents
joined Julia and me in laughing comfortably at the joke.<br />
<br />
Then her mother asked, "So was that a proposal?"<br />
<br />
Julia
closed her eyes. "Mom, Dad, patience. We have to work through a lot of
things before we can really seriously consider getting married. We may
have known each other for several months now, but we've only been
seriously dating for a little more than a week."<br />
<br />
I gave her a hug, and she leaned her head on my shoulder. I kissed her forehead.<br />
<br />
"I guess it is beginning to seem like we've been friends forever."<br />
<br />
She nodded. <br />
<br />
<div style="text-align: center;">
*****</div>
<br />
"It looks like they slipped out already."<br />
<br />
Pat and George had sat in the back during the sermon, but they were now nowhere in sight. <br />
<br />
"Julia! Are you bailing out on choir this Easter?" Their choir director, Valerie Jones, approached.<br />
<br />
Julia looked over at me, and I looked back.<br />
<br />
"Choir?" I raised my eyebrows and Julia raised hers back, giving her head a tilt.<br />
<br />
Valerie looked from Julia to me. "You know, you have a good voice, and we can use men. You're welcome to join."<br />
<br />
So we stayed after and practiced with their choir, and made a tentative commitment to sing with them for Easter. <br />
<br />
<div style="text-align: center;">
***** </div>
<br />
"I'm
sure I saw Mike around here." Julia looked both ways down the north
hall of the meetinghouse we shared with the other ward, but, if he had
been there, he wasn't any more.<br />
<br />
"Should we check every classroom?"<br />
<br />
"I guess, if he doesn't want to talk to us, we shouldn't."<br />
<br />
"Ah, Joe, you've been making yourself scarce."<br />
<br />
I turned around. "Sister Fulmer. I guess I have. Sorry. Julia, Sister Fulmer is leading our choir this year."<br />
<br />
Julia laughed. "Am I invited, too?"<br />
<br />
"Sure! We'd love to have you. You can sing alto, too, right?"<br />
<br />
"I can."<br />
<br />
And we stayed after for choir in my ward, as well, tentatively committing to the ward's Easter cantata.<br />
<br />
<div style="text-align: center;">
***** </div>
<br />
Back
at my house after the young adult evening, I got on the phone in the
kitchen and dialed Denny's number. Julia went to the extension in Dad's
study.<br />
<br />
"Reeves Mortuary. You stab 'em, we slab 'em."<br />
<br />
"Denny!" we heard Denise chide on the other end of the call.<br />
<br />
"Mpphh." Julia suppressed a snort. <br />
<br />
"Hey, can I reserve a couple of lockers for next Friday?" I joked back.<br />
<br />
"I'm not sure I like this analogy," Julia complained, laughing.<br />
<br />
"Two?" Denny questioned.<br />
<br />
Julia answered, "I can bring a sleeping bag and sleep on the floor somewhere."<br />
<br />
"I guess you're the beautiful Julia we've been hearing about."<br />
<br />
Julia leaned around the corner and mouthed at me, "Beautiful?"<br />
<br />
"Dad," I mouthed back.<br />
<br />
"Well, I am Julia, whether I'm beautiful or not ..."<br />
<br />
"Yeah, she is," I confirmed.<br />
<br />
"Sleeping bag, huh?"<br />
<br />
"I
get to meet Julia?" Denise's voice filtered in from the background.
"She can have the couch. Joe can sleep on the floor with the boys."<br />
<br />
"Ya heard that?" Denny asked.<br />
<br />
"I get the floor in the boys' room and Julia gets the sofa."<br />
<br />
"That means you're coming to talk with my boss's bosses on Friday?"<br />
<br />
"Sure. Any idea what they want to talk about?"<br />
<br />
"I'm not supposed to say."<br />
<br />
"Come as I am, then."<br />
<br />
"Yep." <br />
<br />
<div style="text-align: right;">
Chapter 13.3: what?</div>
<div style="text-align: center;">
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></div>
<hr />
<i>[Backed up at <a href="https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-sabbath.html">https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-sabbath.html</a>.]</i><br />
<br />
<i> </i><i> </i><br />
<i> </i>零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-20312336319665694652020-06-21T17:45:00.003+09:002020-06-21T20:19:48.022+09:00Backup01: 33209: Straits -- Bringing Up FlexSecond version backup of <a href="https://joelrees-novels.blogspot.com/2020/06/33209-straits-bringing-up-flex.html">https://joelrees-novels.blogspot.com/2020/06/33209-straits-bringing-up-flex.html</a>.<br />
<hr />
<a href="https://joelrees-novels.blogspot.com/2020/06/33209-straits-getting-julia-booted-up.html">Chapter 13.0: Straits -- Getting Julia Booted Up</a><br />
<br />
<h4 style="text-align: center;">
Chapter 13.1: Straits -- Bringing Up Flex</h4>
<br />
Julia waited patiently while I disappeared down the rabbit hole again.<br />
<br />
"So
you let those drives do their exercises all night last night, until you
got back from delivering your newspapers this morning."<br />
<br />
"Yep."<br />
<br />
"And they didn't mess up so bad that a retry wouldn't fix it."<br />
<br />
"Uh huh."<br />
<br />
"Which means now you can load this operating system into memory, right?"<br />
<br />
"Yeah, now we can be fairly confident that we can load the OS into RAM with these disk drives." <br />
<br />
"But
even if you write a program to read the operating system into memory in
the place it's supposed to go, it's not going to run?"<br />
<br />
"Maybe
I'm wrong and it might run after all. But it looks like it will either
run off a cliff when it calls I/O routines that it expects to be there
but aren't, or it will go looking for those routines, not find them, and
give up. And I'm not sure how we'll know which is happening, beyond
that it doesn't do what we expect it to."<br />
<br />
"That's not very friendly."<br />
<br />
"I'm
sure they don't have manpower to handle every hardware variation guys
like me could dream up. And that means I get to try to figure it out." I
continued scanning the manuals in my lap, and Julia didn't say anything
more for a moment. <br />
<br />
"Oh, I think I found something here."<br />
<br />
"What?"<br />
<br />
"Hang
on." I scanned the pages I had open again. "This entry shows an area
where the standard disk drivers are, and there are vectors that they can
be called through at the beginning. If my drivers imitate drivers for
Western Digital controllers closely enough, I should be able to
overwrite those vectors with jumps to my own code."<br />
<br />
"I'm lost."<br />
<br />
"Vectors
are like pointers to where the drivers are actually stored. These are
jump vectors, so programs call them and the jump instruction sends them
on to the actual driver routines."<br />
<br />
"Oh-kay. So you have to write new drivers and put them where the existing drivers are?"<br />
<br />
"I'm
thinking I'll put them outside the memory Flex uses and overwrite just
the vectors that are there for linking through. That should minimize
potential for damage."<br />
<br />
"As if I knew anything about the question I just asked, much less what you just said."<br />
<br />
She laughed, and I leaned over to where she sat on the bench seat and gave her a hug.<br />
<br />
"It's
sure nice to have someone to talk with while I'm down in that rabbit
hole. I'll show you those vectors when I get things put together and
running."<br />
<br />
"I'm looking forward to it."<br />
<br />
We both chuckled at the mixed irony in her tone. <br />
<br />
"I
guess my first project is to do what the manual suggests and copy the
disks they sent me, so that, if I mess something up, we have a backup."<br />
<br />
"Good idea. How are you going to do that?"<br />
<br />
"The test routines should help. But it's a little scary. I'm worried that my drives will malfunction."<br />
<br />
"Isn't there some way to prevent the originals from being copied onto?"<br />
<br />
I
showed her the write protect notch on the floppy cover and the strips
of write-protect tape tabs from the box of floppies I'd bought in
Austin. "This is backwards of good engineering, but if I cover this
notch with this tape it should protect the disk -- if the drive
electronics function correctly."<br />
<br />
She smirked. "Doubt your own work?"<br />
<br />
"Yeah. I haven't actually implemented the protection in the hardware."<br />
<br />
"Well, maybe you should. But why is it backwards?"<br />
<br />
"Uhm, I guess maybe it depends on how you look at things, but I'd rather it be protected if the tape falls off."<br />
<br />
"I guess that makes sense."<br />
<br />
"You
know, some computers implement write-protect in the driver software
instead of the controller hardware, so you just can change the drivers
to make your drives work the way you prefer. But I think you're right, I
should add the write-protect circuitry."<br />
<br />
I dug up my
diagrams, and drew in some additional logic. "If I add a few gates here,
and connect it to the controller I/O here, I can make the controller
respect the write-protect notch by default in the hardware, but allow
the driver to invert the sense."<br />
<br />
"Make it complicated? Why not just do it normal and keep it simple?"<br />
<br />
"Keep it simple. Didja know that's actually an engineering principle?"<br />
<br />
"Engineering principle?" She gave me a lopsided smile of curiosity.<br />
<br />
"It has an acronym: K-I-S-S."<br />
<br />
"Okay." She leaned over and gave me a peck on the lips. "And that's three times, now."<br />
<br />
I grinned. "And I'm not complaining."<br />
<br />
"So -- what's the second 'S'?"<br />
<br />
I
looked at the floor and coughed. "Erm, you have to understand, it's a
special bit of engineering jargon. It sounds a little, uhm, stupid, but
it has special meaning."<br />
<br />
"Okay. So tell me."<br />
<br />
"It's 'stupid'."<br />
<br />
"You said that."<br />
<br />
"Quote stupid un-quote."<br />
<br />
"Oh." Now she gave me a sharp look.<br />
<br />
"It means, not trying to be too smart. Trying to be too smart makes things not simple."<br />
<br />
"Uh-huh."<br />
<br />
"No, seriously."<br />
<br />
"I believe you." She laughed. "But I think I'll remember this one."<br />
<br />
"Heh."<br />
<br />
"So, the write-protect circuit, right? How do you keep it simple?"<br />
<br />
"Well,
I already have the sensor hooked into an input bit of the controller's
MCU, but the controller ignores it for now. Instead of adding hardware, I
could do this in the controller's firmware, and that way I wouldn't be
depending on the driver software in the computer for protection."<br />
<br />
"Does that mean re-programming the controller?"<br />
<br />
"Yeah. Hmm. While I'm in it, I could add a switch to allow it to switch between FM and MFM on the fly."<br />
<br />
Julia
watched and asked questions, and listened to my answers, while I put a
68701 in the EPROM eraser, loaded the floppy controller source code from
tape, added the code to handle write-protect and the FM/MFM switch, and
programmed the new controller.<br />
<br />
For a test, I wrote a
quick routine to duplicate and check a single-sided disk in the second
drive to the first drive and used the routine to duplicate one of my
test floppies. That worked, so I tried to use my disk drives to
duplicate the OS disk.<br />
<br />
"Error."<br />
<br />
"What kind of error?"<br />
<br />
"It won't read TSC's floppy."<br />
<br />
We both sat and thought for a minute.<br />
<br />
"Can you do it with Giselle's computer?"<br />
<br />
"Worth a try."<br />
<br />
We
went in to Giselle's room, and she agreed to set the project she was
working on aside long enough to let me try to make a copy. I attached
one of my drives to her Color Computer controller as a second drive and
wrote a quick program in EDTASM+, then inserted the disks.<br />
<br />
"Error."<br />
<br />
"Could the disk be bad?" <br />
<br />
"Let
me look up the error code." I thumbed through Giselle's manual. "Format
error. But I'm reading it in raw format, so that shouldn't make a
difference."<br />
<br />
I thanked Giselle, and we took our stuff back to my room.<br />
<br />
"I guess I'm going to have to wait 'til Monday and give them a call."<br />
<br />
"TSC?"<br />
<br />
"Yeah."<br />
<br />
"Nobody in the office today?"<br />
<br />
I
gave her a quizzical look. "Might be. Worth a try. It's even not the
most expensive time to call. But let me make sure what I'm going to ask
before we do."<br />
<br />
And I dug back into the manuals.<br />
<br />
"Oh, look at this."<br />
<br />
"What?"<br />
<br />
"The disk they sent is FM."<br />
<br />
Julia looked pointedly at my stereo tuner.<br />
<br />
"You've been waiting a whole week to say that." I laughed, and she laughed.<br />
<br />
"Without words. But not the same FM, I guess? And there's no AM?"<br />
<br />
"AM. The bit clock is the carrier, so 0 is absence of clock and 1 is presence. Ick."<br />
<br />
I reached for some paper, but she put her hand on mine and stopped me. <br />
<br />
"I was just joking about the AM."<br />
<br />
"Okay, okay, I'll see if I can puzzle that one out later."<br />
<br />
The
changes to duplicate the FM disk were quick, and the copy proceeded
without further error. "And that was verify-after-write, so it should be
gold."<br />
<br />
"So -- my suggestion to call wasn't necessary?"<br />
<br />
I
wrinkled my brow and leaned over and gave her a peck on the lips, but
stayed close. "It was part of the conversation, and kept me from getting
stalled." My eyes searched hers.<br />
<br />
She returned my searching look. "Just to be safe, make another?"<br />
<br />
"Good
idea." I sat back, with some regrets, and made the second copy, then
copied the second of the two OS disks TSC had sent, the utilities disk,
"Just for good measure."<br />
<br />
We shared a hug.<br />
<br />
"Okay, now I need to write the drivers."<br />
<br />
Because
I'd been constructing the controllers to emulate the Western Digital
controllers, the basic drivers were a straightforward extract from my
test code. And I showed Julia where the vectors were and how I'd
over-write them.<br />
<br />
"And now the throw-away loader."<br />
<br />
"Throw-away?"<br />
<br />
"If
it works, I'll only use it once to load Flex into memory without using
the drivers. Then I'll load my drivers from tape and overwrite the
driver vectors, and call the OS's cold boot routine. Then we'll be
running Flex, and I'll use Flex itself to make a bootable disk that
contains Flex with my drivers."<br />
<br />
"Finally running the OS?"<br />
<br />
"Yeah.
Exciting, huh? I'll probably base the boot loader on the throwaway, so
it won't be completely throwaway. But since the first one's throw-away, I
can write it to run anywhere. Maybe I should just put it after my
drivers anyway, so I can keep the drivers and the loader together."<br />
<br />
I was in good form, the loader ran the first time, and I was able to boot Flex. Flex's prompt came up on the screen.<br />
<blockquote class="tr_bq">
<span style="color: #38761d;"><span style="background-color: lime;">FLEX 2.1 </span></span><br />
<span style="color: #38761d;"><span style="background-color: lime;">+++ </span></span></blockquote>
I turned to Julia with a hand outstretched for a slap of the palm, but she wrapped her arms around me and gave me a しっかりした kiss.<br />
<blockquote class="tr_bq">
<i>Shikkari.</i> </blockquote>
When
I was a new missionary, I hated that word. It seemed to mean whatever
fit the speaker's sense of what was right, and it seemed to ignore the
right of the person being spoken to to have any sense.<br />
<blockquote class="tr_bq">
しっかりした体格 <i>shikkari shita taikaku</i> -- proper build/physique (solid build)</blockquote>
<blockquote class="tr_bq">
しっかりしなさい! <i>Shikkari shinasai!</i> -- Do it right! (Hold it together! or Hang in there!)</blockquote>
Righteous kiss? Proper kiss? Solid kiss? Who has a right to judge a kiss? It's not a sporting event.<br />
<br />
Okay, I liked it. And it wasn't just a quick buss. Somehow, <i>"shikkari"</i> fits.<br />
<br />
"Ahem," Giselle's voice interrupted. "I hate to interrupt, but, uhm, the missionaries are here?"<br />
<br />
We broke apart and turned in unison to give Giselle a guilty look.<br />
<br />
She smirked. "Well, it's none of my business, but, since the missionaries <i>are</i> here, maybe you two should save that."<br />
<br />
We both stood up a little unsteadily, left the computer at the Flex prompt, and went to meet the missionaries.<br />
<br />
<div style="text-align: center;">
***** </div>
<br />
The
discussion we had with the missionaries was pretty straightforward. At
the time, the first lesson in most of the culturally Christian world was
an explanation of the vision Joseph Smith Jr. had when he was fourteen,
somewhat more complete than I had given her to that point. I will
mention here that the interested reader will find it in <i>The Pearl of Great Price</i>, "Joseph Smith -- History", but otherwise leave it out of this story.<br />
<br />
Giselle
joined the discussion, and, after the discussion, I invited the
missionaries to stay for lunch. But they were on their way to see
Julia's family, and Mrs. Cisneros had invited them for lunch there.<br />
<br />
Julia and Giselle and I ate lunch together, just the three of us.<br />
<br />
"They're awfully young." Julia thoughtfully arranged salad on a second slice of bread spread with peanut butter.<br />
<br />
She
hadn't even commented when I suggested one of our family's mainstay
quick lunches. Well, she did comment on the crunchy, no-sugar,
no-additive peanut butter we bought in bulk from the co-op. She said she
liked being able to taste the peanuts.<br />
<br />
"Only a year younger than you and Joe are."<br />
<br />
"Okay, they seem young. That wasn't really all that persuasive a presentation."<br />
<br />
Giselle
reached out and took Julia's hand, and gave her a searching look. "We
aren't sending missionaries out to convert the whole world."<br />
<br />
"No?"<br />
<br />
"No. We are sending them out to teach people who are ready to listen."<br />
<br />
"Oh." <br />
<br />
<div style="text-align: center;">
***** </div>
<br />
On
the way to the lab, Julia reached over to where my hand rested on the
shift lever, and hesitantly, tentatively covered my hand with hers.<br />
<br />
"Mmm?"<br />
<br />
"Uhm," she started hesitantly.<br />
<br />
"Mmmm?"<br />
<br />
"What if I'm not ready to listen?"<br />
<br />
I
turned my hand over and gave hers a squeeze. "Whether you join the
church and whether you and I end up getting together are two separate
questions." Then I had to turn my hand back over to shift gears.<br />
<br />
She kept her hand over the back of mine, but was silent until we turned right on University Avenue.<br />
<br />
"But if I don't convert, then ..."<br />
<br />
I waited for her to complete the sentence, but she didn't.<br />
<br />
"We'll
ask God what to do then. The missionaries have six discussions they
present. When we get through those, you'll have the basic understanding
of what to do if you're ready. Until then, don't worry about it."<br />
<br />
"Will you still like me?"<br />
<br />
"Too late to ask that question. I already do." <br />
<br />
"I mean, enough to ..."<br />
<br />
"Ask you to marry me anyway?"<br />
<br />
We
were both silent until I parked the car in the west parking lot, and we
started unloading our stuff from the back of the Colt.<br />
<br />
"Well?" she asked.<br />
<br />
I
put the Micro Chroma 68 back down in the bed of the compact station
wagon, took her in my arms, and we stood face to face, lost in each
other's eyes. I nuzzled her nose, and she giggled. Then I gave her a <i>shikkari shita</i> kiss.<br />
<br />
I
suppose it was at least a half minute later when we heard Mike say, in a
voice dripping with sarcasm, "Well if it isn't two love-birds engaged
in a little PDA."<br />
<br />
I felt Julia start, and stiffen, but I
kept my arms around her, and she relaxed before turning to say with a
smile, "Yeah. I guess it is."<br />
<br />
Pat and George were
behind Mike, and neither of them seemed comfortable. Mike looked openly
angry, but he seemed to be trying to keep his anger in check. He shook
his head and walked past us with no further comment, followed by Pat and
George, neither of whom said anything.<br />
<br />
"Whenever you're ready, tell me about Mike."<br />
<br />
Julia leaned into me and buried her face against my shoulder, and mumbled.<br />
<br />
"I didn't understand any of what you just said, but if you're not ready, I'll wait."<br />
<br />
She leaned back and held my gaze with her eyes, letting me see her fear. "I guess it wouldn't be fair to you."<br />
<br />
I said, as gently as I could, "It's your choice when to tell me. I won't act on information I don't have."<br />
<br />
I thought I saw her lower lip quiver before she pulled her face into a tight, wrinkled, hesitant smile.<br />
<br />
"We
dated really seriously in high school. Dad wasn't happy, but Mike and I
promised ourselves to each other. Then Mike seemed to think promises
meant more than I thought they did, and I broke it off."<br />
<br />
"I can see him not being happy with that."<br />
<br />
"He
blamed my faith, and I told him point-blank that I would not accept
that from him. We could still be friends, but I wasn't going to trust
him like that any more."<br />
<br />
I smiled and nodded and gave her what I hoped was a reassuring caress.<br />
<br />
"He tried to take me too far. I can't let that happen. Not before marriage." <br />
<br />
I nodded again, still searching her eyes. After a moment, I guessed, "But there are still some leftover feelings."<br />
<br />
She looked down. "Yes, there are."<br />
<br />
"He's a good-looking guy."<br />
<br />
"You think so?"<br />
<br />
"Absolutely. Watch which of the women in our group are watching him today in the lab."<br />
<br />
"What about ...?"<br />
<br />
"Of
course, looks aren't everything. Still, if he's behaved decently
towards you since then, I would be lying to deny that it's another point
in his favor."<br />
<br />
She still hesitated, then seemed to get courage to be more plain. "What about his race?"<br />
<br />
"African, I suppose."<br />
<br />
"You don't seem to hold that against him, either."<br />
<br />
"Cultural
issues are much more important than race. If I'm not going to hold
religious culture as an issue between you and me, I would be somewhat
lacking to hold race, whatever that is, as an issue with anybody."<br />
<br />
"You're not jealous?"<br />
<br />
"God
only knows what the future holds for him, for me, and for you. At this
point, I can see several paths ahead. If God tells you and me to get
together, and if you are agreed, I'm game. If you aren't, or if God says
no, we'll figure that out when it's time."<br />
<br />
She wrapped herself around me, and I nuzzled the back of her neck.<br />
<br />
"But let's get to the lab before anybody can make up any really egregious rumors about us."<br />
<br />
We both giggled as we grabbed our stuff.<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
Neither
Pat nor George, nor Mike, had mentioned the scene in the parking lot
when we got to the lab, and we just set the computer up and got started.
The lab session turned out to be quite productive.<br />
<br />
Mark
and Jeff helped Suzanne and Winston with their mainboards while
everyone else discussed the keyboard/trainers. I put another diagram up
on the chalkboard to help the discussion. <br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-vcJ0QP-_e88/XuYTo3DvoJI/AAAAAAAACpY/_yrX2L8Oz-Mw3JdmQ4ugEgQbA03s4SWNACLcBGAsYHQ/s1600/keyboard_trainer_block_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="744" data-original-width="1105" height="430" src="https://1.bp.blogspot.com/-vcJ0QP-_e88/XuYTo3DvoJI/AAAAAAAACpY/_yrX2L8Oz-Mw3JdmQ4ugEgQbA03s4SWNACLcBGAsYHQ/s640/keyboard_trainer_block_diagram.png" width="640" /></a></div>
<br />
"Those buffers may be internal to the MCU," I commented as I finished the diagram. <br />
<br />
Since
I hadn't saved an OS image with a complete boot loader, I had to stage
load the OS again using the throw-away loader. But it was just an extra
couple of steps, and several in the group were very interested in
watching me go through the steps.<br />
<br />
"I use the TV-BUG L
command to load the drivers into place from tape." The code was short,
so even though I had saved it to slow tape, it loaded quickly. "My
throw-away loader is with the drivers, so I use the TV-BUG G command to
jump to it, and it loads the Flex OS, then returns to the monitor so we
can check it using the E command. E for examine, I guess."<br />
<br />
Wallace complained, "That's just a bunch of hex numbers."<br />
<br />
"Well,
it's good enough to check Flex's driver vectors and overwrite them with
the M command." I did so. "M for modify. And now we can use the G
command again to go jump through Flex's cold boot vector and boot Flex."<br />
<br />
Flex booted, and we got the prompt again.<br />
<blockquote class="tr_bq">
<span style="color: #38761d;"><span style="background-color: lime;">FLEX 2.1 </span></span><br />
<span style="color: #38761d;"><span style="background-color: lime;">+++ </span></span></blockquote>
With
the Micro Chroma 68 running Flex, I was able to load and run
Motorola's cross assembler for the 6805. That allowed us to assemble and
test code, so several of the students started writing assembly language
code the old-fashioned way, with pencil and paper. There were several
comments about being glad that they wouldn't have to hand-assemble their
programs now, but others noted that we all had to share my computer for
a while.<br />
<br />
Everybody seemed focused on using the 6805's fancy bit I/O instructions.<br />
<br />
Bob
and Jennifer were working
together, and Jennifer typed in their code while Bob read it to her and
checked it over her shoulder, then assembled it and burned it into a
68705 to test. They got their expected output, but then they were stuck
on how to generalize their code without making multiple copies of
blocks of code, changing
each copy a little at a time.<br />
<br />
"This isn't just tedious, it's going to be error-prone, isn't it?" Bob commented, Jennifer nodding her head in agreement.<br />
<br />
Dr. Brown and I agreed.<br />
<br />
We
took a look at several other attempts at decoding the keyboard, but
they also ran into the same problem of needing to use copy/paste
techniques to deal with the whole keyboard matrix.<br />
<br />
Neither Dr. Brown nor I seemed inclined to point them to a different approach, but I had a different suggestion. <br />
<br />
"Tell you what. Let's take a break from the keyboard decoding and look at getting real output on the LEDs." <br />
<br />
"Real output?" Kyle asked.<br />
<br />
"So
far, all we are doing is lighting up segments. Let's make routines we
can call to put actual multi-digit numbers on those LEDs."<br />
<br />
There
were some complaints, but most of the group shifted gears with me. By
this time, Suzanne and Winston's mainboards were giving output, and they
joined us, too.<br />
<br />
I redrew the display block diagram by itself.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-9CfkTODEV8Q/XuYX95r-oDI/AAAAAAAACpk/uShdlXpBJvwLBUHQjOZh7YvIWnF6xFk_gCLcBGAsYHQ/s1600/seven_segment_block_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="283" data-original-width="1024" height="176" src="https://1.bp.blogspot.com/-9CfkTODEV8Q/XuYX95r-oDI/AAAAAAAACpk/uShdlXpBJvwLBUHQjOZh7YvIWnF6xFk_gCLcBGAsYHQ/s640/seven_segment_block_diagram.png" width="640" /></a></div>
<br />
"Is everyone clear on the idea that we will be enabling, or strobing, one digit at a time?"<br />
<br />
Sheryl raised her hand. "No?"<br />
<br />
Bob
stood up and went to the chalkboard. Pointing to the lines coming out
of the left buffer, he said, "All these lines -- wires -- are shared --
connected to each display." Then, pointing to the lines connecting each
display to the buffer along the bottom. "These lines are not shared. We
have to demux them somehow."<br />
<br />
"Yep," I agreed. "Maybe I should draw a diagram of one of the digit elements."<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-VT-rUM8jSoc/Xug3ZrsAOXI/AAAAAAAACp0/aL6vQPtfCbcCah_D3XOT1jSZ72lzuGd1QCLcBGAsYHQ/s1600/seven_segment_block_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="742" data-original-width="599" height="400" src="https://1.bp.blogspot.com/-VT-rUM8jSoc/Xug3ZrsAOXI/AAAAAAAACp0/aL6vQPtfCbcCah_D3XOT1jSZ72lzuGd1QCLcBGAsYHQ/s400/seven_segment_block_diagram.png" width="322" /></a></div>
<br />
"No buffers, no latches, just light emitting diodes in those seven segment LEDs."<br />
<br />
Sheryl's forehead wrinkled. "That's common anode, I guess."<br />
<br />
"Right."<br />
<br />
"And if we have seven banks of those with cathodes connected in parallel, ...," she thought out loud.<br />
<br />
"Ah!" Freddie exclaimed. "You have to activate the anode of each digit separately, or they'll all show the same pattern."<br />
<br />
There was tentative agreement among the electronics students, but the data processing group and Julia were still lost.<br />
<br />
Except Mike wasn't.<br />
<br />
Mike
stood up at the chalkboard where Bob and I were, and started sketching
out the segment matrix. When Bob saw what he was doing, he started
helping.<br />
<br />
I also raised chalk, but Mike pushed my hand away. "Too many cooks," he grumbled.<br />
<br />
I
grinned and stepped back. Then I looked over at Julia with my eyebrows
raised, but she wasn't looking at us. She was checking the reactions of
the other women in the room.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-Db5lclYSiQk/XuhA9cqeI_I/AAAAAAAACqM/BXC2rwhL0K8duCBIydG8ClMRcbEEWijWQCLcBGAsYHQ/s1600/seven_segment_banks_block_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="802" data-original-width="782" height="640" src="https://1.bp.blogspot.com/-Db5lclYSiQk/XuhA9cqeI_I/AAAAAAAACqM/BXC2rwhL0K8duCBIydG8ClMRcbEEWijWQCLcBGAsYHQ/s640/seven_segment_banks_block_diagram.png" width="624" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
"Nicely
done," I said when they were done, and started to reach out for a slap
of the palms, but it didn't look like Mike was going to respond to that.
So I gave them a thumbs-up, and Mike gave me a dirty look.<br />
<br />
Bob
looked at me questioningly, so I gave him and Mike a nod, and they took
over the explanation. When they were done, everyone was satisfied that
activating the strobe for all digits at once would put the same pattern
on every digit, and that it might work to strobe them one at a time. But
there was considerable concern about flicker.<br />
<br />
Dr.
Brown got out his TI programmable calculator with LED readout and had
Wallace turn out the lights. then he walked around the room waving the
calculator so that everyone could see the flicker. Many of the students
commented on having noticed the flicker. I think it was Tanya who
related it to TV flicker.<br />
<br />
I reminded them of the TV
refresh rate, and from there we started calculating the refresh rate for
the seven segment displays. It was agreed that scanning the entire set
of digits thirty times a second should present a somewhat stable
display, which would mean each digit should get a seventh of that
interval, or 1/210 of a second -- between four and five milliseconds.<br />
<br />
With
the lights back on, we talked about setting the 6805's timer to
interrupt at that rate, and pretty soon several groups were putting code
together. By the time Dr. Brown suggested we shut down for the day and
go home, all the groups were able to display arbitrary digits on their
displays, and two of the groups were able to output bytes in
hexadecimal.<br />
<br />
Some of the students were curious about
brightness, and I tried to venture into duty cycle, but Bob suggested
we'd had enough for a day, and I had to agree.<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
"Are you up for some singing tonight?"<br />
<br />
"What?" Julia was lost in thought on the road home.<br />
<br />
"I need to practice for my recital."<br />
<br />
"Recital," she said absently. "You were right. I think every women in that group has some kind of a crush on Mike."<br />
<br />
"Some of the guys, too."<br />
<br />
"I'm not going to pretend to understand that. What's this about a recital?"<br />
<br />
"The singer's diction course I'm taking."<br />
<br />
"Oh, that. You haven't been practicing."<br />
<br />
"Not enough. I probably need to practice a half hour a day for the next two weeks."<br />
<br />
"I love to sing."<br />
<br />
"I know."<br />
<br />
"And I can play the piano for you, too."<br />
<br />
And
that was what we did that night. Julia called her family, and they came
over and we had dinner together, played some rounds of <i>Pit</i> and <i>Uno</i>, and had a two-family sing-along, leaving computers and other difficult questions behind for an evening.<br />
<br />
Julia
and Mom played some four-handed music. And they let me squeeze in some
practice. We sang the hymn, "O God, the Enternal Father" in English and Spanish
before I practiced it in Japanese.<br />
<br />
(Just as a reminder,
Julia is a composite of several of the women I knew in College. If this
story went at the pace of my real life, it would be turgid, and I'm
sure not nearly as interesting to read about. Also, if the fantasy
version of me waited for his first kiss until Helen broke my heart in
the real world, he would also likely be waiting another four years
before digging into computers for real. Events around me would not allow
that, for the purpose of this story.)<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
After Julia gave me a good night hug and went home with her family, Denny called. <br />
<br />
"You up for a trip here next Friday?"<br />
<br />
"What's up?<br />
<br />
"Management
wants a bit of your time without the distractions. They wanted to fly
you in, but I pointed out that it would be just as fast for you to drive
as to catch a flight, and you'd probably want to visit the surplus shop
on Saturday. They said they could pay mileage instead of plane fare, if
you can make it by five or six."<br />
<br />
"Hmm. When do I need to have an answer?"<br />
<br />
"Monday morning."<br />
<br />
<br />
<div style="text-align: right;">
Chapter 13.2: what?</div>
<div style="text-align: center;">
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></div>
<hr />
<i>[Second version backup at </i><i><a href="https://joel-rees-economics.blogspot.com/2020/06/bk01-33209-straits-bringing-up-flex.html">https://joel-rees-economics.blogspot.com/2020/06/bk01-33209-straits-bringing-up-flex.html</a>. <a class="K3JSBVB-dc-a" href="https://www.blogger.com/null" kind="click"> </a></i><br />
<i>Original backed up at <a href="https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-bringing-up-flex.html">https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-bringing-up-flex.html</a>.</i><br />
<i>Some more notes at <a href="https://joel-rees-economics.blogspot.com/2020/06/notes-33209-straits-bringing-up-flex.html">https://joel-rees-economics.blogspot.com/2020/06/notes-33209-straits-bringing-up-flex.html</a>.]</i><br />
<br />
<i> </i><i> </i><br />
<i> </i>零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-66371611371808057722020-06-16T14:36:00.001+09:002020-08-01T13:51:22.557+09:00Notes: 33209: Straits -- Bringing Up FlexNotes for <a href="https://joelrees-novels.blogspot.com/2020/06/33209-straits-bringing-up-flex.html">https://joelrees-novels.blogspot.com/2020/06/33209-straits-bringing-up-flex.html</a>.<br />
<hr />
<br />
<a href="https://joelrees-novels.blogspot.com/2020/06/33209-straits-getting-julia-booted-up.html">Chapter 13.0: Straits -- Getting Julia Booted Up</a><br />
<br />
<h4 style="text-align: center;">
Chapter 13.1: Straits -- Bringing Up Flex</h4>
<br />
<br />
Denny
called about the time we were wrapping up, and Julia got on the
extension in Dad's study to say hi. It seemed it would be appropriate to
make a run to Austin the next weekend, and to leave immediately after
our last morning classes so I could visit with some of the management at
Motorola Friday evening.<br />
<br />
"You, know," Julia said, "if I
went with, maybe I could look for floppy disk drives at that surplus
shop on Saturday before coming back."<br />
<br />
Denny checked
with Denise, and they decided Julia could sleep on the couch in the
living room and I could sleep on the floor in a sleeping bag in the
boys' room. Julia's parents said they thought it would be okay, and Mom
and Dad suggested we pray about it.<br />
<br />
Which we did. No one felt inspired to object, so <br />
<br />
Julia suggested she go with me, so she could go looking for her own disk drives, and Denny and Denise bo<br />
<br />
<br />
Talk about duty cycle and mention DtoA as a way to adjust brightness.<br />
<br />
<br />
Watching
the students work on the keyboard and keypad matrix decoding,
became clear to me that, while the bit I/O instructions might be useful
for certain singular, non-generalized kinds of code, a keyboard or
keypad matrix contained a lot of repeated elements. Ultimately, shifts
and logical instructions would provide the more
general scalable solution.<br />
<br />
After about a half hour of <br />
<br />
<br />
I
stood up and demonstrated the concept of a state array for the matrix,
then suggested we put it on a back burner and look at the seven-segment
LED displays. This time, the bit I/O instructions were ignored, and
several groups formed around defining an array of the segment patterns
for each integer. Some of the students wanted to turn the translation
array upside down for some reason, but I didn't stop them. <br />
<br />
Suzanne's
and Winston's and Winston's mainboards were both up enough to display
the TV-BUG prompt by this point, and the four of them joined the rest on
the keyboard/trainers.<br />
<br />
Since Flex was running on my
Micro Chroma 68, I was able to load the cross-assembler, and we had
several students burn code into their 68705s for testing before time to
shut down.<br />
<br />
Even as productive as the session was, no one got their s<br />
<br />
<br />
Mike kept trying to work out how to set the keyboard state up as an array, but he couldn't seem to quite pin it down.<br />
<br />
M <br />
<br />
<br />
<br />
<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
<br />
"Floppies multiplying like rabbits," I grumbled.<br />
<br />
She laughed. <br />
<br />
<br />
<br />
Julia returned to working on her keyboard/trainer, while I dug back into my test routines. Shortly, I thought I had <br />
<br />
tendency to idealize/idolize foreign<br />
<br />
<br />
<div style="text-align: right;">
Chapter 13.2: what?</div>
<div style="text-align: center;">
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></div>
<hr />
<i>[Backed up at <a href="https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-bringing-up-flex.html">https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-bringing-up-flex.html</a>.]</i><br />
<br />零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-67775078170025312682020-06-16T14:36:00.000+09:002020-06-16T21:28:53.997+09:00Backup: 33209: Straits -- Bringing Up FlexBackup of <a href="https://joelrees-novels.blogspot.com/2020/06/33209-straits-bringing-up-flex.html">https://joelrees-novels.blogspot.com/2020/06/33209-straits-bringing-up-flex.html</a>.<br />
<hr />
<br />
<a href="https://joelrees-novels.blogspot.com/2020/06/33209-straits-getting-julia-booted-up.html">Chapter 13.0: Straits -- Getting Julia Booted Up</a><br />
<br />
<h4 style="text-align: center;">
Chapter 13.1: Straits -- Bringing Up Flex</h4>
<br />
Julia waited patiently while I disappeared down the rabbit hole again.<br />
<br />
"So,
you let the drives do their exercises all night, and they didn't mess
up so bad that a retry wouldn't fix it. So now you can load this
operating system into memory."<br />
<br />
"Yeah, now we can be fairly confident that we can load the OS into RAM with these disk drives." <br />
<br />
"But even if you wrote a program to read the operating system into memory in the place it's supposed to go, it wouldn't run?"<br />
<br />
"Maybe
I'm wrong and it might. But it looks like it will either run off a
cliff when it calls I/O routines that it expects to be there but aren't,
or it will go looking for those routines, not find them, and give up.
And I'm not sure we'll know which is happening, beyond that it doesn't
do what we expect it to."<br />
<br />
"That's not very friendly."<br />
<br />
"I'm
sure they don't have manpower to handle every variation. And that means
I get to try to figure it out. Oh. I think I found something here."<br />
<br />
"What?"<br />
<br />
"Hang
on." I scanned again through several pages in the manuals I had on my
lap. "This entry shows an area where the standard disk drivers are, and
there are vectors that they can be called through at the beginning. If
my drivers imitate drivers for Western Digital controllers closely
enough, I should be able to overwrite those vectors with jumps to my own
code."<br />
<br />
"I'm lost."<br />
<br />
"Vectors are like pointers to where the drivers are actually stored."<br />
<br />
"Oh-kay. So you have to write new drivers and put them where the existing drivers are?"<br />
<br />
"I'm
thinking I'll put them outside the memory Flex uses and just overwrite
the vectors that are there for linking through. That should minimalize
potential for damage."<br />
<br />
"As if I knew anything about the question I just asked, much less what you just said."<br />
<br />
She laughed, and I leaned over and hugged her.<br />
<br />
"It's
sure noice to have someone to talk with while I'm down in the rabbit
hole. I'll show you where the vectors are when I get things put
together."<br />
<br />
"I'm looking forward to it."<br />
<br />
"I guess my first project is to copy the disks they sent me, so that, if I mess something up, we have a backup."<br />
<br />
"Good idea. How are you going to do that?"<br />
<br />
"The test routines should help. But it's a little scary. I'm worried that my drives will malfunction."<br />
<br />
"Isn't there some way to prevent the originals from being copied over?"<br />
<br />
I
showed her the write protect notch on the floppy cover and a strip of
write-protect tape from the box of floppies I'd bought in Austin. "This
is backwards of good engineering, but if I cover this notch with this
tape it should protect the disk -- if the drive electronics function
correctly."<br />
<br />
"Doubt your own work?"<br />
<br />
"Yeah. I haven't actually made it protected in hardware."<br />
<br />
"Well, maybe you should. Why is it backwards?"<br />
<br />
"Uhm,
I guess maybe it depends on how you look at things, but I'd rather it
be protected if the tape falls off. You know, some computers implement
write-protect in the driver software instead of the controller hardware,
so I could make my drives work the way I prefer. But you're right, I
should add the write-protect circuitry."<br />
<br />
I dug up my
diagrams, and drew in some additional logic. "If I add a few gates here,
and connect a bit of the controller I/O here, I can make the controller
respect the write-protect notch by default, but allow the controller to
invert the sense."<br />
<br />
"Make it complicated? Why not just do it normal and keep it simple."<br />
<br />
"Keep it simple. That's actually an engineering principle wih an acronym. K-I-S-S."<br />
<br />
"Okay." She leaned over and gave me a peck on the lips. "And that's three times, now."<br />
<br />
I grinned.<br />
<br />
"So what's the second 'S'?"<br />
<br />
I
dropped my head and coughed. "Erm, you have to understand, it's a
special bit of engineering jargon. It sounds a little, uhm, stupid, but
it has special meaning."<br />
<br />
"Okay. So tell me."<br />
<br />
"It's 'stupid'."<br />
<br />
"You said that."<br />
<br />
"Quote stupid un-quote."<br />
<br />
"Oh." Now she gave me a sharp look.<br />
<br />
"It means, not trying to be too smart."<br />
<br />
"Uh-huh."<br />
<br />
"No, seriously."<br />
<br />
"I believe you." She laughed. "But I think I'll remember this one."<br />
<br />
"Heh."<br />
<br />
"So, the write-protect circuit."<br />
<br />
"Keep
it simple. I have the sensor hooked into the controller's CPU, although
the controller ignores it now. I could do this in the controller's
firmware, and that would mean I wouldn't be depending on the driver
software in the computer. I did hook the sensor up to a port bit, so
that should work okay."<br />
<br />
"Does that mean re-programming the controller?"<br />
<br />
"Yeah. Hmm. While I'm in it, I think I'll add a switch to allow it to switch between FM and MFM on the fly."<br />
<br />
Julia
watched and asked questions, and listened to my answers, while I put a
68701 in the EPROM eraser, loaded the floppy controller source code from
tape, added the code to handle write-protect and the FM/MFM switch, and
programmed the new controller.<br />
<br />
For a test, I wrote a
quick routine to duplicate and check a single-sided disk in the second
drive to the first drive and used it to duplicate one of my test
floppies. Then I tried to used my disks to duplicate the OS disk.<br />
<br />
"Error."<br />
<br />
"What kind of error?"<br />
<br />
"It won't read TSC's floppy."<br />
<br />
We both sat and thought for a minute.<br />
<br />
"Can you do it with Giselle's computer?"<br />
<br />
"Worth a try."<br />
<br />
We
went in to Giselle's room, and she agreed to set the project she was
working on aside long enough to let me try to make a copy. I attached
one of my drives to her Color Computer controller as a second drive and
wrote a quick program in EDTASM+., then inserted the disks.<br />
<br />
"Error."<br />
<br />
"Could the disk be bad?" <br />
<br />
"Let
me look up the error code." I thumbed through Giselle's manual. "Format
error. But I'm reading it in raw format, so that shouldn't make a
difference."<br />
<br />
I thanked Giselle, and we took our stuff back to my room.<br />
<br />
"I guess I'm going to have to wait 'til Monday and give them a call."<br />
<br />
"TSC?"<br />
<br />
"Yeah."<br />
<br />
"Nobody in today?"<br />
<br />
I
gave her a quizzical look. "Might be. Worth a try. It's even not the
most expensive time to call. But let me make sure what I'm going to ask
before we do."<br />
<br />
And I dug back into the manuals.<br />
<br />
"Oh, look at this."<br />
<br />
"What?"<br />
<br />
"The disk they sent is FM."<br />
<br />
Julia looked up at my stereo tuner.<br />
<br />
"You've been waiting a whole week to say that." I laughed, and she laughed.<br />
<br />
"Without words. Not the same FM, I guess? And no AM?"<br />
<br />
"AM. The bit clock is the carrier, so 0 is absence of clock and 1 is presence. Ick."<br />
<br />
I reached for some paper, but she put her hand on mine and stopped me. <br />
<br />
"Just joking about the AM."<br />
<br />
"Okay, okay, I'll see if I can puzzle that one out later."<br />
<br />
The
changes to duplicate the FM disk were quick, and the copy proceeded
without further error. "And that was verify-after-write, so it should be
gold."<br />
<br />
"I guess my suggestion to call wasn't necessary?"<br />
<br />
I
wrinkled my brow and leaned over and gave her a peck on the lips, but
stayed close. "It was part of the conversation, and kept me from getting
stalled." My eyes searched hers.<br />
<br />
She returned my searching look. "Just to be safe, make another?"<br />
<br />
"Good
idea." I sat back, with some regrets, and made the second copy, then
copied the second of the two <strike>disks TSC had sent.</strike> OS disks TSC had sent, the utilities disk, "Just for good
measure."<br />
<br />
We shared a hug.<br />
<br />
"Okay, now I need to write the drivers."<br />
<br />
Because
I'd been constructing the controllers to emulate the Western Digital
controllers, the basic drivers were a straightforward extract from my
test code.<br />
<br />
"And now the throw-away loader."<br />
<br />
"Throw-away?"<br />
<br />
"If
it works, I'll only use it once to load Flex into memory without the
drivers. Then we'll be running Flex, and I'll use Flex to make a
bootable disk that contains the drivers. I will probably base the boot
loader on it later. Since it's throw-away, I can write it to run
anywhere. Maybe I should just put it after my drivers, so I can keep the
drivers and the loader together."<br />
<br />
I was in good form, the loader ran the first time, and I was able to boot Flex. Flex's prompt came up on the screen.<br />
<blockquote class="tr_bq">
<span style="color: #38761d;"><span style="background-color: lime;">FLEX 2.1 </span></span><br />
<span style="color: #38761d;"><span style="background-color: lime;">+++ </span></span></blockquote>
I turned to Julia with a hand outstretched for a slap of the palm, but she wrapped her arms around me and gave me a しっかりした kiss.<br />
<br />
<blockquote class="tr_bq">
<i>Shikkari.</i> </blockquote>
When
I was a new missionary, I hated that word. It seemed to mean whatever
fit the speaker's sense of what was right, and it seemed to ignore the
right of the person being spoken to to have any sense.<br />
<blockquote class="tr_bq">
しっかりした体格 <i>shikkari shita taikaku</i> -- proper build/physique (solid build)</blockquote>
<blockquote class="tr_bq">
しっかりしなさい! <i>Shikkari shinasai!</i> -- Do it right! (Hold it together! or Hang in there!)</blockquote>
Righteous kiss? Proper kiss? Solid kiss?<br />
<br />
Okay, I liked it. And it wasn't just a quick buss.<br />
<br />
"Ahem," Giselle's voice interrupted. "I hate to interrupt, but, uhm, the missionaries are here?"<br />
<br />
We broke apart and turned in unison to give Giselle a guilty look.<br />
<br />
She smirked. "Well, it's none of my business, but, since the missionaries <i>are</i> here, maybe you two should save that."<br />
<br />
We both stood up a little unsteadily, left the computer at the Flex prompt, and went to meet the missionaries.<br />
<br />
<div style="text-align: center;">
***** </div>
<br />
The
discussion we had with the missionaries was pretty straightforward. At
the time, the first lesson in most of the culturally Christian world was
a more complete explanation of the vision Joseph Smith Jr. had when he
was fourteen. I will mention that the interested reader will find it in <i>The Pearl of Great Price</i>, "Joseph Smith -- History", but otherwise leave it out of the story here.<br />
<br />
Giselle
joined the discussion, and, after the discussion, I invited the
missionaries to stay for lunch. But they were on their way to see
Julia's family, and Mrs. Cisneros had invited them for lunch there.<br />
<br />
Julia and Giselle and I ate lunch together, just the three of us.<br />
<br />
"They're awfully young." Julia thoughtfully arranged salad on a second slice of bread spread with peanut butter.<br />
<br />
She
hadn't even commented when I suggested one of our family's mainstay
quick lunches. Well, she did comment on the crunchy, no-sugar,
no-additive peanut butter we bought in bulk from the co-op. She said she
liked being able to taste the peanuts.<br />
<br />
"Only a year younger than you and Joe are."<br />
<br />
"Okay, they seem young. That wasn't really all that persuasive a presentation."<br />
<br />
Giselle
reached out and took Julia's hand, and gave her a searching look. "We
aren't sending missionaries out to convert the whole world."<br />
<br />
"No?"<br />
<br />
"No. We are sending them out to teach people who are ready to listen."<br />
<br />
"Oh."<br />
<br />
<div style="text-align: center;">
***** </div>
<br />
On
the way to the lab, Julia reached over to where my hand rested on the
shift lever, and hesitantly, tentatively covered my hand with hers.<br />
<br />
"Mmm?"<br />
<br />
"So," she paused. "What if I'm not ready to listen?"<br />
<br />
I
turned my hand over and gave hers a squeeze. "Whether you join the
church and whether you and I end up getting together are two separate
questions." Then I had to turn my hand back over to shift gears.<br />
<br />
She kept her hand on mine, but was silent until we turned right on University Avenue.<br />
<br />
"But if I don't convert, then ..."<br />
<br />
I waited for her to complete the sentence, but she didn't.<br />
<br />
"We'll
ask God what to do then. The missionaries have six discussions they
present. When we get through those, you'll have the basic understanding
of what to do if you're ready. Until then, don't worry about it."<br />
<br />
"Will you still like me?"<br />
<br />
"Too late to ask that question. I already do." <br />
<br />
"I mean, enough to ..."<br />
<br />
"Ask you to marry me anyway?"<br />
<br />
We
were both silent until I parked the car in the west parking lot, and we
started unloading our stuff from the back of the Colt.<br />
<br />
"Well?" she asked.<br />
<br />
I
put the Micro Chroma 68 back down in the bed of the compact station
wagon, took her in my arms, and we stood face to face, lost in each
other's eyes. I nuzzled her nose, and she giggled. Then I gave her a <i>shikkari shita</i> kiss.<br />
<br />
I
suppose it was at least a half minute later when we heard Mike say, in a
voice dripping with sarcasm, "Well if it isn't two love-birds engaged
in a little PDA."<br />
<br />
I felt Julia start, and stiffen, but I
kept my arms around her, and she relaxed before turning to say with a
smile, "Yeah. I guess it is."<br />
<br />
Pat and George were
behind Mike, and neither of them seemed comfortable. Mike looked openly
angry, but he seemed to be trying to keep his anger in check. He shook
his head and walked past us with no further comment, followed by Pat and
George, neither of whom said anything.<br />
<br />
"Whenever you're ready, tell me about Mike."<br />
<br />
Julia leaned into me and buried her face against my shoulder, and mumbled.<br />
<br />
"I didn't understand any of what you just said, but if you're not ready, I'll wait."<br />
<br />
She leaned back and held my gaze with her eyes, letting me see her fear. "I guess it wouldn't be fair to you."<br />
<br />
I said, as gently as I could, "It's your choice when to tell me. I won't act on information I don't have."<br />
<br />
I thought I saw her lower lip quiver before she pulled her face into a tight, wrinkled, hesitant smile.<br />
<br />
"We
dated really seriously in high school. Dad wasn't happy, but Mike and I
promised ourselves to each other. Then Mike seemed to think promises
meant more than I thought they did, and I broke it off."<br />
<br />
"I can see him not being happy with that."<br />
<br />
"He
blamed my faith, and I told him point-blank that I would not accept
that from him. We could still be friends, but I wasn't going to trust
him like that any more."<br />
<br />
I smiled and nodded and gave her back what I hoped was a reassuring caress.<br />
<br />
"He tried to take me too far. I can't let that happen. Not before marriage." <br />
<br />
I nodded. After a moment, I guessed, "But there are still some leftover feelings."<br />
<br />
She looked down. "Yes, there are."<br />
<br />
"He's a good-looking guy."<br />
<br />
"You think so?"<br />
<br />
"Absolutely. Watch which of the women in our group are watching him today in the lab."<br />
<br />
"What about ...?"<br />
<br />
"Of
course, looks aren't everything. Still, if he's behaved decently
towards you since then, I would be lying to deny that it's another point
in his favor."<br />
<br />
She still hesitated, then seemed to get courage to be more plain. "What about his race?"<br />
<br />
"African, I suppose."<br />
<br />
"You don't seem to hold that against him, either."<br />
<br />
"Cultural
issues are much more important than race. If I'm not going to hold
religious culture as an issue between you and me, I would be somewhat
lacking to hold race, whatever that is, as an issue with anybody."<br />
<br />
"You're not jealous?"<br />
<br />
"God
knows what the future holds for him, for me, and for you. At this
point, I can see several paths ahead. If God tells you and me to get
together, and if you are agreed, I'm game. If you aren't, or if God says
no, we'll figure that out when it's time."<br />
<br />
She wrapped herself around me, and I nuzzled the back of her neck.<br />
<br />
"Let's get to the lab before anybody can make up any really egregious rumors about us."<br />
<br />
We both giggled as we grabbed our stuff.<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
Neither
Pat nor George, nor Mike, had mentioned the scene in the parking lot
when we got to the lab, and we just set the computer up and got started.
The lab session turned out to be quite productive.<br />
<br />
Mark
and Jeff helped Suzanne and Winston with their mainboards while
everyone else discussed the keyboard/trainers. I put another diagram up
on the chalkboard to help the discussion. <br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-vcJ0QP-_e88/XuYTo3DvoJI/AAAAAAAACpY/_yrX2L8Oz-Mw3JdmQ4ugEgQbA03s4SWNACLcBGAsYHQ/s1600/keyboard_trainer_block_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="744" data-original-width="1105" height="430" src="https://1.bp.blogspot.com/-vcJ0QP-_e88/XuYTo3DvoJI/AAAAAAAACpY/_yrX2L8Oz-Mw3JdmQ4ugEgQbA03s4SWNACLcBGAsYHQ/s640/keyboard_trainer_block_diagram.png" width="640" /></a></div>
<br />
"Those buffers may be internal to the MCU," I commented as I finished the diagram. <br />
<br />
With the Micro Chroma 68 running Flex, I was able to load and run
Motorola's cross assembler for the 6805, allowing us to assemble and test code.<br />
<br />
We
took a look at several attempts at decoding the keyboard. Everybody
seemed focused on using the 6805's bit I/O instructions, and we kept
running into similar blind alleys.<br />
<br />
Bob and Jennifer were working
together, and Jennifer typed in their code with Bob reading over her shoulder, assembled it, and burned it into a
68705 to test. They got their expected output, but then they were stuck
on how to generalize their code without making many copies of the code, changing
each copy a little at a time.<br />
<br />
"This isn't just tedious, it's going to be error-prone, isn't it?" Bob commented, Jennifer nodding her head in agreement. <br />
<br />
Neither Dr. Brown nor I commented, but I had a suggestion. <br />
<br />
"Tell you what. Let's take a break from the keyboard decoding and look at getting real output on the LEDs." <br />
<br />
"Real output?"<br />
<br />
"So far, all we are doing is lighting up segments. Let's make routines to put actual multi-digit numbers on those LEDs."<br />
<br />
There
were some complaints, but most of the group shifted gears with me. By
this time, Suzanne and Winston's mainboards were giving output, and they
joined us, too.<br />
<br />
I redrew the display block diagram by itself.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-9CfkTODEV8Q/XuYX95r-oDI/AAAAAAAACpk/uShdlXpBJvwLBUHQjOZh7YvIWnF6xFk_gCLcBGAsYHQ/s1600/seven_segment_block_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="283" data-original-width="1024" height="176" src="https://1.bp.blogspot.com/-9CfkTODEV8Q/XuYX95r-oDI/AAAAAAAACpk/uShdlXpBJvwLBUHQjOZh7YvIWnF6xFk_gCLcBGAsYHQ/s640/seven_segment_block_diagram.png" width="640" /></a></div>
<br />
"Is everyone clear on the idea that we will be enabling, or strobing, one digit at a time?"<br />
<br />
Sheryl raised her hand. "No?"<br />
<br />
Bob
stood up and went to the chalkboard. Pointing to the lines coming out
of the left buffer, he said, "All these lines -- wires -- are shared --
connected to each display." Then, pointing to the lines connecting each
display to the buffer along the bottom. "These lines are not shared. We
have to demux them somehow."<br />
<br />
"Yep," I agreed. "Maybe I should draw a diagram of one of the digit elements."<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-VT-rUM8jSoc/Xug3ZrsAOXI/AAAAAAAACp0/aL6vQPtfCbcCah_D3XOT1jSZ72lzuGd1QCLcBGAsYHQ/s1600/seven_segment_block_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="742" data-original-width="599" height="400" src="https://1.bp.blogspot.com/-VT-rUM8jSoc/Xug3ZrsAOXI/AAAAAAAACp0/aL6vQPtfCbcCah_D3XOT1jSZ72lzuGd1QCLcBGAsYHQ/s400/seven_segment_block_diagram.png" width="322" /></a></div>
<br />
"No buffers, no latches, just light emitting diodes in those seven segment LEDs."<br />
<br />
Sheryl's forehead wrinkled. "That's common anode, I guess."<br />
<br />
"Right."<br />
<br />
"And if we have seven banks of those with cathodes connected in parallel, ...," she thought out loud.<br />
<br />
"Ah!" Freddie exclaimed. "You have to activate the anode of each digit separately, or they'll all show the same pattern."<br />
<br />
There
was tentative agreement among the electronics students, but the data
processing group and Julia were all still lost. Except for Mike.<br />
<br />
Mike
joined Bob and me at the chalkboard, and started sketching out the
segment matrix. When Bob saw what he was doing, he started helping.<br />
<br />
I also raised chalk, but Mike pushed my hand away. "Too many cooks," he grumbled.<br />
<br />
I
grinned and stepped back. Then I looked over at Julia with my eyebrows
raised, but she wasn't looking at us. She was checking the reactions of
the other women in the room.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-Db5lclYSiQk/XuhA9cqeI_I/AAAAAAAACqM/BXC2rwhL0K8duCBIydG8ClMRcbEEWijWQCLcBGAsYHQ/s1600/seven_segment_banks_block_diagram.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="802" data-original-width="782" height="640" src="https://1.bp.blogspot.com/-Db5lclYSiQk/XuhA9cqeI_I/AAAAAAAACqM/BXC2rwhL0K8duCBIydG8ClMRcbEEWijWQCLcBGAsYHQ/s640/seven_segment_banks_block_diagram.png" width="624" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
"Nicely
done," I said when they were done, and started to reach out for a slap
of the palms, but it didn't look like Mike was going to respond to that.
So I gave them a thumbs-up, and Mike gave me a dirty look.<br />
<br />
Bob
looked at me questioningly, so I gave him and Mike a nod, and they took
over the explanation. When they were done, everyone was satisfied that
activating the strobe for all digits at once would put the same pattern
on every digit, and that it might work to strobe them one at a time. But
there was considerable concern about flicker.<br />
<br />
Dr.
Brown got out his TI programmable calculator with LED readout and had
Wallace turn out the lights. then he walked around the room waving the
calculator so that everyone could see the flicker. Many of the students
commented on having noticed the flicker. I think it was Tanya who
related it to TV flicker.<br />
<br />
I reminded them of the TV
refresh rate, and from there we started calculating the refresh rate. It
was agreed that scanning the entire set of digits thirty times a second
should present a somewhat stable display, which would mean each digit
should get a seventh of that, or 1/210 of a second -- between four and
five milliseconds.<br />
<br />
With the lights back on, we talked
about setting the 6805's timer to interrupt at that rate, and pretty
soon several groups were putting code together. By the time Dr. Brown
suggested we shut down and go home, all the groups were able to display
arbitrary digits on their displays, and two of the groups were able to
output bytes in hexadecimal.<br />
<br />
Some of the students were
curious about brightness, and I tried to venture into duty cycle, but
Bob suggested we'd had enough for a day, and I had to agree.<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
"Are you up for some singing tonight?"<br />
<br />
"What?" Julia was lost in thought on the road home.<br />
<br />
"I need to practice for my recital."<br />
<br />
"Recital," she said absently. "You were right. I think every women in that group has some kind of a crush on Mike."<br />
<br />
"Some of the guys, too."<br />
<br />
"I'm not going to pretend to understand that. What's this about a recital?"<br />
<br />
"The singer's diction course I'm taking."<br />
<br />
"Oh, that. You haven't been practicing."<br />
<br />
"Not enough. I probably need to practice a half hour a day for the next two weeks."<br />
<br />
"I love to sing."<br />
<br />
"I know."<br />
<br />
"Yeah. And I can play the piano for you, too."<br />
<br />
And
that was what we did that night. Julia called her family, and they came
over and we had dinner together, played some rounds of <i>Pit</i> and <i>Uno</i>, and had a two-family sing-along, leaving computers and other difficult questions behind for an evening.<br />
<br />
Julia
and Mom played some four-handed music. And they let me squeeze in some
practice. We sang the hymn, "O God, the Enternal Father" in English
before I practiced it in Japanese.<br />
<br />
(Just as a reminder,
Julia is a composite of several of the women I knew in College. If this
story went at the pace of my real life, it would be turgid, and I'm
sure not nearly as interesting to read about. Also, if the fantasy
version of me waited until Helen broke my heart in the real world for
his first kiss, he would also likely be waiting another four years
before digging into computers for real. Events around me would not allow
that, for the purpose of this story.)<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
<strike>After Julia and her family went home, Denny called.</strike><br />
After Julia gave me a good night hug and went home with her family, Denny called.<br />
<br />
"You up for a trip here next Friday?"<br />
<br />
"What's up?<br />
<br />
"Management
wants a bit of your time without the distractions. They want to fly you
out, but I explained that you would probably want to visit the surplus
shop on Saturday. So they agreed to pay your gas instead of your plane
fare, if you can make it by five."<br />
<br />
"Hmm. When do I need to have an answer?"<br />
<br />
"Monday morning."<br />
<br />
<div style="text-align: right;">
Chapter 13.2: what?</div>
<div style="text-align: center;">
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></div>
<hr />
<i>[Backed up at <a href="https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-bringing-up-flex.html">https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-bringing-up-flex.html</a>.]</i><br />
<br />
<i> </i><i> </i><br />
<i> </i>零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-35942899575694074752020-06-09T21:41:00.000+09:002020-06-16T23:09:16.382+09:00Notes: 33209: Straits -- Booting Up<br />
Notes for <a href="https://joelrees-novels.blogspot.com/2020/06/33209-straits-booting-up.html">https://joelrees-novels.blogspot.com/2020/06/33209-straits-booting-up.html</a>.<br />
<hr />
<br />
<a href="https://joelrees-novels.blogspot.com/2020/06/33209-storm-warnings-exercising-diskette-drives-controllers.html">Chapter 12: Storm Warnings, and Exercising Diskette Drives and Controllers</a><br />
<br />
<h4 style="text-align: center;">
Chapter 13: Storms</h4>
<br />
<br />
+=+=<br />
<br />
Working together on something that lets us talk about religion.<br />
<br />
She needs to understand my culture, and I need to understand hers, etc.<br />
<br />
<br />
Sat. Morning -- <br />
<br />
<br />
Need to realize the dependency on limited existing solutions because of lack of source code for Flex, here. <br />
<br />
<br />
Then we got Julia's Micro Chroma out, and I checked her work. (NO I DON'T!)<br />
<br />
"Looking good."<br />
<br />
"I'm getting to where I feel pretty confident with what I'm doing."<br />
<br />
I got out my tools and she got to work on finishing the daughterboard while I watched.<br />
<br />
"You don't need to watch me."<br />
<br />
"Spoil my fun."<br />
<br />
"Quit that." She grinned. "Where are those packages your mom gave you yesterday?"<br />
<br />
"Oh. Yeah. The operating system and the Forth."<br />
<br />
"Fourth what?"<br />
<br />
"Hang on."<br />
<br />
I went into my room and brought out the two thick envelopes that
had come the day before. I held up the one from Mountain View Press before opening it up.<br />
<br />
The envelope contained two thick photocopied manuals, about two hundred pages
total, and a cassette. One manual, with a kind of baby blue cover, was
titled, <i>APPLE II fig-FORTH INSTALLATION MANUAL AND ASSEMBLY SOURCE LISTING WITH GLOSSARY</i>, and the other, with a pink cover, was titled <i>fig-FORTH FOR 6800 ASSEMBLY SOURCE LISTING</i>. The cassette was labeled <i>fig-FORTH FOR 6800 ASSEMBLY SOURCE</i>.<br />
<br />
"Fig? Forth?" She looked at me suspiciously.<br />
<br />
"Fig is a three letter acronym for Forth Interest Group."<br />
<br />
"Forth from a fig leaf."<br />
<br />
"Interesting," I raised my eyebrows with a wry smile, "because Forth is said to be close to the bare metal."<br />
<br />
"Metal, as in music?"<br />
<br />
I had to let out a quiet laugh. "Bare metal, as in speaking to the computer in machine language."<br />
<br />
"Clearly an inside joke I'm not privy to." She gave me a discontented look.<br />
<br />
"Okay, I thought we'd start with Flex, but it looks like we'll start with Forth."<br />
<br />
"What's the difference?"<br />
<br />
"Let's find out."<br />
<br />
While she worked on the Micro Chroma, I read the fig-Forth manuals.<br />
<br />
"You know," Julia paused after soldering a wire in place on the daughterboard. "We really do need to talk about religion."<br />
<br />
I set the manuals down and searched her face. "Are you sure?"<br />
<br />
"I've
talked with my mom and my dad. Reverend Johansen has come over to talk
while I've been over here, and my parents are more than a little mad at
him. I'm a little scared. Why does church have to be so important? You
believe in Jesus, I believe in Jesus, isn't that good enough?"<br />
<br />
"Joseph Smith talked with Jesus."<br />
<br />
She picked up a spool of wire wrap wire, measured and cut another length, stripped the ends, and soldered it into place.<br />
<br />
"Have you?"<br />
<br />
"Not exactly. I have talked with God, though."<br />
<br />
"Prayer." She stared another.<br />
<br />
"When you pray, does God answer?"<br />
<br />
"Not always."<br />
<br />
"Have you prayed about me, about which direction our relationship should take?"<br />
<br />
"Sort-of. Not in so many words, maybe."<br />
<br />
"We should both pray."<br />
<br />
"Can we pray now?" She set the iron and the daughterboard down and took my hands, looking into my eyes.<br />
<br />
"I'm already praying in my heart."<br />
<br />
"What are your praying for?"<br />
<br />
I almost said something I'd have regretted, but my tongue was held.<br />
<br />
"Well?"<br />
<br />
"The
Spirit seems to tell me to let you pray first. Then I'll pray, and
then, if you want, you can pray again. But we need to pray alone tonight
because, while we're together, it's hard to see beyond the immediate."<br />
<br />
We did so, and then we returned to what we were working on.<br />
<br />
"So what do I need to know to become a Mormon?"<br />
<br />
"Mormon was a prophet of God the Father, and of Jesus. I think he'd ask you how converted you are to Jesus."<br />
<br />
She looked puzzled. <br />
<br />
"I
am culturally Mormon. Sort of. My parents are a bit non-conformist. You
might want to become familiar with Mormon culture, or you might not.
But becoming 'Mormon' in a sense of religion is not what either Mormon
or I would advise."<br />
<br />
"Outward church, inward church?"<br />
<br />
"Maybe that's close enough."<br />
<br />
"Wheat and tares?"<br />
<br />
"Separate question." <br />
<br />
She
put her tools down again. "You can be so ... analytical ...
exasperating." And she chuckled in resignation. "Where did I get that
from?"<br />
<br />
"It's not a word you'd use?"<br />
<br />
"Not when I'm trying to convince this magnificent man to give me his heart."<br />
<br />
"There's a problem. I'm not a magnificent man, but you have my heart."<br />
<br />
"Then I can ask you to kiss me?"<br />
<br />
I
chuckled in agony and dropped my head. I breathed deeply, then turned
to face Julia, my left knee touching her right. I took her hands and
leaned forward, and we pressed our lips together, then drew apart.<br />
<br />
(This
experience was still five years away for the real me. Julia is, as I
believe I have both mentioned and implied, a combination of several of
the women I knew and several I counted as close friends. The plot of
this fantasy won't allow the me of this story to wait for Helen to break
my heart for good. So I need Julia in the story.)<br />
<br />
"Ahem. Sorry to interrupt, but I need some help."<br />
<br />
We turned in unison to look at Giselle.<br />
<br />
She looked truly remorseful. "I'm stuck, and neither Dad nor Mom can't get me out." <br />
<br />
We both went into
Giselle's room and helped work out some problem she was having with a
saved file that she couldn't get to read back in, then went back to the
living room.<br />
<br />
<br />
"Forth is interesting, but it won't help us program 6805s," I announced as we sat down.<br />
<br />
Julia sighed. "Let's see if we can get my Micro Chroma to boot to the monitor prompt tonight."<br />
<br />
"How's it coming?"<br />
<br />
"Just a little more."<br />
<br />
Shortly,
she had the last wires in place. I gave it a visual check, and we
plugged it in to the power supply in the Micro Chroma 68, and it booted
up to the Monitor prompt. That was an excuse for a kiss, and then I
plugged the Micro Chroma's keyboard in and she typed in some monitor
commands which successfully returned results. And that was an excuse for
another kiss.<br />
<br />
"I think I should go call the
missionaries and see if they can come over tomorrow morning. Explaining
what joining the church means is their job."<br />
<br />
"You used to be a missionary."<br />
<br />
"True, but it's not my job any more. My job is now to be the best example I can, whatever that is."<br />
<br />
"I think you're a pretty good example."<br />
<br />
"Heh. I'll go call now. Ten or eleven tomorrow morning okay? It'll take six or seven visits with them, about an hour each visit.<br />
<br />
"You'll be there, too?"<br />
<br />
"Of course. That is definitely my job now."<br />
<br />
She rewarded me with another kiss. "Are you going to pray about us tonight?"<br />
<br />
"I pray about us every night, lately."<br />
<br />
"Me, too."<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Instead,
Julia listened patiently while I explained the program I needed to
write, to generate generate a lot of pseudo-random data that would
exercise the dark corners of my controller. Since the data produced by
the program was deterministic, but with a distribution of values that
resembled theoretical randomness, it could be recreated in the read
pass, allowing me to test several times that what was written was the
same as what the controller read back, without having to have a known
good controller and a known good disk to compare with.<br />
<br />
The program was done by the time I finished explaining it. <br />
<br />
Then
I borrowed Giselle's computer just long enough to write the initial
read test disk on the CoCo. That took about ten minutes, and Giselle and
Julia and Dad and Mom chatted in the kitchen while I worked.<br />
<br />
I
got the Micro Chroma 68 set up to read and check what it read in an
endless cycle, counting the number of errors. I set it up to retry on
errors, and to count the number of retries, and the number of times a
retry did not get a good read. <br />
<br />
With the exerciser
routine started, we had a little scripture study, chasing down the
concept of stewardship relative to revelation and commandments.<br />
<br />
Then I drove Julia home. And we kissed each other on the cheeks, because we didn't want to risk anything more.<br />
<br />
<br />
<br />
<br />
<br />
<br />
"Which is most interesting?" I asked, semi-rhetorically, raising my
eyebrows as I sat back down.<br />
<br />
She pouted. "Disk
operating system, or whichever it is you need to be able to use the 6805
tools Ms. Steward left us. But now that I've said that, you're going to
make me wait." <br />
<br />
"Now why would I do that?" I chuckled as I picked up the package from TSC. "This would be Flex, and the compilers."<br />
<br />
The
package contained several diskettes and manuals. "Flex disk, manual.
Additional utilities. Pascal compiler and manual, and Tiny C compiler
and manual. Advanced Programmers Guide."<br />
<br />
"They don't look all that special."<br />
<br />
"Heh.
Let's see if I can find a good place to get a toehold." I scanned
through the Flex manual and the utility manual first, to get an
overview, then scanned through the installation hints.<br />
<br />
"Hmm."<br />
<br />
"What?"<br />
<br />
"I've got to write some glue code. It looks like setting this thing up to replace the<br />
<br />
Has to put code where Flex expects it. Replacing the monitor requires mapping the monitor out after boot.<br />
<br />
Mapping the monitor, reset to on-board monitor on POR but not on RESET.<br />
<br />
Need to be able to switch the disks to FM? Or TSC fixed that?<br />
<br />
Terminal I/O routines<br />
Disk I/O routines<br />
<br />
<br />
<br />
<br />
<br />
<br />
before getting Julia's Micro Chroma out. I checked her work, and she
started back in on the wiring while I dug into the datasheets for the
TMS 9900 and TMS 9940.<br />
<br />
<br />
<div style="text-align: right;">
Chapter 13: what?</div>
<div style="text-align: center;">
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></div>
<hr />
<i>[Backed up at https://joel-rees-economics.blogspot.com/2020/06/bk-33209-storms.html.]</i><br />
<br />
<i> </i><i> </i><br />
<i> </i>零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-74112569694975889742020-06-08T23:02:00.001+09:002020-06-10T20:50:14.079+09:00Backup: 33209: Straits -- Booting UpThe backup chapter you're looking for is here: <a href="https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-getting-julia-booted-up.html">https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-getting-julia-booted-up.html</a>.零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-89171149429403058992020-06-08T23:02:00.000+09:002020-06-10T20:51:01.196+09:00Backup: 33209: Straits -- Getting Julia Booted UpBackup of <a href="https://joelrees-novels.blogspot.com/2020/06/33209-straits-getting-julia-booted-up.html">https://joelrees-novels.blogspot.com/2020/06/33209-straits-getting-julia-booted-up.html</a>.<br />
<hr />
<br />
<a href="https://joelrees-novels.blogspot.com/2020/06/33209-storm-warnings-exercising-diskette-drives-controllers.html">Chapter 12: Storm Warnings, and Exercising Diskette Drives and Controllers</a><br />
<br />
<h4 style="text-align: center;">
Chapter 13.0: Straits -- Getting Julia Booted Up</h4>
<br />
When we got to the
house, we set the Micro Chroma 68 up on the magazine table in the
living room and set it to work exercising the disk drives again.<br />
<br />
"Magazine table?"<br />
<br />
"Tea
table, coffee table, same thing. No tea or coffee in our house.
Sometimes we emphasize that fact by calling the coffee table a magazine
table."<br />
<br />
Julia laughed softly as we went into the kitchen to see if we could lend a hand with dinner.<br />
<br />
"Sorry about the plain fare," Mom apologized.<br />
<br />
"Do-it-yourself
grilled cheese sandwiches with whole wheat bread, green beans, lettuce,
tomatoes, and onions. Good food. I feel right at home," Julia replied
with a grin as she flipped her sandwich in the frying pan. "Can I say
grace this time? I mean, ask the blessing."<br />
<br />
"Don't see why not."<br />
<br />
Giselle added, "I don't object."<br />
<br />
Dad was working late, and wasn't home yet.<br />
<br />
Mom nodded. "Please. And we don't mind if you call it grace."<br />
<br />
Julia hesitated.<br />
<br />
"Just the way you would at home." I gave her a nudge. "We're all Christians here." <br />
<br />
So she offered grace her way, and Mom and Giselle gave her hugs. I had to wait my turn.<br />
<br />
<br />
And we all ate, fixing more sandwiches as we ate.<br />
<br />
After
eating, Julia and I returned to the living room and we checked the
drives. There were no errors, but since they had been running for less
than an hour, I didn't really expect any.<br />
<br />
I shut the
tests down so we could use the computer, and we took turns using Tiny
BASIC as a calculator and using the text editor. Homework took us both a
bit over an hour.<br />
<br />
When Julia finished her homework, we
moved our stuff to my room, and she got out her Micro Chroma board and
started working on it again at my desk. She used my anti-static straps.<br />
<br />
We set my Micro Chroma 68 on the corner of the desk, between us, and I sat on the car seat and finished my homework.<br />
<br />
When I put it away, Julia said, "I'm curious about those packages you got yesterday."<br />
<br />
"So am I." I reached over to pick them up from my desk.<br />
<br />
"But I think they can wait."<br />
<br />
"Oh?"<br />
<br />
"We do need to talk about religion."<br />
<br />
I sat back. "If I get those out, I'll be back down that rabbit hole again."<br />
<br />
"Exactly. I need you to be here, to talk to me."<br />
<br />
"Okay, I'll just listen. Go ahead."<br />
<br />
She worked silently for about half a minute. "Feels funny."<br />
<br />
"Why?"<br />
<br />
"I don't need you looking at me. Don't laugh." She was smiling.<br />
<br />
"I can't help it."<br />
<br />
"Laughing or looking at me?" Now we were both chuckling.<br />
<br />
"Both."<br />
<br />
"Find something to do."<br />
<br />
Still
chuckling, I dug in my parts bin. But, instead, I got out paper,
pencil, ruler, and eraser. "I think I can talk while I doodle."<br />
<br />
"Watcha gonna doodle?"<br />
<br />
"Memory selection."<br />
<br />
"Tell me what that means later."<br />
<br />
"Switching pieces of memory between RAM and ROM, mostly."<br />
<br />
"I sort of understand that." <br />
<br />
We both chuckled, then worked in silence for a few minutes.<br />
<br />
"So. Religion," I prompted.<br />
<br />
"Mom and Dad like you."<br />
<br />
"My
parents like you, too." I thought for a moment. "But your parents don't
really know me all that well. And what does that have to do with
religion?"<br />
<br />
"They think it's okay if I become a Mormon."<br />
<br />
"Ideally, these would be separate topics of discussion."<br />
<br />
"This is the real world. Reverend Johansen has been over to the house three times this week."<br />
<br />
"When have you been home to talk with him?"<br />
<br />
"I haven't. He talks with my parents, instead."<br />
<br />
"Oh."<br />
<br />
"They aren't impressed."<br />
<br />
"Why's that?" I set my pencil and paper down and shut down the Micro Chroma 68.<br />
<br />
"He thinks we should apply pressure to you to give up Mormonism." <br />
<br />
"Okay,
I need to tell you my opinion of something here." I started undoing
screws and connectors so I could remove the mainboard.<br />
<br />
"What are you doing?"<br />
<br />
"Just
going to finish out the memory selection circuit, so I can switch RAM
in anywhere in the memory map, and even switch out the monitor ROM."<br />
<br />
"Switch out the monitor ROM?"<br />
<br />
"So if I put a 68701 in it I can boot it from the 68701's internal EPROM."<br />
<br />
"Why?"<br />
<br />
"Flexibility. Maybe. I have a hunch that I need the flexibility."<br />
<br />
"Oh. So what about your opinions on something?<br />
<br />
"First,
Mormon was a prophet. Prophets testify about Jesus Christ. Therefore,
people who really follow Mormon's teachings are following Jesus'
teachings. People call us Mormon, but we are Christians."<br />
<br />
"That's your opinion?"<br />
<br />
"That's fact, or something close to fact, and doctrine."<br />
<br />
She put the soldering iron down and scratched her head.<br />
<br />
I continued, "There is something I call cultural Mormonism."<br />
<br />
"People who are members from birth, not because they believe it?" She picked the iron back up and continued her work.<br />
<br />
"That
too, but more general -- We have a history, and we have a culture. Some
people confuse our culture with our religion, our tradition with
doctrine."<br />
<br />
"Outward church?"<br />
<br />
"Yeah, it's tangled up in that, too."<br />
<br />
"All churches have that."<br />
<br />
"True. Can I borrow that iron for a moment?"<br />
<br />
"Sure."<br />
<br />
She
set the soldering iron in its holder, then watched as I picked it up
and applied solder to hold an IC socket in place. I set the iron back,
and she picked it back up.<br />
<br />
"So I don't exactly recommend becoming Mormon," I added.<br />
<br />
"You're talking about cultural Mormon."<br />
<br />
"Right." <br />
<br />
"Okay,
I'll try to figure out the difference between tradition and what you
actually believe. But how do I find out what you guys believe?"<br />
<br />
"Ah, the missionaries can teach you that. We can arrange for you to meet with them."<br />
<br />
"You've been a missionary. Can't you teach me?"<br />
<br />
"It's no longer my calling."<br />
<br />
"If I meet with them, can you be there, too?"<br />
<br />
"Of course. That's even what I'm supposed to do, but I wouldn't miss it."<br />
<br />
"Okay."<br />
<br />
"And I think I should study a bit of what Reverend Johansen wants me to study, too."<br />
<br />
"Why?"<br />
<br />
"Because it's an important part of your life."<br />
<br />
"Okay. I'm glad." <br />
<br />
We both worked in silence, taking turns with the soldering iron.<br />
<br />
"Can you give me an overview or something?"<br />
<br />
"Well,
a boy named Joseph Smith, back in the early 1800s, wanted to know which
church he should join. He prayed, and had a vision in which he was told
not to join any. All the churches back then had strayed too far away
from true doctrine."<br />
<br />
"All?"<br />
<br />
"When I
read the histories, it's fairly clear to me that religion was too mixed
up in politics, science, the arts, education, just about everything. Too
much about the Church trying to be the ultimate answer to everything,
too much about control, not enough room for the Holy Spirit to guide. I
think you've seen some of how that happened in your research for your
classes."<br />
<br />
"Yes, I have. This country has been a big
influence in making it possible for people in this modern world to
practice their religion independent of their community and cultural
affiliations, hasn't it?"<br />
<br />
"Definitely. People need to
be free to work out their religion for themselves, or religion isn't
much use for its real purpose. So Joseph Smith was told to join none,
and he was also told that he would play a part in restoring true
religion to the world. When he was older, he had another vision, and he
was shown where he could find some ancient records like the Bible, but
from the Americas instead of the middle east."<br />
<br />
"Is that the Book of Mormon?"<br />
<br />
"Right. And, as you now know, we use it as a companion to the Bible."<br />
<br />
"And it teaches about Jesus Christ."<br />
<br />
"Very much so." I put the iron back down, checked my work, and started putting the mainboard back in place.<br />
<br />
"So, are the native Americans the other sheep?" She picked the iron back up.<br />
<br />
"The other sheep mentioned in John 10, yes. But he also told the people here that he had other sheep than they, even."<br />
<br />
"More sheep. As in other countries?"<br />
<br />
"Yeah."<br />
<br />
"Not just the people Paul went to teach."<br />
<br />
"Right." <br />
<br />
"So does the Book of Mormon teach that the gospel is for everyone in the whole world?"<br />
<br />
"Oh,
yes. It definitely teaches that." I plugged the Micro Chroma 68 in, and
it booted up okay. "So far, so good. But I'll have to write code to
test it, to be sure it's really working."<br />
<br />
"Other preachers didn't take kindly to all of that, I guess?"<br />
<br />
"No."<br />
<br />
She put her work down for a minute and thought. "So that explains why there has to be a different organization."<br />
<br />
"Jesus
called new apostles, so we have twelve apostles. And we have a lay
ministry, where all the members receive calls, and sort of take turns
teaching and being leaders."<br />
<br />
"Being leaders?"<br />
<br />
"Teaching, being bishop, presiding over quorums, that kind of thing."<br />
<br />
"Could you be a bishop?"<br />
<br />
"If I were called."<br />
<br />
"Could I?"<br />
<br />
"There are apparently some cultural issues about that. Some people think it's doctrinal issues, but I think they misunderstand."<br />
<br />
"What do you mean?"<br />
<br />
"The
way I understand what we do in the temple, men and women should share
the priesthood callings. But we have a bunch of false traditions from
the cultural background that make it difficult." <br />
<br />
"Such as?"<br />
<br />
"Hard
to explain, but there's a lot of confusion about what the priesthood
is. And it's really easy for members to overreach their
responsibilities. We have the women and the men organized in
separate, somewhat parallel organizations. It's an imperfect fit, but it
seems to invite less misunderstanding this way."<br />
<br />
Julia frowned. "Hmm. So what is priesthood?"<br />
<br />
"We
say it's the authority and power to act in the name of God, but the
power is faith, and everyone should have faith. Authority is permission.
I sometimes say it's our excuse to do God's work, to do good things."<br />
<br />
"We need an excuse?"<br />
<br />
"Men seem to, more so than women, I think."<br />
<br />
"That's not making sense. Women do bad things, too."<br />
<br />
"Priesthood
is not something magic that prevents us from doing bad things, or that
automagically makes what we do good and right. We still have to follow
the Holy Spirit and not some other spirit. Too many people think what we
call priesthood is the same as witchcraft."<br />
<br />
"Witchcraft? Magic?"<br />
<br />
"Priesthood
operates by faith. Faith is belief in things that are true, especially
things that are not seen but are true, and the actions such belief
induces."<br />
<br />
"Paul says, 'Faith is the substance of things hoped for, the evidence of things not seen.'"<br />
<br />
"Hebrews 11, starting at the first verse. Exactly."<br />
<br />
"And Witchcraft is?"<br />
<br />
"Near as I understand it, trying to bring things which are not real into existence by force of will and deception."<br />
<br />
She was shaking her head. "Okay. Not okay. What about science? Which is that?"<br />
<br />
"Good science tends to operate on principles of faith, bad science tends to work like witchcraft."<br />
<br />
She rested her forehead in her palm and sighed. "What about magic tricks?"<br />
<br />
"Sleight of hand?"<br />
<br />
"So, deception?"<br />
<br />
"Entertainment,
unless the magician is trying to pervert the faith of the audience. In
my opinion, of course. But we've managed to stray far away from the
overview and the basics we need to be focusing on."<br />
<br />
She thought for a moment. "Do you think it would cause even more problems with other churches?"<br />
<br />
"What?"<br />
<br />
"Calling women as bishops." <br />
<br />
"Hah. I'd forgotten where we got sidetracked. Probably cause worse problems among our members."<br />
<br />
"How so?"<br />
<br />
"Too
many of our good men operate under the model of the tie-breaking vote
being the man's. Too many of our women happily respond by asserting
themselves in the kitchen or the bedroom, or with the kids. And that
puts us right back in Machiavelli's world."<br />
<br />
Now she closed her eyes in frustration. "So. Who gets the tie-breaker?"<br />
<br />
"Heh.
It would be easy to just say, 'God'. But that would fail to answer. If
we are not one, we are not God's. So there is no tie-breaker. Just
prayer and trying to understand each other, and trying to understand
God's will."<br />
<br />
Her face screwed up in thought. "What happens when you are sure you are right?"<br />
<br />
"Argument, and loss of access to the Spirit of God."<br />
<br />
Now she nodded. "I guess that's what would happen if I were to sure I were right, too."<br />
<br />
"Strong opinions are not bad, we just have to be willing not to chase the Holy Spirit away."<br />
<br />
Julia
continued to nod as she set her mainboard on my desk. "Well, I think
I'm finished with this." Then she turned to me and took my hands.
"Somehow, we're making the theory real between us."<br />
<br />
I think, for a moment, our hearts beat as one.<br />
<br />
"What about other races?" she asked.<br />
<br />
"The gospel is to all people, bond or free, black or white, man, woman, child, whatever."<br />
<br />
"Scripture?" She let my hands go so I could get my scriptures out, and I did so.<br />
<br />
"Several
places, one is 2nd Nephi 26." I opened to the chapter in the Book of
Mormon, and she took the book and set it in her lap, and we read it
together, silently, me reading upside-down.<br />
<br />
She said, somewhat to herself, "The law is given by Christ."<br />
<br />
"As in the sermon on the mount."<br />
<br />
"I can see that."<br />
<br />
We continued to read.<br />
<br />
"Verse 13. He goes and reveals the gospel to every nation."<br />
<br />
"And there are other places where it says that."<br />
<br />
"This book in verse 17, is it the Book of Mormon?"<br />
<br />
"In this specific case, that's how I understand it."<br />
<br />
"In this specific case?"<br />
<br />
"Patterns get repeated in God's work." <br />
<br />
We kept reading. "We talked a little about churches built up for power."<br />
<br />
"Yeah."<br />
<br />
"Verse 28. All are privileged, none are forbidden."<br />
<br />
I nodded in agreement and we continued to read.<br />
<br />
"Last verse. Black and white, bond and free, male and female, ... the heathen, Jew and Gentile, all are alike unto God." <br />
<br />
I didn't say anything.<br />
<br />
"So
why did your church restrict blacks for so long? It's only been in the
last year or so that the restriction was changed, right?<br />
<br />
"We
aren't perfect, unfortunately. I think this is another case where God
has been willing to overlook the faults of many of the members of the
Church so that the Church itself could grow. We have to trust God to
make it up to those who were restricted so long, and we have to actively
reach out now."<br />
<br />
"Jesus is our Savior and our Redeemer, so He can make it up."<br />
<br />
"Exactly.
Although the white members have lost quite a bit for the wait, more
than the black members have lost, when I look at from the eternal point
of view. Not to make light of what black people of faith have lost, but
white people of faith will lose their essential faith if we don't reach
out and change things."<br />
<br />
"I'm part hispanic."<br />
<br />
"I know."<br />
<br />
"And part African."<br />
<br />
"And
I am part native American and part Swedish." I shrugged my shoulders
and grinned. "If we get married, you have a right to hit me up-side the
head if I try to exercise any kind of unrighteous dominion. Shoot. Even
if we don't. Let's see your mainboard boot up."<br />
<br />
We
hooked her mainboard to the TV, and to the power supply in the Micro
Chroma 68, and powered her mainboard up. It showed the TV-BUG prompt
right away, so we turned the power back off and plugged the ribbon cable
from my keyboard into her mainboard, and we powered it up again and
played around with the TV-BUG commands.<br />
<br />
I knelt beside
her while I explained the commands and what they did. She reached around
my waist and gave me a hug. And I hugged her back.<br />
<br />
"Can you call the missionaries and make an appointment?"<br />
<br />
"Good
idea. We somehow got way out in the wilderness." I checked the clock.
"Still a little time before curfew, maybe we can arrange something
tonight."<br />
<br />
So we went into the kitchen to use the phone, and arranged for her first meeting the next morning, before lunch.<br />
<br />
<div style="text-align: center;">
*****</div>
<br />
"It
doesn't play games!" Tito voiced the general disappointment in the
Micro Chroma among her siblings. We didn't have a keyboard with us, so
it basically did nothing but display the TV-BUG prompt.<br />
<br />
"Not yet, anyway. We'll be working on that. Or maybe you can." I chuckled.<br />
<br />
"How many times have you kissed?" Sisi asked. She was sitting between us on the couch.<br />
<br />
"We haven't," I replied.<br />
<br />
Julia
looked at me, and I saw her amusement and read her thought. She leaned
across in front of Sisi, and I leaned forward to meet her.<br />
<br />
"Hey!" Sisi's shout was muffled.<br />
<br />
"Once." Julia said with a grin, as our lips parted.<br />
<br />
"Gross!"<br />
<br />
"We'd better be careful or Sisi'll be calling the Society for the Prevention of Cruelty to Little Sisters," I joked.<br />
<br />
"Hmmph." <br />
<br />
"Don't ask questions you don't want answers to," Julia smirked. <br />
<br />
Julia's mother cleared her throat.<br />
<br />
"So are you going to come get Hoot again tomorrow morning?" Tito asked.<br />
<br />
"I need to help Joe get his disks running so we can make the keyboard for this thing work."<br />
<br />
"I'll bet you won't even touch the computer all morning!"<br />
<br />
"Mario!" Mrs. Cisneros reprimanded.<br />
<br />
"No,
much to my regret," I sighed, "I'm pretty sure we'll only be taking a
break from the computer for an hour or so before lunch."<br />
<br />
"What for?" Sisi asked. <br />
<br />
"I'm going to listen to their missionaries."<br />
<br />
"Oh. That could be interesting." Julia's father looked at his wife. "Do you think we should sit in on this?"<br />
<br />
"I think we should let Julia do this herself. Maybe we can have them come tell us what they've told her later."<br />
<br />
Mr. Cisneros looked over to me. "You think they'll have time tomorrow afternoon?"<br />
<br />
"I'll ask. They've turned into pumpkins now. Can I give them your phone number in the morning?"<br />
<br />
<div style="text-align: right;">
Chapter 13.1: what?</div>
<div style="text-align: center;">
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></div>
<hr />
<i>[Backed up at <a href="https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-getting-julia-booted-up.html">https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-getting-julia-booted-up.html</a>.]</i><br />
<br />
<i> </i><i> </i><br />
<i> </i>零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0tag:blogger.com,1999:blog-5855642260993556818.post-82222841205924614762020-06-02T20:45:00.001+09:002020-06-03T18:31:13.327+09:00Backup: 33209: Storm Warnings, and Exercising Diskette Drives and ControllersBackup of <a href="https://joelrees-novels.blogspot.com/2020/06/33209-storm-warnings-exercising-diskette-drives-controllers.html">https://joelrees-novels.blogspot.com/2020/06/33209-storm-warnings-exercising-diskette-drives-controllers.html</a>.<br />
<hr />
<br />
<a href="https://joelrees-novels.blogspot.com/2020/05/33209-headwinds-becalmed.html">Chapter 11.9: Headwinds -- Becalmed</a><br />
<br />
<h4 style="text-align: center;">
Chapter 12: Storm Warnings, and Exercising Diskette Drives and Controllers</h4>
[JMR202006031137 rewrite:]<br />
<br />
When
Julia and I got to the electronics lab after lunch, several of the
members of the group were already there. Mark and Jeff were working on
their Micro Chromas and daughterboards. Others were reworking their
trainer designs to use 68705s. <br />
<br />
"Hi guys," I said to all and no one in particular. "I doodled up some ideas about the daughterboard last night."<br />
<br />
"How'd you find time?" Jeff smirked, with a meaningful glance at Julia.<br />
<br />
Julia rolled her eyes and shook her head.<br />
<br />
"I managed. Do you want to see?"<br />
<br />
"Ignore Jeff." But Mark also smirked. "Yes. We want to see." <br />
<br />
Julia sighed. "Should I take notes on this, too?"<br />
<br />
"Could you?"<br />
<br />
"Sure." She gave me an indulgent smile. <br />
<br />
"Sorry.
Appreciate it." I gave her my doodlings from the night before and went
to the chalkboard. She sat down between Mark and Jeff at our lab table,
and they helped her translate my diagrams and explanations into useful
notes.<br />
<br />
While I was working at the chalkboard, Winston came in and sat down and started copying the diagrams.<br />
<br />
As I completed the diagrams, Bob commented, "You're trying to put the whole computer on the daughterboard." <br />
<br />
Suzanne came in about that point, and also sat down and started copying the diagrams<br />
<br />
"Yeah,
if I actually build one with all of this on the daughterboard connected
through the CPU socket, it's likely to shake loose and come unplugged
and leave the Micro Chroma with memory but no brains. But it's something
to think about. Scratch calculations."<br />
<br />
"How about adding just the DMA controller?" Jeff asked.<br />
<br />
"If
I understand the application notes, this should cover it." I drew a
second diagram with just the 68701 and the DMA controller and some
support circuitry.<br />
<br />
He nodded thoughtfully. "In that case, I'll leave space for the 6844 on mine."<br />
<br />
Mark agreed that was a good idea. Others in the group didn't seem so sure.<br />
<br />
Dr.
Brown came in, carrying rails of ICs. "Mrs. Steward left these 68705s
with me last night. As she said, there aren't quite enough for everyone
to get one, but she'll be sending more pretty soon. Come get them when
you're ready. First come, first serve."<br />
<br />
"Should I make a run to Austin tomorrow for more?" I suggested.<br />
<br />
Julia
reached out and poked me in the back with her pencil. "You need to
finish your disk drive controllers. If I understand right, we need those
so everyone can program their 68705s."<br />
<br />
She was right.<br />
<br />
So
I sat down and focused on writing a set of programs to exercise and
test the disk drives by writing a variety of troublesome pseudorandom
data patterns and reading them multiple times. My initial test routines
recorded parity errors in addition to reads that didn't match the
generated data, but did not attempt retry-on-error.<br />
<br />
While
the test programs were running, several of us made a run to the parts
store out on West County Road, and visited the surplus store nearby.
When we came back, Julia had the parts she needed for her Micro Chroma
and its daughterboard, and a keyboard that would need a decoder. <br />
<br />
Until
time to go deliver the newspapers, I made sure the students building
Micro Chromas were progressing okay, and helped other students with
whatever they were working on, mostly trying to understand the
differences between the 6801 and the 6805, and modifying their trainer
designs to fit.<br />
<br />
Mike was working on adding a 68008 to his daughterboard design as a co-processor.<br />
<br />
"You
know, anything you do now with the 68008 is strictly theoretical," I
warned him. "The specs we have are tentative, and we have no idea when
we can get real CPUs."<br />
<br />
Mike shook his head. "I'm going to be ready to put one in when they're available."<br />
<br />
"How
about designing it for the base 68000 ?" I suggested. "I can get you
one of those." I sensed Julia staring at my back, and I glanced over my
shoulder. With her eyes, she asked me what I was doing. I gave her an
it's-okay look, and she wrinkled her forehead and set her mouth slightly
to the side.<br />
<br />
"The 68000 addresses a word address space." Mike was talking about the 16-bit data bus, twice as wide as a byte wide data bus.<br />
<br />
"I've
seen application notes for multiplexing the 68000's data bus so it can
read sequential bytes in a byte-wide address space."<br />
<br />
"That'll
be messy and require debugging. Besides, the 68000 is a big 64 pin
chip. That's going to make the daughterboard physically unstable, too,
like a daughterboard with lots of RAM and ROM."<br />
<br />
"Point taken." The rest of his design looked good, so I left him to his own devices.<br />
<br />
Several
times, I noticed him covertly watching Julia. Once, while I was helping
someone across the room, I saw Julia catch him looking at her, and she
gave him a look of reproach that could have put ten 68000s in
state-preserving static halt and cooled the Three-mile Island reactor
core without any physical coolant, and still had effect left over.<br />
<br />
I chuckled to myself, and she heard me, but she waited to give me a perplexed frown until Mike had looked away.<br />
<br />
Other than Mike's sad-puppy expression, I couldn't read much from his reaction. <br />
<br />
Dr.
Brown said he'd stick around until dinnertime, so I left everyone at
work on their projects and headed home to deliver my newspapers.<br />
<br />
When I got back, I stopped the disk exerciser and checked the error counts.<br />
<br />
"Errors?" Julia looked over my shoulder.<br />
<br />
"There should be a few, from dust in the air and other random environmental stuff. This is about what should be expected."<br />
<br />
"But errors are no good, right?"<br />
<br />
"The
places where the data read doesn't match the data written all show
parity errors or sector checksum errors, so we're in good shape. Now I
need to add retry routines, to see whether the errors will repeat." <br />
<br />
"Hold on here," Julia complained, "I have no idea what you're talking about."<br />
<br />
Jennifer,
who was also among those watching me work, said, "Dr. Brown has
explained parity in class, but some of us didn't really get it."<br />
<br />
So I went to the chalkboard again and wrote out a list of numbers and their byte checksum in ordinary arithmetic:<br />
<blockquote class="tr_bq">
72<br />
101<br />
108<br />
108<br />
111<br />
33<br />
-------<br />
533<br />
533 ÷256 = 2 remainder 21</blockquote>
"If one number changes, the sum and remainder are going to change, right?"<br />
<br />
Blank looks.<br />
<br />
Mike
laughed. "Well, if those are all byte values, yeah, because if the last
number is changed to 289, the remainder doesn't change, but 289 stuffed
in a byte gets clipped to 33 anyway."<br />
<br />
"Exactly."<br />
<br />
Still more blank looks than recognition.<br />
<br />
Julia gave me a look of resignation. "Step by step, please."<br />
<br />
Mike
stood up to the board and wrote 33+256=289 beside the 33, then erased
the 33 and replaced it with 289, and adjusted the sum to 789, and the
integer quotient to 3:<br />
<blockquote class="tr_bq">
72<br />
101<br />
108<br />
108<br />
111<br />
289 33+256=289<br />
-------<br />
789 <br />
789 ÷256 = 3 remainder 21</blockquote>
<br />
"But," he continued, if all of these are bytes of memory,
none of them can be larger than 256. And 289 modulo 256 is back to 33." And adjusted the the sum and results accordingly.<br />
<blockquote class="tr_bq">
72<br />
101<br />
108<br />
108<br />
111<br />
33 33+256=289, 289 modulo 256 = 33<br />
-------<br />
533 <br />
533 ÷256 = 2 remainder 21</blockquote>
He gave me a challenging stare. I gave him a thumbs-up, and lost a little air and sat down.<br />
<br />
Stephan shook his head. "But what if there are multiple errors? Couldn't the errors cancel each other out?"<br />
<br />
"It's
a statistical game, really. In practice, errors that cancel each other
out are really rare, and we keep the sector size small to keep it that
way."<br />
<br />
Jennifer said, "So that's the checksum?"<br />
<br />
I nodded. "Except that the actual checksum uses exclusive-or instead of addition." <br />
<br />
Dr.
Brown laughed as most of the group looked like they were ready to give
up on the question. "I'm glad it's not just me that has problems getting
this across."<br />
<br />
"It is pretty arcane math," I admitted.
"It's also a case where having the computer helps a bit. I don't
particularly want to clear out the error numbers, but I could write a
BASIC program for this."<br />
<br />
"I put the numbers in my notes."<br />
<br />
Julia gave me a look that expected a reward. I gave her a hug. She stiffened and grumbled under her breath. "Just a hug?"<br />
<br />
"I don't want to crush someone," I sub-vocalized back before saying, out loud, "I owe you one. Another one."<br />
<br />
Julia smirked and hugged me back.<br />
<br />
And there were snickers and chuckles.<br />
<br />
I booted Tiny BASIC and typed, with Julia taking notes, and others copying from her notes:<br />
<blockquote class="tr_bq">
10 DIM A(10)<br />
20 A(1)=72<br />
30 A(2)=101<br />
40 A(3)=108<br />
50 A(4)=108<br />
60 A(5)=111<br />
70 A(6)=33<br />
80 S=0<br />
90 FOR I = 1 to 6<br />
100 S=S+A(I)<br />
110 PRINT CHR$(A(I));<br />
120 NEXT I<br />
130 PRINT <br />
140 PRINT S<br />
150 D=S/256<br />
160 PRINT D<br />
170 PRINT (D-INT(D))*256<br />
200 END</blockquote>
Then I typed "RUN", and Tiny BASIC output the results:<br />
<blockquote class="tr_bq">
<span style="background-color: lime;"><span style="color: #38761d;">H<span style="color: lime;"><span style="background-color: #444444;">ELLO</span></span>! <br /> 533 <br /> 2.0820 <br /> 21 </span> </span></blockquote>
<br />
I
played with values in the array and showed how different changes
produce different results, and how there were very few changes that
could preserve the checksum.<br />
<br />
Then I modified the summation
in line 100 to use the exclusive-or, and again showed how changes in
the values changed the checksum.<br />
<br />
Several of the other members of the groups tried modifications of their own, and eventually most of the group were satisfied.<br />
<br />
"Parity
is similar, but it just works on bits, and the parity check is kept for
each byte, but we can save demonstrating that for another day. Doing it
in BASIC will be confusing, and doing it in assembler might not be much
less confusing. And I need to go down the rabbit hole for a while."<br />
<br />
Everyone
went back to what they were doing, and I rewrote my routines, adding
retires on parity and checksum errors, and adding read-after-write
checks to the sector write routines. I also altered the tests to track
the count of retries and non-recoverable errors, where the automatic
retries didn't fix things, separately. And set the new tests running.<br />
<br />
While
those were running, I checked with Jeff and Mark on their progress.
They hadn't been able to get their Micro Chroma boards with their
daughterboards to boot far enough to get output on the screen, even
though the video controller circuits appeared to be working. Both of
their boards came up in what appeared to be a graphic mode, with
arbitrary data in the video memory that showed as not-very-meaningful
stripes on the screen.<br />
<br />
"Do we want to figure out why the contents of video RAM looks like stripes instead of a TV screen filled with static?"<br />
<br />
Jeff was quick to say "No." Mark just grinned and shook his head. <br />
<br />
We
got scopes out and started tracing signals, and found some wiring
errors. With those fixed, they both got the TV-BUG prompt to show up.<br />
<br />
They
both had found decoded keyboards with ASCII output, and, with some
testing and rewiring of the keyboards themelves, were able to issue
commands to the monitor and get results.<br />
<br />
"So are you and Julia going to be working on her Micro Chroma tomorrow?" Mark asked.<br />
<br />
Julia and I exchanged glances, and she smiled.<br />
<br />
"Probably," she said. I grinned and nodded.<br />
<br />
"Where?" Jeff asked. "Can we come crash the party?"<br />
<br />
"My place?" I suggested.<br />
<br />
Julia nodded. "But only in the afternoon."<br />
<br />
Dr.
Brown interjected, "If you guys want, I'll open up this lab tomorrow
afternoon, from one to four or so. Then you'll have scopes and other
tools available. But only if we can shut this party down within the next
half-hour or so."<br />
<br />
That announcement was met with cheers. <br />
<br />
"Change of plans," I declared, and we all shut our work down and packed up.<br />
<br />
When I checked, there was only one read parity error during the
second test run, and the first automatic retry got the correct data. <br />
<br />
<div style="text-align: center;">
***** </div>
<br />
"Coming to my house for dinner tonight?" I turned left on Andrews Highway, coming out of the parking lot.<br />
<br />
"Just dinner?"<br />
<br />
"Well, and homework ..."<br />
<br />
Julia
put her hand on my hand, where it was resting on the shift lever.
"Homework. Do you think we'll get my computer as far as Mark's and
Jeff's tonight?" She gave my hand a squeeze.<br />
<br />
"Was there something else you wanted to do?"<br />
<br />
She sighed. "So many things ... I want to do ... with you ... tonight."<br />
<br />
I swallowed hard and almost missed the red light at 27th, squealing the tires to get stopped.<br />
<br />
Julia laughed as she braced herself with her free hand. "Wait. I didn't mean what that sounded like."<br />
<br />
"No?"<br />
<br />
"Maybe." A smile played across her lips.<br />
<br />
I
turned my hand palm up and returned the squeeze. Then the light turned
green and I had to turn it back over and shift. Clumsily. Ground the
gears.<br />
<br />
She giggled. "Sorry."<br />
<br />
"Lousy adrenaline rush."<br />
<br />
For
a moment, she gazed out the window instead of meeting my gaze. "I guess
we need to start talking about religion seriously tonight." <br />
<br />
"Dang. And I haven't even been trying to court you for real. But we can do that."<br />
<br />
"Court. Sounds so courtly." She turned and smiled shyly. Or was it boldly? How can a woman be bold and shy at the same time?<br />
<br />
I took advantage of the clear traffic to lift her hand to my lips and give it a kiss.<br />
<br />
"Pay attention to the road."<br />
<br />
But she didn't take her hand back.<br />
<br />
As I turned right onto 38th Street, I said, "If you ever want to talk about Mike, I'm all ears."<br />
<br />
She sighed. "We dated in high school, but that's long past history."<br />
<br />
"Well, if you ever need to talk about it." <br />
<br />
She didn't answer that, but I felt the energy in her hand cool somewhat.<br />
<br />
[JMR202006031137 rewrite.]<br />
<br />
[JMR202006022045 original:] <br />
<i> </i><i> </i><br />
<i> </i><br />
<br />
When
Julia and I got to the electronics lab after lunch, Several of the
members of the group were already there. Mark and Jeff were working on
their Micro Chromas and daughterboards. Others were reworking their
trainer designs to use 68705s. <br />
<br />
"Hi guys," I said to all and no one in particular. "I doodled up some ideas about the daughterboard last night."<br />
<br />
"How'd you find time?" Jeff smirked, with a meaningful glance at Julia.<br />
<br />
Julia rolled her eyes and shook her head.<br />
<br />
"I managed. Do you want to see?"<br />
<br />
"Ignore Jeff." But Mark also smirked. "Yes. We want to see." <br />
<br />
Julia sighed. "Should I take notes on this, too?"<br />
<br />
"Could you?"<br />
<br />
"Sure." She gave me an indulgent smile. <br />
<br />
"Sorry. Appreciate it." I gave her my doodlings from the night before and went to the chalkboard.<br />
<br />
Winston came in and sat down and started copying the diagrams.<br />
<br />
As I completed the diagrams, Bob commented, "You're trying to put the whole computer on the daughterboard." <br />
<br />
Suzanne also came in, and also sat down and started copying the diagrams<br />
<br />
"Yeah,
if I actually build one with all this on the daughterboard, it's likely
to shake loose and come unplugged, and leave the Micro Chroma with
memory but no brains. But it's something to think about."<br />
<br />
"How about adding just the DMA controller?" Jeff asked.<br />
<br />
"If
I understand the application notes, this should cover it." I drew a
second diagram with just the 68701 and the DMA controller and some
support circuits.<br />
<br />
Jeff nodded thoughtfully. "In that case, I'll leave space for the 6844 on mine."<br />
<br />
Mark agreed that was a good idea. Winston and Suzanne didn't seem so sure.<br />
<br />
Dr.
Brown came in, carrying rails of ICs. "Mrs. Steward left these 68705s
with me last night. As she said, there aren't quite enough for everyone
to get one, but she'll be sending more pretty soon. Come get them when
you're ready. First come, first serve."<br />
<br />
"Should I make a run to Austin tomorrow for more?" I suggested.<br />
<br />
Julia
reached out and poked me in the back with her pencil. "You need to
finish your disk drive controllers. If I understand right, we need those
so everyone can program their 68705s."<br />
<br />
She was right.<br />
<br />
So
I focused on writing a set of programs to exercise and test the disk
drives by writing a variety of troublesome pseudorandom data patterns
and reading them multiple times. My initial test routines recorded
parity errors in addition to reads that didn't match the generated data,
but did not attempt retry-on-error.<br />
<br />
While the test
programs were running, several of us made a run to the parts store out
on West County Road, and visited the surplus store nearby. When we came
back Julia, had the parts she needed for her Micro Chroma and its
daughterboard, and a keyboard that would need a decoder. <br />
<br />
Until
time to go deliver the newspapers, I made sure Micro Chromas were
progressing okay, and helped other students with whatever they were
working on, mostly trying to understand the differences between the 6801
and the 6805, and modifying their trainer designs to fit.<br />
<br />
Mike was working on adding a 68008 to his daughterboard design as a co-processor.<br />
<br />
"You know, anything you do now with the 68008 is strictly theoretical," I warned him.<br />
<br />
Mike shook his head. "I'm going to be ready to put one in."<br />
<br />
"How
about designing it for the 68000? I can get you one of those." I felt
Julia staring at my back, and I glanced over my shoulder. She asked me
with her eyes what I was doing. I gave her an it's okay look, and she
wrinkled her forehead and set her mouth slightly to the side.<br />
<br />
"The 68000 addresses a word address space." Mike was talking about the 16-bit data bus, twice as wide as a byte wide data bus.<br />
<br />
"I've seen application notes for multiplexing the data bus so it can read sequential bytes in a byte-wide address space."<br />
<br />
"That'll
be messy and require debugging. Besides, the 68000 is a big 64 pin
chip. That's going to make the daughterboard physically unstable, too,
like a daughterboard with lots of RAM and ROM."<br />
<br />
The rest of his design looked good, so I left him to his own devices.<br />
<br />
Several
times, I noticed him covertly watching Julia. Once I saw Julia catch
him looking at her, and she gave him a look of reproach that could have
put a hundred 6800s in static halt or cooled the Three-mile Island
reactor core without any physical coolant.<br />
<br />
Other than Mike's sad-puppy expression, I couldn't read much from his reaction. <br />
<br />
Dr.
Brown said he'd stick around until dinnertime, so I left everyone at
work on their projects and headed home to deliver my newspapers.<br />
<br />
When
I got back, I stopped the disk exerciser and checked the error counts.
There were a small number of errors, as I expected, so I worked out
routines that included retrying on parity errors. I stopped to explain
the new routines to any of the other students who were interested, and
Julia took more notes, with Jeff and Mark's help. Then I started the
tests running again, keeping count of retries and of non-recoverable
errors -- errors where the first retry didn't fix the error, with logic
to keep track of expected data errors that weren't caught as parity
errors -- bytes with an even number of bits in error.<br />
<br />
While
those were running, I checked with Jeff and Mark on their progress.
They hadn't been able to get their Micro Chroma boards with their
daughterboards to boot far enough to get output on the screen, even
though the video controller circuits appeared to be working. Both of
their boards came up in what appeared to be a graphic mode, with
arbitrary data in the video memory that showed as not-very-meaningful
stripes on the screen.<br />
<br />
"Do we want to figure out why the contents of video RAM looks like stripes instead of a TV screen filled with static?"<br />
<br />
Jeff was quick to say "No." Mark just grinned and shook his head. <br />
<br />
We
got scopes out and started tracing signals, and found some wiring
errors. With those fixed, they both got the TV-BUG prompt to show up.<br />
<br />
They
both had decoded keyboards, and, with some testing and rewiring of the
keyboard interface, were able to issue commands to the monitor and get
results.<br />
<br />
"So are you and Julia going to be working on her Micro Chroma tomorrow?" Mark asked.<br />
<br />
Julia and I exchanged glances, and she smiled.<br />
<br />
"Probably," she said. I grinned and nodded.<br />
<br />
"Where?" Jeff asked. "Can we come crash the party?"<br />
<br />
"My place?" I suggested.<br />
<br />
Julia nodded. "But only in the afternoon."<br />
<br />
Dr.
Brown interjected, "If you guys want, I'll open up this lab tomorrow
afternoon, from one to four or so. Then you'll have scopes and other
tools available. But only if we can shut this party down within the next
half-hour or so."<br />
<br />
That announcement was met with cheers.<br />
<br />
"Change of plans," I declared, and we all shut our work down and packed up.<br />
<br />
<div style="text-align: center;">
***** </div>
<br />
"Coming to my house for dinner tonight?" I turned left on Andrews Highway, coming out of the parking lot.<br />
<br />
"Just dinner?"<br />
<br />
"Well, and homework ..."<br />
<br />
Julia
put her hand on my hand, where it was resting on the shift lever.
"Homework. Do you think we'll get my computer as far as Mark's and
Jeff's tonight?" She gave my hand a squeeze.<br />
<br />
"Want to do something else?"<br />
<br />
She sighed. "So many things ... I want to do ... with you ... tonight."<br />
<br />
I swallowed hard and almost missed the red light at 27th.<br />
<br />
"Wait. I didn't mean what that sounded like."<br />
<br />
"No?"<br />
<br />
"Maybe." A smile played across her lips.<br />
<br />
I
turned my hand palm up and returned the squeeze. Then the light turned
green and I had to turn it back over and shift. Clumsily. Ground the
gears.<br />
<br />
She giggled. "Sorry."<br />
<br />
"Lousy adrenaline rush."<br />
<br />
"I
guess we need to start talking about religion seriously tonight." She
looked out the passenger window instead of meeting my gaze.<br />
<br />
"Dang. And I haven't even been trying to court you for real."<br />
<br />
"Court. Sounds so courtly." She turned and smiled shyly. Or was it boldly? How can a woman be bold and shy at the same time?<br />
<br />
I took advantage of the clear traffic to lift her hand to my lips and give it a kiss.<br />
<br />
"Pay attention to the road."<br />
<br />
But she didn't take her hand back.<br />
<br />
As I turned right onto 38th Street, I said, "If you ever want to talk about Mike, I'm all ears."<br />
<br />
She sighed. "We dated in high school, but that's long past history."<br />
<br />
"Well, if you ever need to talk about it." <br />
<br />
She didn't answer that, but the energy in her hand cooled somewhat.<br />
<br />
[JMR202006022045 original.] <br />
<i> </i><i> </i><br />
<i> </i><br />
<br />
<div style="text-align: right;">
Chapter 13: storms?</div>
<div style="text-align: center;">
<a href="https://joelrees-novels.blogspot.com/2020/01/33209-2nd-Microcomputer-Revolution-Homecoming-TOC.html">TOC</a></div>
<hr />
<i>[Backed up at <a href="https://joel-rees-economics.blogspot.com/2020/06/bk-33209-storm-warnings-exercising-diskette-drives-controllers.html">https://joel-rees-economics.blogspot.com/2020/06/bk-33209-storm-warnings-exercising-diskette-drives-controllers.html</a>.</i><br />
<i>Some notes in <a href="https://joel-rees-economics.blogspot.com/2020/05/notes-33209-storms-exercising-diskette-drives-controllers.html">https://joel-rees-economics.blogspot.com/2020/05/notes-33209-storms-exercising-diskette-drives-controllers.html</a>.]</i><br />
<br />
<i> </i><i> </i><br />
<i> </i>零石http://www.blogger.com/profile/01111094813708912513noreply@blogger.com0