Enhancing the CNOP Instruction

Size: px
Start display at page:

Download "Enhancing the CNOP Instruction"

Transcription

1 Enhancing the CNOP Instruction The CNOP instruction and how it has been enhanced by APAR PI17455 Author: Jeremy Stone Page 1 Copyright IBM (UK) Ltd 2014

2 Introduction With the introduction of APAR PI17455, HLASM has enhanced the CNOP assembler instruction. This technote explains how CNOP works before and after the apply of APAR PI17455, detailing the enhancements provided by the APAR. Review of the CNOP instruction prior to APAR PI17455 As the High Level Assembler Language Reference explains, The CNOP instruction aligns any instruction or other data on a specific halfword boundary. This ensures an unbroken flow of executable instructions, since the CNOP instruction generates nooperation instructions to fill the bytes skipped to achieve specified alignment. Looking at the HLASM Language References, they syntax of the CNOP instruction is: >> CNOP byte,boundary >< +--symbol--+ byte Is an absolute expression that specifies at which even-numbered byte in a fullword, doubleword, or quadword the location counter is set. The value of the expression must be 0 to boundary-2. boundary Is an absolute expression that specifies the byte specified by boundary is in a fullword, doubleword, or quadword. A value of 4 indicates the byte is in a fullword, a value of 8 indicates the byte is in a doubleword, and a value of 16 indicates the byte is in a quadword. To achieve alignment on a specific halfword boundary we can specify how many bytes that halfword is offset from either a fullword, doubleword or quadword address. Where the CNOP instruction already has the desired alignment, then it will generate no code leaving the subsequent instruction with the same alignment. If the CNOP instruction does not fall on a halfword, perhaps because it follows a DC or DS instruction, then normal HLASM processing will first halfword align it before performing any processing. Page 2 Copyright IBM (UK) Ltd 2014

3 Aligning on a fullword, doubleword or quadword boundary Starting with the simpler example where the value of byte is 0, the CNOP instruction will set the location counter so that the next instruction is aligned according to the value of boundary. Depending on whether the boundary value is 4, 8 or 16, the next instruction's location counter would be aligned on a fullword (4), doubleword (8) or quadword (16) location. The following table demonstrates how fullword, doubleword and quadword alignment is achieved and how this affects the location counter of the next instruction: Instruction Current location counter New location counter Comment CNOP 0,4 x'32' x'34' x'34' is the first free fullword boundary CNOP 0,8 x'1032' x'1038' x'1038' is the first free doubleword boundary CNOP 0,16 x'2032' x'2040' x'2040' is the first free quadword boundary The assembler listing containing the above can be seen in Table A at the end of this section. Looking at the following extract from the assembly listing we see: Loc Object Code Addr1 Addr2 Stmt Source Statement C1C1 18 DC C'AA' Plus another 2 bytes CNOP 0,8 Align on a doubleword C2C2 20 DC C'BB' Demonstrate where we are The CNOP instruction is initially aligned at location x'1032', but the value of boundary is 8 and the value of byte is 0, indicating that we require alignment on a doubleword boundary. Since 1032 is not on a doubleword boundary, CNOP generates sufficient nooperation instructions in order that the following instruction becomes on a doubleword boundary. The CNOP generated no-operation instructions are explained in detail below. Page 3 Copyright IBM (UK) Ltd 2014

4 Aligning at an offset from a fullword, doubleword or quadword boundary Where the value of the byte operand is not 0, then the next instruction will be offset from the specified boundary by byte bytes. In a similar example to the above, the following table demonstrates how a halfword offset from a fullword, doubleword and quadword alignment is achieved and how this affects the location counter for the next instruction: Instruction Current location counter New location counter Comment CNOP 2,4 x'32' x'32' Aligned on fullword at x'30' +2 (No change) CNOP 6,8 x'1032' x'1036' Aligned on doubleword at x'1030' +6 CNOP 12,16 x'2032' x'203c' Aligned on quadword at x'2030' +12 The assembler listing containing the above can be seen in Table B at the end of this section. Looking at the following extract from the assembly we have: C1C1 19 DC C'AA' Plus another 2 bytes CNOP 6,8 Align on a doubleword C2C2 21 DC C'BB' Demonstrate where we are The CNOP instruction aligns the next instruction on the first free byte which is 6 bytes after the doubleword at x'1030' even though this doubleword boundary itself is prior to the CNOP instruction. Looking at the following extract we can see: C1C1 11 DC C'AA' Plus another 2 bytes CNOP 2,4 Align on a fullword C2C2 13 DC C'BB' Demonstrate where we are This time the CNOP instruction would not alter the alignment because the current location x'32' is already offset 2 from location x'30' which is fullword aligned. The above examples aligned us at a location offset within byte bytes from the CNOP instruction, but it will be noted that using the CNOP instruction with a non-zero byte value may align us beyond the next fullword, doubleword or quadword. Page 4 Copyright IBM (UK) Ltd 2014

5 Using another example, the following table demonstrates how the alignment may fall after the next fullword, doubleword or quadword. Instruction Current location counter New location counter Comment CNOP 2,4 x'38' x'3a' Fullword at x'38' +2 CNOP 6,16 x'1038' x'1046' Quadword at x'1040' +6 (x'1036' is not free) CNOP 10,16 x'2038' x'203a' Quadword at x'2030'+10 The assembler listing containing the above can be seen in Table C at the end of this section. Looking at the following extract from the assembly we can see: F1F2F3F4F5F6F7F8 21 DC C' ' Plus another 8 bytes CNOP 6,16 Align on a quadword E C2C2 23 DC C'BB' Demonstrate where we are This demonstrates that coding CNOP 6,16 from offset x'1038' requires us to go 6 bytes past the next quadword boundary to get to a free offset of 6 from a quadword boundary. The offset of 6 from the previous quadword boundary at x'1030' would place us at x'1036' which is before the CNOP instruction and is therefore not free. Coding CNOP 10,16 from offset x'3a' only requires us to skip 2 bytes to get to the next 10 byte offset past the doubleword boundary at x'30'. Page 5 Copyright IBM (UK) Ltd 2014

6 CNOP Generated no-operation instructions Let's now look at the no-operation instructions which CNOP may generate to fill any bytes skipped in order to achieve the required alignment. It is essential for HLASM to do this because if we were to just skip some bytes, the contents of these skipped bytes would be unpredictable. The no-operation instructions generated vary depending on how many bytes need to be filled as shown in the table below. They are all equivalent to a no-operation instruction. Bytes to fill Instructions generated Equivalent mnemonics 2 x'0700' BCR 0,0 4 x' ' BC 0,700(0,0) 6 x' ' BCR 0,0 BC 0,700(0,0) 8 14 Above + x' ' The intention of generating different instructions according to how many bytes need to be filled is to fill the gap with the fewest number of executable instructions. The assembler listing demonstrating the above equivalence of the BCR and BC mnemonics with the instructions generated can be seen in Table D at the end of this section. Page 6 Copyright IBM (UK) Ltd 2014

7 Output from sample assemblies demonstrating use of CNOP The following output now demonstrate the examples used above. The following extracts are strictly for the purposes of demonstrating the action of the CNOP instruction and do not serve any other useful purpose. Table A 2 * Code to demonstrate CNOP processing to align on 3 * a fullword, doubleword and a quadword. 4 * CNOPTST1 CSECT 6 CNOPTST1 AMODE ANY R:C USING *,12 8 * Fill with a little data to get us away from the start F0F1F2F3F4F5F6F7 9 DC 3C' ABCDEF' Fill with x'30' bytes C1C1 10 DC C'AA' Plus another 2 bytes CNOP 0,4 Align on a fullword C2C2 12 DC C'BB' Demonstrate where we are A 13 CNOPTST2 CSECT 14 CNOPTST2 AMODE ANY R:C USING *,12 16 * Fill with a little data to get us away from the start F0F1F2F3F4F5F6F7 17 DC 3C' ABCDEF' Fill with x'30' bytes C1C1 18 DC C'AA' Plus another 2 bytes CNOP 0,8 Align on a doubleword C2C2 20 DC C'BB' Demonstrate where we are CNOPTST3 CSECT 22 CNOPTST3 AMODE ANY R:C USING *,12 24 * Fill with a little data to get us away from the start F0F1F2F3F4F5F6F7 25 DC 3C' ABCDEF' Fill with x'30' bytes C1C1 26 DC C'AA' Plus another 2 bytes CNOP 0,16 Align on a quadword C2C2 28 DC C'BB' Demonstrate where we are LTORG 30 END Page 7 Copyright IBM (UK) Ltd 2014

