I see 8 errors. There might be more. If you were to correct the missing comma 
that David pointed out, it would abend. Probably with a S0C1 on the GET. But if 
those errors were to be corrected and it made it to the BR 14, it would loop.

This is what it does when it decides on the specifications for the program. 
That is the most generous test possible.

-- 
Tom Marchant

On Tue, 5 Sep 2023 11:43:07 -0400, Steve Thompson <ste...@wkyr.net> wrote:

>I doubt it will assemble. And even if it does, the results are
>unpredictable, other than it will probably ABEND for one reason
>or another.
>
>There are no DCB, OPEN, CLOSE macros while GET and PUT are being
>used.
>
>Me thinks this AI system is confusing a few different assembly
>languages together. I wonder how close they came for DOS I/O.
>Steve Thompson
>
>
>
>On 9/5/2023 11:20 AM, Tom Marchant wrote:
>> You're right, Tom. That is not a program. Certainly not one that will do 
>> what it claims to do.
>>
>> -- Tom Marchant On Mon, 4 Sep 2023 10:42:51 -0700, Tom Brennan
>> <t...@tombrennansoftware.com> wrote:
>>> I can't be sure I formatted it properly, but after looking over the
>>> code, I have nothing to say but WTF? 😄
>>>
>>>           PRINT NOGEN
>>>           TITLE 'Simple Addition Program'
>>> ** Define storage for input numbers and result
>>> *
>>> NUM1     DS    F             First input number
>>> NUM2     DS    F             Second input number
>>> RESULT   DS    F             Result of addition
>>> ** Main program
>>> *
>>> MAIN     C      0        NUM1   Check if NUM1 is zero
>>>           BE     ZERO            Branch to ZERO if true
>>> ** Read the first number from input
>>> *
>>>           GET    NUM1,NUMIN      Read NUM1 from input
>>>           LA     0,NUM1          Load NUM1 into register
>>> ** Read the second number from input
>>> *
>>>           GET    NUM2,NUMIN      Read NUM2 from input
>>>           A      NUM1,NUM2       Add NUM1 and NUM2
>>>           ST     NUM1,RESULT     Store the result in RESULT
>>> ** Print the result
>>> *
>>>           PUT    RESULT,NUMOUT   Print the result
>>> ** Terminate the program
>>> *
>>>           SR     15,15           Set return code to 0
>>>           BR     14              Return to caller
>>> ** Define input and output areas
>>> *
>>> NUMIN    DC    F'0'           Input buffer for numbers
>>> NUMOUT   DC    F'0'           Output buffer for result
>>> ZERO     DC    F'0'           Constant zero
>>>           END   MAIN            End of program

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to