home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / tasm / chapxmpl.arc / IDLBSP.ASM < prev    next >
Encoding:
Assembly Source File  |  1988-10-10  |  1.4 KB  |  70 lines

  1. ; Datei <IdeBeisp.ASM>
  2. ; Beispielprogramm im Ideal-Modus,
  3. ; um eine Zeile in Großbuchstaben umzuwandeln
  4.         IDEAL                                ; #1
  5.         %TITLE    "Beispielprogramm Ideal-Modus"        ; #2
  6.         P286N                                ; #3
  7. PufferGroesse        =    128
  8.  
  9. MACRO    DOS    intnum                            ; #4
  10.         mov    ah,intnum
  11.         int    21h
  12. ENDM
  13.  
  14. SEGMENT    Stk    STACK                            ; #5
  15.         db    100h DUP (?)
  16. ENDS                                            ; #6
  17.  
  18. SEGMENT    Data        WORD                            ; #7
  19. EingabePuffer    DB    PufferGroesse DUP (?)
  20. AusgabePuffer    DB    PufferGroesse DUP (?)
  21. ENDS        Data                                    ; #8
  22.  
  23. GROUP    DGroup        Stk, Data                    ; #9
  24.  
  25. SEGMENT    Code        WORD                            ; #10
  26.         ASSUME    cs:CODE        
  27. Anfang:
  28.         mov    ax,DGROUP
  29.         mov    ds,ax
  30.         ASSUME    ds:DGROUP
  31.         mov    dx,OFFSET EingabePuffer                ; #11
  32.         xor    bx,bx
  33.         call    ZeileLesen
  34.         mov    bx,ax
  35.         mov    [EingabePuffer+bx],0                    ; #12
  36.         push    ax
  37.         call    GrossBuchStabe
  38.         pop    cx
  39.         mov    dx,OFFSET AusgabePuffer                ; #13
  40.         mov    bx,1
  41.         DOS    40h
  42.         DOS    4Ch
  43.  
  44. ; Eine Zeile einlesen, DS zeigt auf Puffer, liefert Anzahl in AX
  45. PROC        ZeileLesen NEAR                            ; #14
  46.         mov    cx,Puffergroesse
  47.         DOS    3Fh
  48.         and    ax,ax
  49.         ret
  50. ENDP                                            ; #15
  51.  
  52. ; Zeile in Großbuchstaben umwandeln
  53. PROC        GrossBuchStabe NEAR                        ; #16
  54.         mov    si,OFFSET EingabePuffer                ; #17
  55.         mov    di,0
  56. @@UmwandelnSchleife:
  57.         cmp    [BYTE si],0                        ; #18
  58.         je    @@Fertig
  59.         mov    al,[si]
  60.         and    al,NOT 'a' - 'A'
  61.         mov    [AusgabePuffer+di],al                    ; #19
  62.         inc    si
  63.         inc    di
  64.         jmp    @@UmwandelnSchleife
  65. @@Fertig:
  66.         ret
  67. ENDP        GrossBuchStabe                            ; #20
  68.         ENDS                                    ; #21
  69.         END    Anfang
  70.