The Novels

Economics 101, a Novel (Rough Draft) -- My first sustained attempt at a novel, two-thirds finished in rough draft, and heading a little too far south.
What would you do if you and your study partner, with whom you had been seriously discussing marriage, suddenly found yourselves all alone together on a desert island? Study economics?
Sociology 500, a Romance (Second Draft) -- The first book in the Economics 101 Trilogy.(On hold.)
Karel and Dan, former American football teammates and now graduate students, meet fellow graduate students Kristie and Bobbie, and the four form a steady study group.

Featured Post

Sociology 500, a Romance, ch 1 pt 1 -- Introducing Bobbie

TOC Well, let's meet Roberta Whitmer. Bobbie entered the anthropology department office and looked around. Near the receptionis...

Monday, June 29, 2020

Backup01: 33209: Straits -- Status Display

Second version backup of https://joelrees-novels.blogspot.com/2020/06/33209-straits-status-display.html.


Chapter 13.2: Straits -- Sabbath

Chapter 13.3: Straits -- Status Display


"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."

"Focus on your girlfriend, huh?" Tanya was apparently feeling a little catty.

"So you're finally owning up to it!", Suzanne pouted. "What did it take?"

"Oh, shutup, Suzanne," Mike grumbled. "I, for one, don't want to hear about it."

Wallace also complained. "Leading us on, and then jumping ship for your girlfriend?"

Winston admonished, "We can handle this. Bob and Jennifer almost have it worked out, anyway."

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."

"Should you just abandon everyone for me?" Julia asked.

"I'm not abandoning anybody, and Jennifer's right."

Doctor Brown just watched in amusement.

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.
                 

"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."

"Name them?"

"Give them names in the program."

"Okay."

"We'll call the bottom left segment BLS, and it will be binary 10000000."

"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?"

I gave her a thumbs-up and scrawled
BLS EQU $80 ; 1000 0000
"Instead of BLS, BLT would not be a good name?"
Julia and I chuckled at her joke, and so did the students who were listening.

"No?"

"Well, I was thinking S for segment, but why not? T for the last letter of 'bit'. How about the rest?"

"Like this?" Julia wrote out code, intuiting the permutations from the line I'd written:
BLT  EQU $80 ; 1000 0000
BT   EQU $40 ; 0100 0000
BRT  EQU $20 ; 0010 0000
MT   EQU $10 ; 0001 0000
TLT  EQU $08 ; 0000 1000
TT   EQU $04 ; 0000 0100
TRT  EQU $02 ; 0000 0010
DT   EQU $01 ; 0000 0001
"Yep."

"Oh, maybe T is a little confusing."

"It's okay. We'll keep it. As long as we can read it and understand it."

"Then we'll need comment lines to help us remember?"

"Such as?"

She wrote,
* BOTTOM, TOP, MIDDLE
* LEFT, RIGHT, DECIMAL
"Looks good, and it keeps it short for the screen we're working on."

"Do the last four lines need the dollar sign and the zero?"

"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?"

"All but the middle and the decimal?"

"Okay. We can use '.OR.' to put bits together, so it can look like this:"
TABLE
    FCB BLT.OR.BT.OR.BRT.OR.TRT.OR.TT.OR.TLT
"That's not going to fit in the 32 column screen."

"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."

After some thought, I wrote
CUP EQU BLT.OR.BT.OR.BRT
CAP EQU TRT.OR.TT.OR.TLT
*
TABLE
    FCB CUP.OR.CAP
"It sort of helps."

"Heh. Okay, there's zero. One is easy."

She scribbled her guess, "BRT.OR.TRT". "Is that it?"

"Right."

With a bit of scribbling, erasing, and rescribbling, we had this:
BCUP EQU BLT.OR.BT.OR.BRT
TCAP EQU TRT.OR.TT.OR.TLT
ONET EQU BRT.OR.TRT
TRCUP EQU TT.OR.TRT.OR.MT
BLCUP EQU MT.OR.BLT.OR.BT
BRCUP EQU MT.OR.BRT.OR.BT
TCUP EQU TLT.OR.MT.OR.TRT
TLCUP EQU TT.OR.TLT.OR.MT
BCAP EQU BLT.OR.BT.OR.BRT
VBAR EQU TLT.OR.BLT
*
SEGTBL
    FCB BCUP.OR.TCAP ; 0
    FCB ONET ; 1
    FCB TRCUP.OR.BLCUP ; 2
    FCB TRCUP.OR.BRCUP ; 3
    FCB TCUP.OR.BRT ; 4
    FCB TLCUP.OR.BRCUP ; 5
    FCB TLCUP.OR.BCUP ; 6
    FCB TT.OR.ONET ; 7
    FCB BCUP.OR.TCAP.OR.MT ; 8
    FCB TCAP.OR.BRCUP ; 9
    FCB TCAP.OR.BCAP ; A
    FCB VBAR.OR.BRCUP ; b
    FCB BLCUP ; c
    FCB BLCUP.OR.ONET ; d
    FCB TCAP.OR.BLCUP ; e
    FCB VBAR.OR.TLCUP ; F
"I can sort of see what the table is, but how does that get into the LEDs?" Julia asked me.

"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."

Julia looked at me with a blank expression.

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:
NUMDSP RMB 1
CLMDSP RMB 1
"We can squeeze those into a single byte if we need to, but let's do it simple first."
PUTDIG
    LDX NUMDSP ; HIGH BITS ZERO!
    LDA SEGTBL,X
    LDX CLMDSP ; HIGH BITS ZERO!
"I'm lost."

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.

I looked over at Doctor Brown, and he gave just gave me a "Who, me?" look.

I chuckled in embarrassment.

"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?"

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.

George apologized, "I don't seem t do hexadecimal math in my head. Can someone explain it?"

Mike started scribbling on some scratch paper. "It's like this, --"

Doctor Brown suggested, "Mike, could you do that at the board for those who need some review?"

