Off the top of my head

          MACRO
 .*             Generate the translate table for TROT to translate
 .*             from binary to hexadecimal
 &L      TROTAB
          LCLA  &LINE,&CHAR
          LCLC  &HEX,&ROW
 &L       DS    0CL256
 &LINE    SETA  0
  .*
  .LINE   ANOP
 &ROW     SETC  'C'''
 &CHAR    SETA  &LINE
 .*
 .CHAR    ANOP
 &HEX     SETC  A2X(&CHAR)
 &ROW     SETC  '&ROW'.'&HEX'(7,2)
 &CHAR    SETA  &CHAR+1
          AIF   (&CHAR LT &LINE+16).CHAR
 &ROW     SETC  '&ROW'.''''
 .*
 &LINE    SETA  &LINE+16
          AIF   (&LINE LT 256).LINE
          MEND

This should work with any 8-bit character set the assembler accepts. There are 
some stylistic issues.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Assembler List [[email protected]] on behalf 
of Paul Gilmartin [[email protected]]
Sent: Monday, June 8, 2020 1:20 PM
To: [email protected]
Subject: TROT (was: ... SIMD ... )

On 2020-06-08, at 00:33:08, Pieter Wiid wrote:
>
> I did create a macro to build the table -- and one for TRTO, to convert
> display to hex.
>
TROT is way easy in Rexx:

signal on novalue
do Line = 0 to 15
Chars = "         DC    C'"
    do Col = Line * 16 to Line * 16 + 15
        Chars = Chars || c2x( right( d2c( Col ), 1 ) )
        end Col
    say Chars"'"
end Line

... it'e the C2X() that makes it work

I can generate a table in HLASM:

TABLE DC 256AL2((*-TABLE)/2)

... but it's the wrong table

I'm HLASM-naive.  Has HLASM anything like C2X, perhaps in a
macro from cbttape.org, conditional or mainstream assembly?
Or must it be done painstakingly, character by character?

(TR12 would be a better mnemonic.  Do any opcodes contain digits?)

-- gil

Reply via email to