Hey Rick, Gherhard and Many Others
Thanks for putting up with my foolishness.
The 'move stuff' portion of the code fails - It does not seem to detect the
end of the INBUF. I checked
the example I have and the documentation I could find on TGET and it seems
that TGET returns the
byte count in R1? ?
- I changed the code two ways:
Each loop through the move routine I issue a TPUT and update the screen,
--- so I can see the stuff writing into the output stream
+++ (It does - it just does not stop..)
And I changed to R1 as suggested above.
I am pretty sure the R1 thing is right because I do correctly detect the
situation where any aid
key is pressed without touching any of the fields.
This is from one of those documentation programs and it talks about savign
the length and using r1 to
do it.
TGET (2),(3),R READ FROM THE TERMINAL
STH R1,0(R4) SAVE THE LENGTH FROM TGET
SPACE 2
LR R1,R13 COPY MY SAVE AREA POINTER
btw: What does the "SPACE" directive do above?
I have a list of the machine instructions but no list yet of compiler
directives or macros.
Here is the current state of the routine:
TGET INBUF,INBUFLN,ASIS 00170000
* 00180000
CLI INBUF,X'F3' 00190000
BE EXIT 00200000
* 00210000
* ************************************************************* 00220000
* 00230000
* MOVE STUFF FRON INBUF INTO DISPLY 00240000
* CODE:G.POSTPISHIL 00250000
* ************************************************************* 00260000
My actual understanding is we are using R6 to point into the INBUF
starting in location 3,
and R5 to point into the DISPLY portion of the output stream, We are
incrementing those
two as we move characters betwen the two memory areas. We are also
decrementing the
bytecount returned by TGET in R1 until it goes negative. As we do this
we watch for
x'11' bytes in the input buffer and we replace the x'11' and the next
two bytes with '#' when
we find them, triple incrementing R5 and R6 and triple Decrementing R1.
* BASICALLY, READ A CHAR FROM THE INPUT BUFFER INDEXD 00270000
* DECIDE TO POUND IT (REPLACE IT WITH A POUND SIGN) OR 00280000
* NOT THEN STORE IT TO THE DISPLY+INDEX 00290000
* 00300000
* THEN INCREMENT THE INDEX AND SEE IF IT IS GREATER THAN 00310000
* THE BYTES READ RETURNED BY TGET IN R0 00320000
* ************************************************************* 00330000
* 00340000
* FIRST CHECK TO SEE IF TGET RETURNED ANY FIELDS 00350000
* 00360000
SH 1,=H'3' SUBTRACT 3 FROM THE BYTE COUNT 00370000
BNP DONE BRANCH TO NEXT STEP IF BC <= 3
00380000 <-- not working?
* 00390000
* NOW WE CAN START LOOKING 00400000
* 00410000
LA 6,INBUF+3 POINTER FOR INPUT 00420000
LA 5,DISPLY POINTER FOR OUTPUT 00430000
* 00440000
MVNXT CLI 0(6),X'11' CHECK CURRENT (R6)=X'11' 00450000
BE POUND GO POUND IT! 00460000
* 00470000
MVC 0(1,5),0(6) MOVE 1 CHAR FROM INBUF TO DISPLY 00480000
DEBUG01 TPUT STREAM,STREAMLN,FULLSCR 00490000
LA 5,1(,5) ADVANCE OUTPUT POINTER 00500000
LA 6,1(,6) ADVANCE INPUT POINTER 00510000
SH 1,=H'1' REDUCE BYTE COUNT 00520000
BP MVNXT IF STILL POSITIVE LOOP AGAIN
00530000 <-- or here?
B DONE IF NOW ZERO - EXIT MOVELOOP 00540000
* 00550000
* WHEREIN WE STORE A # INSTEAD OF THE SBA WE HAVE. 00560000
* 00570000
POUND MVC 0(3,5),=C'###' SBA BE HERE 00580000
LA 5,3(,5) INCREMENT OUTPUT POINTER BY 3 00590000
LA 6,3(,6) INCREMENT INPUT POINTER BY 3 00600000
SH 1,=H'3' DECREMENT BYTES READ BY 3 00610000
BP MVNXT STILL POSITIVE, LOOP AGAIN 00620000
B DONE GO ASK USER AGIAN 00630000
* 00640000
* SOMEDAY WE DO SOMETHING WITH THE INFORMATION HERE 00650000
* 00660000
DONE B LOOP FOR NOW BRANCH TO PRESENT FORM 00670000
* 00680000
* 00690000
* 00700000
Thanks again, Ron.