After a moment of hesitation, Mike stood up to the chalkboard and quickly wrote out a conversion table:

decimal
hexadecimal
binary
0:$00=0000 0000
1:$01=0000 0001
2:$02=0000 0010
3:$03=0000 0011
4:$04=0000 0100
5:$05=0000 0101
6:$06=0000 0110
7:$07=0000 0111
8:$08=0000 1000
9:$09=0000 1001
10:$0A=0000 1010
11:$0B=0000 1011
12:$0C=0000 1100
13:$0D=0000 1101
14:$0E=0000 1110
15:$0F=0000 1111
16:$10=0001 0000
17:$11=0001 0001
21:$15=0001 0101
32:$20=0010 0000
37:$25=0010 0101
128:$80=1000 0000
133:$85=1000 0101

"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."

After a bit of discussion, George just shrugged. "I guess I'm just not seeing something. Maybe we should keep going."

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."

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.

"'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.

"So when we write
BLT  EQU $80 ; 1000 0000
"that could mean bacon, lettuce, and tomato is flagged by bit seven, or it could mean the bottom left segment bit is bit seven."

That got some chuckles.

"'.OR.' is the logical-or operator. It performs a column-by-column logical or, keeping the column results in their columns. That means that'
ONET EQU BRT.OR.TRT
"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"
START
    LDA #22
    STA CATHODES
    LDA #FE
    STA ANODES
WAITLP
    BRA WAITLP
"'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."

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.

"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:
* BOTTOM, TOP, MIDDLE
* LEFT, RIGHT, DECIMAL
* SEGMENT BIT T
BLT  EQU $80 ; 1000 0000
BT   EQU $40 ; 0100 0000
BRT  EQU $20 ; 0010 0000
MT   EQU $10 ; 0001 0000
TLT  EQU $08 ; 0000 1000
TT   EQU $04 ; 0000 0100
TRT  EQU $02 ; 0000 0010
DT   EQU $01 ; 0000 0001
*
BCUP EQU BLT.OR.BT.OR.BRT
* 1110 0000 $E0
TCAP EQU TRT.OR.TT.OR.TLT
* 0000 1110 $0E
ONET EQU BRT.OR.TRT
* 0010 0010 $22
TRCUP EQU TT.OR.TRT.OR.MT
* 0001 0110 $16
BLCUP EQU MT.OR.BLT.OR.BT
* 1101 0000 $D0
BRCUP EQU MT.OR.BRT.OR.BT
* 0111 0000 $70
TCUP EQU TLT.OR.MT.OR.TRT
* 0001 1010 $1A
TLCUP EQU TT.OR.TLT.OR.MT
* 0001 1100 $1C
BCAP EQU BLT.OR.BT.OR.BRT
* 1110 0000 $E0
VBAR EQU TLT.OR.BLT
* 1000 1000 $88
*
SEGTBL
    FCB BCUP.OR.TCAP ; 0
    FCB ONET ; 1
    FCB TRCUP.OR.BLCUP ; 2
    FCB TRCUP.OR.BRCUP ; 3
    FCB TCUP.OR.BRT ; 4
    FCB TLCUP.OR.BRCUP ; 5
    FCB TLCUP.OR.BCUP ; 6
    FCB TT.OR.ONET ; 7
    FCB BCUP.OR.TCAP.OR.MT ; 8
    FCB TCAP.OR.BRCUP ; 9
    FCB TCAP.OR.BCAP ; A
    FCB VBAR.OR.BRCUP ; b
    FCB BLCUP ; c
    FCB BLCUP.OR.ONET ; d
    FCB TLCUP.OR.BLCUP ; E
    FCB VBAR.OR.TLCUP ; F
"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.

"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."

Eyes were glazing over, so I wrote another bit of demonstration code, directly using the constants I had defined earlier:
PAUSE
     DECX ; IDLE COUNT
     BNE PAUSE
     RTS
*
START
    CLRX
    LDA #FE
    STA ANODES
    LDA #ONET
    STA CATHODES
    BSR PAUSE ; LET PORT SETTLE
    LSL ANODES
    LDA #TCAP
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #VBAR
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #BLCUP
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #TRCUP
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #TCUP
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #BCAP
    STA CATHODES
    BSR PAUSE
    BRA START
"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."

"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.

Suzanne complained, "I suppose some male engineer thought that mnemonic up."

"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."

"I don't suppose anyone will forget the original mnemonic," Bob commented, and Jennifer slapped him over the head.

Doctor Brown watched this in amusement, taking no sides.

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.


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:
N0 EQU BCUP.OR.TCAP ; 0
N1 EQU ONET ; 1
N2 EQU TRCUP.OR.BLCUP ; 2
N3 EQU TRCUP.OR.BRCUP ; 3
N4 EQU TCUP.OR.BRT ; 4
N5 EQU TLCUP.OR.BRCUP ; 5
N6 EQU TLCUP.OR.BCUP ; 6
N7 EQU TT.OR.ONET ; 7
N8 EQU BCUP.OR.TCAP.OR.MT ; 8
N9 EQU TCAP.OR.BRCUP ; 9
NA EQU TCAP.OR.BCAP ; A
NB EQU VBAR.OR.BRCUP ; b
NC EQU BLCUP ; c
ND EQU BLCUP.OR.ONET ; d
NE EQU TLCUP.OR.BLCUP ; E
NF EQU VBAR.OR.TLCUP ; F
*
SEGTBL
    FCB N0 ; $EE 1110 1110
    FCB N1 ; $22 0010 0010
    FCB N2 ; $D6 1101 0110
    FCB N3 ; $76 0111 0110
    FCB N4 ; $3A 0011 1010
    FCB N5 ; $7C 0111 1100
    FCB N6 ; $FC 1111 1100
    FCB N7 ; $26 0010 0110
    FCB N8 ; $FE 1111 1110
    FCB N9 ; $7E 0111 1110
    FCB NA ; $EE 1110 1110
    FCB NB ; $F8 1111 1000
    FCB NC ; $D0 1101 0000
    FCB ND ; $F2 1111 0010
    FCB NE ; $DC 1101 1100
    FCB NF ; $9C 1001 1100
