Re: Re: Where do I start?
Gerhard Postpischil <[email protected]>
| Newsgroups | gmane.comp.emulators.turnkey-mvs |
|---|---|
| Message-ID | <[email protected]> |
On 5/26/2010 3:59 PM, Ron Hudson wrote:
> Ok, Here's my first stab at stepping through the inbuf copying stuff to the
> disply
First of all, check the input length returned from TGET. If it's
three, all you got back was a PA key (PA1-PA3, some of them
intercepted by TSO support services, or a PFK, or ENTER without
input). If the length is 6 or more, you continue.
CLI INBUF,C'3' PFK3?
BE exit
LA 6,INBUF+3 point to first data field
LA 5,DISPLY output
SH 0,=H'3' ANY INPUT FIELDS?
BNP done no; skip move loop (clear previous contents first?)
> MVNXT L 6,INBUF,(2) GET CHAR FROM INBUF+R2 00370000
L works on a word (4 bytes). The syntax is L 6,INBUF(2) - but I
suspect you want to point to it, hence my LA
00380000
> CLI 2,X'3' POUND AIDKEY,BUFR,1ST'11',1ST 00390000
> BC 2,NOPOUND IF R6> '3' THEN DO NOT POUND 00400000
Register two at this point contains zero. Why are you looking at
low storage? If you want to skip the AID and buffer address
sequence, it should be before the loop, because you'll execute
this test each time through the loop. Also don't use BC if you
can avoid it. I remember that 2 is High (for BH NOPOUND), but
your test is meaningless, because everything in your input
buffer (that's returned by TGET) will be higher than 3.
> CLI 6,X'11' COMPARE THIS CHAR VS X'11' 00420000
> BE POUND IF SO GO POUND IT. 00430000
Instructions come in different formats. CLI starts with an address:
FIELDLUP CLI 0(R6),X'11' HIT SBA ?
BE POUND
> Right here I need to add code to skip the next char when the prev was
> x'11' because it's a binary buffer location.
No; you never get here for an 11 - you have a BE
(check that INBUF not exhausted)
MVC 0(1,5),0(6) copy one byte input to output
LA 5,1(,5) ADVANCE OUTPUT
LA 6,1(,6) ADVANCE INPUT
SH 0,=H'1' ADJUST RESIDUAL COUNT
BP FIELDLUP
B done
>
> * 00440000
>
> B NOPOUND NO REASON TO POUND IT - DONT 00450000
> * 00460000
> POUND L 6,C'#' YOU MUST POUND IT! 00470000
POUND MVC 0(3,5),=C'###' SHOW SBA
LA 5,3(,5)
LA 6,3(,6)
SH 0,=H'3'
BP FIELDLUP
B done
>
> * 00480000
> NOPOUND ST 6,DISPLY(2) STORE R6 INTO DISPLAY+R2 00490000
> ADD 2,X'1'
You don't need it, but an increment would be done be A 2,=F'1'
(length of register and storage must match); for small values LA
2,1(,2) would add 1 and clear the high byte (wraps at 16Million)
INCREMENT R2 00500000
>
> * 00510000
> CP 2,0 COMPARE MY INDEX AND BYTES READ 00520000
> BE CONT0002 DONE IF EQUAL 00530000
>
> B MVNXT IF NOT MORE MOVE NEEDED 00540000
> *
> CONT0002 goes here
>
done now you can process the buffer, and look at INBUF again to
check for Enter/PF7/PF8/PAn, etc., including possible data file
update.
... your display processing (back to TPUT/TGET above?)
exit - as before
> How does it look? Where there is any question my comment gives intent and
> is to be trusted over the code (which could be really wrong)
Sorry to sound critical, but you didn't think this through -
only one AID/cursor address appears in the buffer, so the
check/skip should be before the loop. When you see an SBA x'11',
then you know three bytes may be skipped; and the POUND/NOPOUND
branch and comments were mixed up. But take heart - my first
professional 360 assembly had about 2000 cards, and got 6000
lines of error messages!
Gerhard Postpischil
Bradford, VT
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/turnkey-mvs/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/turnkey-mvs/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/