11.07.2015 Views

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

DC instruction—Graphic constantTable 24. Graphic constants (continued)Subfield Value Example Result6. Nominal valueRepresented by: DBCS charactersdelimited by SOand SIEnclosed by: Single quotationmarksNumber of valuesper operand:OneDCDCDCG’’G’’G’’Padding: With DBCS spacesat right (X'4040') DC GL6’’Truncation ofassembled value:At rightDCGL2’’Object codeX'4250427D'X'42C142C2'Object codeX'42C1426B42C2'Object codeX'42C140404040'Object codeX'42C1'Hexadecimal constant—XHexadecimal constants generate large bit patterns more conveniently than binaryconstants. Also, the hexadecimal values you specify in a source module let youcompare them directly with the hexadecimal values generated for the object codeand address locations printed in the program listing.Each hexadecimal digit (see ▌1▐ in Table 25 on page 146) specified in the nominalvalue subfield is assembled into four bits (their binary patterns can be found in“Self-defining terms” on page 32). The implicit length in bytes of a hexadecimalconstant is then half the number of hexadecimal digits specified (assuming that ahigh-order hexadecimal zero is added to an odd number of digits). See ▌2▐ and ▌3▐in Table 25.An 8-digit hexadecimal constant provides a convenient way to set the bit patternof a full binary word. The constant in the following example sets the first and thirdbytes of a word with all 1 bits.DS0FTEST DC X’FF00FF00’The DS instruction sets the location counter to a fullword boundary. (See “DSinstruction” on page 173.)The next example uses a hexadecimal constant as a literal and inserts a byte of all1 bits into the rightmost 8 bits of register 5.IC5,=X’FF’In the following example, the digit A is dropped, because 5 hexadecimal digits arespecified for a length of 2 bytes:ALPHACON DC 3XL2’A6F4E’ Generates 6F4E 3 timesThe resulting constant is 6F4E, which occupies the specified 2 bytes. It isduplicated three times, as requested by the duplication factor. If it had beenspecified as:ALPHACON DC 3X’A6F4E’ Generates 0A6F4E 3 timesthe resulting constant would have a hexadecimal zero in the leftmost position.0A6F4E0A6F4E0A6F4EChapter 5. Assembler instruction statements 145

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!