Then she modified the test code to use her new equates:
START
    CLRX
    LDA #FE
    STA ANODES
    LDA #N0
    STA CATHODES
    BSR PAUSE ; LET PORT SETTLE
    LSL ANODES
    LDA #N1
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #N2
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #N3
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #N4
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #N5
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #N6
    STA CATHODES
    BSR PAUSE
    BRA START
And she tried it again, borrowing a 68705 from Mark this time.


I think everyone cheered.

"But I have a question."

"Yeah?"

"I don't think my code is actually using the table in this test."

"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."

"Oh, give her a kiss," Winston said. "She deserves it."

"No es para ...," I began, but Julia shook her head just perceptively enough for me to see.

"Whether I reward him with a kiss or not is my business," she said.

Wolf whistles and other unnecessary noises of appreciation ensued, and Julia and I cleared our throats simultaneously, with lopsided grins.

Mike did not join in the circus. 

"Back to work," Julia said.

I continued. "So now we need to try actually using the table. We'll use the X register to pick the pattern to display:"
    ORG $40 ; VARIABLES
PAUSER RMB 1
    ORG ROM ; CODE
PAUSE
    CLR PAUSER
PAUSELP
    DEC PAUSER
    BNE PAUSELP
*
START
    LDA #$FE
    STA ANODES
    LDX #1
    SEC
DISPLP
    LSL ANODES
    LDA SEGTBL,X
    STA CATHODES
    BSR PAUSE
    INCX
    CPX #8
    BNE DISPLP
    BRA START
"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.

"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.

"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."

I stopped to diagram it on the chalkboard:

SEGTBL,X
(@SEGTBL+X)

SEGTBL+0:11101110(N0=$EE)
(X=1)=>SEGTBL+1:00100010(N1=$22)

SEGTBL+2:11010110(N2=$D6)

SEGTBL+3:01110110(N3=$76)

SEGTBL+4:00111010(N4=$3A)

SEGTBL+5:01111100(N5=$7C)

SEGTBL+6:11111100(N6=$FC)

SEGTBL+7:00100110(N7=$26)

SEGTBL+8:11111110(N8=$FE)

SEGTBL+9:01111110(N9=$7E)

SEGTBL+A:11101110(NA=$EE)

SEGTBL+B:11111000(NB=$F8)

SEGTBL+C:11010000(NC=$D0)

SEGTBL+D:11110010(ND=$F2)

SEGTBL+E:11011100(NE=$DC)

SEGTBL+F:10011100(NF=$9C)

"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.

"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."

I looked at Julia, and she nodded hesitantly.

"I think it sort of makes sense. Should we let someone else do the programming this time?"

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.

When the test proved successful, Freddie returned to helping take notes.

Mark and Jeff were keeping track of how long each MCU was in the eraser.

(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.)

"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?"

Bob looked questioningly at Jennifer, and they stood, hesitantly.

Jennifer asked, "I guess we need a variable to hold the number, and a routine to convert from binary to hexadecimal?"

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."

"Not much?" Bob asked.

Doctor Brown spoke up. "Before worrying about that, let's see what you would do."

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."

They took over, and I sat down next to Julia.

She took my hand under the lab table and whispered, "This is hard!"

"You're not the only one who thinks so," I whispered back.

"Are we going to need to do decimal numbers?" Jennifer asked from the chalkboard.

"Somebody might, but, for now, let's just do hexadecimal," I suggested

Bob and Jennifer took separate panes of the chalkboard and both started writing:
    ORG $40
WAITCT RMB 1 ; IDLE COUNTER
CMDOUT RMB 1 ; CMD to DSP
BYTOUT RMB 1 ; BYTE to DISP
ADROUT RMB 2 ; ADR TO DISP
*
    ORG $80
* HI BIT DP
* CLOCKWISE FROM TOP
* LO BIT MIDDLE SEG
SEGTBL
    FCB $7E ; 0 0111 1110
    FCB $30 ; 1 0011 0000
    FCB $6D ; 2 0110 1101
    FCB $79 ; 3 0111 1001
    FCB $33 ; 4 0011 0011
    FCB $5B ; 5 0101 1011
    FCB $5F ; 6 0101 1111
    FCB $70 ; 7 0111 0000
    FCB $7F ; 8 0111 1111
    FCB $7B ; 9 0111 1011
    FCB $77 ; A 0111 0111
    FCB $1F ; b 0001 1111
    FCB $3D ; d 0011 1101
    FCB $0D ; c 0000 1101
    FCB $4F ; E 0100 1111
    FCB $47 ; F 0100 0111
*
*
BITTBL
    FCB 1
    FCB 2
    FCB 4
    FCB 8
    FCB $10
    FCB $20
    FCB $40
    FCB $80
*
DSPCMD
    LDA CMDOUT
GTXNIB
    ANDA  #$0F
    TAX
    LDA SEGTBL,X
    RTS
*
DSPBYT
* HI NIB
    LDA BYTOUT
    LSRA
    LSRA
    LSRA
    LSRA
    BSR GTXNIB
    STA CATHOD
    LDX #5
    LDA BITTBL,X
    STA ANODE
* LO NIB
    LDA BYTOUT
    BSR GTXNIB
    BSR WAIT
    STA CATHOD
    LDX #4
    LDA BITTBL,X
    STA ANODE
    BSR WAIT
    RTS
*
DSPADR
*WAIT
    CLR WAITCT
WAIT0
    INC WAITCT
    BNE WAIT0
    RTS
*
INIT
* INIT PORTS
START
    LDA #$0C
    STA CMDOUT
*    BSR DSPCMD
    LDA #$5A
    STA BYTOUT
    BSR DSPBYT
    LDA #$10
    STA ADROUT
    LDA #$00
    STA ADROUT+1
