[list -] %INCLUDE "Along32.inc" %INCLUDE "Macros_Along.inc" [list +] ;--------------------------------------------------------------------- extern ReadFirstTwo ; HLL prototype: void ReadFirstTwo(int *array); ; Accepts two 32-bit signed integers from standard input and uses ; these two values to initialize the first two elements of an array. ; These two values represent the first two terms in a Fibonacci ; sequence. ; Receives: ESI = starting offset of array ; Returns: nothing ;--------------------------------------------------------------------- ;--------------------------------------------------------------------- extern FillArray ; HLL prototype: void FillArray(int *array, int n); ; Given the first two elements of a Fibonacci sequence, fill the ; remaining elements of the array with the next terms in the ; sequence. ; Receives: ESI = starting offset of array ; ECX = # of elements in array ; Returns: nothing ;--------------------------------------------------------------------- ;--------------------------------------------------------------------- extern DisplayArray ; HLL prototype: void DisplayArray(int *array, int n); ; Displays the elements of the n-element array to standard output, ; one element per line. Each element is preceded by a descriptive ; literal. ; Receives: ESI = starting offset of array ; ECX = # of elements in array ; Returns: nothing ;--------------------------------------------------------------------- SECTION .data fib times 47 dd 0 size equ ($ - fib) / 4 SECTION .text global _start _start: mov esi,fib call ReadFirstTwo mov esi,fib mov ebx,4 mov ecx,size call DumpMem mov esi,fib mov ecx,size call FillArray mov esi,fib mov ebx,4 mov ecx,size call DumpMem mov al,10 call WriteChar mov esi,fib mov ecx,size call DisplayArray Exit {0}