8 Table B 2 * Code to demonstrate CNOP processing to 3 * align on various offsets from a 4 * fullword, doubleword and a quadword. 5 * CNOPTST4 CSECT 7 CNOPTST4 AMODE ANY R:C USING *,12 9 * Fill with a little data to get us away from the start F0F1F2F3F4F5F6F7 10 DC 3C' ABCDEF' Fill with x'30' bytes C1C1 11 DC C'AA' Plus another 2 bytes CNOP 2,4 Align on a fullword C2C2 13 DC C'BB' Demonstrate where we are CNOPTST5 CSECT 15 CNOPTST5 AMODE ANY R:C USING *,12 17 * Fill with a little data to get us away from the start F0F1F2F3F4F5F6F7 18 DC 3C' ABCDEF' Fill with x'30' bytes C1C1 19 DC C'AA' Plus another 2 bytes CNOP 6,8 Align on a doubleword C2C2 21 DC C'BB' Demonstrate where we are CNOPTST6 CSECT 23 CNOPTST6 AMODE ANY R:C USING *,12 25 * Fill with a little data to get us away from the start F0F1F2F3F4F5F6F7 26 DC 3C' ABCDEF' Fill with x'30' bytes C1C1 27 DC C'AA' Plus another 2 bytes CNOP 12,16 Align on a quadword C C2C2 29 DC C'BB' Demonstrate where we are LTORG 31 END Table C 2 * Code to demonstrate CNOP processing to align on various 3 * offsets from a fullword, doubleword and a quadword. 4 * 5 * Note that the offset may exist after the next 6 * boundary alignment. 7 * C 8 CNOPTST7 CSECT 9 CNOPTST7 AMODE ANY R:C USING *,12 1 Fill with a little data to get us away from the start F0F1F2F3F4F5F6F7 12 DC 3C' ABCDEF' Fill with x'30' bytes F1F2F3F4F5F6F7F8 13 DC C' ' Plus another 8 bytes CNOP 2,4 Align on a fullword A C2C2 15 DC C'BB' Demonstrate where we are CNOPTST8 CSECT 17 CNOPTST8 AMODE ANY R:C USING *,12 19 * Fill with a little data to get us away from the start F0F1F2F3F4F5F6F7 20 DC 3C' ABCDEF' Fill with x'30' bytes F1F2F3F4F5F6F7F8 21 DC C' ' Plus another 8 bytes CNOP 6,16 Align on a quadword E C2C2 23 DC C'BB' Demonstrate where we are CNOPTST9 CSECT 25 CNOPTST9 AMODE ANY R:C USING *,12 27 * Fill with a little data to get us away from the start F0F1F2F3F4F5F6F7 28 DC 3C' ABCDEF' Fill with x'30' bytes F1F2F3F4F5F6F7F8 29 DC C' ' Plus another 8 bytes CNOP 10,16 Align on a fullword A C2C2 31 DC C'BB' Demonstrate where we are LTORG 33 END Page 8 Copyright IBM (UK) Ltd 2014

9 Table D 2 * Code to demonstrate that op-codes generated by CNOP are 3 * equivalent to Branch Conditional mnemonics with a mask 4 * of 0 to cause the branch to never be taken, this being 5 * equivalent to a no-operation instruction. 6 * CNOPTSTA CSECT 8 CNOPTSTA AMODE ANY R:C USING *,12 10 * Demonstrate the mnemonics used BCR 0, BC 0,x'700'(0,0) 13 END Page 9 Copyright IBM (UK) Ltd 2014

10 CNOP Enhancements Now that we understand how the CNOP instruction operates we can look at the enhancements made to CNOP processing by APAR PI It should be noted that references to enhanced CNOP are only used to distinguish between CNOP processing prior to APAR PI17455 and post PI Enhanced CNOP is in no sense a new instruction. The the instruction format remains unchanged as: >> CNOP byte,boundary >< +--symbol--+ The primary reason for the enhancements was a requirement for HLASM to support larger boundary values than 16. The value accepted by the boundary operand must remain as a power of 2 but has been increased to allow a maximum value equal to that of SECTALGN. Where SECTALGN has its maximum permissible value of 4096, the value of boundary can therefore now be one of 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, We still need to be able to align to any halfword within the new boundary value so valid values for the byte operand are still from 0 up to 2 less than the new limit for the boundary value, i.e. a value of 4094 is the maximum permitted for byte when boundary is set to its maximum permitted value of We still need to fill any gap between the last instruction before the CNOP and the first instruction after the CNOP with no-operation instructions. Because this could now entail filling up to 4094 bytes, there have also been some enhancements to the instructions generated for this. The enhanced CNOP instruction now exploits relative branch instructions. To demonstrate how any gap is filled with instructions, the key points are each described below. The assembler listing extracts from example programs which demonstrate each of the logic points has also been included below. As we have already seen, it was previously the case that any gap caused by CNOP alignment would be filled by multiple instances of 2 byte BCR and / or 4 byte BC instruction. This is no longer necessarily the case. Prior to APAR PI17455, the maximum value for the byte operand was 14, so this would also be the maximum number of bytes which CNOP could generate to modify alignment. Therefore where 16 or more bytes are to be filled or the boundary value is 16 or greater, there can be no compatibility concerns. This will explain the references to 16 in many of the following logic points. Where the value of boundary is 16 or less, these bytes will be filled with exactly the same instructions as before APAR PI17455, so as to ensure code generated after the APAR is identical to code generated before. See Table E-New for the assembler listing generated with PI17455 and Table E-Old for the assembler listing generated prior to Page 10 Copyright IBM (UK) Ltd 2014

11 PI Where the value of boundary is greater than 16 it will be ensured that no instruction crosses a boundary. This can be seen in the following extract from table F F0F1F2F3F4F5F6F7 13 DC C' ABCD' Fill with x'e' bytes F8F9C1C2C3C E CNOP 18,32 Skip to offset A C2C2 15 DC C'BB' Demonstrate where we are Here, the CNOP instruction is 2 bytes before a boundary and 20 bytes are required to fill the gap. This could have been done by repeating the 4 byte no-operation instruction x' ' five times. However to avoid crossing the 32 bytes boundary specified in the CNOP instruction at x'20' with a 4 byte instruction, the 4 byte instruction is now changed to two 2 byte no-operation instruction of x'0700'. The first of these takes us up to the x'20' 32 byte boundary and the second of these follows it. Where the value of boundary is 16 or greater and the OPTABLE value specified is not one of DOS, 370 or XA, we can take advantage of what are in effect 6 byte nooperation instructions. Naturally, if the OPTABLE is one of DOS, 370 or XA then we have to restrict generated instructions to the supported 2 and 4 byte no-operation instructions available on these platforms. The 6 byte no-operation instruction is: x'c ' which is equivalent to a BRCL 0,offset instruction which with the mask of 0 will never branch, so is a no-operation instruction. By using 6 byte no-operation instructions in preference to 2 or 4 byte no-operation instructions we can reduce the number of instructions to be executed, and also reduce the amount of output produced by disassemblers. The fact that the BRCL instruction is not available with DOS, 370 or XA explains why it becomes vital what when CNOP is being used and may require 16 or more bytes of instruction to be generated, that an appropriate HLASM assembler option OPTABLE value is specified so as to prevent instructions being generated which may not be valid for the box on which the code is going to run. This can be seen in the following extract from Table G: F0F1F2F3F4F5F6F7 12 DC 2C' ABCDEF' Fill with x'20' bytes F8F9C1C2C3C4C5C F0F1F2F3F4F5F6F F8F9C1C2C3C4C5C A7F CNOP 16,32 Skip to offset C A C C2C2 14 DC C'BB' Demonstrate where we are Page 11 Copyright IBM (UK) Ltd 2014

