* * HEXCHAR2 * Use table lookup to convert a nibble to an ASCII hex * character. The nibble is stored in the byte variable * NIBBLE at location $9000. The result is printed. * Version 2: Position Independent * NIBBLE EQU $9000 HEXCHAR ORG $8000 CLR.W D1 ;Make sure high byte of D1 is zero. MOVE.B NIBBLE,D1 ;Load nibble into low byte of D1 MOVE.B HEXDIG(PC,D0),D1 ;D1 now contains ACSCII char TRAP #1 ;Print result TRAP #14 HEXDIG DC.B '0123456789ABCDEF' END HEXCHAR