[…] One item I can't remember is the clause used to inform the compiler registers […]
I don't understand here.The idea was to take a HEX string of chars and generate a binary of it.
Needed a break from what I was working on. Here is the result:Code: Pascal [Select][+][-]function H2B(const h:string):string;const bins:array[$0..$F] of string =('0000','0001','0010','0011','0100','0101','0110','0111','1000','1001','1010','1011','1100','1101','1110','1111'); type TNibbles=bitpacked record case boolean of False:(c:char); True: (L:$0..$F; H:$0..$F) end; var b:PDWord; n:TNibbles; i:Integer;begin SetLength(Result,Length(h) shl 2); b:=@Result[1]; for i:=1 to Length(h) do begin n.c:=h[i]; case n.H of 3: begin if n.L < 10 then Move(bins[0+n.L][1],b^,4) else exit('Error') end; 4,6:begin if n.L in [1..6] then Move(bins[9+n.L][1],b^,4) else exit('Error') end; else; Exit('Error'); end; inc(b); end;end;