*     BSR DSPADR
    BRA START
*
    ORG $1FFE
    FDB INIT
    END
(Yes, I'm fudging a little, not showing the initialization code.)

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."

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."

Jennifer pointed out, "Our segments are wired differently from Joe's and Julia's."

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."

Julia snickered and poked me in the ribs.

"Theirs does follow a more common pattern," Mike pointed out. "Mine uses the same as theirs."

Tanya asked, "Is WAIT a legal label?"

"Labels and op-code mnemonics are in a different symbol space in the assembler, so it's okay," I explained. "Might confuse humans, though."

"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."

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."

"I'm doing something completely different than that," Mike asserted.

"When Bob and Jennifer have tested theirs, how about you taking a turn, Mike?" I suggested.

He seemed a little surprised that I suggested it, but agreed.

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.

"Sorry, you've lost me again. Tell me what you mean when you get back."

By the time I got back, Mike was describing his first step.

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."

The corrected bit table looked like this:
BITTBL
    FCB $FE
    FCB $FD
    FCB $FB
    FCB $F7
    FCB $EF
    FCB $DF
    FCB $BF
    FCB $7F
"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."

"Valuable experience."

"Helped me a lot."

"Let's see what Mike's got."

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.)
    ORG $40
LONGP RMB 1
    ORG $100
INIT
* SET UP PORTS
* SET TIMER PRESCALE TO 64
* SET TIMER COUNT TO 125
    LDA #125
    STA LONGP
    LDA #$FE
    STA ANODE
    LDA #30 ; 1
    STA CATHOD
    WAIT
TIMINT
    BCLR TIMCR7 ; INT FLAG
    DEC LONGP
    BNE TIMDUN
    LDA #125
    STA LONGP
    LDA CATHOD
    XORA #$FF ; 1 INVERTS TO E
    STA CATHOD
TIMDUN
    RTI
*
    ORG $1FF6
    FDB TIMINT; CMOS MODE TIMER INT
    FDB TIMINT ; ORDINARY TIMER INT
    FDB INIT ; INTERRUPT
    FDB INIT ; SWI
    FDB INIT ; $1FFF RESET
    END
"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.

"WAIT clears the CPU's interrupt mask before it puts the CPU in a WAIT state, but lets the timer keep running.

"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."

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.

"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."

"No problemo."

And he proceeded to show his code:

    ORG $40
CURDIG RMB 1 ; 1-7
DIGBUF RMB 7 ; 7 DISPLAYS
*
ORG $100
* BIT AND SEGMENT TABLES
TIMINT
    BCLR TIMCR7
    LDA CURDIG
    ANDA #07 ; SAFE MASKING
    STA CURDIG
    TAX
    LDA BITTBL,X
    STA ANODE
    LDX CURDIG
    LDA DIGBUF,X
    ANDA #$0F ; SAFE MASKING
    TAX
    LDA SEGTBL,X
    STA CATHOD
    RTI
*
START
    LDA #5
    STA DIGBUF
    LDA #3
    STA DIGBUF+1
    LDA #7
    STA DIGBUF+2
    LDA #7
    STA DIGBUF+3
    LDA #3
    STA DIGBUF+4
    LDA #8
    STA DIGBUF+5
    LDA #0
    STA DIGBUF+6
    WAIT
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.

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?"

Mike looked at me in resignation. "Hit me with it."

I laughed and looked at Doctor Brown, and he said, "Just keep it short."

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?"

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."

*****

Julia leaned against my shoulder across the transmission well, looking out the window at the twilit sky.

"Either you aren't the jealous kind or you have supreme confidence about my feelings for you."

"I trust you to figure out what you want." I lifted my hand from the gearshift and gave her a quick hug.

"Supremely confident."

I chuckled. "And if I disagree, I'm going to be in a world of hurt."

She turned her head and bit my shoulder. Gently.

*****

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 ローマ字 -- Rōmaji -- 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.

"I'm not seeing it."

"What?

"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."

Julia gave me a blank look.

"It's actually a full context switch on this processor, generating a linked list of contexts instead of a straight stack."

 She raised her hands with a smile that said, "I have no idea what you are talking about."

I grinned back. "Just pretend like your listening to something that makes sense."

"Hah."

"I'm going to pretend I'm explaining it to you, but I'm explaining it to myself."

"Uh, huh." She snickered.

"The TMS 9900 has a really unusual register scheme. All the computational registers are actually in memory, pointed to by the working set register."

"Last week, I would have been lost when you said scheme and register."

"What's a register?"

"Registers are where the poor little guy does all those calculations, and RAM is where she stores results."

"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."

"I can pretend I might understand that someday."

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."

"Working set pointer?"

"Careful. You might actually understand this."

"Hah."

"You also have to know where the instructions are, so the 9900 has a register for that. It's called IP."

"Instruction pointer."

"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."

"I could see that. Someday."

"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."

Julia frowned. "You know that almost makes sense."

"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."

"Now I'm lost again."

"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."

I thumbed through the datasheet pages again, with Julia looking over my shoulder again.

"These are jumps?" She said.

"Yeah. Conditional jumps. It's not there."

I thumbed back and forth a bit more.

"Single operand instructions. How many operands does this branch and link, uhm, WP  instruction have?"

"That's actually what I want to find out."

"B for branch."

"Yeah."

"BL."


"Branch and link, but without WP. It's a quick call."

"BLWP," we said in unison.

"Op code 17."

"Where? I don't see seventeen."

"Binary." I pointed to it. "One zero zero zero one."

"Ah. Yeah."

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.

Julia fell asleep on my shoulder, and I drifted off, as well. Giselle woke us up at 10:30, and I drove her home.

"So, what if I decide to reward you with a kiss?"

We had stopped on her front porch to talk.

"Who am I to turn down a reward?"

It was a nice, sweet reward, giving and getting, but not too much.

Chapter 13.4: Keyboard Decoding

[Backed up at https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-status-display.html.]