12 Here we can see that the area to be filled includes 6 byte no-operation instruction of x'c '. Where the OPTABLE value is not one of DOS, 370 or XA, then we have the option to take advantage of the 4 byte BRC instruction and 6 byte BRCL instruction not only as no-operation instruction, but also to branch around the entire area filled with nooperation instructions, thereby potentially significantly reducing the number of instructions which require to be executed down to 1 (or 2 if the first two bytes are filled with x'0700' as per the logic point 2 above). The BRC and BRCL instructions are only used where 16 bytes or more need to be filled with no-operation instructions. This can be seen in the following extracts from Table H F0F1F2F3F4F5F6F7 12 DC 2C' ABCDEF' Fill with x'20' bytes F8F9C1C2C3C4C5C F0F1F2F3F4F5F6F F8F9C1C2C3C4C5C A7F CNOP 16,32 Skip to offset C A C C2C2 14 DC C'BB' Demonstrate where we are Above we can see at location x'20' the instruction is x'a7f40008' which is equivalent to a BRC unconditionally branching the 8 halfwords needed to take us to the next instruction after the CNOP. Below we can see that at location x'1020' the instruction is x'c0f ' which is equivalent to a BRCL unconditionally branching the 9 halfwords needed to take us to the next instruction after the CNOP F0F1F2F3F4F5F6F7 19 DC 2C' ABCDEF' Fill with x'20' bytes F8F9C1C2C3C4C5C F0F1F2F3F4F5F6F F8F9C1C2C3C4C5C C0F CNOP 18,32 Skip to offset C C C C2C2 21 DC C'BB' Demonstrate where we are Where the BRC or BRCL instructions are generated, the addr2 value will be printed in the assembler listing to make it easier to see where the code will continue execution, as can be seen above. Printing CNOP instructions Currently it is possible that the CNOP instruction may result in 1 or 2 lines of output in the assembler listing. As already mentioned, it is now possible for up to 4094 bytes to be required to achieve the desired alignment which could result in many hundreds of lines in the assembler listing from just a single CNOP instruction. To enable users to be able to control how much output is printed in the assembler listing, the PCONTROL(DATA/NODATA) or PRINT(DATA/NODATA)assembler options can be used. PCONTROL(DATA) and PRINT(DATA) will result in all generated instructions being Page 12 Copyright IBM (UK) Ltd 2014

13 printed, while PCONTROL(NODATA) and PRINT(NODATA) will only result in up to 2 lines being printed. PCONTROL(NODATA) and PRINT(NODATA) printing up to 2 lines was done again for compatibility reasons, the CNOP instruction without PI17455 printing up to 2 lines. This can be seen in the following extracts from Table G and Table I. Table I was created using identical input as table G, but with the PC(NODATA) option in effect F0F1F2F3F4F5F6F7 12 DC 2C' ABCDEF' Fill with x'20' bytes F8F9C1C2C3C4C5C F0F1F2F3F4F5F6F F8F9C1C2C3C4C5C A7F CNOP 16,32 Skip to offset C A C C2C2 14 DC C'BB' Demonstrate where we are With PC(DATA) on above we can see that the CNOP statement generates 3 lines of assembler listing at offsets x'20', x'24' and x'2a' F0F1F2F3F4F5F6F7 12 DC 2C' ABCDEF' Fill with x'20' bytes A7F CNOP 16,32 Skip to offset C C2C2 14 DC C'BB' Demonstrate where we are With PC(NODATA) above, the amount of data generated for the assembler listing by a CNOP instruction is limited to just 2 lines at offsets x'20' and x'24'. Summary It can therefore be seen from this technote how PI17455 has enhanced CNOP processing such that: The value of the CNOP boundary operand is now valid up to the value of SECTALGN and alignment can be achieved on any halfword within this range. Where the value of the boundary operand is greater than 16 it will be ensured that no instruction crosses a boundary. Where the value of the boundary operand is 16 or greater and the OPTABLE value specified is not one of DOS, 370 or XA we may use 6 byte no-operation instructions. Where the OPTABLE value is not one of DOS, 370 or XA, we may branch around CNOP generated no-operation instructions by using a BRC or BRCL instruction. We can control how much is printed in the listing as a result of a CNOP instruction by using the PRINT(DATA/NODATA) or PCONTROL(DATA/NODATA) options. Page 13 Copyright IBM (UK) Ltd 2014

14 Output from sample assemblies demonstrating enhanced CNOP Table E-New 2 * Code to demonstrate CNOP logic. 3 * Logic point 1. Where 14 or fewer bytes need to be filled with 4 * no-operation op-codes, they will be filled with exactly the 5 * same op-codes as before PI17455 to ensure code generated with 6 * the APAR is identical to code generated before it is applied. 7 * CNOPR1A CSECT 9 CNOPR1A AMODE ANY R:C USING *,12 11 ACONTROL OPTABLE(ZS6) Allow new op-codes 12 * Fill with a little data to get us away from the start F0F1F2F3F4F5F6F7 13 DC 3C' ABCDEF' Fill with x'30' bytes CNOP 14,16 Skip to offset E C2C2 15 DC C'BB' Demonstrate where we are 16 ACONTROL OPTABLE(UNI) Code must be compatible 17 * CNOP 14,16 Skip to offset E C2C2 19 DC C'BB' Demonstrate where we are LTORG 21 END Table E-Old 2 * Code to demonstrate CNOP logic. 3 * Logic point 1. Where 14 or fewer bytes need to be filled with 4 * no-operation op-codes, they will be filled with exactly the 5 * same op-codes as before PI17455 to ensure code generated with 6 * the APAR is identical to code generated before it is applied. 7 * CNOPR1A CSECT 9 CNOPR1A AMODE ANY R:C USING *,12 11 ACONTROL OPTABLE(ZS6) Allow new op-codes 12 * Fill with a little data to get us away from the start F0F1F2F3F4F5F6F7 13 DC 3C' ABCDEF' Fill with x'30' bytes CNOP 14,16 Skip to offset E C2C2 15 DC C'BB' Demonstrate where we are 16 ACONTROL OPTABLE(UNI) Code must be compatible 17 * CNOP 14,16 Skip to offset E C2C2 19 DC C'BB' Demonstrate where we are LTORG 21 END Page 14 Copyright IBM (UK) Ltd 2014

15 Table F 2 * Code to demonstrate CNOP logic. 3 * Logic point 2. Where 16 or more bytes need to be filled 4 * and the byte value is non zero, no op-code will cross a 5 * boundary. 6 * CNOPR2 CSECT 8 CNOPR2 AMODE ANY R:C USING *,12 10 ACONTROL OPTABLE(XA) 1 Fill with a little data to get us away from the start F0F1F2F3F4F5F6F7 12 DC C' ABCDEF' Fill with x'10' bytes F8F9C1C2C3C4C5C F0F1F2F3F4F5F6F7 13 DC C' ABCD' Fill with x'e' bytes F8F9C1C2C3C E CNOP 18,32 Skip to offset A C2C2 15 DC C'BB' Demonstrate where we are LTORG 17 END Table G 2 * Code to demonstrate CNOP logic. 3 * Logic point 3. Where 16 or more bytes need to be filled 4 * we may use BR and BRC op-codes. 5 * 6 * CNOPR3 CSECT 8 CNOPR3 AMODE ANY R:C USING *,12 10 ACONTROL OPTABLE(ESA) 1 Fill with a little data to get us away from the start F0F1F2F3F4F5F6F7 12 DC 2C' ABCDEF' Fill with x'20' bytes F8F9C1C2C3C4C5C F0F1F2F3F4F5F6F F8F9C1C2C3C4C5C A7F CNOP 16,32 Skip to offset C A C C2C2 14 DC C'BB' Demonstrate where we are LTORG 16 END Page 15 Copyright IBM (UK) Ltd 2014

