Re: Assembler theology question

2023-06-01 Thread Phil Smith III
See, I knew this would get into theology! I guess I wasn't clear enough: I only meant this for when you're doing a single instruction, something that will never expand-this kind of "flyby" of a control block on the way to another. Clearly if you're doing a bunch, it makes more sense to do

Re: ChatGPT "knows" HLASM

2023-06-01 Thread John McKown
On Thu, Jun 1, 2023 at 7:43 PM John McKown wrote: > In the same conversation, I said "show me this in the C language" and I > got: > > #include > #include > #include > > int main() { > char message[] = "Hello, World!"; > int length = strlen(message); > > cconsole_code_t code; >

Re: ChatGPT "knows" HLASM

2023-06-01 Thread John McKown
On Thu, Jun 1, 2023 at 7:03 PM Paul Gilmartin < 0014e0e4a59b-dmarc-requ...@listserv.uga.edu> wrote: > On 6/1/23 17:27:21, John McKown wrote: > >> > >> Oh, I guess I should mention that what got me interested was s YouTube > >> where the person used ChatGPT to create Python code. The entire

Re: ChatGPT "knows" HLASM

2023-06-01 Thread Paul Gilmartin
On 6/1/23 17:27:21, John McKown wrote: Oh, I guess I should mention that what got me interested was s YouTube where the person used ChatGPT to create Python code. The entire point was ... What are you quoting? I can't find it in the Archives. I've found the responses to be very

Re: ChatGPT "knows" HLASM

2023-06-01 Thread John McKown
On Thu, Jun 1, 2023 at 6:27 PM John McKown wrote: > Oh, I guess I should mention that what got me interested was s YouTube >> where the person used ChatGPT to create Python code. The entire point was >> that the original Python code was really poor, but by asking and telling >> ChatGPT more and

Re: ChatGPT "knows" HLASM

2023-06-01 Thread John McKown
> > Oh, I guess I should mention that what got me interested was s YouTube > where the person used ChatGPT to create Python code. The entire point was > that the original Python code was really poor, but by asking and telling > ChatGPT more and iterating, the code got progressively better. I

Re: ChatGPT "knows" HLASM

2023-06-01 Thread Paul Gilmartin
On 6/1/23 11:39:34, John McKown wrote: I asked ChatGPT for an example HLASM program. Here's what I got: BALRR9,0 Set the base register USING *,R9 Establish a base register LR R3,R9Load the base register into R3

Re: Assembler theology question

2023-06-01 Thread Jeremy Nicoll
In Thu, 1 Jun 2023, at 17:24, Phil Smith III wrote: > We've all seen (and written!) code like this: > USING PSA,R9 > L R10,PSATOLD Get current TCB > DROP R9 > > USING TCB,R10 > L R9,TCBJSCB

Re: Assembler theology question

2023-06-01 Thread Seymour J Metz
How does that eliminate the ASMA306W? From: IBM Mainframe Assembler List on behalf of David Cole Sent: Thursday, June 1, 2023 2:58 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Assembler theology question No. I left the comma out intentionally

Re: ChatGPT "knows" HLASM

2023-06-01 Thread Schmitt, Michael
I asked ChatGPT: Write a z/Architecture assembler program to solve Advent of Code 2021 day 17 part 2. I was expecting a result like linked in this post: https://www.reddit.com/r/adventofcode/comments/ri9kdq/comment/hqcqzqe/?utm_source=share_medium=web2x=3 (click on z/Architecture

Re: Assembler theology question

2023-06-01 Thread David Cole
No. I left the comma out intentionally At 6/1/2023 02:06 PM, Seymour J Metz wrote: ? ITYM L R10,PSATOLD-PSA(,0) -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 From: IBM Mainframe Assembler List

Re: Assembler theology question

2023-06-01 Thread Schmitt, Michael
I would use the first method, because it is more understandable for users* that don't have deep knowledge of both HLASM syntax and what the base field name is in the DSECTs. * like myself -Original Message- From: IBM Mainframe Assembler List On Behalf Of Phil Smith III Sent:

Re: ChatGPT "knows" HLASM

2023-06-01 Thread Jon Perryman
ChatGPT gave you the answer you asked for. You didn't ask for good or functional. Why are you asking AI a question that would yield the same results as a Google search? Ask ChatGPT to convert an HLASM program (you supply) to C. My guess is that it will say something like it has not been

Re: ChatGPT "knows" HLASM

2023-06-01 Thread Paul Gilmartin
On 6/1/23 11:39:34, John McKown wrote: I asked ChatGPT for an example HLASM program. Here's what I got: BALRR9,0 Set the base register USING *,R9 Establish a base register LR R3,R9Load the base register into R3