Wednesday, June 24, 2020

Backup: 33209: Straits -- Status Display

Backup of https://joelrees-novels.blogspot.com/2020/06/33209-straits-status-display.html.


Chapter 13.2: Straits -- Sabbath

Chapter 13.3: Straits -- Status Display


"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."

"For your girlfriend, huh?" Tanya was apparently feeling a little catty.

"So you're finally owning up to it?", Suzanne pouted. "What did it take?"

"Oh, shutup, Suzanne," Mike grumbled. "I, for one, don't want to hear about it."

Wallace also complained, "Leading us on, and then jumping ship for your girlfriend?"

Winston admonished, "We can handle this. Bob and Jennifer almost have it worked out, anyway."

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."

"Should you just abandon everyone for me?" Julia asked.

"I'm not abandoning anybody, and Jennifer's right."

Doctor Brown just watched in amusement.

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.
                 

"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."

"Name them?"

"Give them names in the program."

"Okay."

"We'll call the bottom left segment BLS, and it will be binary 10000000."

"You and Dad both told me about converting to hexadecimal four bits at a time, so that's $80?"

I gave her a thumbs-up and scrawled
BLS EQU $80 ; 1000 0000
"BLT would not be a good name?"

Julia and I chuckled, and so did the students who were listening.

"No?"

"Well, I was thinking S for segment, but why not? T for the last letter of 'bit'. How about the rest?"

"Like this?" Julia wrote out code, intuiting the permutations from the line I'd written:
BLT  EQU $80 ; 1000 0000
BT   EQU $40 ; 0100 0000
BRT  EQU $20 ; 0010 0000
MT   EQU $10 ; 0001 0000
TLT  EQU $08 ; 0000 1000
TT   EQU $04 ; 0000 0100
TRT  EQU $02 ; 0000 0010
DT   EQU $01 ; 0000 0001
"Yep."

"Oh, maybe T is a little confusing."

"It's okay. We'll keep it. As long as we can read it and understand it."

"Then we need a comment line to help us remember?"

"Such as?"

She wrote,
* BOTTOM, TOP, MIDDLE
* LEFT, RIGHT, DECIMAL
"Looks good."

"Do the last four lines need the dollar sign and the zero?"

"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?"

"All but the middle and the decimal?"

"Okay. We can use '.OR.' to put bits together, so it can look like this:"
TABLE
    FCB BLT.OR.BT.OR.BRT.OR.TRT.OR.TT.OR.TLT
"That's not going to fit in the 32 column screen."

"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."

After some thought, I wrote
CUP EQU BLT.OR.BT.OR.BRT
CAP EQU TRT.OR.TT.OR.TLT
*
TABLE
    FCB CUP.OR.CAP
"It sort of helps."

"Heh. Okay, there's zero. One is easy."

She scribbled her guess, "BRT.OR.TRT". "Is that it?"

"Right."

With a bit of scribbling, erasing, and rescribbling, we had this:
BCUP EQU BLT.OR.BT.OR.BRT
TCAP EQU TRT.OR.TT.OR.TLT
ONET EQU BRT.OR.TRT
TRCUP EQU TT.OR.TRT.OR.MT
BLCUP EQU MT.OR.BLT.OR.BT
BRCUP EQU MT.OR.BRT.OR.BT
TCUP EQU TLT.OR.MT.OR.TLT
TLCUP EQU TT.OR.TLT.OR.MT
BCAP EQU BLT.OR.BT.OR.BRT
VBAR EQU TLT.OR.BLT
*
SEGTBL
    FCB BCUP.OR.TCAP ; 0
    FCB ONET ; 1
    FCB TRCUP.OR.BLCUP ; 2
    FCB TRCUP.OR.BRCUP ; 3
    FCB TCUP.OR.BRT ; 4
    FCB TLCUP.OR.BRCUP ; 5
    FCB TLCUP.OR.BCUP ; 6
    FCB TT.OR.ONET ; 7
    FCB BCUP.OR.TCAP.OR.MT ; 8
    FCB TCAP.OR.BRCUP ; 9
    FCB TCAP.OR.BCAP ; A
    FCB VBAR.OR.BRCUP ; b
    FCB BLCUP ; c
    FCB BLCUP.OR.ONET ; d
    FCB TCAP.OR.BLCUP ; e
    FCB VBAR.OR.TLCUP ; F
"I can sort of see what the table is, but how does that get into the LEDs?" Julia asked me.

"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."

Julia looked at me with a blank expression.

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:
NUMDSP RMB 1
CLMDSP RMB 1
"We can squeeze those into a single byte if we need to, but let's do it simple first."
PUTDIG
    LDX NUMDSP ; HIGH BITS ZERO!
    LDA SEGTBL,X
    LDX CLMDSP ; HIGH BITS ZERO!
"I'm lost."

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.

I looked over at Doctor Brown, and he gave just gave me a "Who, me?" look.

I chuckled in embarrassment.

"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?"

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.

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.

"'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.

"So when we write
BLT  EQU $80 ; 1000 0000
"that could mean bacon, lettuce, and tomato is flagged by bit seven, or it could mean the bottom left segment bit is bit seven."

That got some chuckles.

"'.OR.' is the logical-or operator. It performs a column-by-column logical or, keeping the column results in their columns. That means that'
ONET EQU BRT.OR.TRT
"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"
START
    LDA #22
    STA CATHODES
    LDA #FE
    STA ANODES
WAITLP
    BRA WAITLP
"'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."

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.

"Hopefully everybody's working out the equate definitions for your own circuits while we do this.

"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.

"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."

Eyes were glazing over, so I wrote another bit of demonstration code, using the defined constants directly:
PAUSE
     DECX ; IDLE COUNT
     BNE PAUSE
     RTS
*
START
    CLRX
    LDA #FE
    STA ANODES
    LDA #ONET
    STA CATHODES
    BSR PAUSE ; LET PORT SETTLE
    LSL ANODES
    LDA #TCAP
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #VBAR
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #BLCUP
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #TRCUP
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #TCUP
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #BCAP
    STA CATHODES
    BSR PAUSE
    BRA START