16 Table H 2 * Code to demonstrate CNOP logic. 3 * Logic point 4. Where 16 or more bytes need to be filled 4 * we may use BRC and BRCL op-codes to branch around large 5 * amounts of code in a single instruction. 6 * CNOPR4A CSECT 8 CNOPR4A AMODE ANY R:C USING *,12 10 ACONTROL OPTABLE(ESA) 1 Fill with a little data to get us away from the start F0F1F2F3F4F5F6F7 12 DC 2C' ABCDEF' Fill with x'20' bytes F8F9C1C2C3C4C5C F0F1F2F3F4F5F6F F8F9C1C2C3C4C5C A7F CNOP 16,32 Skip to offset C A C C2C2 14 DC C'BB' Demonstrate where we are CNOPR4B CSECT 16 CNOPR4B AMODE ANY R:C USING *,12 18 * Fill with a little data to get us away from the start F0F1F2F3F4F5F6F7 19 DC 2C' ABCDEF' Fill with x'20' bytes F8F9C1C2C3C4C5C F0F1F2F3F4F5F6F F8F9C1C2C3C4C5C C0F CNOP 18,32 Skip to offset C C C C2C2 21 DC C'BB' Demonstrate where we are CNOPR4C CSECT 23 CNOPR4C AMODE ANY R:C USING *,12 25 * Fill with a little data to get us away from the start F0F1F2F3F4F5F6F7 26 DC 2C' ABCDEF' Fill with x'20' bytes F8F9C1C2C3C4C5C F0F1F2F3F4F5F6F F8F9C1C2C3C4C5C C0F A CNOP 20,32 Skip to offset C E C C2C2 28 DC C'BB' Demonstrate where we are CNOPR4D CSECT 30 CNOPR4D AMODE ANY R:C USING *,12 32 * Fill with a little data to get us away from the start F0F1F2F3F4F5F6F7 33 DC 2C' ABCDEF' Fill with x'20' bytes F8F9C1C2C3C4C5C F0F1F2F3F4F5F6F F8F9C1C2C3C4C5C A7F4000B CNOP 22,32 Skip to offset C A C C C2C2 35 DC C'BB' Demonstrate where we are LTORG 37 END Page 16 Copyright IBM (UK) Ltd 2014

17 Table I 2 * Code to demonstrate CNOP logic. 3 * Logic point 3. Where 16 or more bytes need to be filled 4 * we may use BR and BRC op-codes. 5 * 6 * CNOPR3 CSECT 8 CNOPR3 AMODE ANY R:C USING *,12 10 ACONTROL OPTABLE(ESA) 1 Fill with a little data to get us away from the start F0F1F2F3F4F5F6F7 12 DC 2C' ABCDEF' Fill with x'20' bytes A7F CNOP 16,32 Skip to offset C C2C2 14 DC C'BB' Demonstrate where we are LTORG 16 END Page 17 Copyright IBM (UK) Ltd 2014

Assembler Language "Boot Camp" Part 2 - Instructions and Addressing. SHARE 118 in Atlanta Session March 12, 2012

Assembler Language Boot Camp Part 2 - Instructions and Addressing. SHARE 118 in Atlanta Session March 12, 2012 Assembler Language "Boot Camp" Part 2 - Instructions and Addressing SHARE 118 in Atlanta Session 10345 March 12, 2012 1 Introduction Who are we? John Ehrman, IBM Software Group Dan Greiner, IBM Systems

More information

Assembler Language "Boot Camp" Part 2 - Instructions and Addressing SHARE 116 in Anaheim February 28, 2011

Assembler Language Boot Camp Part 2 - Instructions and Addressing SHARE 116 in Anaheim February 28, 2011 Assembler Language "Boot Camp" Part 2 - Instructions and Addressing SHARE 116 in Anaheim February 28, 2011 Introduction Who are we? John Ehrman, IBM Software Group John Dravnieks, IBM Software Group Dan

More information

DEFINING DATA CONSTANTS AND SYMBOLS

DEFINING DATA CONSTANTS AND SYMBOLS Chapter 2 DEFINING DATA CONSTANTS AND SYMBOLS SYS-ED/ Computer Education Techniques, Inc. Objectives You will learn: Data types. Defining constants. Truncation and padding. Alignment - constants and boundary.

More information

Assembler Language "Boot Camp" Part 3x - Implicit Addresses and USING SHARE in New York City August 15-20, 2004 Session 8188

Assembler Language Boot Camp Part 3x - Implicit Addresses and USING SHARE in New York City August 15-20, 2004 Session 8188 Assembler Language "Boot Camp" Part 3x - Implicit Addresses and USING SHARE in New York City August 15-20, 2004 Session 8188 1 Introduction Who are we? John Dravnieks, IBM Australia John Ehrman, IBM Silicon

More information

Assembler Language "Boot Camp" Part 3 - Assembly and Execution; Branching SHARE 115 in Boston August 3, 2009

Assembler Language Boot Camp Part 3 - Assembly and Execution; Branching SHARE 115 in Boston August 3, 2009 Assembler Language "Boot Camp" Part 3 - Assembly and Execution; Branching SHARE 115 in Boston August 3, 2009 Introduction Who are we? John Ehrman, IBM Software Group Dan Greiner, IBM Systems & Technology

More information

Assembler Language "Boot Camp" Part 4 - Program Structures; Arithmetic. SHARE 118 in Atlanta Session March 14, 2012

Assembler Language Boot Camp Part 4 - Program Structures; Arithmetic. SHARE 118 in Atlanta Session March 14, 2012 Assembler Language "Boot Camp" Part 4 - Program Structures; Arithmetic SHARE 118 in Atlanta Session 10347 March 14, 2012 1 Introduction Who are we? John Ehrman, IBM Software Group Dan Greiner, IBM Systems

More information

Assembler Language "Boot Camp" Part 4 - Program Structures; Arithmetic SHARE 116 in Anaheim March 2, 2011

Assembler Language Boot Camp Part 4 - Program Structures; Arithmetic SHARE 116 in Anaheim March 2, 2011 Assembler Language "Boot Camp" Part 4 - Program Structures; Arithmetic SHARE 116 in Anaheim March 2, 2011 Introduction Who are we? John Ehrman, IBM Software Group John Dravnieks, IBM Software Group Dan

More information

Assembler Language "Boot Camp" Part 4 - Arithmetic; Program Structures SHARE in San Francisco August 18-23, 2002 Session 8184

Assembler Language Boot Camp Part 4 - Arithmetic; Program Structures SHARE in San Francisco August 18-23, 2002 Session 8184 Assembler Language "Boot Camp" Part 4 - Arithmetic; Program Structures SHARE in San Francisco August 18-23, 2002 Session 8184 1 Introduction Who are we? John Dravnieks, IBM Australia John Ehrman, IBM Silicon

More information

Instruction Sets: Characteristics and Functions

Instruction Sets: Characteristics and Functions Instruction Sets: Characteristics and Functions Chapter 10 Lesson 15 Slide 1/22 Machine instruction set Computer designer: The machine instruction set provides the functional requirements for the CPU.

More information

Assembler University 303: A Gentle Introduction to Trimodal Programming on z/architecture

Assembler University 303: A Gentle Introduction to Trimodal Programming on z/architecture Assembler University 303: A Gentle Introduction to Trimodal Programming on z/architecture SHARE 116 in Anaheim, Session 8981 Avri J. Adleman, IBM adleman@us.ibm.com (Presented by John Ehrman, IBM) March

More information

Chapter 6 What's this Stuff on the Left?

Chapter 6 What's this Stuff on the Left? Chapter 6 What's this Stuff on the Left? Objectives Upon completion of this chapter you will be able to: Describe the SI instruction format as used with the MVI and CLI instructions, Describe the SS instruction

More information

