Jump to content

Hope to get explaination

- - - - -

  • Please log in to reply
3 replies to this topic

#1
NicholasIT

NicholasIT

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
void interrupt our(__CPPARGS){

		 //if(inportb(0x60)==UP){

		 		 //i=0;j

		  switch(inportb(0x60)){
case UP: if(direction==1)break;direction=0;break;
case DOWN: if(direction==0)break;direction=1;break;
case RIGHT: if(direction==3)break;direction=2;break;
case LEFT: if(direction==2)break;direction=3;break;
case 15:blocks++;break;
case ESC: stop=1;break;
}

(*prev)();
}[/CODE]


anyone can explain what this coding doin??? i know if the keyboard hti ,then it will up down left right
void interrupt our(__CPPARGS){

		 //if(inportb(0x60)==UP){

		 		 //i=0;j

		  switch(inportb(0x60)){
this part anyone know what does it mean?

#2
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,717 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
It's using a C interface to assembly language to read from I/O port 0x60, which is mapped to the keyboard controller. These are old nonstandard Borland extensions that aren't really used anymore. In fact, only the 16-bit versions of the compiler supported these. As for what it does, it basically gets the value of the key being pressed and decides what to do based on that.
sudo rm -rf /

#3
NicholasIT

NicholasIT

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
thanks your explaination ,appreacited !

#4
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,717 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
No problem.
sudo rm -rf /




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users