home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_02_02
/
2n02035a
< prev
next >
Wrap
Text File
|
1990-06-25
|
1KB
|
39 lines
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