$if 0 Funktion: Info: Gr”áe+Belegung der DOS-Umgebung PSprache: PowerBasic 3.xx PAutor : Gerhard Frey, Oberthal; $endif ' Compilerdirectiven $CPU 8086 '(CPU-Typ: 8086-er $compile exe '(EXE-File erstell $lib all off '(Speicher sparen $error all off '( $string 1 '( ' VAR: Typ "Word" defwrd a - z sub environsize (envMax, envUsed) local envAdr, env 'Environment-L„nge ! mov ah, &H51 ! int &H21 ! mov es, bx ! mov bx, word ptr es:[&H16] ! mov es, bx ! mov ax, word ptr es:[&H2C] ! push ax ! dec ax ! mov es, ax ! mov bx, word ptr es:[&H03] ! mov cl, &H04 ! shl bx, cl ! mov env, bx ! pop ax ! mov envAdr, ax envMax = env 'belegte Bytes def seg = envAdr offs = 0 do ptr = peeki(offs) if ptr = 0 then incr offs: exit do end if incr offs loop envUsed = offs end sub 'Hauptprog cls : x$ = "#####" call environsize ( eMax, eUse ) eFre = eMax - eUse ? "Analyse der DOS-Umgebung: "; ? "(Angaben in Bytes)" ? "-------------------------"; ? "-------------------" ? "Maximale L„nge: ";using x$;eMax ? "Aktuell belegt: ";using x$;eUse ? "Noch frei sind: ";using x$;eFre