Re: Assembler theology question

2023-06-01 Thread Ed Jaffe
On 6/1/2023 9:24 AM, Phil Smith III wrote: Thoughts? (Yes, I *said* it was theology, so I'm prepared for religious arguments!) The latter seems great when the field names are super short like PSATOLD-PSA or TCBJSCB-TCB as in your example. Modern control block field names are often much,

Re: ChatGPT "knows" HLASM

2023-06-01 Thread Seymour J Metz
I cined the term Artificial Stupiditiy (AS) for such code. -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Mike Shaw [quick...@gmail.com] Sent: Thursday, June 1,

Re: Assembler theology question

2023-06-01 Thread Seymour J Metz
? ITYM L R10,PSATOLD-PSA(,0) -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of David Cole [dbc...@colesoft.com] Sent: Thursday, June 1, 2023 1:49 PM

Re: Assembler theology question

2023-06-01 Thread David Cole
WRT: L R10,PSATOLD-PSA(,R9)Get current TCB L R9,TCBJSCB-TCB(,R1) Get JSCB In the specific case of the PSA, there is no need to load a base register. Also, I probably wouldn't bother with a USING. My favorite instruction for this is: L

Re: ChatGPT "knows" HLASM

2023-06-01 Thread Mike Shaw
bard.google.com is much worse: -- Sure, here is a sample HLASM program that prints the message "Hello, world!" to the console: Code snippet HLASM program to print "Hello, world!" * * * CSECT * Start of main program MAIN: * Print message MVC SYSPRINT,MESSAGE PUT

Re: Assembler theology question

2023-06-01 Thread Rick Troth
On 6/1/23 12:24, Phil Smith III wrote: We've all seen (and written!) code like this: USING PSA,R9 L R10,PSATOLD Get current TCB DROP R9 USING TCB,R10 L R9,TCBJSCB Get JSCB DROP R10 I've also

ChatGPT "knows" HLASM

2023-06-01 Thread John McKown
I asked ChatGPT for an example HLASM program. Here's what I got: BALRR9,0 Set the base register USING *,R9 Establish a base register LR R3,R9Load the base register into R3 LA R4,ARRAY Load the address

Re: Assembler theology question

2023-06-01 Thread David Cole
WRT: L R10,PSATOLD-PSA(,R9)Get current TCB L R9,TCBJSCB-TCB(,R1) Get JSCB In the specific case of the PSA, there is no need to load a base register. Also, I probably wouldn't bother with a USING. My favorite instruction for this is: L

Re: Assembler theology question

2023-06-01 Thread Seymour J Metz
R9? I might believe R0. In general, I prefer the code with USING over the code with explicit offset and base, although I might use the second if I'm only going to reference a single field in the control block. If I need to access multiple instances of the same control block, I would prefer to

SV: Assembler theology question

2023-06-01 Thread Willy Jensen
I too do both, depending on the situation. -Oprindelig meddelelse- Fra: IBM Mainframe Assembler List På vegne af John McKown Sendt: 1. juni 2023 18:31 Til: ASSEMBLER-LIST@LISTSERV.UGA.EDU Emne: Re: Assembler theology question I do both. I have the USING when I either want multiple

Re: Assembler theology question

2023-06-01 Thread Mark Hammack
In this specific case (and others like it), I'd probably use the latter case as well (although I have done both). However, even for just a line or two, I much prefer using the former syntax (I also tend to use R14, R15 to traverse control blocks until I get to the end). Then again, I'm not sure

Re: Assembler theology question

2023-06-01 Thread Mike Shaw
The second method is better; it's shorter (no USINGs). Simpler is better. Mike Shaw MVS/QuickRef Support Group Chicago-Soft, Ltd. On Thu, Jun 1, 2023 at 12:24 PM Phil Smith III wrote: > We've all seen (and written!) code like this: > USING PSA,R9 > L R10,PSATOLD

Re: Assembler theology question

2023-06-01 Thread John McKown
I do both. I have the USING when I either want multiple fields from the same DSECT or I want to reference the same field(s) multiple times rather than storing them myself somewhere. This latter is mainly when I am writing "pure" code, such as in LPA and am short on dynamic storage. On Thu, Jun 1,

Assembler theology question

2023-06-01 Thread Phil Smith III
We've all seen (and written!) code like this: USING PSA,R9 L R10,PSATOLD Get current TCB DROP R9 USING TCB,R10 L R9,TCBJSCB Get JSCB DROP R10 I've also seen (and probably