* * HEXCHAR * 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. * 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.L #HEXDIG,A0 ;A0 points to hex digits table MOVE.B (A0,D1),D0 ;D0 now contains ACSCII char 0-F TRAP #1 ;Print result TRAP #14 HEXDIG DC.B '0123456789ABCDEF' END HEXCHAR