home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / CDEMO.ZIP / MY_P.ASM next >
Encoding:
Assembly Source File  |  1988-06-18  |  1.7 KB  |  69 lines

  1. ; The doctored ASM file.  I am not going to go into a lengthy discussion
  2. ; here about what I did, but just comparing this file to MY.ASM should give
  3. ; you a good idea.  In the future I may cover this topic in more detail.
  4. ; This file was prepared by Richard S. Sadowsky on 6/18/88, and released to
  5. ; the public domain.
  6.  
  7. DATA      SEGMENT WORD PUBLIC
  8. DATA      ENDS
  9.  
  10. CODE      SEGMENT BYTE PUBLIC
  11.           ASSUME CS:CODE,DS:DATA
  12.  
  13.           PUBLIC StrUpr
  14. ;** void pascal far strupr(char *s)
  15.  
  16. STRUPR  proc    far
  17.         push    si
  18.         push    di
  19.         push    bp
  20.         mov     bp,sp
  21.         dec     sp
  22.         dec     sp
  23.  
  24. ;**  len = s[0];
  25.         les     bx,dword ptr [bp+10]
  26.         mov     al,byte ptr es:[bx]
  27.         cbw
  28.         mov     di,ax
  29. ;** for (counter = 1; counter <= len; counter++) { /*skips length byte */
  30.  
  31.         mov     si,1
  32.         jmp     short @5
  33. @4:
  34. ;**   character = s[counter];            /* put a char in a register var */
  35.  
  36.         les     bx,dword ptr [bp+10]
  37.         mov     al,byte ptr es:[bx+si]
  38.         mov     byte ptr [bp-1],al
  39. ;**   s[counter] = UpperCase(character); /* upper case each char in string */
  40.         cmp     byte ptr [bp-1],97
  41.         jb      @7
  42.         cmp     byte ptr [bp-1],122
  43.         ja      @7
  44.         mov     al,byte ptr [bp-1]
  45.         add     al,-32
  46.         jmp     short @6
  47. @7:
  48.         mov     al,byte ptr [bp-1]
  49. @6:
  50.         les     bx,dword ptr [bp+10]
  51.         mov     byte ptr es:[bx+si],al
  52. ; Line 38
  53.         inc     si
  54. @5:
  55.         cmp     si,di
  56.         jle     @4
  57. ; Line 39
  58.         mov     sp,bp
  59.         pop     bp
  60.         pop     di
  61.         pop     si
  62.         ret     4
  63. STRUPR  endp
  64.  
  65.  
  66. CODE   ENDS
  67.  
  68.        END
  69.