Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : When you specified V for RECFM parameter, LRECL value is largest record in the file plus 4 bytes. These four bytes contain the actual length of each variable length record in the file

Google
 
Web mainframegurukul.com

Need Interview FAQ's for Assembler

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> ASSEMBLER
  View previous topic :: View next topic  
Author Message
kumar_log@hotmail.com
Member


Joined: 28 Jan 2009
Posts: 6
Location: Singapore

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Feb 04, 2009 1:21 am    Post subject: Need Interview FAQ's for Assembler Reply with quote

Dear Friends,

I have attended few interview's for Assembler.

I have been asked few queston only as

1. Difference between DS & DC
2. Types of Instruction
3. Different data types
4. Types of registers R1-R16
5. How to call subprogram
6. Move command.

As i'm kind of beginner in assembler and able to manage this kind of basic question, able to clear them. I have some hand on experience on Assembler code, but not much exposure.

I would like to know some good inteview questions with answer's.

Any basic books (links) to start up with coding Assembler.

Pls help me out.

Thanks in Advance.
_________________
Thanks and Regards,
L.Kumar
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

nareshv_99
Member


Joined: 05 Feb 2012
Posts: 25
Location: Bangalore

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Feb 07, 2012 11:48 pm    Post subject: Reply with quote

adding a few.. i had been asked to answer below ques..

1. how to move more than 256 chars to a filed ?
2.
var1 dc cl5'abcde'
var2 dc cl5'12345abcde'
write a instruction so that comparison between var1 and var2 should be true

3.
var1 dc cl5'abcde'
var2 dc cl5'12345abcde'
MVC var2,var2
what var2 will have ?
4.
var1 ds cl5'abcde'
can i define the var1 with the above instruction

other than this they asked me how TR instruction works and difference between TR and TRT

please add if anyone had faced any Assembler interview ques
Thanks!
Back to top
View user's profile Send private message AIM Address
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
nareshv_99
Member


Joined: 05 Feb 2012
Posts: 25
Location: Bangalore

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Feb 07, 2012 11:54 pm    Post subject: Reply with quote

Any basic books (links) to start up with coding Assembler.

i found below links very very useful..
http://www.billqualls.com/
http://www.edwardbosworth.com/

book:
Assembler Language Programming: The IBM System/360 by
George Struble

very useful book for beginners.
enjoy maadi.. Very Happy
Back to top
View user's profile Send private message AIM Address
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1625
Location: Mumbai, India

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Feb 08, 2012 2:33 pm    Post subject: Reply with quote

nareshv_99 - What's the benefit of posting in a thread which is around more than 3 years old?
_________________
Regards,
Anuj
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
nareshv_99
Member


Joined: 05 Feb 2012
Posts: 25
Location: Bangalore

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
1 salutes

PostPosted: Wed Feb 08, 2012 10:08 pm    Post subject: Reply with quote

yea.. totally agree and i didn't see the date when i was posting it..

if i'm not correct main aim first of this forum is sharing and learning..

so what i posted here was my real experience.. can you give a url or references where some posted some useful Assembler links and book names ?

you dont even find those Assembler question in the net..

FYI- i'm not posting for FREE DB2 E-BOOK..
Back to top
View user's profile Send private message AIM Address
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1625
Location: Mumbai, India

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Feb 09, 2012 3:44 pm    Post subject: Reply with quote

Calm down ...Smile. The point is, if the thread is old and the original poster does not lurk around the forums - most of the times you are left with open ended questions, which is not good.

Here is kind of link you've asked for, from this forum: http://www.mainframegurukul.com/ibmmainframeforums/viewtopic.php?t=5393&sid=eb1f23a1668f8b5ecc008728ec18985d
_________________
Regards,
Anuj
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
BobC
Member


Joined: 20 Aug 2015
Posts: 3
Location: California, USA

Answer was approved by Question owner.
Useful Post
1 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Aug 20, 2015 5:25 am    Post subject: Re: Need Interview FAQ's for Assembler Reply with quote

kumar_log@hotmail.com wrote:
Dear Friends,

I have attended few interview's for Assembler.

I have been asked few queston only as

1. Difference between DS & DC
2. Types of Instruction
3. Different data types
4. Types of registers R1-R16
5. How to call subprogram
6. Move command.

As i'm kind of beginner in assembler and able to manage this kind of basic question, able to clear them. I have some hand on experience on Assembler code, but not much exposure.

I would like to know some good inteview questions with answer's.

Any basic books (links) to start up with coding Assembler.

Pls help me out.

Thanks in Advance.


kumar_log@hotmail.com wrote:
Dear Friends,

I have attended few interview's for Assembler.

I have been asked few queston only as

1. Difference between DS & DC
2. Types of Instruction
3. Different data types
4. Types of registers R1-R16
5. How to call subprogram
6. Move command.

