Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Asm: Общие вопросы > ??!!  Ctrl-PrScr


Автор: Zigmund 3.6.2002, 22:46
Здрасте всем!
Я очень нуждаюсь в Вашей срочной помощи!

Объясните пожалуйста, зачем нужна комбиначия клавиш Crtl-PrScr в ДОСе?
Что за моменты она обрабатывает? Работа с AUX?

Фунцкии чтения драйвера консоли зачемто анализируют нажатие именно этой комбинации, и после ее обнаружения выдают как результат 16 (10h)...
прилагаю фрагмент кода:

;************************************************************************
;* *
;* chrin - input single char from keyboard into al *
;* *
;*  we are going to issue extended keyboard function, if *
;*  supported.  the returning value of the extended keystroke *
;*  of the extended keyboard function uses 0e0h in al *
;*  instead of 00 as in the conventional keyboard function. *
;*  this creates a conflict when the user entered real *
;*  greek alpha charater (= 0e0h) to  distinguish the extended *
;*  keystroke and the greek alpha.  this case will be handled *
;*  in the following manner: *
;* *
;*      ah = 16h *
;*      int 16h *
;*      if al == 0, then extended code (in ah) *
;*      else if al == 0e0h, then *
;*      if ah <> 0, then extended code (in ah) *
;* else greek_alpha character. *
;* *
;* also, for compatibility reason, if an extended code is *
;*  detected, then we are going to change the value in al *
;*  from 0e0h to 00h. *
;* *
;************************************************************************


chrin proc near
assume ds:Bios_Data,es:nothing

mov ah,keyrd_func ; set by msinit. 0 or 10h
xor al,al
xchg al,altah ;get character & zero altah

or al,al
jnz keyret

int 16h ; do rom bios keyrd function

alt10:
or ax,ax ;check for non-key after break
jz chrin

cmp ax,7200h ;check for ctrl-prtsc
jnz alt_ext_chk

mov al,16
jmp short keyret

alt_ext_chk:

;**************************************************************
;  if operation was extended function (i.e. keyrd_func != 0) then
;    if character read was 0e0h then
;      if extended byte was zero (i.e. ah == 0) then
; goto keyret
;      else
; set al to zero
; goto alt_save
;      endif
;    endif
;  endif

cmp byte ptr keyrd_func,0
jz not_ext
cmp al,0e0h
jnz not_ext

or ah,ah
jz keyret
ifdef DBCS
ifdef   KOREA                           ; Keyl  1990/11/5
       cmp     ah, 0f0h                ; If hangeul code range then
       jb      EngCodeRange1           ; do not modify any value.
       cmp     ah, 0f2h
       jbe     not_ext
EngCodeRange1:
endif ; KOREA
endif ; DBCS
xor al,al
jmp short alt_save

not_ext:

or al,al ;special case?
jnz keyret

alt_save:
mov altah,ah ;store special key
keyret:
ret
chrin endp

Автор: dostamax 17.7.2002, 12:02
Vpolne vozmogno no ja ne uveren.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)