Discussion:
The best place to begin learning Assembler
Ron Hudson
2010-05-26 19:14:47 UTC
Permalink
Ok, I have the PDF of the 370 Principals of Operations (Sept) and the
Instruction Overview from SimoTime

(I noticed AR and ALR seem to be the same instruction??)

Where, apart from these references, is the best place to learn Assembly?

Ron.
PeterH
2010-05-26 19:27:36 UTC
Permalink
Post by Ron Hudson
(I noticed AR and ALR seem to be the same instruction??)
AR and ALR are different.

The first is 2's complement whereas the second is 1's complement.

It is important to have both instructions available, particularly if
one is going to be using double-word (meaning, 64-bit) integer
operations which are simulated using two ALRs in sequence, branching
around the second should the high-order word NOT need to be adjusted
by an AL =F'1'.

This option is often important when taking an integer which is 64-
bits in width, and needs to be converted into a floating-point number.

Remember, the TOD clock is a 64-bit integer, and taking the beginning
TOD (STCK) and the ending TOD (STCK) values, and then forming the
difference, hence the elapsed-time, requires these 64-bit operations,
but it also usually gives a 32-bit result.
Ron Hudson
2010-05-26 19:52:27 UTC
Permalink
Thanks for the clarification

One says it sets the condition code "No Carry" (ALR) the other says "n/o"
(ar) which
I think means "no overflow"
Post by PeterH
Post by Ron Hudson
(I noticed AR and ALR seem to be the same instruction??)
AR and ALR are different.
The first is 2's complement whereas the second is 1's complement.
It is important to have both instructions available, particularly if
one is going to be using double-word (meaning, 64-bit) integer
operations which are simulated using two ALRs in sequence, branching
around the second should the high-order word NOT need to be adjusted
by an AL =F'1'.
This option is often important when taking an integer which is 64-
bits in width, and needs to be converted into a floating-point number.
Remember, the TOD clock is a 64-bit integer, and taking the beginning
TOD (STCK) and the ending TOD (STCK) values, and then forming the
difference, hence the elapsed-time, requires these 64-bit operations,
but it also usually gives a 32-bit result.
Gerhard Postpischil
2010-05-26 19:45:26 UTC
Permalink
Post by Ron Hudson
Ok, I have the PDF of the 370 Principals of Operations (Sept) and the
Instruction Overview from SimoTime
(I noticed AR and ALR seem to be the same instruction??)
Where, apart from these references, is the best place to learn Assembly?
If you consider AR and ALR the same instruction, then your
effort is doomed from the start. AR sets a condition code, ALR
does not. If R0 contains 1, and R1 contains x'7FFFFFFF' and you
do ALR R1,R0, you get x'80000000'; if you did AR R1,R0 you would
get a surprise (depending on the program mask setting).

There are a few good books on e-bay every once in a while, but
the better ones are very expensive. One way of learning is to
use ASSIST, which takes care of some basics (input, output) so
you can concentrate on the instructions. Others have gone to the
CBT files (distributed with tk3; also on www.cbttape.org),
picked one or more interesting programs, and analyzed them until
they understood what they did. It depends on your learning
style. But beware - there are many purported assembler books out
that not worth the paper they're printed on.

And there is always google to lead you to mysterious
destinations <g>



Gerhard Postpischil
Bradford, VT
Ron Hudson
2010-05-26 20:18:09 UTC
Permalink
On Wed, May 26, 2010 at 12:45 PM, Gerhard Postpischil
Post by Gerhard Postpischil
Post by Ron Hudson
Ok, I have the PDF of the 370 Principals of Operations (Sept) and the
Instruction Overview from SimoTime
(I noticed AR and ALR seem to be the same instruction??)
Where, apart from these references, is the best place to learn Assembly?
If you consider AR and ALR the same instruction, then your
effort is doomed from the start.
All I can go on is what I have found.. that's why I ask.
Post by Gerhard Postpischil
AR sets a condition code, ALR
does not. If R0 contains 1, and R1 contains x'7FFFFFFF' and you
do ALR R1,R0, you get x'80000000'; if you did AR R1,R0 you would
get a surprise (depending on the program mask setting).
There are a few good books on e-bay every once in a while, but
the better ones are very expensive. One way of learning is to
use ASSIST, which takes care of some basics (input, output) so
you can concentrate on the instructions. Others have gone to the
CBT files (distributed with tk3; also on www.cbttape.org),
picked one or more interesting programs, and analyzed them until
they understood what they did. It depends on your learning
style. But beware - there are many purported assembler books out
that not worth the paper they're printed on.
And there is always google to lead you to mysterious
destinations <g>
yeah like SimoTime, But at least I have the Principals of Operation that
lists many more commands (much more tersely)

