Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!ucsd!ucbvax!bloom-beacon!eru!hagbard!sunic!eric From: eric@sunic.sunet.se (Eric Thomas SUNET) Newsgroups: comp.lang.asm370 Subject: Re: Coding Questions Message-ID: <2252@sunic.sunet.se> Date: 1 Nov 90 19:03:26 GMT References: <9011011400.AA10311@ucbvax.Berkeley.EDU> Distribution: inet Organization: Royal Institute of Technology, Sweden Lines: 28 In article <9011011400.AA10311@ucbvax.Berkeley.EDU> IBM 370 Assembly Programming Discussion List writes: >What I am trying to do is build a table which contains 13 sets of information. >The first 2 bytes contain a addr (i.e.; x'4CF8'), the next 4 bytes contain >the address of the field I want to move the input into, and the last 4 bytes >contain the length of the field. When I receive my input I find the 2 bytes >after the sba (x'11') and compare that to my table. When I match I then >EXECUTE a move using the length entry in my table and the address in my >table to move the data from the input area to the work area! This will not work because the amount of data you get from the terminal may not match the length you have defined for the field. You may get less data if the field is, say, 80 bytes and only 10 bytes were entered, or more data, if APL characters have been typed. So what you really want to do is a MVCL with appropriate padding, after computing the length of the data coming from the terminal (locating the next X'11' or end of buffer) and checking that you don't get more than the field has; if you do, it might be better to re-write the screen and ask the user to retype (with one of the early generations of 3277 you could delete start-fields using a particular sequence, and then you could type as much data as you wanted in a field, it was nice to do that and take bets on whether software X would survive or die of a storage overlay). Finally, it is not a good idea to keep the SBA's in machine form (eg X'4CF8') in your table, because that format is not the same for 132-cols terminals. It is much better to store row/col values, and convert the machine form to row/col before scanning the table. Take a look at XEDIT sources for an example of how this can be done. Eric