GN_Phn, Convert 32 bits integer to hexadecimal ascii string

Register parameters

RST 20H, DEFW $8609
IN:
      HL = 2, convert DEBC to stream IX
      HL > 255, pointer to 32 bits integer to convert

      DE = 0, write string to stream IX
      DE = 1, write string to filter IX
      DE > 255, string is written at (DE)

      A = formatting specifier
              A0 = 1, disable leading zero
              A1 = 1, output leading '$'
              A2 = 1, output trailing 'h'
              A3 = 1, lower case (a-f)
              A7-A6, output range
                     @00, 32 bits (DEBC if HL = 2)
                     @11, 24 bits ( EBC if HL = 2)
                     @10, 16 bits (  BC if HL = 2)
                     @01,  8 bits (   C if HL = 2)

      IX = optional output handle (if DE = 0,1 or HL = 2)

OUT, if call successful:
      Fc = 0, DE points to character after result (if DE(in) > 255)

OUT, if call failed:
      Fc = 1, A = RC_Fail (bad source address)
              A = RC_Hnd (bad handle for stream IX or filter IX)

Registers changed after return:
      A.BC..HL/IXIY same
      .F..DE../.... different


Notes

  • PHN stands for Put Hex Number
  • API call implemented in OZ 5.0

Related calls

GN_D16, 16bit unsigned division 
GN_M16, 16bit unsigned multiplication 
GN_D24, 24bit unsigned division 
GN_M24, 24bit unsigned multiplication 
GN_Gdn, convert an ASCII string to a binary number
GN_Ghn, convert an hexadecimal string to a 32 bits integrer
GN_Pdn, write number as decimal ASCII string

web analytics