Are there any video lectures? The major Universities are more and more
taping
their lectures and making them available. I don't suppose any school is
teaching
this stuff though. Google does not find any for me.
Rick Fochtman
2010-05-26 21:22:19 UTC
Permalink
----------------------------------<snip>---------------------------------------
Ok, I have the PDF of the 370 Principals of Operations (Sept) and the
Instruction Overview from SimoTime

(I noticed AR and ALR seem to be the same instruction??)
-----------------------------------<unsnip>------------------------------
Not so. look closely at the handling of the sign bit. Also consider how
the overflow condition is handled.

-----------------------------------<snip>---------------------------------
Where, apart from these references, is the best place to learn Assembly?
--------------------------------------<unsnip>--------------------------
I haven't seen a decent Assembler "textbook" in many years. Keep looking
at code; if I find a decent text or tutorial, I'll let you know.

Rick
kerravon86
2010-05-27 23:49:12 UTC
Permalink
Post by Ron Hudson
Ok, I have the PDF of the 370 Principals of Operations (Sept) and the
Instruction Overview from SimoTime
(I noticed AR and ALR seem to be the same instruction??)
Where, apart from these references, is the best place
to learn Assembly?
One option available is to do some genuine assembler
work that doesn't require much/any assembler skills
(but that many people around these groups are interested
in). That is the MVS 3.8j source code resuscitation
project. We have original source code, and a
slightly-changed object code, and the goal is to
update the original code to match the current
object code, by disassembling the object code.

The nature of the project means that it's basically
impossible to have any bugs, because the end product
already exists and can be exactly compared.

The source is available on the TK3 CD, and
already-updated (by various people) code is available
via various means.

BFN. Paul.
Mike Stramba
2010-05-28 00:03:07 UTC
Permalink
Post by kerravon86
Post by Ron Hudson
Where, apart from these references, is the best place
to learn Assembly?
That is the MVS 3.8j source code resuscitation
project. We have original source code, and a
slightly-changed object code,
We have original source code, and a
slightly-changed object code, and the goal is to
update the original code to match the current
object code, by disassembling the object code.
Nothing like starting "small" LOL.

Have your 1 year old / infant do a lake crossing when teaching them to
swim too :/
Post by kerravon86
Post by Ron Hudson
Ok, I have the PDF of the 370 Principals of Operations (Sept) and the
Instruction Overview from SimoTime
(I noticed AR and ALR seem to be the same instruction??)
Where, apart from these references, is the best place
to learn Assembly?
One option available is to do some genuine assembler
work that doesn't require much/any assembler skills
(but that many people around these groups are interested
in). That is the MVS 3.8j source code resuscitation
project. We have original source code, and a
slightly-changed object code, and the goal is to
update the original code to match the current
object code, by disassembling the object code.
The nature of the project means that it's basically
impossible to have any bugs, because the end product
already exists and can be exactly compared.
The source is available on the TK3 CD, and
already-updated (by various people) code is available
via various means.
BFN. Paul.
Ron Hudson
2010-05-28 00:07:12 UTC
Permalink
Sounds like um ...fun...

Do you have assembly with the code listings?

00008 18 12 label LR 1,2

(hmm did I get that right?)

Things I don't know right now:

Assembly idiom = When there are different ways to do things what is the
most accepted. Linkages and stuff too (I have some of that from examples
sent to me in email)