"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."

"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.

Suzanne complained, "I suppose some male engineer thought that acronym up."

"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."

"I don't suppose anyone will forget the original mnemonic," Bob commented, and Jennifer slapped him over the head.

Doctor Brown watched this in amusement, taking no sides.

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.


She was rather dissatisfied with the cryptic output, so she got back on the computer and added equates for each digit:
N0 EQU BCUP.OR.TCAP ; 0
N1 EQU ONET ; 1
N2 EQU TRCUP.OR.BLCUP ; 2
N3 EQU TRCUP.OR.BRCUP ; 3
N4 EQU TCUP.OR.BRT ; 4
N5 EQU TLCUP.OR.BRCUP ; 5
N6 EQU TLCUP.OR.BCUP ; 6
N7 EQU TT.OR.ONET ; 7
N8 EQU BCUP.OR.TCAP.OR.MT ; 8
N9 EQU TCAP.OR.BRCUP ; 9
NA EQU TCAP.OR.BCAP ; A
NB EQU VBAR.OR.BRCUP ; b
NC EQU BLCUP ; c
ND EQU BLCUP.OR.ONET ; d
NE EQU TCAP.OR.BLCUP ; e
NF EQU VBAR.OR.TLCUP ; F
*
SEGTBL
    FCB N0
    FCB N1
    FCB N2
    FCB N3
    FCB N4
    FCB N5
    FCB N6
    FCB N7
    FCB N8
    FCB N9
    FCB NA
    FCB NB
    FCB NC
    FCB ND
    FCB NE
    FCB NF
Then she modified the test code:
START
    CLRX
    LDA #FE
    STA ANODES
    LDA #N0
    STA CATHODES
    BSR PAUSE ; LET PORT SETTLE
    LSL ANODES
    LDA #N1
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #N2
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #N3
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #N4
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #N5
    STA CATHODES
    BSR PAUSE
    LSL ANODES
    LDA #N6
    STA CATHODES
    BSR PAUSE
    BRA START
And she tried it again, borrowing a 68705 from Mark.


I think everyone cheered.

"But I have a question."

"Yeah?"

"I don't think we're actually using the table in this test."

"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."

"Oh, give her a kiss," Winston said. "She deserves it."

"No es para ...," I began, but Julia shook her head just perceptively enough to stop me.

"Whether I reward him with a kiss or not is my business," she said.

Wolf whistles and other unnecessary noises of appreciation ensued, and Julia and I cleared our throats simultaneously, with lopsided grins.

"Back to work," Julia said.

I continued. "So now we need to actually use the table. We'll use the X register to pick the pattern to display:"
    ORG $88 ; VARIABLES
PAUSER RMB 1
    ORG ROM ; CODE
PAUSE
    CLR PAUSER
PAUSELP
    DEC PAUSER
    BNE PAUSELP
*
START
    LDX #1
    SEC
DISPLP
    ROL ANODES
    LDA SEGTBL,X
    STA CATHODES
    BSR PAUSE
    INCX
    CPX #8
    BNE DISPLP
    BRA START
"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.

"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.

"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."
 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.

"If you're not comfortable with all of that, try some of your own later. Now we need to write the real display code.

"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."

"Is this only for displaying numbers?" Tanya asked in a slightly petulant tone.

"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."

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.

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.

Chapter 13.4: Keyboard Decoding

[Backed up at https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-status-display.html.]




Tuesday, June 23, 2020

Backup: 33209: Straits -- Sabbath

Backup of https://joelrees-novels.blogspot.com/2020/06/33209-straits-sabbath.html.


Chapter 13.1: Straits -- Bringing Up Flex

Chapter 13.2: Straits -- Sabbath


Sisi met me at the door. "Mom wants to know why you were such a bad boy with Julia last night."

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.

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."

I made a kissy face at her and she giggled and backed away.

"Mo-om!"

Ms. Cisneros laughed.

Julia gave us all a smirk from the kitchen.

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.

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."

I chuckled, then without checking her mother's expression, drew back so we could give each other a quick peck, lip-to-lip.

Behind me, her mother cleared her throat. "That's a little better. Not much."

"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.

"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.

I laughed, and Julia rolled her eyes, so I snuck my arm around her waist and drew her in for another, more prolonged kiss.

"You need a little practice on that, too, Son."

Julia's shoulders fell, and she turned to face him. "No Papá. No es para sus entretenimiento. We'll kiss how and when we want."

"Heh. I'm afraid that one was at least partly for their entertainment, or I would have given it better attention."

Julia snickered and relaxed back into my arms, and her dad gave me a stern look before breaking into a chuckle.

"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.

Her mother came in and sat down, still chuckling, and Sisi and her brothers followed, and her dad asked me to say grace.

After I asked a blessing, we dug into our tacos.

"By the way, Denny called last night to tell me Motorola wants to talk with me some more down in Austin next Friday."

"What about classes?" Julia asked between bites.

"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."

Julia chewed thoughtfully for a few moments and swallowed. "Are you going to stay the night with your brother?"

"That's the plan."

"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."

I looked up to see what her parents thought, and they seemed to be waiting for my response.

"I'll ask Denny. It would be kind of fun to wander around the surplus shop with you."

Her dad shook his head and gave her mom an inquiring look. "¿Qué prioridades tienen?"

She shrugged, "Dejarlo a ellos."

"¿Tienen un templo Mormón en Austin?"

"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."

Julia was snickering, but she poked me again.

"Hey. Just answering your dad's question."

Sisi and Mario looked a little lost. Tito rolled his eyes. Julia's parents joined Julia and me in laughing comfortably at the joke.

Then her mother asked, "So was that a proposal?"

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."

I gave her a hug, and she leaned her head on my shoulder. I kissed her forehead.

"I guess it is beginning to seem like we've been friends forever."

