t8232.asm
t8232 PROGRAM FORMAT=BIN, LISTMAP=OFF, LISTGLOBALS=OFF ; Define non-recursive macro Factorial which returns ; calclulated value in preprocessing %variable named %Factorial: Factorial %MACRO Number %N %SETA %Number %IF %N <= 1 %Factorial %SETA 1 ; 0! and 1! calculates to 1. %ELSE %Factorial %SETA %N ; Initialize returned value. %WHILE %N > 1 %N %SETA %N - 1 %Factorial %SETA %Factorial * %N %ENDWHILE %ENDIF %ENDMACRO Factorial ;; Use the macro to create table of factorials at assembly time: FactorialTable:: n %FOR 0..15 ; The table will have 16 members. Factorial %n ; Invoke macro to calculate n! DQ %Factorial ; Define 64bit integer value (n!). %ENDFOR n ENDPROGRAM t8232
t8232.asm.lst
t8232.out
I0180 Assembling source file "t8232.asm".
I0270 Assembling source "t8232".
I0310 Assembling source pass 1.
I0330 Assembling source pass 2 - final.
I0470 Assembling program "t8232". "t8232.asm"{1}
I0510 Assembling program pass 1. "t8232.asm"{1}
I0510 Assembling program pass 2. "t8232.asm"{1}
I0530 Assembling program pass 3 - final. "t8232.asm"{1}
I0660 16bit TINY BIN file "t8232.bin" created, size=128. "t8232.asm"{22}
I0650 Program "t8232" assembled in 3 passes with errorlevel 0. "t8232.asm"{22}
I0750 Source "t8232" (22 lines) assembled in 2 passes with errorlevel 0.
I0860 Listing file "t8232.asm.lst" created, size=1263.
I0990 EuroAssembler terminated with errorlevel 0.
t8232. bin
0000: 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ·°°°°°°°·°°°°°°° 0010: 02 00 00 00 00 00 00 00 06 00 00 00 00 00 00 00 ·°°°°°°°·°°°°°°° 0020: 18 00 00 00 00 00 00 00 78 00 00 00 00 00 00 00 ·°°°°°°°x°°°°°°° 0030: D0 02 00 00 00 00 00 00 B0 13 00 00 00 00 00 00 ¤·°°°°°°¤·°°°°°° 0040: 80 9D 00 00 00 00 00 00 80 89 05 00 00 00 00 00 ¤¤°°°°°°¤¤·°°°°° 0050: 00 5F 37 00 00 00 00 00 00 15 61 02 00 00 00 00 °_7°°°°°°·a·°°°° 0060: 00 FC 8C 1C 00 00 00 00 00 CC 28 73 01 00 00 00 °¤¤·°°°°°¤(s·°°° 0070: 00 28 3B 4C 14 00 00 00 00 58 77 77 30 01 00 00 °(;L·°°°°Xww0·°°