home *** CD-ROM | disk | FTP | other *** search
- ;* ------------------------------------------------------ *;
- ;* TASTE.ASM *;
- ;* Umwandlung von Tastatureingaben nach Errorlevel *;
- ;* (c) 1988 Georg Mutschler & TOOLBOX *;
- ;* -- MASM > 4.0 -- *;
- ;* ------------------------------------------------------ *;
- title Taste.asm
- page 62,132
- ; Taste 0...9 und a..z in 0...35
-
- code segment para 'code'
- assume cs:code, ds:code
- org 100h
-
- start: jmp marke
- text db ' Bitte wählen -----> ',"$"
-
- tabe dw 3000h, 3100h, 3200h, 3300h, 3400h, 3500h, 3600h
- dw 3700h, 3800h, 3900h ; 0...9
- dw 3031h, 3131h, 3231h, 3331h, 3431h, 3531h, 3631h
- dw 3731h, 3831h, 3931h ; a...j
- dw 3032h, 3132h, 3232h, 3332h, 3432h, 3532h, 3632h
- dw 3732h, 3832h, 3932h ; k...t
- dw 3033h, 3133h, 3233h, 3333h, 3433h, 3533h ; u...z
-
- marke: mov dx,offset text
- mov ah,09
- int 21h
- mar: mov ah,0
- int 16h
- cmp al,48 ; ASCII-Code für 0
- jb mar ; kleiner ?, zurück
- cmp al,122 ; ASCII-Code für z
- jg mar ; größer ?, zurück
- cmp al,57 ; ASCII 9, subtrahiere 48
- jbe mar2 ; = mar2
- cmp al,96 ; ASCII a
- jae mar1 ; subtrahiere die Differenz
- ; von 9..a = 39
- jmp mar3 ; ASCII : bis ' = 58..95 sperren
- mar1: sub al,39
- mar2: sub al,48
- mov ah,0
- mov di,ax
- sal di,1
- mov dx,tabe[di] ; Schreibe Zahl in Bildspeicher
- jmp ende
- mar3: jmp mar
- ende: mov ah,4ch ; Programm-Ende
- int 21h
-
- code ends
- end start
-
- ;* ------------------------------------------------------ *;
- ;* Ende von TASTE.ASM *;