Compile-time calculation: Difference between revisions

m
Line 1,576:
Since 10! is bigger than 16 bits, I'll use 8! instead to demonstrate. Most assemblers only support the standard C operators for compile-time calculation, so we're going to need to multiply out the factorial manually.
<lang z80>ld hl,8*7*6*5*4*3*2 ;8! equals 40,320 or 0x9D80
call Monitor ;unimplemented routine, displays the register contents to screen</lang>
{{out}}
<tt>0x9D80</tt>
 
 
=={{header|zkl}}==
1,489

edits