Message board for the users of flat assembler.
> Examples and Tutorials > [FASM G][Project Euler] Super Pandigital Numbers
Please, read the problem at Project Euler to understand the goal.
Super Pandigital Numbers
The only real optimization is to realize all 12-digit numbers cannot be tested for super pandigital quality. Therefore, only 12-pandigital numbers are presented for further testing. I was concerned that 12 digits would not be enough, but I moved forward anyhow - to prove myself over cautious.
Note the use of bit arrays within a register to ease multiple exit conditions. Also, array testing has known bound limits or blocking data in place. This prevents the need for some bounds checking (branching). Permutation algorithm is address based and easily adapted to other type arrays.
I build the 64-bit console PE manually because I can (Yes, 64-bit Windows doesn't use much of the headers). Main code can easily be moved to standard FASM template, etc. I'll post more solved problems in time...
;@REM use windows CMD processor to build ; ;@SET INCLUDE=..\..\fasmg\examples\x86\include ;@..\..\fasmg\fasmg.exe %~nx0 %~n0.exe ;@GOTO EOF macro align? boundary rb boundary-1 -