SHARE Pittsburgh 2014 High Level Assembler Bootcamp (16153, 16154, 16155)

SHARE Pittsburgh 2014 High Level Assembler Bootcamp (16153, 16154, 16155) Richard Cebula IBM HLASM SHARE Pittsburgh 2014 High Level Assembler Bootcamp (16153, 16154, 16155) 2013 IBM Corporation Who am I? Sharuff Morsa HLASM, IBM Hursley, UK Material written by Richard Cebula

More information

Chapter Introduction

Chapter Introduction Chapter 1 1. Introduction High-performance computer systems depend on good hardware design coupled with powerful compilers and operating systems. Although announced in 1991, the PowerPC architecture represents

More information

Assembly: Review. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 14

Assembly: Review. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 14 Assembly: Review Computer Science and Engineering College of Engineering The Ohio State University Lecture 14 Definition Recall: Translation A source program is translated into a target program Each language

More information

SHARE Anaheim 2014 High Level Assembler Bootcamp (15250, 15251, 15252)

SHARE Anaheim 2014 High Level Assembler Bootcamp (15250, 15251, 15252) Richard Cebula IBM HLASM SHARE Anaheim 2014 High Level Assembler Bootcamp (15250, 15251, 15252) 2009 IBM Corporation 2013 IBM Corporation HLASM Structured Programming The location counter and USINGs 2

More information