As i'm kind of beginner in assembler and able to manage this kind of basic question, able to clear them. I have some hand on experience on Assembler code, but not much exposure.

I would like to know some good inteview questions with answer's.

Any basic books (links) to start up with coding Assembler.

Pls help me out.

Thanks in Advance.


1. DS means "Define Storage" it sets aside sufficient space for the variable(s) you describe as its parameters, but does NOT give them an initial value, whereas DC ("Define Constant") does initialize the memory it allocates.

2. Machine Instructions are classified by their purpose and datatype:
    (a) General instructions -- perform fixed-point arithmetic and addressing using general-purpose registers, perform logical (Boolean) operations in registers or main memory, perform byte (character) operations in main memory

    (b) Decimal instructions -- perform arithmetic on packed decimal fields in main memory

    (c) Floating-point instructions -- perform floating-point arithmetic using floating-point registers

    (d) Control instructions -- privileged instructions not generally used by application programs (use macros instead)

    (e) Input/output operations -- perform I/O at the machine level. These are not used by applications, which use macros instead

    (f) Branching -- control non-sequential program flow

Note: there are also pseudo-instructions (a/k/a "Assembler Instructions"), whose purpose is to provide information to the Assembler itself. These include USING, DROP, CSECT, START, DSECT, etc.

3. Different data types
IBM mainframes support the following native data types:
    (a) byte (character) data

    (b) half-word integer (16 bits, 1 sign bit and 15 data bits in two's-complement form)

    (c) full-word integer (32 bits, 1 sign bit and 31 data bits in two's-complement form)

    (d) Address data (32 bits, unsigned binary)

    (e) Single (a/k/a "Short") IBM Hexadecimal Floating Point; 4 bytes (32 bits): 1 sign bit, 7-bit characteristic**, and fraction of 6 hexadecimal digits)

    (f) Double (a/k/a "Long") IBM Hexadecimal Floating Point; 8 bytes (64 bits: 1 sign bit, 7-bit characteristic**and fraction of 14 hexadecimal digits

    (g) Quad (a/k/a "Extended") IBM Hexadecimal Floating Point; 16 bytes (128 bits): 1 sign bit, 7-bit characteristic**and fraction of 28 hexadecimal digits)

    (h) Single (a/k/a "Short") IEEE Binary Floating Point: 4 bytes (32 bits) with a sign of 1 bit, an exponent of 8 bits and a binary fraction of 23 bits

    (i) Double (a/k/a "Long") IEEE Binary Floating Point: 8 bytes with a sign of 1 bit, an exponent of 11 bits and a binary fraction of 52 bits.

    (j) Quad (a/k/a "Extended") IEEE Binary Floating Point: 16 bytes with a sign of 1 bit, an exponent of 15 bits and a binary fraction of 112 bits.


** the "characteristic" is a base-16 exponent in binary excess-64 format

4. Types of registers R1-R16
There are two types of registers: general purpose registers and floating-point registers.
    (a) General purpose registers are numbered 0 through 15 (e.g. R0 through R15, NOT R1-R16) and perform 32-bit arithmetic in either signed or unsigned modes, depending on the machine instruction used.

    (b) Floating-point registers are numbered 0 through 6, and are used in pairs, so only the even numbered register is referred to in the instruction.


5. How to call subprogram
Subroutines are not required to have parameters, but those that do are passed a list of addresses in main memory. The first address points to the first parameter, the second address points to the 2nd parameter, etc. The high-order bit of the last address in the parameter list is set to 1; this allows for a variable number of parameters.

(for 24- and 31-bit addressing modes)
The address of the first parameter is placed in register 1.
The address of the subroutine to be called is placed in register 15, with the high order bit on if the subroutine runs in 31-bit mode, and off for 24-bit mode..
A "BALR 14,15" instruction is executed. Note: do not store anything in register 14, as it will be overwritten by this instruction. Note that the BASSM instruction is to be used in the general case.


6. Move command.
First, a matter of terminology: we do not refer to machine instructions as "commands" in assembler. They are "instructions". Each instruction is assigned a mnemonic operation code ("opcode"). There are a number of move instructions, with the following opcodes:

(Note: "Move instruction" usually refers to MVC and/or MVI)

MVI -- "Move Immediate": moves a single-byte value from within the instruction itself to the designated address

MVC -- "Move Characters": moves 1 to 256 characters from one location in main storage (operand2, the source) to another (operand1, the target)

Things to be aware of:
    (a) the target operand comes first, so read MVC to yourself as "Move characters INTO operand1 FROM operand2"
    (b) the length of operand2 is ignored; the number of characters moved is set by the length operand, or the length of the operand1 if the length operand is omitted
    (c) you cannot move zero (0) bytes, it is alway one or more, because the length operand is stored internally as one less than the number of bytes to be moved (e.g. an internal length of 0 moves 1 byte, an internal length of 1 moves 2 bytes, and an internal length of 255 moves 256 bytes)
    (d) Rule (c) becomes important if you use the EX (Execute) command with MVC to implement variable-length strings.


Other MOVE instructions:

    MVCL -- "Move Characters Long" -- uses pairs of registers to specify the length and starting address of the source (operand2) and target (operand1) fields

    MVCIN -- "Move Characters Inverse": moves the characters of the source field (operand1) to the target field (operand2) in reverse order (last becomes first)

    MVO -- "Move with Offset" -- sets the leading 4 bits of operand2 (the target field) to zeroes and moves the nibbles (half-bytes) of operand1 (the source field) to operand2 starting at the low-order nibble of the first position

    MVST -- "Move String": moves a character-delimited string from source location to target location

    MVN -- "Move Numerics": moves the low-order 4 bits of each character in operand1 to the corresponding position in operand2

    MVZ -- "Move Zones": moves the high-order 4 bits of each character in operand1 to the corresponding position in operand2
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
BobC
Member


Joined: 20 Aug 2015
Posts: 3
Location: California, USA

Answer was approved by Question owner.
Useful Post
1 votes
Not an useful post
Greate Post!! Salute Author
1 salutes

PostPosted: Thu Aug 20, 2015 5:28 am    Post subject: Reply with quote

Anuj Dhawan wrote:
nareshv_99 - What's the benefit of posting in a thread which is around more than 3 years old?


I found this thread; you found this thread; the information we leave behind will benefit those who find it in the future (Google brought me here, it will doubtless do so for many others with a similar query)
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
BobC
Member


Joined: 20 Aug 2015
Posts: 3
Location: California, USA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Aug 20, 2015 6:07 am    Post subject: Reply with quote

nareshv_99 wrote:
adding a few.. i had been asked to answer below ques..

1. how to move more than 256 chars to a filed ?
2.
var1 dc cl5'abcde'
var2 dc cl5'12345abcde'
write a instruction so that comparison between var1 and var2 should be true

3.
var1 dc cl5'abcde'
var2 dc cl5'12345abcde'
MVC var2,var2
what var2 will have ?
4.
var1 ds cl5'abcde'
can i define the var1 with the above instruction

other than this they asked me how TR instruction works and difference between TR and TRT

please add if anyone had faced any Assembler interview ques
Thanks!


1. how to move more than 256 chars to a filed [sic]?
Possible solutions:
    (a) code multiple MVC instructions (good for lengths between 257 and maybe 2000 or so)

    (b) code a loop to run the MVC instruction multiple times. For example, you can move 20,000 bytes with a loop that executes a MVC of 250 bytes 80 times

    (c) Use the MVCL instruction (best solution for non-terminated strings, both fixed- and variable-length)

    (d) Use the MVST instruction (best solution for character-terminated variable length strings)



2.
Code:
var1 dc cl5'abcde'
var2 dc cl5'12345abcde'
write a instruction so that comparison between var1 and var2 should be true

The following compares the 5 characters in VAR1 agaijnst the last 5 characters in VAR2 (note that offsets begin at 0, so the first character of VAR2 is at offset 0, and the fifth character, where we want to start, is at offset 4):
Code:
  CLC  VAR1,VAR2+4

The code above works because the assembler uses the declared length of VAR1. If were reverse the parameters, we must explicitly code the length:
Code:
  CLC VAR2+4(5),VAR1



3.
Code:
var1 dc cl5'abcde'
var2 dc cl5'12345abcde'
MVC var2,var2
what var2 will have ?

This is perhaps intended as a trick question. Moving a field to itself will not change its value.


4.
Code:
var1 ds cl5'abcde'

can i define the var1 with the above instruction

Sort of. When you use THE "DS" assembler instruction, the initial value is not stored (it is used by the assembler to infer length, though). If you want the storage allocated for VAR1 to have an initial value, use the "DC" assembler instruction instead of "DS"

[5] other than this they asked me how TR instruction works and difference between TR and TRT

The TR (Translate) machine instruction replaces each byte in the first operand location with a byte obtained from a 256-byte table pointed to by the second operand. The numeric value of the byte from the first operand location is added to the second operand address (as an offset) to select the byte from the table which will replace the first operand byte being examined. The first operand is examined from left to right for the length given (1 to 256 bytes).

TRT (Translate and Test) works in a similar manner, except that instead of replacing the bytes of the first operand, the value obtained from the table is used to determine the next action of the instruction:
(a) if the byte is zero: when this is not the last byte, the instruction proceeds to the next byte; for the last byte, condition code 0 (all function bytes zero) is set and the instruction completes; general registers 1 and 2 remain unchanged
(b) if the byte is non-zero, the address of the source byte is placed in R1 and the value of the table byte is placed in the low-order 8 bits of R2 (the other bits are not changed): when this is NOT the last byte, condition code 1 is set (scan not completed); for the last byte condition code 2 is set (non-zero byte found at end of scan).
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> ASSEMBLER All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-3748.html