MACROS = what macros are available, what do they do?
Post by kerravon86
Post by Ron Hudson
Ok, I have the PDF of the 370 Principals of Operations (Sept) and the
Instruction Overview from SimoTime
(I noticed AR and ALR seem to be the same instruction??)
Where, apart from these references, is the best place
to learn Assembly?
One option available is to do some genuine assembler
work that doesn't require much/any assembler skills
(but that many people around these groups are interested
in). That is the MVS 3.8j source code resuscitation
project. We have original source code, and a
slightly-changed object code, and the goal is to
update the original code to match the current
object code, by disassembling the object code.
how slightly is slightly?
The nature of the project means that it's basically
impossible to have any bugs, because the end product
already exists and can be exactly compared.
Don't you have a disassembler? I know they produce line labels and
variables that look like L0001 AND V0001 - but perhaps search and
replace will help with that...
Post by kerravon86
The source is available on the TK3 CD, and
already-updated (by various people) code is available
via various means.
Turnkey3 cd? the same I made from an ISO file?
How do I access it? Do I do this inside hercules
or out in Windows (linux)?
Post by kerravon86
BFN. Paul.
kerravon86
2010-05-28 01:29:46 UTC
Permalink
Post by Ron Hudson
Sounds like um ...fun...
Do you have assembly with the code listings?
00008 18 12 label LR 1,2
(hmm did I get that right?)
You can generate the assembly listing. From my xref:

IEBGENRT MVSSRC.SYM202.F14

so just point your IFOX00 SYSIN to
MVSSRC.SYM202.F14(IEBGENRT)

and see how it goes (ie you should get an assembler
listing). That is the source code for IEBGENER, which
you're presumably familiar with.

I use this as an example because it's one that
has already been worked through (ie the errors
you will encounter have been resolved).
Post by Ron Hudson
Assembly idiom = When there are different ways
to do things what is the
most accepted. Linkages and stuff too (I have
some of that from examples
sent to me in email)
Just use pre-canned code for that.
Post by Ron Hudson
MACROS = what macros are available, what do they do?
It is rare that you need to create a macro,
and when you need to use a macro, it will
be obvious because you are more-or-less
forced to use it (by the documentation).

BFN. Paul.

P.S. To the other message about an infant swimming,
I even tried to get my mother interested in the
project. It requires intelligence, but only mildly
requires assembler skills.
Ron Hudson
2010-05-28 01:42:40 UTC
Permalink
Post by kerravon86
Sounds like um ...fun...
so just point your IFOX00 SYSIN to
MVSSRC.SYM202.F14(IEBGENRT)
I don't seem to have any hlq mvssrc
Just use pre-canned code for that.
Unless it has very good comments I won't learn anything from it as far as
idiom goes.
scott
2010-05-28 04:10:09 UTC
Permalink
Post by kerravon86
Sounds like um ...fun...
so just point your IFOX00 SYSIN to
MVSSRC.SYM202.F14(IEBGENRT)
I don't seem to have any hlq mvssrc
Just use pre-canned code for that.
Unless it has very good comments I won't learn anything from it as far
as idiom goes.
If you want to learn assembler I suggest Mike Muroch's book.
http://www.murach.com/books/mbal/index.htm
Mike Schwab
2010-05-28 04:42:37 UTC
Permalink
Post by kerravon86
Post by kerravon86
Sounds like um ...fun...
so just point your IFOX00 SYSIN to
MVSSRC.SYM202.F14(IEBGENRT)
I don't seem to have any hlq mvssrc
Did you install the source volumes from the CD?
Post by kerravon86
Post by kerravon86
Just use pre-canned code for that.
Unless it has very good comments I won't learn anything from it as far as idiom goes.
--
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?
Ron Hudson
2010-05-28 04:47:32 UTC
Permalink
Post by Mike Schwab
Post by kerravon86
Post by kerravon86
Sounds like um ...fun...
so just point your IFOX00 SYSIN to
MVSSRC.SYM202.F14(IEBGENRT)
I don't seem to have any hlq mvssrc
Did you install the source volumes from the CD?
I must not have.
Post by kerravon86
Post by kerravon86
Just use pre-canned code for that.
Unless it has very good comments I won't learn anything from it as far as
idiom goes.
--
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?
Ron Hudson
2010-05-28 21:37:38 UTC
Permalink
Hey All

I found a website with a set of lecture slides for
assembly language

http://www.edwardbosworth.com/

This link has been placed in the Network Resources section of the Hercules
Turnkey Wiki.

Ron

Loading...