HEX a Binary to HEX converter



    Hex is a very simple binary to hex converter.
 It outputs a text file which can be used for inline
 hex assembly. The output is in the style of Sphinx C--:

 $ DB 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00

     To use Hex you need a pure binary file. With Nasm
 you just compile it with no headers or offset. I have
 included an a20 test routine as an example. The .asm
 file is in Nasm format without headers or offset. The
 .bin file is the compiled version. The .hex file is
 the output from Hex.

    To use the .hex file in Sphinx C-- is easy. Just make
 a subroutine and copy the .hex file into it and call the
 subroutine.

 void a20_test()
 {
 /*
        A routine to test the a20 line.
        Returns AL=0 for on or AL=1 for off
 */
 // HEX Binary to HEX converter
 // by  Scott Billingsley
 // Input file :a20test.bin  Output file :a20test.hex

 $ DB 0X31,0XC0,0X8E,0XE0,0X48,0X8E,0XE8,0X64
 $ DB 0XA0,0X00,0X00,0X88,0XC4,0XF6,0XD0,0X65
 $ DB 0X86,0X06,0X10,0X00,0X64,0X3A,0X26,0X00
 $ DB 0X00,0X65,0XA2,0X10,0X00,0X74,0X05,0XB0
 $ DB 0X01,0XE9,0X02,0X00,0XB0,0X00
 }

    Now a call to a20_test() will run the code and return
 AL.
    This should allow for the short comings of Sphinx C--.
 This code ,for example, uses calls that Sphinx C-- doesn't
 support but Nasm does.

    You can  download  a copy here.. HEX.ZIP
    If you have a comment or question, please feel free
    to send me an  Email .