






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
How to input binary integers into a computer system using ebcdic characters. It covers the three-step process of reading in characters, converting them to numeric form, and storing the values in registers. The document also discusses the use of specific instructions like lcr and ic, and provides an example of the conversion process.
Typology: Study notes
1 / 11
This page cannot be seen from the preview
Don't miss anything!







Remember that input should be viewed as a card image of 80 columns. Consider a field of N characters found beginning in column M. Suppose that the leftmost byte in this array is associated with the label CARDIN. The leftmost byte in the range of interest will be denoted by the label CARDIN+M. Elements in this range will be referenced using an index register as CARDIN+M(Reg). Our specific example will assume the following:
If the first non–blank character is a minus sign, then the next character is assumed to be the first digit. The index value is incremented by 1 to address the character after the “–”. If the first non–blank character is not a minus sign, it is assumed to be a digit and processed as one. Note however that the processing loop explicitly makes two tests and processes the character only if it is not less than “0’ and not greater than “9”.
At this point, we know that CARDIN+20(R3) references a non–blank character that is in the range of card columns that might contain a digit. Here is the conversion loop. ISDIG CLI CARDIN+20(R3),C‘0’ IS IT A DIGIT BL LOOP NO – CODE < ‘0’ CLI CARDIN+20(R3),C‘9’ ANOTHER CHECK BH LOOP NO – CODE > ‘9’ M R6,=F‘10’ MULTIPLY (R6,R7) BY 10 SR R8,R8 CLEAR R IC R8,CARDIN+20(R3) GET THE DIGIT S R8,=X‘F0’ CONVERT TO VALUE OF DIGIT AR R7,R8 ADD TO THE PRODUCT LOOP BXLE R3,R4,ISDIG END OF THE LOOP CLI THESIGN,C‘N’ WAS THE INPUT NEGATIVE BNE DONE IT IS NOT NEGATIVE LCR R7,R7 TAKE 2’S COMPLEMENT DONE * HERE R7 CONTAINS THE BINARY VALUE