TITLE ASMCAPS .386 .MODEL FLAT ; _ACODE SEGMENT PARA USE32 PUBLIC 'CODE' ASSUME CS:_ACODE PUBLIC _asmcaps_ ; Entry point name _asmcaps_ PROC NEAR ; Start of procedure push ebp ; Save EBP mov ebp,esp ; Will use EBP for args push esi ; Must preserve ESI push edi ; Must preserve EDI ; mov esi,[ebp+8] ; 1st string addr (L1) mov edi,[ebp+12] ; 2nd string addr (L2) mov ecx,[ebp+16] ; 1st string length cmp ecx, 0 ; Length nonpositive? jle Exit ; Yes, so return ; Looper: mov al, [esi] ; Get char from L1 cmp al, 97 ; Below "a"? jl PutIt ; Yes, so no conversion cmp al, 122 ; Above "z"? jg PutIt ; Yes, so no conversion sub al, 32 ; Change LC to UC PutIt: mov [edi], al ; Store inc esi ; Point to next char inc edi ; Point to next target loop Looper ; Loop until done ; Exit: pop edi ; Restore saved EDI pop esi ; Restore saved ESI mov esp,ebp ; Restore stack pointer pop ebp ; Restore base pointer ret ; Return to caller _asmcaps_ ENDP ; End of procedure _ACODE ENDS ; End of segment END