[list -] %INCLUDE "Along32.inc" %INCLUDE "Macros_Along.inc" [list +] ;--------------------------------------------------------------------- extern GenerateRandomString ; HLL prototype: void GenerateRandomString(char *string, int n); ; This function generates a string of length n, containing all ; capital letters. The random letters are placed in the string ; beginning at the lowest offset. ; Receives: ESI = starting offset of string ; ECX = length of string ; Returns: nothing ;--------------------------------------------------------------------- SECTION .data string times 50 db '#' size equ ($ - string) lit1 db 'string(',0 lit2 db ') = ',0 count dd 1 SECTION .text global _start _start: mov ecx,size-1 ; loop control myLoop: push ecx ; save ecx mov ecx,[count] mov esi,string call GenerateRandomString add esi,[count] mov byte [esi],0 ; place a null byte at end of string mov edx,lit1 ; print the first literal call WriteString mov eax,[count] ; print count as an unsigned int call WriteDec mov edx,lit2 ; print the second literal call WriteString mov edx,string call WriteString ; print the randomly generated string mov al,10 ; write \n to standard output call WriteChar inc dword [count] pop ecx ; return loop control variable to ecx loop myLoop Exit {0}