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