She nodded.

*****

"It looks like they slipped out already."

Pat and George had sat in the back during the sermon, but they were now nowhere in sight.

"Julia! Are you bailing out on choir this Easter?" Their choir director, Valerie Jones, approached.

Julia looked over at me, and I looked back.

"Choir?" I raised my eyebrows and Julia raised hers back, giving her head a tilt.

Valerie looked from Julia to me. "You know, you have a good voice, and we can use men. You're welcome to join."

So we stayed after and practiced with their choir, and made a tentative commitment to sing with them for Easter.

*****

"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.

"Should we check every classroom?"

"I guess, if he doesn't want to talk to us, we shouldn't."

"Ah, Joe, you've been making yourself scarce."

I turned around. "Sister Fulmer. I guess I have. Sorry. Julia, Sister Fulmer is leading our choir this year."

Julia laughed. "Am I invited, too?"

"Sure! We'd love to have you. You can sing alto, too, right?"

"I can."

And we stayed after for choir in my ward, as well, tentatively committing to the ward's Easter cantata.

*****

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.

"Reeves Mortuary. You stab 'em, we slab 'em."

"Denny!" we heard Denise chide on the other end of the call.

"Mpphh." Julia suppressed a snort.

"Hey, can I reserve a couple of lockers for next Friday?" I joked back.

"I'm not sure I like this analogy," Julia complained, laughing.

"Two?" Denny questioned.

Julia answered, "I can bring a sleeping bag and sleep on the floor somewhere."

"I guess you're the beautiful Julia we've been hearing about."

Julia leaned around the corner and mouthed at me, "Beautiful?"

"Dad," I mouthed back.

"Well, I am Julia, whether I'm beautiful or not ..."

"Yeah, she is," I confirmed.

"Sleeping bag, huh?"

"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."

"Ya heard that?" Denny asked.

"I get the floor in the boys' room and Julia gets the sofa."

"That means you're coming to talk with my boss's bosses on Friday?"

"Sure. Any idea what they want to talk about?"

"I'm not supposed to say."

"Come as I am, then."

"Yep."

Chapter 13.3: what?

[Backed up at https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-sabbath.html.]


Sunday, June 21, 2020

Backup01: 33209: Straits -- Bringing Up Flex

Second version backup of https://joelrees-novels.blogspot.com/2020/06/33209-straits-bringing-up-flex.html.

Chapter 13.0: Straits -- Getting Julia Booted Up

Chapter 13.1: Straits -- Bringing Up Flex


Julia waited patiently while I disappeared down the rabbit hole again.

"So you let those drives do their exercises all night last night, until you got back from delivering your newspapers this morning."

"Yep."

"And they didn't mess up so bad that a retry wouldn't fix it."

"Uh huh."

"Which means now you can load this operating system into memory, right?"

"Yeah, now we can be fairly confident that we can load the OS into RAM with these disk drives."

"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?"

"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."

"That's not very friendly."

"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.

"Oh, I think I found something here."

"What?"

"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."

"I'm lost."

"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."

"Oh-kay. So you have to write new drivers and put them where the existing drivers are?"

"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."

"As if I knew anything about the question I just asked, much less what you just said."

She laughed, and I leaned over to where she sat on the bench seat and gave her a hug.

"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."

"I'm looking forward to it."

We both chuckled at the mixed irony in her tone.

"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."

"Good idea. How are you going to do that?"

"The test routines should help. But it's a little scary. I'm worried that my drives will malfunction."

"Isn't there some way to prevent the originals from being copied onto?"

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."

She smirked. "Doubt your own work?"

"Yeah. I haven't actually implemented the protection in the hardware."

"Well, maybe you should. But why is it backwards?"

"Uhm, I guess maybe it depends on how you look at things, but I'd rather it be protected if the tape falls off."

"I guess that makes sense."

"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."

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."

"Make it complicated? Why not just do it normal and keep it simple?"

"Keep it simple. Didja know that's actually an engineering principle?"

"Engineering principle?" She gave me a lopsided smile of curiosity.

"It has  an acronym: K-I-S-S."

"Okay." She leaned over and gave me a peck on the lips. "And that's three times, now."

I grinned. "And I'm not complaining."

"So -- what's the second 'S'?"

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."

"Okay. So tell me."

"It's 'stupid'."

"You said that."

"Quote stupid un-quote."

"Oh." Now she gave me a sharp look.

"It means, not trying to be too smart. Trying to be too smart makes things not simple."

"Uh-huh."

"No, seriously."

"I believe you." She laughed. "But I think I'll remember this one."

"Heh."

"So, the write-protect circuit, right? How do you keep it simple?"

"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."

"Does that mean re-programming the controller?"

"Yeah. Hmm. While I'm in it, I could add a switch to allow it to switch between FM and MFM on the fly."

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.

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.

"Error."

"What kind of error?"

"It won't read TSC's floppy."

We both sat and thought for a minute.

"Can you do it with Giselle's computer?"

"Worth a try."

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.

"Error."

"Could the disk be bad?"

"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."

I thanked Giselle, and we took our stuff back to my room.

"I guess I'm going to have to wait 'til Monday and give them a call."

"TSC?"

"Yeah."

"Nobody in the office today?"

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."

And I dug back into the manuals.

"Oh, look at this."

"What?"

"The disk they sent is FM."

Julia looked pointedly at my stereo tuner.

"You've been waiting a whole week to say that." I laughed, and she laughed.

"Without words. But not the same FM, I guess? And there's no AM?"

"AM. The bit clock is the carrier, so 0 is absence of clock and 1 is presence. Ick."

I reached for some paper, but she put her hand on mine and stopped me.

"I was just joking about the AM."

"Okay, okay, I'll see if I can puzzle that one out later."

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."

"So -- my suggestion to call wasn't necessary?"

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.

She returned my searching look. "Just to be safe, make another?"

"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."

We shared a hug.

"Okay, now I need to write the drivers."

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.

