DIM Dhex as string*8 a???=&hffffffff DoubleHex a???,Dhex print Dhex end sub DoubleHex(a???,Dhex as string*8) ! push di ! push ds ! push si ! les di,a??? ;es:di points to a??? ! lds si,Dhex ;ds:si points to DHex start ! mov ax,si ! add ax,7 ! mov si,ax ;ds:si points to DHex end ! mov ax,es:[di] ;get the least sig word ! mov cx,4 ;shift constant ! mov bx,&h204 ;words/nibbles to process *MOD bh AS REQD.* shloop1: ! push ax ! and ax,&H0F ;get next nibble ! add al,&h90 ! daa ! adc al,&h40 ! daa ;AL now contains ASCII value for the nibble ! mov ds:[si],AL ;store it ! dec si ! pop ax ! shr ax,CL ;adjust data ! dec bl ! jnz shloop1 ;repeat for all nibbles in the word ! or bl,4 ;reset nibble counter ! inc di ! inc di ! mov ax,es:[di] ;get next most sig word ! dec bh ;see if all words done yet ! jnz shloop1 ;loop if not ! pop si ! pop ds ! pop di end sub