Re: Re: Where do I start?
Rick Fochtman <[email protected]> Thu, 27 May 2010 20:14:54 -0500
| Newsgroups | gmane.comp.emulators.turnkey-mvs |
|---|---|
| Message-ID | <[email protected]> |
------------------------------------<snip>-------------------------------- >>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? >> >> > >SPACE 2 tells the assembler to leave two blank lines, for a >prettier listing. Also that TGET doesn't really save much; >shorter would be: > LA 1,INBUFF > LA 0,L'INBUFF > ICM 1,8,=x'81' TGET ASIS > TGET 1,0,R > > -------------------------------<unsnip>--------------------------------------- Are you planning to store in location X'000001' for zero bytes? That's what you're saying with " TGET 1,0,R ". The first TGET above tells the system to store the answer in the location defined by register 2, for a maximum length as defined in register 3. This is called "REGISTER NOTATION". :-) ------------------------------<snip>---------------------------------- >The current assembler documentation is on the IBM web site, but >much of the HL stuff doesn't apply to XF. Macros are documented >in manuals specific to use (Using Data Sets; Assembler Services; >etc.). > > > >>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 >> >> > >The TPUT has just destroyed R1 (address of STREAM), so the loop >will never end. One way of handling is is to use, for instance: > TGET ... > LTR 4,1 check for input > BNP none nothing read > >and use register 4 instead of 1 in subsequent code. > > -------------------------------<snip>------------------------------ I think the point Gerhard is trying to make is this: awareness of register conventions is a MANDATORY PART of Assembler programming. It's a lot more complicated, in many ways, because you're working at the machine level; you don't have a HLL compiler making those decisions for you "under the covers". And in most HLL's, you don't have to be concerned about arithmetic modes, because the conversions are done for you "under the covers". Rick