INCLUDE Irvine32.inc.data CR EQU 0Dh ; ASCII Carriage Return Character LF EQU 0Ah ; ASCII Line Feed Character EOS EQU 0h ; Zero-terminated all BYTE CR, LF, EOS ; parameters to be passed. sFore DWORD white ; SetColor sFore (parameter) sBack DWORD blue ; SetColor sBack (parameter) wChar DWORD " " ; WriteColorChar wChar (parameter) L1temp DWORD ? ; temp loop counter for L1 L2temp DWORD ? ; temp loop counter for L2 L3temp DWORD 1 ; temp loop counter for L3.codemain PROC mov eax, sFore ; move sFore into eax reg. for color manipulation mov ebx, sBack ; move sBack into ebx reg. for color manipulation mov ecx, wChar ; move wChar into ecx reg. for WriteChar call push eax ; push sFore onto the stack push ebx ; push sBack onto the stack push ecx call WriteColorChar mov edx, OFFSET all ; print a blank line call WriteString ; call WriteString exitmain ENDP;----------------------------------------------------------------------------------------------------SetColor PROC; This procedure calls the SetTextColor procedure ; from the Irvine32 Library to set the color of the text push ebp ; Save calling procedure base pointer mov ebp, esp ; Set base pointer for this procedure mov ecx, [ebp + 16] ; Retrieve colors mov eax, [ebp + 12] ; from the stack mov ebx, 16 ; foreColor + (backColor * 16 ) mul ebx ; add ecx, eax ; mov eax, ecx ; move ecx reg. into eax re. call SetTextColor ; call SetTextColor to set the fore and back colors mov eax, [ ebp + 8 ] ; retreive the char from the stack pop ebp ; Restore base pointer for calling procedure retSetColor ENDP;----------------------------------------------------------------------------------------------------WriteColorChar PROC; This program calls the SetColor Procedure to set the color of the vertical bars; that are to be printed in the testing code..data .code pop ebp ; pop the ebp from the stack pop ecx ; pop the ecx reg. from the stack pop ebx ; pop the ebx reg. from the stack pop eax ; pop the eax reg. from the stack push eax ; push sFore onto the stack push ebx ; push sBack onto the stack push ecx ; push wChar onto the stack call SetColor ; call SetColor call WriteChar ; call WriteChar retWriteColorChar ENDP END main
The Problem that I am running into is that when calling the WriteColorChar Procedure, the program wont return into the main procedure.
I know that the SetColor procedure works and that it gets back into the WriteColorChar proc, however, cannot return to the main from there.
I was just wondering if anyone knew what I am doing wrong. I understand that it is probably just a stack variable I'm messing up by not popping it off or popping it off when not suppose.
If anyone has any idea it would be greatly appreciated....thanks!