delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/08/17:33:30

From: phreadd AT powerup DOT com DOT au (David)
Newsgroups: comp.os.msdos.djgpp
Subject: asm conversion
Date: 5 May 1997 14:28:33 GMT
Organization: Power Up
Lines: 39
Message-ID: <5kkqqh$859$1@grissom.powerup.com.au>
NNTP-Posting-Host: ts0109.powerup.com.au
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I've tried reading the faq and "brennans guide to inline assembly" but I 
still can't convert the following code. Maybe it's because I can't really 
program in assembly anyway :)

It's borland inline asm, and it reads a keypress for me. It'll go in a 
wrapper and act as my keyboard handler (I already wrote a mouse one). OK, 
here goes:

#define KEY_BUFFER a_value
#define KEY_CONTROL another_value
#define INT_CONTROL yet_another_value

asm{
  sti
  in al,KEY_BUFFER
  xor ah,ah
  mov raw_key,ax
  in al,KEY_CONTROL
  or al,0x82
  out KEY_CONTROL,al
  and al,0x7f
  out KEY_CONTROL,al
  mov al,0x20
  out INT_CONTROL,al
}

I'm writing all my own routines rather than use "allegro", since you learn 
by doing. And I already had the routines for BC ;)

Thanx in advance,

+----------------------------------------+
|   David Orme                     \/\   |
|   phreadd AT powerup DOT com DOT au         /\/   |
|   powerup.com.au/~phreadd              |
+----------------------------------------+
|   "Striving for Excellence"            |
+----------------------------------------+

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019