home *** CD-ROM | disk | FTP | other *** search
- ; The doctored ASM file. I am not going to go into a lengthy discussion
- ; here about what I did, but just comparing this file to MY.ASM should give
- ; you a good idea. In the future I may cover this topic in more detail.
- ; This file was prepared by Richard S. Sadowsky on 6/18/88, and released to
- ; the public domain.
-
- DATA SEGMENT WORD PUBLIC
- DATA ENDS
-
- CODE SEGMENT BYTE PUBLIC
- ASSUME CS:CODE,DS:DATA
-
- PUBLIC StrUpr
- ;** void pascal far strupr(char *s)
-
- STRUPR proc far
- push si
- push di
- push bp
- mov bp,sp
- dec sp
- dec sp
-
- ;** len = s[0];
- les bx,dword ptr [bp+10]
- mov al,byte ptr es:[bx]
- cbw
- mov di,ax
- ;** for (counter = 1; counter <= len; counter++) { /*skips length byte */
-
- mov si,1
- jmp short @5
- @4:
- ;** character = s[counter]; /* put a char in a register var */
-
- les bx,dword ptr [bp+10]
- mov al,byte ptr es:[bx+si]
- mov byte ptr [bp-1],al
- ;** s[counter] = UpperCase(character); /* upper case each char in string */
- cmp byte ptr [bp-1],97
- jb @7
- cmp byte ptr [bp-1],122
- ja @7
- mov al,byte ptr [bp-1]
- add al,-32
- jmp short @6
- @7:
- mov al,byte ptr [bp-1]
- @6:
- les bx,dword ptr [bp+10]
- mov byte ptr es:[bx+si],al
- ; Line 38
- inc si
- @5:
- cmp si,di
- jle @4
- ; Line 39
- mov sp,bp
- pop bp
- pop di
- pop si
- ret 4
- STRUPR endp
-
-
- CODE ENDS
-
- END