Bill, formatting or not, the program makes no sense. Anyone who has
taken even a couple of ASM classes would know the BE ZERO alone makes no
sense, branching to a constant F'0'? Good luck.
Then the GET "DCB" is a DC fullword instead of a DCB. So that would be
fun since GET expects a branch address off the DCB from OPEN, and oops,
there's no OPEN anyway. Then even if the GET worked and you managed to
get a 4 byte binary number into NUM1, what in the world is the LA doing,
trying to load that 4 byte number into register zero? Just nuts.
I don't need to look any further. Like I say, anybody who knows even
the least bit about ASM coding would not even bother trying to assemble
it. The code is totally worthless.
On 9/5/2023 9:00 AM, Bill Johnson wrote:
Why do you doubt it? Is it because you hope it doesn’t? Certainly, one of you
assembler geniuses could test it.
Like Mullins said, and others mentioned, most companies that run z/OS don’t
need assembler programmers. That numbers in the thousands if not ten thousand.
Whereas ISV’s who are the likely users of Assembler programming, number in the
hundreds, maybe. So install on Systems Programmers.
Sent from Yahoo Mail for iPhone
On Tuesday, September 5, 2023, 11:43 AM, Steve Thompson <[email protected]> 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
<[email protected]> 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 [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN