Class az390

All Implemented Interfaces:
Runnable

public class az390 extends Object implements Runnable
Class az390 implements the assembler part of z390
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    Comparator for mnemonics to mimic EBCDIC collating sequence The mnemonic portion occupies the first 8 positions of the ReportEntry and contains only uppercase characters and digits.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) byte
    variable
    (package private) byte
    variable
    (package private) byte
    variable
    (package private) byte
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) boolean
    variable
    (package private) Thread
    variable
    (package private) boolean
    variable
    (package private) boolean
    variable
    (package private) boolean
    variable
    (package private) File
    variable
    (package private) BufferedReader
    variable
    (package private) byte
    variable
    (package private) byte
    variable
    (package private) String
    variable
    (package private) boolean
    variable
    (package private) String
    variable
    (package private) boolean
    variable
    (package private) boolean
    variable
    (package private) int
    variable
    (package private) int[]
    variable
    (package private) String[]
    variable
    (package private) int[]
    variable
    (package private) int[]
    variable
    (package private) String
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) String
    variable
    (package private) int
    variable
    (package private) String
    variable
    (package private) int
    variable
    (package private) String
    variable
    (package private) char
    variable
    (package private) byte[]
    variable
    (package private) byte[]
    variable
    (package private) byte[]
    variable
    (package private) byte[]
    variable
    (package private) byte[]
    variable
    (package private) boolean
    variable
    (package private) Date
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) char
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) String
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) int
    variable
    (package private) String
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) byte
    variable
    (package private) BigDecimal
    variable
    (package private) BigInteger
    variable
    (package private) BigInteger
    variable
    (package private) int
    variable
    (package private) byte[]
    variable
    (package private) int
    variable
    (package private) String
    variable
    (package private) boolean
    variable
    (package private) int
    variable
    (package private) long
    variable
    (package private) byte[]
    variable
    (package private) ByteBuffer
    variable
    (package private) byte[]
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) int
    variable
    (package private) String
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) String
    variable
    (package private) byte
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) char
    variable
    (package private) char
    variable
    (package private) String
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) boolean
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) boolean
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) char
    variable
    (package private) int[]
    variable
    (package private) char[]
    variable
    (package private) String
    variable
    (package private) int
    variable
    (package private) int[]
    variable
    (package private) char
    variable
    (package private) String
    variable
    (package private) boolean
    variable
    (package private) boolean
    variable
    (package private) String
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) Pattern
    variable
    (package private) Pattern
    variable
    (package private) int
    variable
    (package private) Matcher
    variable
    (package private) char
    variable
    (package private) Pattern
    variable
    (package private) String
    variable
    (package private) int
    variable
    (package private) char
    variable
    (package private) boolean
    variable
    (package private) int
    variable
    (package private) String[]
    variable
    (package private) String[]
    variable
    (package private) String[]
    variable
    (package private) String[]
    variable
    (package private) byte
    variable
    (package private) byte
    variable
    (package private) String
    variable
    (package private) boolean
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) int
    variable
    (package private) int[]
    variable
    (package private) int
    variable
    (package private) int[]
    variable
    (package private) int
    variable
    (package private) int[]
    variable
    (package private) int[]
    variable
    (package private) byte
    variable
    (package private) boolean
    variable
    (package private) boolean
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) Matcher
    variable
    (package private) String
    variable
    (package private) int[]
    variable
    (package private) Pattern
    variable
    (package private) String
    variable
    (package private) int[]
    variable
    (package private) byte
    variable
    (package private) boolean
    variable
    (package private) int
    variable
    (package private) int[]
    variable
    (package private) String
    variable
    (package private) int
    variable
    (package private) String[]
    variable
    (package private) int[]
    variable
    (package private) int[]
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) boolean
    variable
    (package private) boolean
    variable
    (package private) String
    variable
    (package private) String
    variable
    (package private) String
    variable
    (package private) byte
    variable
    (package private) String
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) Matcher
    variable
    (package private) Pattern
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) BigDecimal
    variable
    (package private) byte[]
    variable
    (package private) BigDecimal
    variable
    (package private) BigDecimal
    variable
    (package private) BigDecimal
    variable
    (package private) BigInteger
    variable
    (package private) BigInteger
    variable
    (package private) BigInteger
    variable
    (package private) BigInteger
    variable
    (package private) BigInteger
    variable
    (package private) MathContext
    variable
    (package private) ByteBuffer
    variable
    (package private) byte[]
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) double
    variable
    (package private) double
    variable
    (package private) long
    variable
    (package private) long
    variable
    (package private) long
    variable
    (package private) long
    variable
    (package private) int
    variable
    (package private) String
    variable
    (package private) boolean
    variable
    (package private) boolean
    variable
    (package private) String
    variable
    (package private) String
    variable
    (package private) String
    variable
    (package private) String
    variable
    (package private) String
    variable
    (package private) String
    variable
    (package private) String
    variable
    (package private) String
    variable
    (package private) String
    variable
    (package private) String
    variable
    (package private) String
    variable
    (package private) SimpleDateFormat
    variable
    (package private) Matcher
    variable
    (package private) Pattern
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) String
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) byte[]
    variable
    (package private) byte[]
    variable
    (package private) int[]
    variable
    (package private) int[]
    variable
    (package private) int[]
    variable
    (package private) byte[]
    variable
    (package private) int[]
    variable
    (package private) int[]
    variable
    (package private) int[]
    variable
    (package private) int[]
    variable
    (package private) boolean
    variable
    (package private) String[]
    variable
    (package private) int[]
    variable
    (package private) int[]
    variable
    (package private) TreeSet<Integer>[]
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) final Lock
    variable
    (package private) final Condition
    variable
    (package private) boolean
    variable
    (package private) boolean
    variable
    (package private) boolean
    variable
    (package private) boolean
    variable
    (package private) boolean
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) long[]
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) long[]
    variable
    (package private) int
    variable
    (package private) String[]
    variable
    (package private) String[]
    variable
    (package private) SimpleDateFormat
    variable
    (package private) String
    variable
    (package private) String
    variable
    (package private) boolean
    variable
    (package private) boolean
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) String
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) byte
    variable
    (package private) String
    variable
    (package private) RandomAccessFile
    variable
    (package private) String
    variable
    (package private) String
    variable
    (package private) String
    variable
    (package private) boolean
    variable
    (package private) String
    variable
    (package private) int
    variable
    (package private) String
    variable
    (package private) int
    variable
    (package private) char
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) byte
    variable
    (package private) boolean[]
    variable
    (package private) boolean[]
    variable
    (package private) int
    variable
    (package private) boolean[]
    variable
    (package private) String
    variable
    (package private) File
    variable
    (package private) BufferedWriter
    variable
    (package private) int[]
    variable
    (package private) int[]
    variable
    (package private) boolean
    variable
    (package private) boolean
    variable
    (package private) char
    variable
    (package private) int[]
    variable
    (package private) byte[]
    variable
    (package private) int[]
    variable
    (package private) char[]
    variable
    (package private) char
    variable
    (package private) int[]
    variable
    (package private) boolean
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) byte[]
    variable
    (package private) byte[]
    variable
    (package private) byte
    variable
    (package private) String[]
    variable
    (package private) String[]
    variable
    (package private) int[]
    variable
    (package private) byte
    variable
    (package private) byte[]
    variable
    (package private) byte[]
    variable
    (package private) int[]
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) byte
    variable
    (package private) byte
    variable
    (package private) int[]
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) byte
    variable
    (package private) byte
    variable
    (package private) int[]
    variable
    (package private) int[]
    variable
    (package private) boolean
    variable
    (package private) String
    variable
    (package private) int[]
    variable
    (package private) String[]
    variable
    (package private) byte
    variable
    (package private) byte
    variable
    (package private) int[]
    variable
    (package private) byte
    variable
    (package private) int[]
    variable
    (package private) int[]
    variable
    (package private) int[]
    variable
    (package private) byte[]
    variable
    (package private) String[]
    variable
    (package private) byte
    variable
    (package private) byte
    variable
    (package private) byte
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) byte
    variable
    (package private) TreeSet<Integer>[]
    variable
    (package private) long
    variable
    (package private) long
    variable
    (package private) long
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) long
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) String
    variable
    (package private) tz390
    variable
    (package private) int[]
    variable
    (package private) int[]
    variable
    (package private) int[]
    variable
    (package private) int
    variable
    (package private) boolean
    variable
    (package private) String[]
    variable
    (package private) int[]
    variable
    (package private) int[]
    variable
    (package private) int[]
    variable
    (package private) int
    variable
    (package private) int[]
    variable
    (package private) int
    variable
    (package private) int
    variable
    (package private) int[]
    variable
    (package private) String
    variable
    (package private) String[]
    variable
    (package private) String[]
    variable
    (package private) char[]
    variable
    (package private) JTextArea
    variable
  • Constructor Summary

    Constructors
    Constructor
    Description
    Dummy constructor - no initialization needed
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    abort_error(int error, String msg)
    issue error msg to log with prefix and inc error total
    private void
    add ENTRY
    private int
    add_esd(int sid, byte sect_type)
    add new esd chained to sid and return index else abort
    private int
    add EXTRN using V vs S key index
    private void
    add_lit_xref(int index)
    add literal xref
    boolean
    add missing copy file for ERRSUM
    private boolean
    add missing macro file for ERRSUM
    private void
    add_rld(int exp_esd)
    add plus rld
    int
    add symbol table entry name and return index for use in setting remaining fields
    Note: If lookahead mode, set sym_def = -1
    private void
    add_sym_xref(int index)
    add symbol xref
    private void
    add use entry
    private void
    add or replace USING for code generation
    private int
    add WXTRN using V vs S key index
    private String
    bytes_to_hex(byte[] bytes, int byte_start, int byte_length, int chunk)
    Format bytes into hex string If chunk more than 0 insert space after each chuck
    private boolean
    calculate abs value else abort
    private boolean
    set dca_ignore_refs for A and V type symbol refs if DS or DSECT
    private boolean
    parse abs/rel expression starting at exp_text.charAt(exp_index)
    return true if ok and set: exp_val = abs or rel offset exp_esd = abs 0 or cst/dst esd exp_index = index to terminator which can be end of string, or () Note: this version applies a default location counter offset of 0
    private boolean
    calc_exp(int loc_ctr_offset)
    parse abs/rel expression starting at exp_text.charAt(exp_index)
    return true if ok and set: exp_val = abs or rel offset exp_esd = abs 0 or cst/dst esd exp_index = index to terminator which can be end of string, or ()
    private boolean
    Find or add literal and set exp_type, exp_val, and exp_esd. If literal followed by '-' or '+' calculate expression add to lit address and return abs val else error.
    private void
    calc rel exp for lit or explicit offset for following offset(index,base)
    private boolean
    calculate rel value else abort
    private void
    check if generated object code equals instruction length and check for extra parms beyond end of last instruction parm and issue error
    private boolean
    set true if ok to list BAL line on PRN file
    private void
    start private csect if no csect or dsect
    private void
    check if timeout expired
    void
    close output obj, prn, err, tra
    private void
    compile regular expression parsers
    private void
    calc tz390.fp_exp and big_dec2 such that: big_dec1 = big_dec2 * 2 ** tz390.fp_exp
    tz390.fp_exp = log(big_dec1) / log(2)
    Since the exponent range of LB exceeds native double, the log of big_dec1 is calculated using equivalent: log(X*10**N) = log(X) + N*log(10)
    The exponent must then be offset by the number of bits in the required binary mantissa in order to retain significant bits when big_dec2 is converted to big_int format.
    private void
    convert ascii hex object string to binary 80 byte EBCDIC format for mainframe compatiblity.
    private void
    dc_align(int align_len)
    align to mult of align_len from loc_ctr
    If align_len more than 8 use 8
    private void
    dc_fill(int fill_len)
    increment loc_ctr by bytes if not bit mode else shift bits by bit length if DC and not first field fill with zeros
    private void
    remove labeled using if found
    private void
    Remove cur_use_reg entries if found but not labeled usings.
    private void
    drop duplicate unlabeled dependent USING for same section and offset
    private void
    drop one or more using registers or labeled using
    private void
    issue error for duplicate symbol definition
    void
    put stats and display total errors after mz390 is done and close files.
    Note: return az390 return code for use by mz390 when called from mz390 when mfc option on.
    private void
    add top of stack value to prev.
    private void
    div top of stack value into prev.
    private void
    replace sym or lit on stack with integer I' attribute value
    private void
    replace sym or lit on stack with length value
    private void
    mpy top of stack value to prev.
    private boolean
    exp_next_char(char next_char)
    return true if next exp_text char at exp_index is next_char
    private void
    pop current op on stack
    private void
    put current op on stack
    if unary minus push 0 var first
    if unary plus skip the push
    private void
    replace sym or lit on stack with scale value
    private void
    sub top of stack value from prev.
    private void
    exp_term(int loc_ctr_offset)
    terminate expression returning value on stack if no errors
    private int
    return index of bal operation
    or return 0 for comments
    or return -1 if undefined operation
    or return -2 if cancelled OPSYN
    int
    Return defined symbol index else -1 If not lookahead mode: if found, add xref else if vcon mode, add extrn
    void
    finish_az390(String[] mac_file_path, int[] mac_file_errors)
    save xref file names and error counts for cross reference at end of PRN
    private void
    flush any bits in dc_bit_buff to align to byte boundary for next field or end of DS.DC
    private void
    BFP - Adjust mantiss and base 2 exponent to align for assumed 1 bit. HFP - Adjust mantissa and base 2 exponent to base 16 exponent. DFP - Set base 10 exponent based on explicit decimal point and trailing significant digits including zeros else use preferred exponent of 0.
    private void
    set dc_hex for floating point string fp_text in scientific notation 0.314159E1 etc.
    format is based on fp type 0-8 (db,dd,dh,eb,ed,eh,lb,ld,lh)
    Notes: This is very tricky code! Use BigDecimal for all types to insure DH and EH exponents beyond range of DB and EB will be correctly handled without error. The fp_context is set to significant decimal digits plus fp_guard_digts to insure sufficient significant bits for proper rounding occurs. The preferred DFP exponent (BigDecimal scale factor) is set based on explicit decimal poiint with significant trailing decimal places including zeros else use 0. First convert string constant to positive big_dec1 value with sufficent sig.
    private void
    generate 8 byte aligned CCW0: op8,addr24,flags8,zero8,len16
    private void
    generate 8 byte aligned CCW1: op8,flags8,len16,addr32
    private void
    gen F or H bit field
    private void
    gen F or H byte field
    private void
    gen del bit length field
    private void
    gen del byte length field
    private void
    gen dca exp_val in dc_bit_buff
    Note: Shared by gen_dcb_bits
    private void
    gen dca byte field
    private void
    gen dcb type bit field in dc_bit_buff
    private void
    gen dcb byte length field
    private void
    gen dcc bit field
    private void
    gen dcc bytes
    private void
    gen P bit field
    private void
    gen P byte field
    private void
    gen X bit field
    private void
    gen X byte field
    private void
    gen_exp_rld(int loc_ctr_offset)
    generate rlds for expression
    Notes: convert to rel csect vs rel module offsets for linker use. Original exp_val saved in rld_exp_val for use in PRN display (i.e.
    private void
    Lists all mnemonics in the selected opcode table All mnemonics from the current opcode table are converted into report entries The report entries are sorted The sorted entries are printed (three on a print line) preceded by a header line
    private void
    gen_lit_size(int size)
    generate literal dc's of specified size
    force all length 1 lits to even addr for access by relative halfword offsets in LARL etc.
    private void
    list literals in alpha order with optional cross reference
    private void
    generate ltorg at current location in csect
    private void
    write END object record with entry if specified
    private void
    write ESD's for CSECTS, EXTRNS, and ENTRIES to the OBJ file in ascii hex and list on PRN if option LIST
    private void
    write RLD's to the OBJ file in ascii hex
    private void
    generate object code for bal instructions in CSECT's on final pass
    private void
    list symbols in alpah order with optional cross reference
    private void
    get next bal line from bal file or from mz390 parallel thread pass
    private String
    get_base_name(String file_name)
    return base file name from path\file.sfx
    private boolean
    set dc_bd_val from next floating point sdt in dc_field at dc_index
    Notes: Apply any scale factor or exponent to dc_bd_value. Set dc_unsigned true/false
    private String
    get 1-16 byte hex value for F or H constant from dc_bd_val
    private void
    return dup factor for dc_field else 1
    private void
    Set L, S, E defaults Check modifiiers based on type if DEL check for B/D/H and set tz390.fp_type if C check for A/E and set dc_type_sfx if AFV check for D and set dc_type_sfx if LQ ignore the Q for 16 byte default If S check for Y and set length 3 Process explicit L length, S scale, and E exponent modifiers in any order Align and save first length if req'd
    private void
    set dc_type and dc_type_index and verify valid type else abort
    private void
    get_dc_fp_hex(String text, int index)
    set dc_hex for D, E, or L floating point sdt starting at text index
    private int
    get_dc_int(int index)
    return next number from dc_field at index else return 1 and update dc_index
    private int
    return integer expression in (...) or decimal number for modifier
    private String
    return bddd or bdddhh
    private String
    return esd type
    private String
    return bddd or bdddhh from explicit ddd(b) with ddd in exp_val
    private String
    get_exp_abs_bddd(int b, int dddhh)
    return bddd or bdddhh using exp_val displacement
    private String
    return xbddd or xbdddhh from explicit ddd(x,b) with ddd in exp_val
    private String
    return xbddd or xbdddhh from explicit ddd(x,b) with ddd in exp_val
    private String
    Return hex bddd based on exp_esd and exp_val set by calc_exp or calc_lit. If get_bdddhh is set, then 20 bit signed offset will be returned as bdddhh. Set cur_reg and cur_reg_loc for use when called from dependent using with domain expression. If exp_use_lab is not null restrict using entries to labelled using.
    private int
    return explicit or implied length from exp_len
    private String
    get hex x from next (x) else 0
    private String
    get hex x from next (x) else 0
    private void
    get_hex_bddd2(boolean add_code)
    if add_code
    then append bddd or bdddhh hex object code from next parm
    else just set hex_bddd2
    private void
    gen bdddhh where hhddd is 20 bit signed offset to b.
    private void
    append hex byte from next parm
    private void
    append signed byte from next parm RPI 1146
    private void
    append hex halfword from next parm
    private void
    get_hex_int(int bits)
    append hex integer from next parm
    private void
    set hex_len, hex_bddd, and hex_bddd_loc from next parm
    private String
    return single hex nibble char 0-f
    private void
    get_hex_op(int op_offset, int op_len)
    initialize object code with op code and initialize exp parser with parms if op_offset = 1
    private void
    append hex reg from next parm
    private void
    append hex reg from next parm - if it is an even register
    private String
    return relative 24 bit halfword offset from psw_loc to symbol in same csect at even address
    Note: Error if not same csect or odd address
    private void
    append hex relative offset from current instruction
    private String
    return relative 12 bit relative halfword offset
    private String
    return relative 16 bit relative halfword offset
    private String
    return relative signed half word offset from psw_loc to symbol in same csect at even address
    Note: Error if not same csect or odd address
    private void
    append iiiiiiii signed offset (calc for label)
    private void
    gen 32 bit RLD or abs value with loc ctr at start of ins.
    private void
    append xbddd or xbdddhh hex object code from next parm
    private void
    get_hex_vreg(int vreg)
    append vector hex reg low 4 bits from next parm and set corresponding vreg_rxb high bit for 16-31 vregs
    private void
    vector register 1-5 high bits to support registers 16-31 reset for next set of high bits
    private void
    append xbddd or xbdddhh hex object code from next parm
    private void
    append xbddd hex object code from next parm
    private void
    get_hex_zero(int hex_ll)
    append zero nibbles
    int
    get_int_pfx(byte type, byte type_sfx, int len, int scale)
    return I' integer pfx value for symbol based on length and scale per ref.
    private void
    find or add literal and set: cur_lit = lit table index exp_val = lit address exp_esd = lit esd
    private String
    get_long_hex(long work_long)
    Format long into 16 byte hex string
    private String
    use tz390.parm_match to find and return next parm in upper case else return null.
    private void
    set stk_values 1 and and 2 from top of stack
    private int
    get_sym_len(int index)
    return total length of csect or dsect
    private void
    set cur_use_reg and cur_use_off from exp_text at exp_index set by get_use_range
    Note: get_rel_exp_bddd is called for dependent using expressions to find reg and loc
    private void
    set cur_use_base esd,loc, and len
    private boolean
    check if room to add to exp_stack and return true else abort
    private void
    initialize arrays using tz390.opt_max???
    private void
    init_az390(String[] args, JTextArea log_text, RandomAccessFile systerm, RandomAccessFile stats)
    initialize log routing set options compile regular expression parsers open bal and obj buffered I/O files Init ascii/ebcdic translation table
    private void
    use tz390.parm_match to find and return next parm separated by commas else return null.
    private void
    init push/pop using and print
    private void
    init sym variables for new or existing lookahead symbol table entry
    private void
    list bal line with first 8 bytes of object code if any and turn off list_bal_line request
    Note: See comments processing case 0 for update of mac_call_gen, call reformating, and delay flags mac_call_first and mac_call_last.
    private void
    list current use table if LISTUSE
    private void
    load bal source
    Concatentate any continuations indicated by non-blank in position 72.
    private void
    log_error(int error, String msg)
    issue error msg to log with prefix and inc error total
    Notes: Set bal_abort if not set else exit supress if not gen_obj and not trace print bal line first if list on
    static void
    main(String[] args)
    main is entry when executed from command line Create instance of az390 class and pass parms to az390 like z390 does.
    private void
    move_use_entry(int index1, int index2)
    move use entry from index1 to index2
    private void
    Set trace file name; then open obj and prn files
    private void
    missing description
    private void
    set bal_label and bal_op
    void
    pass_bal_line(String new_bal_line, String new_xref_file_name, char new_xref_file_type, int new_xref_file_num, int new_xref_line_num)
    pass mz390 bal_line to az390 bal_line with synchronization of threads. ignore BAL after END
    private void
    proc_exp_op(int loc_ctr_offset)
    description missing
    private void
    description missing
    private void
    description missing
    private void
    proc_exp_token(int loc_ctr_offset)
    parse general expression tokens: push sym or sdt exec or push operations + - * / terminate on end of string or ()
    private void
    push current location counter on stack
    private void
    assemble bal source file into relocatable OBJ file and generate optional PRN file.
    private void
    assemble bal source into obj relocatable object code file
    private void
    allocate or generate object code for bal op Note op_type index values must match op_name array values. Indexes less than 100 and CNOP are machine instr.
    private void
    generate one or more 0700 instr.
    void
    process_dc(int request_type)
    processing by request type: parse ds/dc bal statement and allocate or gen data items including alignment bytes where required. find or add literal table entry using ds/dc type single parm following = parm generate literal pool dc using loc_ctr set to referenced instruction. if LTORG, gen lits
    if not DC/DS/LTORG set dc_lit and process first field as literal and update exp_index
    private void
    alloc or gen DS/DC D, E, or L type data using prev settings for dc_type, dc_type_sfx, dc_dup and dc_len.
    private void
    alloc or gen DS/DC A/V/Y type parms using prev.
    private void
    alloc or gen DS/DC B type parms using prev.
    private void
    allocate or generate dc Cln'...' data using dc_dup and explicit dc_len if any
    Notes: C'..' default EBCDIC unless ASCII option C".." always ASCII regardless of option C!..! always EBCDIC regardless of option ''|""|!! or double ampersand replaced with single '|"|! or ampersand CA'...' always ASCII CE'...' always EBCDIC
    private void
    alloc or gen DS/DC F type parms using prev.
    private void
    alloc or gen DS/DC H type parms using prev.
    private void
    alloc or gen DS/DC P type parms using prev.
    private void
    alloc or gen DS/DC S type parms using prev.
    private void
    alloc or gen DS/DC X type parms using prev.
    private void
    alloc or gen DS/DC Z type parms using prev.
    private void
    perform END processing at END statement or end of MLC source at end of each pass
    void
    define or update symbol definition: Set sym_loc to first pos value Set sym_len to optional 2nd pos value else set sym_len to 1. Set sym_attr to optional 3rd pos value. Set sym_attrp 4th program type Set sym_attra 5th assembler type
    private void
    process_esd(byte esd_type)
    process EXTRN, ENTRY, or WXTRN statement
    private void
    reset current location in same csect
    private void
    pop print or using level if any
    private void
    process print options (unsupported options ignored)
    private void
    push print or using level if any
    private void
    process_sect(byte sect_type, String sect_name)
    add or update csect, dsect, or loctr indicated by sym_cst, sym_dst, or sym_lct type parm
    Steps: Update previous section if any with max length and any loctr pointers If name omitted used private cst/dst Add new section if not found or external reference found as local label Reset location counter to end of current section Update prev section type and sid for use in processing sym_lct sections
    private void
    set current location first csect
    private void
    push literal on stack else abort and set cur_lit >= 0 and cur_sit = -1 for L' to determine that literal is on the stack
    Note: Literal must be first term in exp since it may use calc_exp during DC processing and then resets exp stack with lit address
    private void
    push self defining abs term on stack
    private void
    push symbol on stack else abort
    set cur_sid > 0 used by L'
    private void
    display az390 version, timestamp, and copyright if running standalone
    private void
    put ERRSUM msgs on ERR file and console
    private void
    Write message to z390_log_text or console if running standalone
    private void
    put object code to obj file in hex or binary format
    private void
    Append obj_code to list_obj_code for print line (reguired by mult DC calls). Exit if gen_obj_code not on or not CSECT Buffer output of ojbect text code for contiguous data in same ESD. Called from END processing with BAL_EOF to flush buffer. Reset obj_code for use by DC routines Note: this version applies a default location counter offset of 0
    private void
    put_obj_text(int loc_ctr_offset)
    Append obj_code to list_obj_code for print line (reguired by mult DC calls). Exit if gen_obj_code not on or not CSECT Buffer output of ojbect text code for contiguous data in same ESD. Called from END processing with BAL_EOF to flush buffer. Reset obj_code for use by DC routines
    private void
    put line to prt listing file if print_on and not surpressed by nogen.
    private void
    routine statistics line to PRN or STATS(file)
    void
    display statistics on STA and totals on STA and TRM including MZ and AZ totals.
    private void
    pop operator from op stack pop sym_val2 off var stack replace original sym_val1 on top of stack with result
    private void
    reduce rld on stack
    private String
    remove blanks allowed within numeric DC fields BDEFHLPXZ
    void
    report critical errors on ERR file and console for ERRSUM option
    private void
    reset lit_gen flags to force reallocation on each pass
    void
    reset sym lock at next mz390 bal line and at start of lookahead mode.
    private void
    if errors occurred during loading of bal repeat symbol update passes until there are no errors or minimum error or max passes are reached.
    void
    run()
    run the assembler
    private void
    save bal line during loading for log_error use
    private void
    set sect_change
    private void
    set DFP preferred base 10 exponent for fp_big_dec1 value if explicit decimal found in fp_text.
    private void
    set xref_file_line passed from mz390 if available for use in error messages
    void
    Block mz390 until az390 is waiting for next bal. Set sym_lock Notes: See az390 pass_bal for lock check. See mz390 put_bal_line for lock reset.
    private void
    verify and skip comma
    void
    start_az390_thread(String[] args, JTextArea z390_log, RandomAccessFile mz390_systerm_file, RandomAccessFile mz390_stats_file)
    initialize z390 when called from mz390 to receive bal directly and share the symbol table with mz390.
    private String
    string_to_hex(String text, boolean ascii)
    Format text string into hex string If ascii_req true, gen ascii else ebcdic hex
    private void
    sub_rld(int exp_esd)
    sub rld
    void
    add or update relative labels and exclude CST, DST, EQU, USING symbols
    private void
    update mac_call_gen after prn
    private void
    update loctr sections with contiguous starting addresses from CSECT/DSECT and issue errors if any start address or length changes and reset length for next pass.
    private void
    update length of current section and save current loc_ctr for continue
    private void
    update each section starting address and max length, and reset current length and current esd_loc
    Notes: If any section start address or max length changes issue error to force additional passes. sym_cst CSECT's start at 0 and are contiguous within LOCTR's Each new CSECT is aligned to 8 sym_dst DSECT's always start at 0 Set esd_base to root section for cst, dst, and loctors
    private void
    scan bal source and update symbols

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • tz390

      tz390 tz390
      variable
    • msg_id

      String msg_id
      variable
    • az390_rc

      int az390_rc
      variable
    • az390_errors

      int az390_errors
      variable
    • mz390_errors

      int mz390_errors
      variable
    • mz390_started_msg

      String mz390_started_msg
      variable
    • mz390_abort

      boolean mz390_abort
      variable
    • az390_recursive_abort

      boolean az390_recursive_abort
      variable
    • mz390_rc

      int mz390_rc
      variable
    • cur_pass

      int cur_pass
      variable
    • cur_date

      Date cur_date
      variable
    • tod_start

      long tod_start
      variable
    • tod_end

      long tod_end
      variable
    • tot_sec

      long tot_sec
      variable
    • stats_to_obj

      boolean stats_to_obj
      variable
    • tot_obj_bytes

      int tot_obj_bytes
      variable
    • bal_file

      File bal_file
      variable
    • bal_file_buff

      BufferedReader bal_file_buff
      variable
    • obj_file

      variable
    • prn_file

      File prn_file
      variable
    • prn_file_buff

      BufferedWriter prn_file_buff
      variable
    • bal_line

      String bal_line
      variable
    • mnote_warning_msg

      String mnote_warning_msg
      variable
    • mcall_bal_index

      int mcall_bal_index
      variable
    • mcall_lv_index

      int mcall_lv_index
      variable
    • bal_xref_file_name

      String bal_xref_file_name
      variable
    • bal_xref_file_type

      char bal_xref_file_type
      variable
    • cur_line_type

      char cur_line_type
      variable
    • cur_line_file_num

      int cur_line_file_num
      variable
    • bal_xref_file_path

      String bal_xref_file_path
      variable
    • bal_xref_file_num

      int bal_xref_file_num
      variable
    • bal_xref_file_line

      int bal_xref_file_line
      variable
    • tot_xref_files

      int tot_xref_files
      variable
    • xref_file_name

      String[] xref_file_name
      variable
    • xref_file_path

      String[] xref_file_path
      variable
    • xref_file_errors

      int[] xref_file_errors
      variable
    • xref_file_type

      char[] xref_file_type
      variable
    • mz390_xref_file

      int mz390_xref_file
      variable
    • mz390_xref_line

      int mz390_xref_line
      variable
    • bal_label

      String bal_label
      variable
    • opsyn_label

      String opsyn_label
      variable
    • bal_op

      String bal_op
      variable
    • bal_op_ok

      boolean bal_op_ok
      variable
    • bal_label_ok

      boolean bal_label_ok
      variable
    • bal_parms

      String bal_parms
      variable
    • list_use

      boolean list_use
      variable
    • mac_inline_level

      int mac_inline_level
      variable
    • mac_inline_op_macro

      int mac_inline_op_macro
      variable
    • mac_inline_op_mend

      int mac_inline_op_mend
      variable
    • mac_inline_op_other

      int mac_inline_op_other
      variable
    • bal_abort

      boolean bal_abort
      variable
    • bal_op_index

      int bal_op_index
      variable
    • end_loc

      int end_loc
      variable
    • report_label_changes

      boolean report_label_changes
      variable
    • report_equ_changes

      boolean report_equ_changes
      variable
    • bal_eof

      boolean bal_eof
      variable
    • end_found

      boolean end_found
      variable
    • end_entry

      String end_entry
      variable
    • end_entry_sid

      int end_entry_sid
      variable
    • end_entry_found

      boolean end_entry_found
      variable
    • mmddyy

      variable
    • hhmmss

      variable
    • log_tod

      boolean log_tod
      variable
    • z390_log_text

      JTextArea z390_log_text
      variable
    • az390_thread

      Thread az390_thread
      variable
    • az390_running

      boolean az390_running
      variable
    • mz390_call

      boolean mz390_call
      variable
    • lookahead_mode

      boolean lookahead_mode
      variable
    • sym_lock

      boolean sym_lock
      variable
    • sym_lock_desc

      String sym_lock_desc
      variable
    • lock

      final Lock lock
      variable
    • lock_condition

      final Condition lock_condition
      variable
    • bal_line_full

      boolean bal_line_full
      variable
    • pass_bal_line

      String pass_bal_line
      variable
    • pass_xref_file_name

      String pass_xref_file_name
      variable
    • pass_xref_file_type

      char pass_xref_file_type
      variable
    • pass_xref_file_num

      int pass_xref_file_num
      variable
    • pass_xref_file_line

      int pass_xref_file_line
      variable
    • xref_file_line

      String xref_file_line
      variable
    • xref_bal_index

      int xref_bal_index
      variable
    • pass_bal_eof

      boolean pass_bal_eof
      variable
    • az390_waiting

      boolean az390_waiting
      variable
    • az390_private_sect

      boolean az390_private_sect
      variable
    • sort_index_bias

      int sort_index_bias
      variable
    • sort_index_len

      int sort_index_len
      variable
    • max_exp_stk

      int max_exp_stk
      variable
    • max_exp_rld

      int max_exp_rld
      variable
    • max_hh

      int max_hh
      variable
    • min_hh

      int min_hh
      variable
    • max_text_buff_len

      int max_text_buff_len
      variable
    • max_fh

      long[] max_fh
      variable
    • min_fh

      long[] min_fh
      variable
    • tod_time_limit

      long tod_time_limit
      variable
    • tot_bal_line

      int tot_bal_line
      variable
    • tot_mac_copy

      int tot_mac_copy
      variable
    • tot_mnote_warning

      int tot_mnote_warning
      variable
    • tot_mnote_errors

      int tot_mnote_errors
      variable
    • max_mnote_level

      int max_mnote_level
      variable
    • bal_line_text

      String[] bal_line_text
      variable
    • bal_line_num

      int[] bal_line_num
      variable
    • bal_line_xref_file_num

      int[] bal_line_xref_file_num
      variable
    • bal_line_xref_file_line

      int[] bal_line_xref_file_line
      variable
    • bal_line_gen

      boolean bal_line_gen
      variable
    • trace_pfx

      String trace_pfx
      variable
    • parm_name

      String parm_name
      variable
    • parm_value

      String parm_value
      variable
    • bal_line_index

      int bal_line_index
      variable
    • exp_pattern

      Pattern exp_pattern
      variable
    • exp_match

      Matcher exp_match
      variable
    • label_pattern

      Pattern label_pattern
      variable
    • label_match

      Matcher label_match
      variable
    • extrn_pattern

      Pattern extrn_pattern
      variable
    • extrn_match

      Matcher extrn_match
      variable
    • dcc_sq_pattern

      Pattern dcc_sq_pattern
      variable
    • dcc_dq_pattern

      Pattern dcc_dq_pattern
      variable
    • dcc_eq_pattern

      Pattern dcc_eq_pattern
      variable
    • dcc_match

      Matcher dcc_match
      variable
    • loc_ctr

      int loc_ctr
      variable
    • loc_start

      int loc_start
      variable
    • start_loc

      int start_loc
      variable
    • loc_len

      int loc_len
      variable
    • cur_esd_sid

      int cur_esd_sid
      variable
    • tot_esd

      int tot_esd
      variable
    • cur_esd

      int cur_esd
      variable
    • cur_esd_base

      int cur_esd_base
      variable
    • first_cst_esd

      int first_cst_esd
      variable
    • esd_sdt

      int esd_sdt
      variable
    • esd_cpx_rld

      int esd_cpx_rld
      variable
    • esd_sid

      int[] esd_sid
      variable
    • esd_base

      int[] esd_base
      variable
    • esd_loc

      int[] esd_loc
      variable
    • tot_loc_stmt

      int tot_loc_stmt
      variable
    • cur_use_start

      int cur_use_start
      variable
    • cur_use_end

      int cur_use_end
      variable
    • explicit_drop_reg

      boolean explicit_drop_reg
      variable
    • push_cur_use_start

      int[] push_cur_use_start
      variable
    • push_cur_use_end

      int[] push_cur_use_end
      variable
    • cur_use

      int cur_use
      variable
    • cur_use_depend

      boolean cur_use_depend
      variable
    • use_eof

      boolean use_eof
      variable
    • cur_use_base_esd

      int cur_use_base_esd
      variable
    • cur_use_base_loc

      int cur_use_base_loc
      variable
    • cur_use_base_len

      int cur_use_base_len
      variable
    • cur_use_reg

      int cur_use_reg
      variable
    • cur_use_neg_reg

      int cur_use_neg_reg
      variable
    • cur_use_off

      int cur_use_off
      variable
    • cur_use_neg_off

      int cur_use_neg_off
      variable
    • cur_use_lab

      String cur_use_lab
      variable
    • use_lab

      String[] use_lab
      variable
    • use_base_esd

      int[] use_base_esd
      variable
    • use_base_loc

      int[] use_base_loc
      variable
    • use_base_len

      int[] use_base_len
      variable
    • use_reg

      int[] use_reg
      variable
    • use_reg_loc

      int[] use_reg_loc
      variable
    • use_domain_tot

      int use_domain_tot
      variable
    • using_level

      int using_level
      variable
    • using_start

      int[] using_start
      variable
    • using_end

      int[] using_end
      variable
    • force_list_bal

      boolean force_list_bal
      variable
    • list_bal_line

      boolean list_bal_line
      variable
    • mac_call_gen

      boolean mac_call_gen
      variable
    • mac_call_first

      boolean mac_call_first
      variable
    • mac_call_last

      boolean mac_call_last
      variable
    • sym_sdt

      byte sym_sdt
      variable
    • sym_cst

      byte sym_cst
      variable
    • sym_dst

      byte sym_dst
      variable
    • sym_ent

      byte sym_ent
      variable
    • sym_ext

      byte sym_ext
      variable
    • sym_rel

      byte sym_rel
      variable
    • sym_rld

      byte sym_rld
      variable
    • sym_lct

      byte sym_lct
      variable
    • sym_wxt

      byte sym_wxt
      variable
    • sym_und

      byte sym_und
      variable
    • tot_sym

      int tot_sym
      variable
    • tot_sym_find

      int tot_sym_find
      variable
    • tot_sym_comp

      int tot_sym_comp
      variable
    • cur_sid

      int cur_sid
      variable
    • prev_sect_sid

      int prev_sect_sid
      variable
    • prev_sect_esd

      int prev_sect_esd
      variable
    • cur_sym_sect

      boolean cur_sym_sect
      variable
    • sect_change

      boolean sect_change
      variable
    • prev_sect_type

      byte prev_sect_type
      variable
    • private_csect

      String private_csect
      variable
    • sym_type_desc

      String[] sym_type_desc
      variable
    • sym_name

      String[] sym_name
      variable
    • sym_def

      int[] sym_def
      variable
    • sym_type

      byte[] sym_type
      variable
    • sym_dc_type

      byte[] sym_dc_type
      variable
    • sym_dc_type_sfx

      byte[] sym_dc_type_sfx
      variable
    • sym_attr

      byte[] sym_attr
      variable
    • sym_attr_elt

      byte[] sym_attr_elt
      variable
    • sym_scale

      int[] sym_scale
      variable
    • sym_attrp

      int[] sym_attrp
      variable
    • sym_attra

      String[] sym_attra
      variable
    • sym_esd

      int[] sym_esd
      variable
    • sym_loc

      int[] sym_loc
      variable
    • sym_max_loc

      int[] sym_max_loc
      variable
    • sym_len

      int[] sym_len
      variable
    • sym_sect_type

      int[] sym_sect_type
      variable
    • sym_sect_prev

      int[] sym_sect_prev
      variable
    • sym_sect_next

      int[] sym_sect_next
      variable
    • sym_xref

      TreeSet<Integer>[] sym_xref
      variable
    • last_xref_index

      int last_xref_index
      variable
    • last_xref_line

      int last_xref_line
      variable
    • sym_def_ref

      int sym_def_ref
      variable
    • sym_def_lookahead

      int sym_def_lookahead
      variable
    • vreg_rxb

      int vreg_rxb
      variable
    • max_missing

      int max_missing
      variable
    • tot_missing_copy

      int tot_missing_copy
      variable
    • tot_missing_macro

      int tot_missing_macro
      variable
    • tot_missing_sym

      int tot_missing_sym
      variable
    • missing_copy

      String[] missing_copy
      variable
    • missing_macro

      String[] missing_macro
      variable
    • dc_type_table

      String dc_type_table
      variable
    • dc_type_explicit

      String dc_type_explicit
      variable
    • dc_type_len

      int[] dc_type_len
      variable
    • dc_type_align

      int[] dc_type_align
      variable
    • dc_type_delimiter

      char[] dc_type_delimiter
      variable
    • sym_attra_type

      String[] sym_attra_type
      variable
    • bal_lab_attr

      byte bal_lab_attr
      variable
    • sym_attr_elt_def

      byte sym_attr_elt_def
      variable
    • bal_lab_attr_elt

      byte bal_lab_attr_elt
      variable
    • tot_lit

      int tot_lit
      variable
    • cur_lit

      int cur_lit
      variable
    • lit_loc_ref

      boolean lit_loc_ref
      variable
    • cur_lit_pool

      int cur_lit_pool
      variable
    • lit_name

      String[] lit_name
      variable
    • lit_pool

      int[] lit_pool
      variable
    • lit_line

      int[] lit_line
      variable
    • lit_line_loc

      int[] lit_line_loc
      variable
    • lit_esd

      int[] lit_esd
      variable
    • lit_loc

      int[] lit_loc
      variable
    • lit_len

      int[] lit_len
      variable
    • lit_dup

      int[] lit_dup
      variable
    • lit_scale

      int[] lit_scale
      variable
    • lit_dc_type

      byte[] lit_dc_type
      variable
    • lit_dc_type_sfx

      byte[] lit_dc_type_sfx
      variable
    • lit_gen

      byte[] lit_gen
      variable
    • lit_def

      int[] lit_def
      variable
    • lit_xref

      TreeSet<Integer>[] lit_xref
      variable
    • hex_tab

      String hex_tab
      variable
    • hex_op

      String hex_op
      variable
    • hex_ll

      String hex_ll
      variable
    • hex_len1

      String hex_len1
      variable
    • hex_len2

      String hex_len2
      variable
    • hex_bddd

      String hex_bddd
      variable
    • hex_bddd1

      String hex_bddd1
      variable
    • get_bdddhh

      boolean get_bdddhh
      variable
    • hex_bddd2

      String hex_bddd2
      variable
    • hex_bddd_loc

      String hex_bddd_loc
      variable
    • hex_bddd1_loc

      String hex_bddd1_loc
      variable
    • hex_bddd2_loc

      String hex_bddd2_loc
      variable
    • exp_text

      String exp_text
      variable
    • exp_index

      int exp_index
      variable
    • check_prev_op

      boolean check_prev_op
      variable
    • exp_val

      int exp_val
      variable
    • exp_esd

      int exp_esd
      variable
    • exp_type

      byte exp_type
      variable
    • exp_attr

      byte exp_attr
      variable
    • exp_state

      int exp_state
      variable
    • exp_level

      int exp_level
      variable
    • exp_use_lab

      String exp_use_lab
      variable
    • exp_term

      boolean exp_term
      variable
    • exp_eot

      boolean exp_eot
      variable
    • exp_term_op

      String exp_term_op
      variable
    • exp_start_op

      String exp_start_op
      variable
    • exp_token

      String exp_token
      variable
    • exp_op

      String exp_op
      variable
    • sym_esd1

      int sym_esd1
      variable
    • sym_esd2

      int sym_esd2
      variable
    • sym_type1

      byte sym_type1
      variable
    • sym_type2

      byte sym_type2
      variable
    • sym_val1

      int sym_val1
      variable
    • sym_val2

      int sym_val2
      variable
    • exp_prev_op

      String exp_prev_op
      variable
    • exp_sym_index

      int exp_sym_index
      variable
    • exp_sym_pushed

      boolean exp_sym_pushed
      variable
    • exp_sym_last

      boolean exp_sym_last
      variable
    • exp_first_sym_len

      boolean exp_first_sym_len
      variable
    • exp_equ

      boolean exp_equ
      variable
    • exp_lit_mod

      boolean exp_lit_mod
      variable
    • exp_len

      int exp_len
      variable
    • tot_exp_stk_sym

      int tot_exp_stk_sym
      variable
    • tot_exp_stk_op

      int tot_exp_stk_op
      variable
    • exp_stk_sym_esd

      int[] exp_stk_sym_esd
      variable
    • exp_stk_sym_val

      int[] exp_stk_sym_val
      variable
    • exp_stk_op

      String[] exp_stk_op
      variable
    • exp_op_class

      int[] exp_op_class
      variable
    • tot_classes

      int tot_classes
      variable
    • exp_action

      int[] exp_action
      variable
    • exp_rld_mod_val

      int exp_rld_mod_val
      variable
    • exp_rld_mod_set

      boolean exp_rld_mod_set
      variable
    • exp_rld_len

      byte exp_rld_len
      variable
    • tot_exp_rld_add

      int tot_exp_rld_add
      variable
    • tot_exp_rld_sub

      int tot_exp_rld_sub
      variable
    • exp_rld_add_esd

      int[] exp_rld_add_esd
      variable
    • exp_rld_sub_esd

      int[] exp_rld_sub_esd
      variable
    • tot_rld

      int tot_rld
      variable
    • rld_add

      char rld_add
      variable
    • rld_sub

      char rld_sub
      variable
    • rld_fld_esd

      int[] rld_fld_esd
      variable
    • rld_fld_loc

      int[] rld_fld_loc
      variable
    • rld_fld_len

      byte[] rld_fld_len
      variable
    • rld_fld_sgn

      char[] rld_fld_sgn
      variable
    • rld_xrf_esd

      int[] rld_xrf_esd
      variable
    • gen_obj_code

      boolean gen_obj_code
      variable
    • obj_code

      String obj_code
      variable
    • list_obj_loc

      int list_obj_loc
      variable
    • list_obj_code

      String list_obj_code
      variable
    • cur_text_buff

      String cur_text_buff
      variable
    • cur_text_loc

      int cur_text_loc
      variable
    • cur_text_len

      int cur_text_len
      variable
    • cur_text_esd

      int cur_text_esd
      variable
    • bin_byte

      byte[] bin_byte
      variable
    • obj_bin_id

      byte obj_bin_id
      variable
    • bin_esd_type

      byte[] bin_esd_type
      variable
    • bin_txt_type

      byte[] bin_txt_type
      variable
    • bin_rld_type

      byte[] bin_rld_type
      variable
    • bin_end_type

      byte[] bin_end_type
      variable
    • dc_op

      boolean dc_op
      variable
    • dc_eod

      boolean dc_eod
      variable
    • dc_len_explicit

      boolean dc_len_explicit
      variable
    • dc_scale_explicit

      boolean dc_scale_explicit
      variable
    • dc_exp_explicit

      boolean dc_exp_explicit
      variable
    • dc_bit_len

      boolean dc_bit_len
      variable
    • dc_unsigned

      boolean dc_unsigned
      variable
    • dc_bit_buff

      BigInteger dc_bit_buff
      variable
    • dc_bit_bytes

      byte[] dc_bit_bytes
      variable
    • dc_bit_value

      long dc_bit_value
      variable
    • dc_bit_hex

      String dc_bit_hex
      variable
    • dc_bit_tot

      int dc_bit_tot
      variable
    • dc_bit_byte_len

      int dc_bit_byte_len
      variable
    • dc_bit_fill

      int dc_bit_fill
      variable
    • dcb_len

      int dcb_len
      variable
    • dcb_pad

      int dcb_pad
      variable
    • dcb_bin

      String dcb_bin
      variable
    • dcc_text

      String dcc_text
      variable
    • dcc_quote

      char dcc_quote
      variable
    • dcc_len

      int dcc_len
      variable
    • dcp_len

      int dcp_len
      variable
    • dcp_sign

      char dcp_sign
      variable
    • dcx_len

      int dcx_len
      variable
    • dc_first_field

      boolean dc_first_field
      variable
    • dc_lit_ref

      boolean dc_lit_ref
      variable
    • dc_lit_gen

      boolean dc_lit_gen
      variable
    • dc_lit_index_start

      int dc_lit_index_start
      variable
    • dc_field

      String dc_field
      variable
    • dc_type

      char dc_type
      variable
    • dc_attr_elt

      byte dc_attr_elt
      variable
    • dcv_type

      boolean dcv_type
      variable
    • dca_ignore_refs

      boolean dca_ignore_refs
      variable
    • dc_type_sfx

      char dc_type_sfx
      variable
    • fp_text

      String fp_text
      variable
    • fp_log2

      double fp_log2
      variable
    • fp_log10

      double fp_log10
      variable
    • fp_context

      MathContext fp_context
      variable
    • fp_big_dec1

      BigDecimal fp_big_dec1
      variable
    • fp_big_dec2

      BigDecimal fp_big_dec2
      variable
    • fp_big_dec3

      BigDecimal fp_big_dec3
      variable
    • fp_bd_two

      BigDecimal fp_bd_two
      variable
    • fp_big_byte

      byte[] fp_big_byte
      variable
    • fp_data_byte

      byte[] fp_data_byte
      variable
    • fp_data_buff

      ByteBuffer fp_data_buff
      variable
    • fp_big_int1

      BigInteger fp_big_int1
      variable
    • fp_big_int2

      BigInteger fp_big_int2
      variable
    • fp_big_int_one_bits

      BigInteger fp_big_int_one_bits
      variable
    • fp_big_int_lx_man_bits

      BigInteger fp_big_int_lx_man_bits
      variable
    • fp_big_int_dh_man_bits

      BigInteger fp_big_int_dh_man_bits
      variable
    • fp_int1

      int fp_int1
      variable
    • fp_round_bit

      int fp_round_bit
      variable
    • fp_int_eb_one_bits

      int fp_int_eb_one_bits
      variable
    • fp_int_eb_man_bits

      int fp_int_eb_man_bits
      variable
    • fp_int_eh_man_bits

      int fp_int_eh_man_bits
      variable
    • fp_long1

      long fp_long1
      variable
    • fp_long_db_one_bits

      long fp_long_db_one_bits
      variable
    • fp_long_db_man_bits

      long fp_long_db_man_bits
      variable
    • fp_long_dh_man_bits

      long fp_long_dh_man_bits
      variable
    • dc_index

      int dc_index
      variable
    • dc_data_start

      int dc_data_start
      variable
    • dc_dup

      int dc_dup
      variable
    • dc_dup_loc

      int dc_dup_loc
      variable
    • dc_len

      int dc_len
      variable
    • dc_scale

      int dc_scale
      variable
    • dc_digits

      String dc_digits
      variable
    • dc_dec_point

      boolean dc_dec_point
      variable
    • dc_dec_scale

      int dc_dec_scale
      variable
    • dc_exp

      int dc_exp
      variable
    • dc_first_len

      int dc_first_len
      variable
    • dc_first_dup

      int dc_first_dup
      variable
    • dc_first_loc

      int dc_first_loc
      variable
    • dc_first_type

      char dc_first_type
      variable
    • dc_first_type_sfx

      char dc_first_type_sfx
      variable
    • dc_first_scale

      int dc_first_scale
      variable
    • dc_first_attr_elt

      byte dc_first_attr_elt
      variable
    • dc_hex

      String dc_hex
      variable
    • dc_data_byte

      byte[] dc_data_byte
      variable
    • dc_data

      ByteBuffer dc_data
      variable
    • dc_type_index

      int dc_type_index
      variable
    • dc_bd_val

      BigDecimal dc_bd_val
      variable
    • dc_bi_val

      BigInteger dc_bi_val
      variable
    • dc_byte_val

      byte[] dc_byte_val
      variable
    • dcc_ascii_req

      boolean dcc_ascii_req
      variable
    • ascii_lf

      byte ascii_lf
      variable
    • ascii_cr

      byte ascii_cr
      variable
    • ascii_period

      byte ascii_period
      variable
    • ascii_space

      byte ascii_space
      variable
    • ebcdic_period

      byte ebcdic_period
      variable
    • ebcdic_space

      byte ebcdic_space
      variable
    • dfhresp_type

      String[] dfhresp_type
      variable
    • dfhresp_lit

      String[] dfhresp_lit
      variable
    • dfhvalue_type

      String[] dfhvalue_type
      variable
    • dfhvalue_lit

      String[] dfhvalue_lit
      variable
  • Constructor Details

    • az390

      public az390()
      Dummy constructor - no initialization needed
  • Method Details

    • main

      public static void main(String[] args)
      main is entry when executed from command line Create instance of az390 class and pass parms to az390 like z390 does.
      Parameters:
      args - argument string - same as z390
    • start_az390_thread

      public void start_az390_thread(String[] args, JTextArea z390_log, RandomAccessFile mz390_systerm_file, RandomAccessFile mz390_stats_file)
      initialize z390 when called from mz390 to receive bal directly and share the symbol table with mz390.
      Parameters:
      args - argumebnt string
      z390_log - log data
      mz390_systerm_file - file handle for systerm
      mz390_stats_file - file handle for statistics
    • finish_az390

      public void finish_az390(String[] mac_file_path, int[] mac_file_errors)
      save xref file names and error counts for cross reference at end of PRN
      Parameters:
      mac_file_path - file path for macros
      mac_file_errors - macro error data
    • run

      public void run()
      run the assembler
      Specified by:
      run in interface Runnable
    • process_az390

      private void process_az390()
      assemble bal source file into relocatable OBJ file and generate optional PRN file.
      Notes:
      1. az390 may be called from:
        1. z390 GUI Windows command via main();
        2. Windows command prompt via main();
        3. mz390 call via process_az390_call();
      2. If called from z390 GUI Windows command, the console output will be redirected to to the z390 GUI log.
      3. If called from mz390 via process_az390_call, az390 process will run on separate thread and the get_bal_line and receive_bal_line methods will synchronize passing bal record from mz390 to az390 process.
    • init_az390

      private void init_az390(String[] args, JTextArea log_text, RandomAccessFile systerm, RandomAccessFile stats)
      1. initialize log routing
      2. set options
      3. compile regular expression parsers
      4. open bal and obj buffered I/O files
      5. Init ascii/ebcdic translation table
      Parameters:
      args - argumebnt string
      log_text - log data
      systerm - file handle for systerm
      stats - file handle for statistics
    • init_push_pop

      private void init_push_pop()
      init push/pop using and print
    • init_arrays

      private void init_arrays()
      initialize arrays using tz390.opt_max???
    • compile_patterns

      private void compile_patterns()
      compile regular expression parsers
    • open_files

      private void open_files()
      Set trace file name; then open obj and prn files
    • process_bal

      private void process_bal()
      assemble bal source into obj relocatable object code file
    • resolve_symbols

      private void resolve_symbols()
      if errors occurred during loading of bal repeat symbol update passes until there are no errors or minimum error or max passes are reached.
    • update_symbols

      private void update_symbols()
      scan bal source and update symbols
    • check_timeout

      private void check_timeout()
      check if timeout expired
    • update_sects

      private void update_sects()
      update each section starting address and max length, and reset current length and current esd_loc
      Notes:
      1. If any section start address or max length changes issue error to force additional passes.
      2. sym_cst CSECT's start at 0 and are contiguous within LOCTR's
      3. Each new CSECT is aligned to 8
      4. sym_dst DSECT's always start at 0
      5. Set esd_base to root section for cst, dst, and loctors
    • sect_change_error

      private void sect_change_error()
      set sect_change
    • update_loctrs

      private void update_loctrs()
      update loctr sections with contiguous starting addresses from CSECT/DSECT and issue errors if any start address or length changes and reset length for next pass.
    • reset_lits

      private void reset_lits()
      reset lit_gen flags to force reallocation on each pass
    • gen_list_mnemonics

      private void gen_list_mnemonics()
      Lists all mnemonics in the selected opcode table
      1. All mnemonics from the current opcode table are converted into report entries
      2. The report entries are sorted
      3. The sorted entries are printed (three on a print line) preceded by a header line
    • gen_obj_esds

      private void gen_obj_esds()
      write ESD's for CSECTS, EXTRNS, and ENTRIES to the OBJ file in ascii hex and list on PRN if option LIST
    • get_esd_type

      private String get_esd_type()
      return esd type
      Returns:
      type of ESD
    • gen_obj_text

      private void gen_obj_text()
      generate object code for bal instructions in CSECT's on final pass
    • process_bal_op

      private void process_bal_op()
      allocate or generate object code for bal op
      1. Note op_type index values must match op_name array values.
      2. Indexes less than 100 and CNOP are machine instr. types RPI 743
      3. Indexes more than 100 are assembler instr.
    • list_bal_line

      private void list_bal_line()
      list bal line with first 8 bytes of object code if any and turn off list_bal_line request
      Note: See comments processing case 0 for update of mac_call_gen, call reformating, and delay flags mac_call_first and mac_call_last.
    • check_list_bal_line

      private boolean check_list_bal_line()
      set true if ok to list BAL line on PRN file
      Returns:
      true if BAL line to be printed; false to suppress
    • update_list_bal_line

      private void update_list_bal_line()
      update mac_call_gen after prn
    • add_rld

      private void add_rld(int exp_esd)
      add plus rld
      Parameters:
      exp_esd - ???
    • sub_rld

      private void sub_rld(int exp_esd)
      sub rld
      Parameters:
      exp_esd - ???
    • reduce_exp_rld

      private void reduce_exp_rld()
      reduce rld on stack
    • gen_exp_rld

      private void gen_exp_rld(int loc_ctr_offset)
      generate rlds for expression
      Notes:
      1. convert to rel csect vs rel module offsets for linker use.
      2. Original exp_val saved in rld_exp_val for use in PRN display (i.e. show addresses relative to module versus CSECT).
      Parameters:
      loc_ctr_offset - offset from location counter for (relocatable) expression position // #659
    • gen_obj_rlds

      private void gen_obj_rlds()
      write RLD's to the OBJ file in ascii hex
    • gen_obj_end

      private void gen_obj_end()
      write END object record with entry if specified
    • gen_sym_list

      private void gen_sym_list()
      list symbols in alpah order with optional cross reference
    • gen_lit_xref_list

      private void gen_lit_xref_list()
      list literals in alpha order with optional cross reference
    • load_bal

      private void load_bal()
      load bal source
      Concatentate any continuations indicated by non-blank in position 72. Each continuation must start at position 16.
    • pass_bal_line

      public void pass_bal_line(String new_bal_line, String new_xref_file_name, char new_xref_file_type, int new_xref_file_num, int new_xref_line_num)
      1. pass mz390 bal_line to az390 bal_line with synchronization of threads.
      2. ignore BAL after END
      Parameters:
      new_bal_line - source line
      new_xref_file_name - file name for cross ref
      new_xref_file_type - file type for cross ref
      new_xref_file_num - file nr for cross ref
      new_xref_line_num - file line for cross ref
    • set_sym_lock

      public void set_sym_lock(String desc)
      1. Block mz390 until az390 is waiting for next bal.
      2. Set sym_lock
      Notes:
      1. See az390 pass_bal for lock check.
      2. See mz390 put_bal_line for lock reset.
      Parameters:
      desc - description
    • reset_sym_lock

      public void reset_sym_lock()
      reset sym lock at next mz390 bal line and at start of lookahead mode.
    • get_bal_line

      private void get_bal_line()
      get next bal line from bal file or from mz390 parallel thread pass
    • save_bal_line

      private void save_bal_line()
      save bal line during loading for log_error use
    • parse_bal_line

      private void parse_bal_line()
      set bal_label and bal_op
    • get_base_name

      private String get_base_name(String file_name)
      return base file name from path\file.sfx
      Parameters:
      file_name - file name
      Returns:
      base name of the file (without extension)
    • find_bal_op

      private int find_bal_op()
      return index of bal operation
      or return 0 for comments
      or return -1 if undefined operation
      or return -2 if cancelled OPSYN
      Returns:
      index of bal operation, or -1=undefine, -2=cancelled OPSYN, 0=comment
    • process_esd

      private void process_esd(byte esd_type)
      process EXTRN, ENTRY, or WXTRN statement
      Parameters:
      esd_type - ???
    • add_extrn

      private int add_extrn(String token)
      add EXTRN using V vs S key index
      Parameters:
      token - input token
      Returns:
      index of token
    • add_wxtrn

      private int add_wxtrn(String token)
      add WXTRN using V vs S key index
      Parameters:
      token - input token
      Returns:
      index of token
    • add_entry

      private void add_entry(String token)
      add ENTRY
      Parameters:
      token - input token
    • process_sect

      private void process_sect(byte sect_type, String sect_name)
      add or update csect, dsect, or loctr indicated by sym_cst, sym_dst, or sym_lct type parm
      Steps:
      1. Update previous section if any with max length and any loctr pointers
      2. If name omitted used private cst/dst
      3. Add new section if not found or external reference found as local label
      4. Reset location counter to end of current section
      5. Update prev section type and sid for use in processing sym_lct sections
      Parameters:
      sect_type - section type: CSECT / DSECT / RSECT
      sect_name - section name
    • find_sym

      public int find_sym(String name)
      1. Return defined symbol index else -1
      2. If not lookahead mode:
        • if found, add xref
        • else if vcon mode, add extrn
      Parameters:
      name - input symbol: label or variable name
      Returns:
      index of symbol, or -1 if not defined
    • update_label

      public void update_label()
      add or update relative labels and exclude CST, DST, EQU, USING symbols
    • init_sym_entry

      private void init_sym_entry()
      init sym variables for new or existing lookahead symbol table entry
    • get_sym_len

      private int get_sym_len(int index)
      return total length of csect or dsect
      Parameters:
      index - value
      Returns:
      length in bytes
    • update_sect

      private void update_sect()
      update length of current section and save current loc_ctr for continue
    • process_dc

      public void process_dc(int request_type)
      processing by request type:
      1. parse ds/dc bal statement and allocate or gen data items including alignment bytes where required.
      2. find or add literal table entry using ds/dc type single parm following = parm
      3. generate literal pool dc using loc_ctr set to referenced instruction.
      if LTORG, gen lits
      if not DC/DS/LTORG set dc_lit and process first field as literal and update exp_index
      Parameters:
      request_type - request type code: 1=parse, 2=find, 3=generate
    • calc_abs_exp

      private boolean calc_abs_exp()
      calculate abs value else abort
      Returns:
      true if absolute expression, false otherwise
    • calc_rel_exp

      private boolean calc_rel_exp()
      calculate rel value else abort
      Returns:
      true if relative expression, false otherwise
    • calc_dca_exp

      private boolean calc_dca_exp()
      set dca_ignore_refs for A and V type symbol refs if DS or DSECT
      Returns:
      true if valid DC A() expression, false otherwise
    • calc_exp

      private boolean calc_exp()
      parse abs/rel expression starting at exp_text.charAt(exp_index)
      return true if ok and set:
      1. exp_val = abs or rel offset
      2. exp_esd = abs 0 or cst/dst esd
      3. exp_index = index to terminator which can be end of string, or ()
      Note: this version applies a default location counter offset of 0
      Returns:
      true if valid absolute or relative expression, false otherwise
    • calc_exp

      private boolean calc_exp(int loc_ctr_offset)
      parse abs/rel expression starting at exp_text.charAt(exp_index)
      return true if ok and set:
      1. exp_val = abs or rel offset
      2. exp_esd = abs 0 or cst/dst esd
      3. exp_index = index to terminator which can be end of string, or ()
      Parameters:
      loc_ctr_offset - offset from location counter for (relocatable) expression position // #659
      Returns:
      true if valid absolute or relative expression, false otherwise
    • proc_exp_token

      private void proc_exp_token(int loc_ctr_offset)
      parse general expression tokens:
      1. push sym or sdt
      2. exec or push operations + - * /
      3. terminate on end of string or ()
      Parameters:
      loc_ctr_offset - offset from location counter for (relocatable) expression position // #659
    • proc_loc_ctr

      private void proc_loc_ctr()
      push current location counter on stack
    • proc_exp_sym

      private void proc_exp_sym()
      description missing
    • proc_exp_sdt

      private void proc_exp_sdt()
      description missing
    • proc_exp_op

      private void proc_exp_op(int loc_ctr_offset)
      description missing
      Parameters:
      loc_ctr_offset - offset from location counter for (relocatable) expression position // #659
    • exp_add

      private void exp_add()
      add top of stack value to prev. value and pop the top stack value off
    • exp_sub

      private void exp_sub()
      sub top of stack value from prev. value and pop the top stack value off
    • exp_mpy

      private void exp_mpy()
      mpy top of stack value to prev. value * and pop the top stack value off
    • exp_div

      private void exp_div()
      div top of stack value into prev. value and pop the top stack value off
    • exp_integer_op

      private void exp_integer_op()
      replace sym or lit on stack with integer I' attribute value
    • exp_len_op

      private void exp_len_op()
      replace sym or lit on stack with length value
    • exp_scale_op

      private void exp_scale_op()
      replace sym or lit on stack with scale value
    • get_stk_sym

      private void get_stk_sym()
      set stk_values 1 and and 2 from top of stack
    • put_stk_sym

      private void put_stk_sym()
      1. pop operator from op stack
      2. pop sym_val2 off var stack
      3. replace original sym_val1 on top of stack with result
    • exp_push_op

      private void exp_push_op()
      put current op on stack
      if unary minus push 0 var first
      if unary plus skip the push
    • exp_pop_op

      private void exp_pop_op()
      pop current op on stack
    • exp_term

      private void exp_term(int loc_ctr_offset)
      terminate expression returning value on stack if no errors
      Parameters:
      loc_ctr_offset - offset from location counter for (relocatable) expression position // #659
    • push_exp_sym

      private void push_exp_sym()
      push symbol on stack else abort
      set cur_sid > 0 used by L'
    • push_exp_lit

      private void push_exp_lit()
      push literal on stack else abort and set cur_lit >= 0 and cur_sit = -1 for L' to determine that literal is on the stack
      Note: Literal must be first term in exp since it may use calc_exp during DC processing and then resets exp stack with lit address
    • inc_tot_exp_stk_sym

      private boolean inc_tot_exp_stk_sym()
      check if room to add to exp_stack and return true else abort
      Returns:
      true if stack has room, abort otherwise
    • push_exp_sdt

      private void push_exp_sdt(String sdt)
      push self defining abs term on stack
      Parameters:
      sdt - self-defining term
    • exit_az390

      public void exit_az390()
      put stats and display total errors after mz390 is done and close files.
      Note: return az390 return code for use by mz390 when called from mz390 when mfc option on.
    • put_stats

      public void put_stats()
      display statistics on STA and totals on STA and TRM including MZ and AZ totals.
    • put_stat_line

      private void put_stat_line(String msg)
      routine statistics line to PRN or STATS(file)
      Parameters:
      msg - message
    • close_files

      public void close_files()
      close output obj, prn, err, tra
    • log_error

      private void log_error(int error, String msg)
      issue error msg to log with prefix and inc error total
      Notes:
      1. Set bal_abort if not set else exit
      2. supress if not gen_obj and not trace
      3. print bal line first if list on
      Parameters:
      error - error number
      msg - message text
    • set_file_line_xref

      private void set_file_line_xref()
      set xref_file_line passed from mz390 if available for use in error messages
    • abort_error

      private void abort_error(int error, String msg)
      issue error msg to log with prefix and inc error total
      Parameters:
      error - error number
      msg - error message
    • put_copyright

      private void put_copyright()
      display az390 version, timestamp, and copyright if running standalone
    • put_log

      private void put_log(String msg)
      Write message to z390_log_text or console if running standalone
      Parameters:
      msg - message
    • put_prn_line

      private void put_prn_line(String msg)
      put line to prt listing file if print_on and not surpressed by nogen. if print data, print all data.
      Parameters:
      msg - message
    • check_end_parms

      private void check_end_parms()
      check if generated object code equals instruction length and check for extra parms beyond end of last instruction parm and issue error
    • put_obj_line

      private void put_obj_line(String msg)
      put object code to obj file in hex or binary format
      Parameters:
      msg - message
    • cvt_obj_hex_to_bin

      private void cvt_obj_hex_to_bin(String hex_rcd)
      convert ascii hex object string to binary 80 byte EBCDIC format for mainframe compatiblity. See DFSMS Program Management Manual reference.
      Parameters:
      hex_rcd - ???
    • get_long_hex

      private String get_long_hex(long work_long)
      Format long into 16 byte hex string
      Parameters:
      work_long - long
      Returns:
      hex string equivalent of input
    • string_to_hex

      private String string_to_hex(String text, boolean ascii)
      Format text string into hex string If ascii_req true, gen ascii else ebcdic hex
      Parameters:
      text - text
      ascii - character set indicator
      Returns:
      formatted text
    • bytes_to_hex

      private String bytes_to_hex(byte[] bytes, int byte_start, int byte_length, int chunk)
      Format bytes into hex string If chunk more than 0 insert space after each chuck
      Parameters:
      bytes - byte array
      byte_start - start address
      byte_length - length in bytes
      chunk - chunk indicator
      Returns:
      hex string for selected bytes
    • put_obj_text

      private void put_obj_text()
      1. Append obj_code to list_obj_code for print line (reguired by mult DC calls).
      2. Exit if gen_obj_code not on or not CSECT
      3. Buffer output of ojbect text code for contiguous data in same ESD.
      4. Called from END processing with BAL_EOF to flush buffer.
      5. Reset obj_code for use by DC routines
      Note: this version applies a default location counter offset of 0
    • put_obj_text

      private void put_obj_text(int loc_ctr_offset)
      1. Append obj_code to list_obj_code for print line (reguired by mult DC calls).
      2. Exit if gen_obj_code not on or not CSECT
      3. Buffer output of ojbect text code for contiguous data in same ESD.
      4. Called from END processing with BAL_EOF to flush buffer.
      5. Reset obj_code for use by DC routines
      Parameters:
      loc_ctr_offset - offset from location counter for (relocatable) expression position // #659
    • check_private_csect

      private void check_private_csect()
      start private csect if no csect or dsect
    • add_using

      private void add_using()
      add or replace USING for code generation
    • get_use_range

      private void get_use_range()
      set cur_use_base esd,loc, and len
    • get_use_domain

      private void get_use_domain()
      set cur_use_reg and cur_use_off from exp_text at exp_index set by get_use_range
      Note: get_rel_exp_bddd is called for dependent using expressions to find reg and loc
    • drop_dependent_using

      private void drop_dependent_using()
      drop duplicate unlabeled dependent USING for same section and offset
    • drop_using

      private void drop_using()
      drop one or more using registers or labeled using
    • drop_cur_use_label

      private void drop_cur_use_label()
      remove labeled using if found
    • drop_cur_use_reg

      private void drop_cur_use_reg()
      Remove cur_use_reg entries if found but not labeled usings.
    • move_use_entry

      private void move_use_entry(int index1, int index2)
      move use entry from index1 to index2
      Parameters:
      index1 - origin index
      index2 - target index
    • add_use_entry

      private void add_use_entry()
      add use entry
    • list_use

      private void list_use()
      list current use table if LISTUSE
    • get_hex_op

      private void get_hex_op(int op_offset, int op_len)
      initialize object code with op code and initialize exp parser with parms if op_offset = 1
      Parameters:
      op_offset - ???
      op_len - instruction length in bytes?
    • or_last_op

      private void or_last_op()
      missing description
    • get_hex_nib

      private String get_hex_nib()
      return single hex nibble char 0-f
      Returns:
      1-character string
    • get_hex_vreg

      private void get_hex_vreg(int vreg)
      append vector hex reg low 4 bits from next parm and set corresponding vreg_rxb high bit for 16-31 vregs
      Parameters:
      vreg - vector register number
    • get_hex_reg

      private void get_hex_reg()
      append hex reg from next parm
    • get_hex_reg_even

      private void get_hex_reg_even()
      append hex reg from next parm - if it is an even register
    • get_hex_vreg_rxb

      private void get_hex_vreg_rxb()
      vector register 1-5 high bits to support registers 16-31 reset for next set of high bits
    • get_hex_zero

      private void get_hex_zero(int hex_ll)
      append zero nibbles
      Parameters:
      hex_ll - nr of nibbles to append
    • skip_comma

      private void skip_comma()
      verify and skip comma
    • get_hex_byte

      private void get_hex_byte()
      append hex byte from next parm
    • get_hex_halfword

      private void get_hex_halfword()
      append hex halfword from next parm
    • get_hex_int

      private void get_hex_int(int bits)
      append hex integer from next parm
      Parameters:
      bits - length in bits
    • get_hex_relative_offset

      private void get_hex_relative_offset(int bits)
      append hex relative offset from current instruction
      Parameters:
      bits - length in bits
    • get_hex_byte_signed

      private void get_hex_byte_signed()
      append signed byte from next parm RPI 1146
    • get_hex_llbddd

      private void get_hex_llbddd()
      set hex_len, hex_bddd, and hex_bddd_loc from next parm
    • get_exp_ll

      private int get_exp_ll()
      return explicit or implied length from exp_len
      Returns:
      length in bytes
    • get_hex_v2xbddd

      private void get_hex_v2xbddd()
      append xbddd or xbdddhh hex object code from next parm
    • get_hex_xbddd

      private void get_hex_xbddd()
      append xbddd or xbdddhh hex object code from next parm
    • get_exp_v2x

      private String get_exp_v2x()
      get hex x from next (x) else 0
      Returns:
      ???
    • get_exp_x

      private String get_exp_x()
      get hex x from next (x) else 0
      Returns:
      ???
    • get_hex_xbdddhh2

      private void get_hex_xbdddhh2()
      append xbddd hex object code from next parm
    • get_hex_bddd2

      private void get_hex_bddd2(boolean add_code)
      if add_code
      then append bddd or bdddhh hex object code from next parm
      else just set hex_bddd2
      Parameters:
      add_code - flag to set or add base-displacement code
    • exp_next_char

      private boolean exp_next_char(char next_char)
      return true if next exp_text char at exp_index is next_char
      Parameters:
      next_char - next character
      Returns:
      true if equal, false otherwise
    • get_hex_bdddhh2

      private void get_hex_bdddhh2()
      gen bdddhh where hhddd is 20 bit signed offset to b. RPI 387
    • get_hex_rld_long

      private void get_hex_rld_long()
      gen 32 bit RLD or abs value with loc ctr at start of ins.
    • get_hex_relative_offset_long

      private void get_hex_relative_offset_long()
      append iiiiiiii signed offset (calc for label)
    • get_hex_relative_offset_12

      private String get_hex_relative_offset_12()
      return relative 12 bit relative halfword offset
      Returns:
      ???
    • get_hex_relative_offset_16

      private String get_hex_relative_offset_16()
      return relative 16 bit relative halfword offset
      Returns:
      ???
    • get_hex_relative_offset_32

      private String get_hex_relative_offset_32()
      return relative signed half word offset from psw_loc to symbol in same csect at even address
      Note: Error if not same csect or odd address
      Returns:
      ???
    • get_hex_rel_offset_24

      private String get_hex_rel_offset_24()
      return relative 24 bit halfword offset from psw_loc to symbol in same csect at even address
      Note: Error if not same csect or odd address
      Returns:
      ???
    • get_exp_bddd

      private String get_exp_bddd()
      1. Return hex bddd based on exp_esd and exp_val set by calc_exp or calc_lit.
      2. If get_bdddhh is set, then 20 bit signed offset will be returned as bdddhh.
      3. Set cur_reg and cur_reg_loc for use when called from dependent using with domain expression.
      4. If exp_use_lab is not null restrict using entries to labelled using.
      Returns:
      ???
    • get_exp_abs_bddd

      private String get_exp_abs_bddd()
      return bddd or bdddhh from explicit ddd(b) with ddd in exp_val
      Returns:
      ???
    • get_exp_abs_v2xbddd

      private String get_exp_abs_v2xbddd()
      return xbddd or xbdddhh from explicit ddd(x,b) with ddd in exp_val
      Returns:
      ???
    • get_exp_abs_xbddd

      private String get_exp_abs_xbddd()
      return xbddd or xbdddhh from explicit ddd(x,b) with ddd in exp_val
      Returns:
      ???
    • get_exp_abs_bddd

      private String get_exp_abs_bddd(int b, int dddhh)
      return bddd or bdddhh using exp_val displacement
      Parameters:
      b - base register number
      dddhh - displacement in bytes
      Returns:
      ???
    • get_dc_field_dup

      private void get_dc_field_dup()
      return dup factor for dc_field else 1
    • get_dc_field_type

      private void get_dc_field_type()
      set dc_type and dc_type_index and verify valid type else abort
    • get_dc_field_modifiers

      private void get_dc_field_modifiers()
      1. Set L, S, E defaults
      2. Check modifiiers based on type
        1. if DEL check for B/D/H and set tz390.fp_type
        2. if C check for A/E and set dc_type_sfx
        3. if AFV check for D and set dc_type_sfx
        4. if LQ ignore the Q for 16 byte default
        5. If S check for Y and set length 3
      3. Process explicit L length, S scale, and E exponent modifiers in any order
      4. Align and save first length if req'd
    • dc_align

      private void dc_align(int align_len)
      align to mult of align_len from loc_ctr
      If align_len more than 8 use 8
      Parameters:
      align_len - alignment unit in bytes
    • flush_dc_bits

      private void flush_dc_bits()
      flush any bits in dc_bit_buff to align to byte boundary for next field or end of DS.DC
    • dc_fill

      private void dc_fill(int fill_len)
      1. increment loc_ctr by bytes if not bit mode else shift bits by bit length
      2. if DC and not first field fill with zeros
      Parameters:
      fill_len - length
    • process_dca_data

      private void process_dca_data()
      alloc or gen DS/DC A/V/Y type parms using prev. settings for dc_dup and dc_len. Also save first field dc_type, dc_len
    • gen_dca_bits

      private void gen_dca_bits()
      gen dca exp_val in dc_bit_buff
      Note: Shared by gen_dcb_bits
    • gen_dca_bytes

      private void gen_dca_bytes()
      gen dca byte field
    • process_dcb_data

      private void process_dcb_data()
      alloc or gen DS/DC B type parms using prev. settings for dc_dup and dc_len. Also save first field dc_len
      Note: binary values are right aligned in explicit length fields.
    • gen_dcb_bits

      private void gen_dcb_bits()
      gen dcb type bit field in dc_bit_buff
    • gen_dcb_bytes

      private void gen_dcb_bytes()
      gen dcb byte length field
    • process_dcc_data

      private void process_dcc_data()
      allocate or generate dc Cln'...' data using dc_dup and explicit dc_len if any
      Notes:
      1. C'..' default EBCDIC unless ASCII option
      2. C".." always ASCII regardless of option
      3. C!..! always EBCDIC regardless of option
      4. ''|""|!! or double ampersand replaced with single '|"|! or ampersand
      5. CA'...' always ASCII
      6. CE'...' always EBCDIC
    • gen_dcc_bits

      private void gen_dcc_bits()
      gen dcc bit field
    • gen_dcc_bytes

      private void gen_dcc_bytes()
      gen dcc bytes
    • process_dc_fp_data

      private void process_dc_fp_data()
      alloc or gen DS/DC D, E, or L type data using prev settings for dc_type, dc_type_sfx, dc_dup and dc_len. Also save first field dc_type, dc_len
    • gen_dc_fp_bits

      private void gen_dc_fp_bits()
      gen del bit length field
    • gen_dc_fp_bytes

      private void gen_dc_fp_bytes()
      gen del byte length field
    • get_dc_bd_val

      private boolean get_dc_bd_val()
      set dc_bd_val from next floating point sdt in dc_field at dc_index
      Notes:
      1. Apply any scale factor or exponent to dc_bd_value.
      2. Set dc_unsigned true/false
      Returns:
      true if unsigned, false if signed
    • remove_blanks

      private String remove_blanks(String text_in)
      remove blanks allowed within numeric DC fields BDEFHLPXZ
      Parameters:
      text_in - input text
      Returns:
      text with extraneous blanks removed
    • get_dc_fh_hex_val

      private String get_dc_fh_hex_val()
      get 1-16 byte hex value for F or H constant from dc_bd_val
      Returns:
      hex string
    • get_dc_fp_hex

      private void get_dc_fp_hex(String text, int index)
      set dc_hex for D, E, or L floating point sdt starting at text index
      Parameters:
      text - input string
      index - position
    • process_dcf_data

      private void process_dcf_data()
      alloc or gen DS/DC F type parms using prev. settings for dc_dup and dc_len. Also save first field dc_type, dc_len
    • gen_dc_fh_bits

      private void gen_dc_fh_bits()
      gen F or H bit field
    • gen_dc_fh_bytes

      private void gen_dc_fh_bytes()
      gen F or H byte field
    • process_dch_data

      private void process_dch_data()
      alloc or gen DS/DC H type parms using prev. settings for dc_dup and dc_len. Also save first field dc_type, dc_len
    • process_dcp_data

      private void process_dcp_data()
      alloc or gen DS/DC P type parms using prev. settings for dc_dup and dc_len. Also save first field dc_type, dc_len
    • gen_dcp_bits

      private void gen_dcp_bits()
      gen P bit field
    • gen_dcp_bytes

      private void gen_dcp_bytes()
      gen P byte field
    • process_dcz_data

      private void process_dcz_data()
      alloc or gen DS/DC Z type parms using prev. settings for dc_dup and dc_len. Also save first field dc_type, dc_len
    • process_dcs_data

      private void process_dcs_data()
      alloc or gen DS/DC S type parms using prev. settings for dc_dup and dc_len. Also save first field dc_type, dc_len
    • process_dcx_data

      private void process_dcx_data()
      alloc or gen DS/DC X type parms using prev. settings for dc_dup and dc_len. Also save first field dc_len
      Notes:
      1. hex values are right aligned in explicit length fields.
      2. Spaces are ignored in data
    • gen_dcx_bits

      private void gen_dcx_bits()
      gen X bit field
    • gen_dcx_bytes

      private void gen_dcx_bytes()
      gen X byte field
    • get_dc_mod_int

      private int get_dc_mod_int()
      return integer expression in (...) or decimal number for modifier
      Returns:
      number value
    • get_dc_int

      private int get_dc_int(int index)
      return next number from dc_field at index else return 1 and update dc_index
      Parameters:
      index - index value
      Returns:
      number value
    • process_cnop

      private void process_cnop()
      generate one or more 0700 instr. to align to specified boundary
    • process_end

      private void process_end()
      perform END processing at END statement or end of MLC source at end of each pass
    • process_equ

      public void process_equ()
      define or update symbol definition:
      1. Set sym_loc to first pos value
      2. Set sym_len to optional 2nd pos value else set sym_len to 1.
      3. Set sym_attr to optional 3rd pos value.
      4. Set sym_attrp 4th program type
      5. Set sym_attra 5th assembler type
    • process_org

      private void process_org()
      reset current location in same csect
    • process_start

      private void process_start()
      set current location first csect
    • process_push

      private void process_push()
      push print or using level if any
    • process_pop

      private void process_pop()
      pop print or using level if any
    • process_print

      private void process_print()
      process print options (unsupported options ignored)
    • init_get_next_parm

      private void init_get_next_parm(String parms)
      use tz390.parm_match to find and return next parm separated by commas else return null.
      Parameters:
      parms - parameter string
    • get_next_parm

      private String get_next_parm()
      use tz390.parm_match to find and return next parm in upper case else return null.
      Returns:
      single parameter in uppercase
    • duplicate_symbol_error

      private void duplicate_symbol_error()
      issue error for duplicate symbol definition
    • calc_lit_or_exp

      private void calc_lit_or_exp()
      calc rel exp for lit or explicit offset for following offset(index,base)
    • calc_lit

      private boolean calc_lit()
      1. Find or add literal and set exp_type, exp_val, and exp_esd.
      2. If literal followed by '-' or '+' calculate expression add to lit address and return abs val else error.
      Returns:
      ???
    • get_default_bddd

      private String get_default_bddd()
      return bddd or bdddhh
      Returns:
      base-displacement type as "bddd" or "bdddhh"
    • get_lit_addr

      private void get_lit_addr()
      find or add literal and set:
      1. cur_lit = lit table index
      2. exp_val = lit address
      3. exp_esd = lit esd
    • gen_ltorg

      private void gen_ltorg()
      generate ltorg at current location in csect
    • gen_lit_size

      private void gen_lit_size(int size)
      generate literal dc's of specified size
      force all length 1 lits to even addr for access by relative halfword offsets in LARL etc. per issue #327
      see regression test rt\test\TESTLITS.MLC which fails on previous releases
      Parameters:
      size - size of DC to generate
    • add_lit_xref

      private void add_lit_xref(int index)
      add literal xref
      Parameters:
      index - target index
    • add_esd

      private int add_esd(int sid, byte sect_type)
      add new esd chained to sid and return index else abort
      Parameters:
      sid - section id
      sect_type - type of section
      Returns:
      index value
    • add_sym

      public int add_sym(String name)
      add symbol table entry name and return index for use in setting remaining fields
      Note: If lookahead mode, set sym_def = -1
      Parameters:
      name - name of synbol to add
      Returns:
      index of new entry
    • add_sym_xref

      private void add_sym_xref(int index)
      add symbol xref
      Parameters:
      index - index value
    • gen_ccw0

      private void gen_ccw0()
      generate 8 byte aligned CCW0: op8,addr24,flags8,zero8,len16
    • gen_ccw1

      private void gen_ccw1()
      generate 8 byte aligned CCW1: op8,flags8,len16,addr32
    • fp_get_hex

      private void fp_get_hex()
      set dc_hex for floating point string fp_text in scientific notation 0.314159E1 etc.
      format is based on fp type 0-8 (db,dd,dh,eb,ed,eh,lb,ld,lh)
      Notes:
      1. This is very tricky code!
      2. Use BigDecimal for all types to insure DH and EH exponents beyond range of DB and EB will be correctly handled without error.
      3. The fp_context is set to significant decimal digits plus fp_guard_digts to insure sufficient significant bits for proper rounding occurs.
      4. The preferred DFP exponent (BigDecimal scale factor) is set based on explicit decimal poiint with significant trailing decimal places including zeros else use 0.
      First convert string constant to positive big_dec1 value with sufficent sig. bits.
      Exit with artbitrary format if zero.
    • cvt_fp_exp_to_base_2

      private void cvt_fp_exp_to_base_2()
      calc tz390.fp_exp and big_dec2 such that: big_dec1 = big_dec2 * 2 ** tz390.fp_exp
      tz390.fp_exp = log(big_dec1) / log(2)
      Since the exponent range of LB exceeds native double, the log of big_dec1 is calculated using equivalent: log(X*10**N) = log(X) + N*log(10)
      The exponent must then be offset by the number of bits in the required binary mantissa in order to retain significant bits when big_dec2 is converted to big_int format. The exponent is also reduced by 1 for assumed bit in binary formats plus 1 additional to insure rounding for irrational values is done by shifting right.
    • fp_cvt_bd_to_hex

      private void fp_cvt_bd_to_hex()
      1. BFP - Adjust mantiss and base 2 exponent to align for assumed 1 bit.
      2. HFP - Adjust mantissa and base 2 exponent to base 16 exponent.
      3. DFP - Set base 10 exponent based on explicit decimal point and trailing significant digits including zeros else use preferred exponent of 0.
    • set_dfp_preferred_exp

      private void set_dfp_preferred_exp()
      set DFP preferred base 10 exponent for fp_big_dec1 value if explicit decimal found in fp_text.
    • add_missing_copy

      public boolean add_missing_copy(String name)
      add missing copy file for ERRSUM
      Parameters:
      name - name of missing COPY file
      Returns:
      true if successful, false otherwise
    • add_missing_macro

      private boolean add_missing_macro(String name)
      add missing macro file for ERRSUM
      Parameters:
      name - name of missing macro
      Returns:
      true if successful, false otherwise
    • report_critical_errors

      public void report_critical_errors()
      report critical errors on ERR file and console for ERRSUM option
    • put_errsum

      private void put_errsum(String msg)
      put ERRSUM msgs on ERR file and console
      Parameters:
      msg - message text
    • get_int_pfx

      public int get_int_pfx(byte type, byte type_sfx, int len, int scale)
      return I' integer pfx value for symbol based on length and scale per ref.
      Parameters:
      type - field type (DC type character)
      type_sfx - field subtype (DC based)
      len - length in bytes
      scale - scaling factor
      Returns:
      Integer result value