Relative Addressing (the bits I didn't mention in part one!)

Relative Addressing (the bits I didn't mention in part one!) II Relative Addressing (the bits I didn't mention in part one!) Part II Author: Sharuff Morsa smorsa@uk.ibm.com Copyright IBM (UK) Ltd 2012 1 II Introduction Part I demonstrated how to replace base registers

More information

Assembler Language Macro "Boot Camp" Part 1

Assembler Language Macro Boot Camp Part 1 Assembler Language Macro "Boot Camp" Part 1 SHARE in Austin March 1-6, 2009 Session 8158 Who am I? Michael Stack, K Cats Consulting Instructor in Computer Science at Northern Illinois University from 1982-2007,

More information

Compiler Design. Homework 1. Due Date: Thursday, January 19, 2006, 2:00

Compiler Design. Homework 1. Due Date: Thursday, January 19, 2006, 2:00 Homework 1 Due Date: Thursday, January 19, 2006, 2:00 Your Name: Question 1 Is SPARC big- or little- Endian? When a word of data is stored in memory, which byte is stored in the first byte (i.e., in the

More information

17. Instruction Sets: Characteristics and Functions

17. Instruction Sets: Characteristics and Functions 17. Instruction Sets: Characteristics and Functions Chapter 12 Spring 2016 CS430 - Computer Architecture 1 Introduction Section 12.1, 12.2, and 12.3 pp. 406-418 Computer Designer: Machine instruction set

More information

Assembler Programming

Assembler Programming 31-Bit Mode - Assembler Programming... 13:3 4095 - Limit... 4:17 A ACB: Access Method Control Block...10:2-3 Access Method... 6:1 Add Instructions - A, AR, and AH... 4:8 Addressability... 1:9 Addressing...

More information

MIPS (SPIM) Assembler Syntax

MIPS (SPIM) Assembler Syntax MIPS (SPIM) Assembler Syntax Comments begin with # Everything from # to the end of the line is ignored Identifiers are a sequence of alphanumeric characters, underbars (_), and dots () that do not begin

More information

ARM Cortex-M4 Architecture and Instruction Set 3: Branching; Data definition and memory access instructions

ARM Cortex-M4 Architecture and Instruction Set 3: Branching; Data definition and memory access instructions ARM Cortex-M4 Architecture and Instruction Set 3: Branching; Data definition and memory access instructions M J Brockway February 17, 2016 Branching To do anything other than run a fixed sequence of instructions,

More information

IBM Education Assistance for z/os V2R2

IBM Education Assistance for z/os V2R2 IBM Education Assistance for z/os V2R2 Item: J-con, RAS, Long section name and LP64 DLL Element/Component: Binder Material current as of May 2015 FP0207 J-con Page 2 of 25 Agenda Trademarks Presentation

More information

Introduction to HLASM SHARE Boston 2013 High Level Assembler Bootcamp. Example 1. Example 2

Introduction to HLASM SHARE Boston 2013 High Level Assembler Bootcamp. Example 1. Example 2 Introduction to HLASM SHARE Boston 2013 High Level Assembler Bootcamp Example 1 SIMPLE HELLO WORLD PROGRAM MAIN PROGRAM STARTS HERE EX1 CSECT EX1 AMODE 31 EX1 RMODE 24 USUAL PROGRAM SETUP

More information

Assembler Language "Boot Camp" Part 1 - Numbers and Basic Arithmetic SHARE 115 in Boston August 1-5, 2010

Assembler Language Boot Camp Part 1 - Numbers and Basic Arithmetic SHARE 115 in Boston August 1-5, 2010 Assembler Language "Boot Camp" Part 1 - Numbers and Basic Arithmetic SHARE 115 in Boston August 1-5, 2010 Introduction Who are we? John Ehrman, IBM Software Group Dan Greiner, IBM Systems & Technology

More information

Assembly language Simple, regular instructions building blocks of C, Java & other languages Typically one-to-one mapping to machine language

Assembly language Simple, regular instructions building blocks of C, Java & other languages Typically one-to-one mapping to machine language Assembly Language Readings: 2.1-2.7, 2.9-2.10, 2.14 Green reference card Assembly language Simple, regular instructions building blocks of C, Java & other languages Typically one-to-one mapping to machine

More information

Assembler Directives

Assembler Directives Assembler Directives The assembler directives do not emit machine language but, as the name indicates, direct the assembler to perform certain operations only during the assembly process. Here are a number

More information

Chapter 2A Instructions: Language of the Computer

Chapter 2A Instructions: Language of the Computer Chapter 2A Instructions: Language of the Computer Copyright 2009 Elsevier, Inc. All rights reserved. Instruction Set The repertoire of instructions of a computer Different computers have different instruction

More information

Computer Architecture

Computer Architecture CS3350B Computer Architecture Winter 2015 Lecture 4.2: MIPS ISA -- Instruction Representation Marc Moreno Maza www.csd.uwo.ca/courses/cs3350b [Adapted from lectures on Computer Organization and Design,

More information

Saving Your Caller's Registers - Not Your Father's Save Area

Saving Your Caller's Registers - Not Your Father's Save Area Saving Your Caller's Registers - Not Your Father's Save Area Tom Marchant Compuware thomas.marchant@compuware.com Tuesday, August 7, 2012 Session 11408 1 Acknowledgments Peter Relson, z/os Core Technology

More information

CSIS1120A. 10. Instruction Set & Addressing Mode. CSIS1120A 10. Instruction Set & Addressing Mode 1

CSIS1120A. 10. Instruction Set & Addressing Mode. CSIS1120A 10. Instruction Set & Addressing Mode 1 CSIS1120A 10. Instruction Set & Addressing Mode CSIS1120A 10. Instruction Set & Addressing Mode 1 Elements of a Machine Instruction Operation Code specifies the operation to be performed, e.g. ADD, SUB

More information

Lecture 04: Machine Instructions

Lecture 04: Machine Instructions CSCI2510 Computer Organization Lecture 04: Machine Instructions Ming-Chang YANG mcyang@cse.cuhk.edu.hk Reading: Chap. 2.3~2.4, 2.10~2.11 Recall: Instructions & Program A computer is governed by instructions.

More information

Assembler University 207: Powerful New z/architecture Instructions That Don't Require AMODE(64), Part 2

Assembler University 207: Powerful New z/architecture Instructions That Don't Require AMODE(64), Part 2 Assembler University 207: Powerful New z/architecture Instructions That Don't Require AMODE(64), Part 2 SHARE 116 in Anaheim, Session 8983 Avri J. Adleman, IBM adleman@us.ibm.com (Presented by John Ehrman,

More information

Instruction Sets: Characteristics and Functions Addressing Modes

Instruction Sets: Characteristics and Functions Addressing Modes Instruction Sets: Characteristics and Functions Addressing Modes Chapters 10 and 11, William Stallings Computer Organization and Architecture 7 th Edition What is an Instruction Set? The complete collection

More information

Harry H. Porter, 2006

Harry H. Porter, 2006 The SPARC Computer Architecture Harry Porter Portland State University 1 CS-321 Lexer Parser Type Checking Intermediate Code Generation All semantic error checking finished in this phase IR - Intermediate

More information

Instructions: Language of the Computer

Instructions: Language of the Computer CS359: Computer Architecture Instructions: Language of the Computer Yanyan Shen Department of Computer Science and Engineering 1 The Language a Computer Understands Word a computer understands: instruction

More information

z/os Basics: ABEND and Recovery (All You Need to Know to Write Your First ESTAE)

z/os Basics: ABEND and Recovery (All You Need to Know to Write Your First ESTAE) z/os Basics: ABEND and Recovery (All You Need to Know to Write Your First ESTAE) Vit Gottwald CA Technologies August 3, 2010 Session Number 8017 Agenda Introduction Basic Hardware Terms Instruction Execution

More information

High Level Assembler for z/os & z/vm & z/vse. Language Reference. Version 1 Release 6 SC

High Level Assembler for z/os & z/vm & z/vse. Language Reference. Version 1 Release 6 SC High Level Assembler for z/os & z/vm & z/vse Language Reference Version 1 Release 6 SC26-4940-07 High Level Assembler for z/os & z/vm & z/vse Language Reference Version 1 Release 6 SC26-4940-07 Note Before

More information

CS3350B Computer Architecture MIPS Instruction Representation

CS3350B Computer Architecture MIPS Instruction Representation CS3350B Computer Architecture MIPS Instruction Representation Marc Moreno Maza http://www.csd.uwo.ca/~moreno/cs3350_moreno/index.html Department of Computer Science University of Western Ontario, Canada

More information

Assembler Language "Boot Camp" Part 5 - Decimal and Logical Instructions. SHARE 117 in Orlando Session 9214 August 11, 2011

Assembler Language Boot Camp Part 5 - Decimal and Logical Instructions. SHARE 117 in Orlando Session 9214 August 11, 2011 Assembler Language "Boot Camp" Part 5 - Decimal and Logical Instructions SHARE 117 in Orlando Session 9214 August 11, 2011 1 Introduction Who are we? John Ehrman, IBM Software Group Dan Greiner, IBM Systems

More information

Assembler Language "Boot Camp" Part 5 - Decimal and Logical Instructions SHARE 116 in Anaheim March 3, 2011

Assembler Language Boot Camp Part 5 - Decimal and Logical Instructions SHARE 116 in Anaheim March 3, 2011 Assembler Language "Boot Camp" Part 5 - Decimal and Logical Instructions SHARE 116 in Anaheim March 3, 2011 Introduction Who are we? John Ehrman, IBM Software Group John Dravnieks, IBM Software Group Dan

More information

Agenda. -2Assembler BootCamp Plus: Instructions Everyone Can Use

Agenda. -2Assembler BootCamp Plus: Instructions Everyone Can Use -2Assembler BootCamp Plus: Instructions Everyone Can Use (Created by) John Dravnieks, IBM Australia (dravo@au1.ibm.com) (Presented by Dan Greiner and John Ehrman) SHARE 117, Orlando, FL Thursday, August

More information

Assembly language Simple, regular instructions building blocks of C, Java & other languages Typically one-to-one mapping to machine language

Assembly language Simple, regular instructions building blocks of C, Java & other languages Typically one-to-one mapping to machine language Assembly Language Readings: 2.1-2.7, 2.9-2.10, 2.14 Green reference card Assembly language Simple, regular instructions building blocks of C, Java & other languages Typically one-to-one mapping to machine

More information

The X86 Assembly Language Instruction Nop Means

The X86 Assembly Language Instruction Nop Means The X86 Assembly Language Instruction Nop Means As little as 1 CPU cycle is "wasted" to execute a NOP instruction (the exact and other "assembly tricks", as explained also in this thread on Programmers.

More information

Assembler Language "Boot Camp" Part 1 - Numbers and Basic Arithmetic SHARE in San Francisco August 18-23, 2002 Session 8181

Assembler Language Boot Camp Part 1 - Numbers and Basic Arithmetic SHARE in San Francisco August 18-23, 2002 Session 8181 Assembler Language "Boot Camp" Part 1 - Numbers and Basic Arithmetic SHARE in San Francisco August 18-23, 2002 Session 8181 1 Introduction Who are we? John Dravnieks, IBM Australia John Ehrman, IBM Silicon

More information

SEN361 Computer Organization. Prof. Dr. Hasan Hüseyin BALIK (8 th Week)

SEN361 Computer Organization. Prof. Dr. Hasan Hüseyin BALIK (8 th Week) + SEN361 Computer Organization Prof. Dr. Hasan Hüseyin BALIK (8 th Week) + Outline 3. The Central Processing Unit 3.1 Instruction Sets: Characteristics and Functions 3.2 Instruction Sets: Addressing Modes

More information

Introduction SIC, RISC & CISC 0. Introduction to Systems Programming This course aims at: Understanding what is going on behind the scenes The design and implementation of system software, such as Assemblers

More information

Systems/DBG Debugger Version 2.20

Systems/DBG Debugger Version 2.20 Systems/DBG Debugger Version 2.20 Copyright c 2018, Dignus, LLC Systems/DBG Debugger Version 2.20 i Copyright c 2018 Dignus LLC, 8378 Six Forks Road Suite 203, Raleigh NC, 27615. World rights reserved.

More information

LC-3 Instruction Set Architecture. Textbook Chapter 5

LC-3 Instruction Set Architecture. Textbook Chapter 5 LC-3 Instruction Set Architecture Textbook Chapter 5 Instruction set architecture What is an instruction set architecture (ISA)? It is all of the programmer-visible components and operations of the computer

More information

Computer Organization CS 206 T Lec# 2: Instruction Sets

Computer Organization CS 206 T Lec# 2: Instruction Sets Computer Organization CS 206 T Lec# 2: Instruction Sets Topics What is an instruction set Elements of instruction Instruction Format Instruction types Types of operations Types of operand Addressing mode

More information

Assembler Language Programming. for. IBM System z Servers. Mini-Slides and Lecturer Notes, Version Chapters I to VIII

Assembler Language Programming. for. IBM System z Servers. Mini-Slides and Lecturer Notes, Version Chapters I to VIII Assembler Language Programming for IBM System z Servers Mini-Slides and Lecturer, Version 2.00 Chapters I to VIII John R. Ehrman IBM Silicon Valley Lab Note These pages have space below the miniature copies

More information

Assembler Language "Boot Camp" Part 1 - Numbers and Basic Arithmetic. SHARE 117 in Orlando Session 9210 August 8, 2011

Assembler Language Boot Camp Part 1 - Numbers and Basic Arithmetic. SHARE 117 in Orlando Session 9210 August 8, 2011 Assembler Language "Boot Camp" Part 1 - Numbers and Basic Arithmetic SHARE 117 in Orlando Session 9210 August 8, 2011 1 Introduction Who are we? John Ehrman, IBM Software Group Dan Greiner, IBM Systems

More information

Chapter 04: Instruction Sets and the Processor organizations. Lesson 11: Generation of Memory Addresses and Addressing Modes

Chapter 04: Instruction Sets and the Processor organizations. Lesson 11: Generation of Memory Addresses and Addressing Modes Chapter 04: Instruction Sets and the Processor organizations Lesson 11: Generation of Memory Addresses and Addressing Modes 1 Objective Learn how a memory address generates in different addressing modes

More information

ECE 206, Fall 2001: Lab 3

ECE 206, Fall 2001: Lab 3 ECE 206, : Lab 3 Data Movement Instructions Learning Objectives This lab will give you practice with a number of LC-2 programming constructs. In particular you will cover the following topics: - Load/store

More information

SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC.

SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. Chapter 1: Assembler Language: Introduction Differences between machine and assembler instructions. Macro instructions. Assembly and link editing. Assembler processing. Macro and copy libraries. Control

More information

Lecture 15 Intel Manual, Vol. 1, Chapter 3. Fri, Mar 6, Hampden-Sydney College. The x86 Architecture. Robb T. Koether. Overview of the x86

Lecture 15 Intel Manual, Vol. 1, Chapter 3. Fri, Mar 6, Hampden-Sydney College. The x86 Architecture. Robb T. Koether. Overview of the x86 Lecture 15 Intel Manual, Vol. 1, Chapter 3 Hampden-Sydney College Fri, Mar 6, 2009 Outline 1 2 Overview See the reference IA-32 Intel Software Developer s Manual Volume 1: Basic, Chapter 3. Instructions

More information

Lecture 5: Instruction Set Architectures II. Take QUIZ 2 before 11:59pm today over Chapter 1 Quiz 1: 100% - 29; 80% - 25; 60% - 17; 40% - 3

Lecture 5: Instruction Set Architectures II. Take QUIZ 2 before 11:59pm today over Chapter 1 Quiz 1: 100% - 29; 80% - 25; 60% - 17; 40% - 3 Lecture 5: Instruction Set Architectures II Announcements Turn in Homework #1 XSPIM tutorials in PAI 5.38 during TA office hours Tue Feb 2: 2-3:30pm Wed Feb 3: 1:30-3pm Thu Feb 4: 3-4:30pm Take QUIZ 2

More information

Anne Bracy CS 3410 Computer Science Cornell University. See P&H Chapter: , , Appendix B

Anne Bracy CS 3410 Computer Science Cornell University. See P&H Chapter: , , Appendix B Anne Bracy CS 3410 Computer Science Cornell University The slides are the product of many rounds of teaching CS 3410 by Professors Weatherspoon, Bala, Bracy, and Sirer. See P&H Chapter: 2.16-2.20, 4.1-4.4,

More information

Approaches to Digital System Design

Approaches to Digital System Design Approaches to Digital System Design In Digital Devices, you learned how to create a logic network (Flip-flops + combinational gates) to solve a problem The logic network was SPECIFIC to the problem. To

More information

ASSEMBLERS. Prof. S.J. Soni, SPCE, Visnagar

ASSEMBLERS. Prof. S.J. Soni, SPCE, Visnagar ASSEMBLERS Prof. S.J. Soni, SPCE, Visnagar Design Specifications Identify the information necessary to perform a task Design a suitable data structure to record the information Determine the processing

More information

Introduction to Assembler Programming Sessions 16317, 16318

Introduction to Assembler Programming Sessions 16317, 16318 IBM HLASM SHARE Seattle 2015 Introduction to Assembler Programming Sessions 16317, 16318 Richard Cebula (riccebu@uk.ibm.com) IBM HLASM 2009 IBM Corporation Who am I? Richard Cebula HLASM, IBM Hursley,

More information

ELEC / Computer Architecture and Design Fall 2013 Instruction Set Architecture (Chapter 2)

ELEC / Computer Architecture and Design Fall 2013 Instruction Set Architecture (Chapter 2) ELEC 5200-001/6200-001 Computer Architecture and Design Fall 2013 Instruction Set Architecture (Chapter 2) Victor P. Nelson, Professor & Asst. Chair Vishwani D. Agrawal, James J. Danaher Professor Department

More information

Processor. Han Wang CS3410, Spring 2012 Computer Science Cornell University. See P&H Chapter , 4.1 4

Processor. Han Wang CS3410, Spring 2012 Computer Science Cornell University. See P&H Chapter , 4.1 4 Processor Han Wang CS3410, Spring 2012 Computer Science Cornell University See P&H Chapter 2.16 20, 4.1 4 Announcements Project 1 Available Design Document due in one week. Final Design due in three weeks.

More information

This section covers the MIPS instruction set.

This section covers the MIPS instruction set. This section covers the MIPS instruction set. 1 + I am going to break down the instructions into two types. + a machine instruction which is directly defined in the MIPS architecture and has a one to one

More information

Computer Architecture

Computer Architecture Computer Architecture Chapter 2 Instructions: Language of the Computer Fall 2005 Department of Computer Science Kent State University Assembly Language Encodes machine instructions using symbols and numbers

More information

Course Administration

Course Administration Fall 2017 EE 3613: Computer Organization Chapter 2: Instruction Set Architecture 2/4 Avinash Kodi Department of Electrical Engineering & Computer Science Ohio University, Athens, Ohio 45701 E-mail: kodi@ohio.edu

More information

2. ADDRESSING METHODS

2. ADDRESSING METHODS 2 Addressing Methods STUDY MATERIALS ON COMPUTER ORGANIZATION (As per the curriculum of Third semester BSc Electronics of Mahatma Gandh Uniiversity) Compiled by Sam Kollannore U Lecturer in Electronics

More information

Lecture V Toy Hardware and Operating System

Lecture V Toy Hardware and Operating System 2. THE Machine Lecture V Page 1 Lecture V Toy Hardware and Operating System 1. Introduction For use in our OS projects, we introduce THE Machine where THE is an acronym 1 for Toy HardwarE. We also introduce

More information

Assembler University 201: What is the Assembler Trying to Tell Me? A Guide to Some Answers. SHARE 116 in Anaheim, Session 8636.

Assembler University 201: What is the Assembler Trying to Tell Me? A Guide to Some Answers. SHARE 116 in Anaheim, Session 8636. Assembler University 201: What is the Assembler Trying to Tell Me? A Guide to Some Answers SHARE 116 in Anaheim, Session 8636 March 3, 2011 John R. Ehrman ehrman@us.ibm.com International Business Machines

More information

Writing ARM Assembly. Steven R. Bagley

Writing ARM Assembly. Steven R. Bagley Writing ARM Assembly Steven R. Bagley Introduction Previously, looked at how the system is built out of simple logic gates Last week, started to look at the CPU Writing code in ARM assembly language Assembly

More information

Overview. EE 4504 Computer Organization. Much of the computer s architecture / organization is hidden from a HLL programmer

Overview. EE 4504 Computer Organization. Much of the computer s architecture / organization is hidden from a HLL programmer Overview EE 4504 Computer Organization Section 7 The Instruction Set Much of the computer s architecture / organization is hidden from a HLL programmer In the abstract sense, the programmer should not

More information

CS429: Computer Organization and Architecture

CS429: Computer Organization and Architecture CS429: Computer Organization and Architecture Warren Hunt, Jr. and Bill Young Department of Computer Sciences University of Texas at Austin Last updated: October 1, 2014 at 12:03 CS429 Slideset 6: 1 Topics

More information

QUIZ. Name all the 4 parts of the fetch-execute cycle.

QUIZ. Name all the 4 parts of the fetch-execute cycle. QUIZ Name all the 4 parts of the fetch-execute cycle. 1 Solution Name all the 4 parts of the fetch-execute cycle. 2 QUIZ Name two fundamental differences between magnetic drives and optical drives: 3 Solution

More information

When an instruction is initially read from memory it goes to the Instruction register.

When an instruction is initially read from memory it goes to the Instruction register. CS 320 Ch. 12 Instruction Sets Computer instructions are written in mnemonics. Mnemonics typically have a 1 to 1 correspondence between a mnemonic and the machine code. Mnemonics are the assembly language

More information

Chapter 4 Processor Architecture: Y86 (Sections 4.1 & 4.3) with material from Dr. Bin Ren, College of William & Mary

Chapter 4 Processor Architecture: Y86 (Sections 4.1 & 4.3) with material from Dr. Bin Ren, College of William & Mary Chapter 4 Processor Architecture: Y86 (Sections 4.1 & 4.3) with material from Dr. Bin Ren, College of William & Mary 1 Outline Introduction to assembly programing Introduction to Y86 Y86 instructions,

More information

ECE251: Tuesday Aug. 29

ECE251: Tuesday Aug. 29 ECE251: Tuesday Aug. 29 ARM Cortex Architecture: Data Movement Loading memory data into registers Storing register data into memory Indexed Addressing Reading: Chapters 1 and 5 Labs: #1 due this week at

More information

Structured Programming in Assembler Session 16321

Structured Programming in Assembler Session 16321 IBM HLASM SHARE Seattle 2015 Structured Programming in Assembler Session 16321 Richard Cebula (riccebu@uk.ibm.com) IBM HLASM 2009 IBM Corporation Who am I? Richard Cebula HLASM, IBM Hursley, UK riccebu@uk.ibm.com

More information

The PAW Architecture Reference Manual

The PAW Architecture Reference Manual The PAW Architecture Reference Manual by Hansen Zhang For COS375/ELE375 Princeton University Last Update: 20 September 2015! 1. Introduction The PAW architecture is a simple architecture designed to be

More information

are Softw Instruction Set Architecture Microarchitecture are rdw

are Softw Instruction Set Architecture Microarchitecture are rdw Program, Application Software Programming Language Compiler/Interpreter Operating System Instruction Set Architecture Hardware Microarchitecture Digital Logic Devices (transistors, etc.) Solid-State Physics

More information

Jumping Into Branches

Jumping Into Branches Jumping Into Branches This paper will investigate the many options we have for engineering the flow of control in our programs. We discuss the native and mnemonic branch and jump instructions that can

More information

High Level Assembler for z/os & z/vm & z/vse. Language Reference. Version 1 Release 6 SC

High Level Assembler for z/os & z/vm & z/vse. Language Reference. Version 1 Release 6 SC High Level Assembler for z/os & z/vm & z/vse Language Reference Version 1 Release 6 SC26-4940-06 Note Before using this information and the product it supports, be sure to read the general information

More information

CS 537: Introduction to Operating Systems Fall 2015: Midterm Exam #1

CS 537: Introduction to Operating Systems Fall 2015: Midterm Exam #1 CS 537: Introduction to Operating Systems Fall 2015: Midterm Exam #1 This exam is closed book, closed notes. All cell phones must be turned off. No calculators may be used. You have two hours to complete

More information

Principles of Compiler Design

Principles of Compiler Design Principles of Compiler Design Code Generation Compiler Lexical Analysis Syntax Analysis Semantic Analysis Source Program Token stream Abstract Syntax tree Intermediate Code Code Generation Target Program

More information

Computer Organization MIPS ISA

Computer Organization MIPS ISA CPE 335 Computer Organization MIPS ISA Dr. Iyad Jafar Adapted from Dr. Gheith Abandah Slides http://www.abandah.com/gheith/courses/cpe335_s08/index.html CPE 232 MIPS ISA 1 (vonneumann) Processor Organization

More information

A Java-based Computer Simulator and its Applications

A Java-based Computer Simulator and its Applications A Java-based Computer Simulator and its Applications John K. Estell Bluffton College Session 2220 Abstract This paper describes a learning philosophy for computer science that is based on having students

More information

IBM Education Assistance for z/os V2R2

IBM Education Assistance for z/os V2R2 IBM Education Assistance for z/os V2R2 Item: Health Based Routing Element/Component: WLM Material current as of May 2015 Agenda Trademarks Presentation Objectives Overview Usage & Invocation Migration

More information

1 5. Addressing Modes COMP2611 Fall 2015 Instruction: Language of the Computer

1 5. Addressing Modes COMP2611 Fall 2015 Instruction: Language of the Computer 1 5. Addressing Modes MIPS Addressing Modes 2 Addressing takes care of where to find data instruction We have seen, so far three addressing modes of MIPS (to find data): 1. Immediate addressing: provides

More information

Cell Programming Tips & Techniques

Cell Programming Tips & Techniques Cell Programming Tips & Techniques Course Code: L3T2H1-58 Cell Ecosystem Solutions Enablement 1 Class Objectives Things you will learn Key programming techniques to exploit cell hardware organization and

More information

A Processor. Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University. See: P&H Chapter , 4.1-3

A Processor. Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University. See: P&H Chapter , 4.1-3 A Processor Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University See: P&H Chapter 2.16-20, 4.1-3 Let s build a MIPS CPU but using Harvard architecture Basic Computer System Registers ALU

More information

Embedded Systems Programming

Embedded Systems Programming Embedded Systems Programming x86 Memory and Interrupt (Module 8) Yann-Hang Lee Arizona State University yhlee@asu.edu (480) 727-7507 Summer 2014 X86 ISA Data Representations Little-endian byte ordering

More information

LC-3 Instruction Set Architecture

LC-3 Instruction Set Architecture CMPE12 Notes LC-3 Instruction Set Architecture (Textbookʼs Chapter 5 and 6)# Instruction Set Architecture# ISA is all of the programmer-visible components and operations of the computer.# memory organization#

More information

The x86 Architecture

The x86 Architecture The x86 Architecture Lecture 24 Intel Manual, Vol. 1, Chapter 3 Robb T. Koether Hampden-Sydney College Fri, Mar 20, 2015 Robb T. Koether (Hampden-Sydney College) The x86 Architecture Fri, Mar 20, 2015

More information

Lecture 11: Control Unit and Instruction Encoding

Lecture 11: Control Unit and Instruction Encoding CSCI25 Computer Organization Lecture : Control Unit and Instruction Encoding Ming-Chang YANG mcyang@cse.cuhk.edu.hk Reading: Chap. 7.4~7.5 (5 th Ed.) Recall: Components of a Processor Register file: a

More information

SPARC Architecture. SPARC Registers

SPARC Architecture. SPARC Registers SPRC rchitecture 8-bit cell (byte) is smallest addressable unit 32-bit addresses, i.e., 32-bit virtual address space Larger sizes: at address 7 0 byte 15 +1 halfword 31 +1 +2 +3 word +1 +2 +3 +4 +5 +6

More information

Chapter 8: Addressing in the IBM S/370

Chapter 8: Addressing in the IBM S/370 Chapter 8: Addressing in the IBM S/370 All stored program computers run programs that have been converted to binary machine code and loaded into the primary memory. The presence of virtual memory on most

More information

101 Assembly. ENGR 3410 Computer Architecture Mark L. Chang Fall 2009

101 Assembly. ENGR 3410 Computer Architecture Mark L. Chang Fall 2009 101 Assembly ENGR 3410 Computer Architecture Mark L. Chang Fall 2009 What is assembly? 79 Why are we learning assembly now? 80 Assembly Language Readings: Chapter 2 (2.1-2.6, 2.8, 2.9, 2.13, 2.15), Appendix

More information

Announcements HW1 is due on this Friday (Sept 12th) Appendix A is very helpful to HW1. Check out system calls

Announcements HW1 is due on this Friday (Sept 12th) Appendix A is very helpful to HW1. Check out system calls Announcements HW1 is due on this Friday (Sept 12 th ) Appendix A is very helpful to HW1. Check out system calls on Page A-48. Ask TA (Liquan chen: liquan@ece.rutgers.edu) about homework related questions.

More information

Chapter 2. Assembler Design

Chapter 2. Assembler Design Chapter 2 Assembler Design Assembler is system software which is used to convert an assembly language program to its equivalent object code. The input to the assembler is a source code written in assembly

More information

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation Data Representation II CMSC 313 Sections 01, 02 The conversions we have so far presented have involved only unsigned numbers. To represent signed integers, computer systems allocate the high-order bit

More information

Microprocessor. By Mrs. R.P.Chaudhari Mrs.P.S.Patil

Microprocessor. By Mrs. R.P.Chaudhari Mrs.P.S.Patil Microprocessor By Mrs. R.P.Chaudhari Mrs.P.S.Patil Chapter 1 Basics of Microprocessor CO-Draw Architecture Of 8085 Salient Features of 8085 It is a 8 bit microprocessor. It is manufactured with N-MOS technology.

More information