home *** CD-ROM | disk | FTP | other *** search
-
- COMMENT @
-
- fibonacci table:
-
- demonstrates using REPT block to initialize data
-
- unfortunately Masm 5.0 constants are limited to 16 bits
- so the table is shorter than I'd like
-
- C Program considers table an unsigned int array
-
- extern unsigned fib_table[24]
-
- Version 1.0 Small Memory Model
-
- To assemble with Masm V. 5.0 -- masm /b60 /Ml fibtable;
- June 26, 1990
- Michael Kelly -- Author
- May be used freely if authorship is acknowledged
-
- @
-
- _DATA SEGMENT WORD PUBLIC 'DATA'
- PUBLIC _fib_table ;make accessible to C program
- prev_fib = 0
- this_fib = 1
- fib = 1
- _fib_table LABEL WORD
- REPT 24
- DW fib
- fib = this_fib + prev_fib ;calc fib to 16 bit limit
- prev_fib = this_fib
- this_fib = fib
- ENDM
- _DATA ENDS
-
- END
-