"And now the throw-away loader."

"Throw-away?"

"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."

"Finally running the OS?"

"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."

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.
FLEX  2.1            
+++                      
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.
Shikkari. 
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.
しっかりした体格 shikkari shita taikaku -- proper build/physique (solid build)
しっかりしなさい! Shikkari shinasai! -- Do it right! (Hold it together! or Hang in there!)
Righteous kiss? Proper kiss? Solid kiss? Who has a right to judge a kiss? It's not a sporting event.

Okay, I liked it. And it wasn't just a quick buss. Somehow, "shikkari" fits.

"Ahem," Giselle's voice interrupted. "I hate to interrupt, but, uhm, the missionaries are here?"

We broke apart and turned in unison to give Giselle a guilty look.

She smirked. "Well, it's none of my business, but, since the missionaries are here, maybe you two should save that."

We both stood up a little unsteadily, left the computer at the Flex prompt, and went to meet the missionaries.

*****

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 The Pearl of Great Price, "Joseph Smith -- History", but otherwise leave it out of this story.

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.

Julia and Giselle and I ate lunch together, just the three of us.

"They're awfully young." Julia thoughtfully arranged salad on a second slice of bread spread with peanut butter.

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.

"Only a year younger than you and Joe are."

"Okay, they seem young. That wasn't really all that persuasive a presentation."

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."

"No?"

"No. We are sending them out to teach people who are ready to listen."

"Oh."

*****

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.

"Mmm?"

"Uhm," she started hesitantly.

"Mmmm?"

"What if I'm not ready to listen?"

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.

She kept her hand over the back of mine, but was silent until we turned right on University Avenue.

"But if I don't convert, then ..."

I waited for her to complete the sentence, but she didn't.

"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."

"Will you still like me?"

"Too late to ask that question. I already do."

"I mean, enough to ..."

"Ask you to marry me anyway?"

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.

"Well?" she asked.

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 shikkari shita kiss.

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."

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."

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.

"Whenever you're ready, tell me about Mike."

Julia leaned into me and buried her face against my shoulder, and mumbled.

"I didn't understand any of what you just said, but if you're not ready, I'll wait."

She leaned back and held my gaze with her eyes, letting me see her fear. "I guess it wouldn't be fair to you."

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."

I thought I saw her lower lip quiver before she pulled her face into a tight, wrinkled, hesitant smile.

"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."

"I can see him not being happy with that."

"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."

I smiled and nodded and gave her what I hoped was a reassuring caress.

"He tried to take me too far. I can't let that happen. Not before marriage."

I nodded again, still searching her eyes. After a moment, I guessed, "But there are still some leftover feelings."

She looked down. "Yes, there are."

"He's a good-looking guy."

"You think so?"

"Absolutely. Watch which of the women in our group are watching him today in the lab."

"What about ...?"

"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."

She still hesitated, then seemed to get courage to be more plain. "What about his race?"

"African, I suppose."

"You don't seem to hold that against him, either."

"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."

"You're not jealous?"

"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."

She wrapped herself around me, and I nuzzled the back of her neck.

"But let's get to the lab before anybody can make up any really egregious rumors about us."

We both giggled as we grabbed our stuff.

*****

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.

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.



"Those buffers may be internal to the MCU," I commented as I finished the diagram.

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.

"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."

Wallace complained, "That's just a bunch of hex numbers."

"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."

Flex booted, and we got the prompt again.
FLEX  2.1            
+++                      
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.

Everybody seemed focused on using the 6805's fancy bit I/O instructions.

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.

"This isn't just tedious, it's going to be error-prone, isn't it?" Bob commented, Jennifer nodding her head in agreement.

Dr. Brown and I agreed.

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.

Neither Dr. Brown nor I seemed inclined to point them to a different approach, but I had a different suggestion.

"Tell you what. Let's take a break from the keyboard decoding and look at getting real output on the LEDs."

"Real output?" Kyle asked.

"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."

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.

I redrew the display block diagram by itself.


"Is everyone clear on the idea that we will be enabling, or strobing, one digit at a time?"

Sheryl raised her hand. "No?"

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."

"Yep," I agreed. "Maybe I should draw a diagram of one of the digit elements."


"No buffers, no latches, just light emitting diodes in those seven segment LEDs."

Sheryl's forehead wrinkled. "That's common anode, I guess."

"Right."

"And if we have seven banks of those with cathodes connected in parallel, ...," she thought out loud.

"Ah!" Freddie exclaimed. "You have to activate the anode of each digit separately, or they'll all show the same pattern."

There was tentative agreement among the electronics students, but the data processing group and Julia were still lost.

Except Mike wasn't.

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.

I also raised chalk, but Mike pushed my hand away. "Too many cooks," he grumbled.

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.


"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.

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.

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.

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.

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.

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.

*****

"Are you up for some singing tonight?"

"What?" Julia was lost in thought on the road home.

"I need to practice for my recital."

"Recital," she said absently. "You were right. I think every women in that group has some kind of a crush on Mike."

"Some of the guys, too."

"I'm not going to pretend to understand that. What's this about a recital?"

"The singer's diction course I'm taking."

"Oh, that. You haven't been practicing."

"Not enough. I probably need to practice a half hour a day for the next two weeks."

"I love to sing."

"I know."

"And I can play the piano for you, too."

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 Pit and Uno, and had a two-family sing-along, leaving computers and other difficult questions behind for an evening.

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.

(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.)

*****

After Julia gave me a good night hug and went home with her family, Denny called.

"You up for a trip here next Friday?"

"What's up?

"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."

"Hmm. When do I need to have an answer?"

"Monday morning."


Chapter 13.2: what?

[Second version backup at https://joel-rees-economics.blogspot.com/2020/06/bk01-33209-straits-bringing-up-flex.html.
Original backed up at https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-bringing-up-flex.html.
Some more notes at https://joel-rees-economics.blogspot.com/2020/06/notes-33209-straits-bringing-up-flex.html.]