mersenneforum.org Alt codes : should shift = +32 in them ?
 Register FAQ Search Today's Posts Mark Forums Read

 2011-06-21, 20:58 #1 science_man_88     "Forget I exist" Jul 2009 Dumbassville 26·131 Posts Alt codes : should shift = +32 in them ? some times this happens but 2 and @ aren't 32 apart, so it's harder to remember because you might have to have multiple increments other than +32 for a shift press equivalent. I'm guessing this would take a reprogramming of hardware too much ?
2011-06-21, 21:02   #2
science_man_88

"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts

Quote:
 Originally Posted by science_man_88 some times this happens but 2 and @ aren't 32 apart, so it's harder to remember because you might have to have multiple increments other than +32 for a shift press equivalent. I'm guessing this would take a reprogramming of hardware too much ?
I actually think I see why they all can't be +x because they'd overlap 33+32=65 65+32=97 so all these would have to be on the same key, for it to work out.

 2011-06-22, 03:16 #3 Christenson     Dec 2010 Monticello 5·359 Posts SM88, you wondered why people think you are confused. This thread is a classic for convincing people of that; what the heck are you talking about? Hint1: What are you trying to do with this function? Hint2: If main memory costs $100 per Gigabyte, why wouldn't I simply do this with a table? It's faster, and doesn't depend on the ASCII coding scheme, or even the latin alphabet or one of its variations. 2011-06-22, 12:37 #4 science_man_88 "Forget I exist" Jul 2009 Dumbassville 26×131 Posts Quote:  Originally Posted by Christenson SM88, you wondered why people think you are confused. This thread is a classic for convincing people of that; what the heck are you talking about? Hint1: What are you trying to do with this function? Hint2: If main memory costs$100 per Gigabyte, why wouldn't I simply do this with a table? It's faster, and doesn't depend on the ASCII coding scheme, or even the latin alphabet or one of its variations.
I couldn't program that, second the only reason it got into programming is because it was moved, I was asking why it seemed that shift never increased the value by a constant amount because some of the characters on a qwerty keyboard that would normally be accessed with shift were right next to each other in the Alt codes it makes it complicated to remember them all but I've realised why because any constant value shift would eventually over lap except maybe 128 since 255 symbols don't allow for the overlap.to occur.

 2011-06-22, 17:52 #5 Christenson     Dec 2010 Monticello 179510 Posts Cribbing, I think, from Tannenbaum somewhere, maybe "Modern Operating Systems" A modern PC keyboard sends a series of codes over a serial line to the PC. These codes indicate that a key has either just been depressed or released. A function in the OS, possibly in the BIOS, translates those events (keys becoming depressed or released) into the ASCII (or unicode, or other) encoding that is seen by programs reading from the keyboard, including handling ctrl, alt, shift, caps lock, num lock, and scroll lock states, as well as signalling lone "Alt" key depression as used for Windows menu access. Most of us don't remember which code is which; we look these things up when we need them; if we are writing in the C programming language, we just put the appropriate character between quotes -- for example, if ( (c >= 'a') && (c <= 'z')) c=c-('a'-'A');, assuming your character set is ASCII.
2011-06-22, 18:12   #6
science_man_88

"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts

Quote:
 Originally Posted by Christenson Cribbing, I think, from Tannenbaum somewhere, maybe "Modern Operating Systems" A modern PC keyboard sends a series of codes over a serial line to the PC. These codes indicate that a key has either just been depressed or released. A function in the OS, possibly in the BIOS, translates those events (keys becoming depressed or released) into the ASCII (or unicode, or other) encoding that is seen by programs reading from the keyboard, including handling ctrl, alt, shift, caps lock, num lock, and scroll lock states, as well as signalling lone "Alt" key depression as used for Windows menu access. Most of us don't remember which code is which; we look these things up when we need them; if we are writing in the C programming language, we just put the appropriate character between quotes -- for example, if ( (c >= 'a') && (c <= 'z')) c=c-('a'-'A');, assuming your character set is ASCII.
I was just thinking that a simple shift algorithm ( which actually made it more complicated) could make it simple.

 2011-06-23, 15:31 #7 JohnFullspeed   May 2011 France 7·23 Posts Shl >32 You are rigtht when you speak of a problem. It's a bugs in all the CISC processors (Inte, AMD and other The news Macs have it also. To understand you mist know that a microprocessor is n fact a set og chips we have the FPU,UL,Shifter.... They are not Intel or Amd production In fact for the shift,Tol... every one use the same chip It's why all processors are bugged(????) you also have to know that when you write shl 24 the shifter makse 24 shift of one bit and not a shift of 24. So it has a counter The problem is here : the shifter is modulo 32 It's easy to see a:= 0; for i:=1 to 6 do a:= 1 shl I and look at I and A 1,2,3,4,5,6,7,8,9, 1,2,4,8,16,32,64,128,256 .... Then I= 33,34,35,36,67... A= 1,2,3,4,5 A is modulo 32 The real bug is that Intel,AMD,Borland,Microsoft know this bug and no body want to resolve it. I well know the Delhhi Compiler : the code generated is patched I repete: all the computer in the word is bugged It's one of the reason I change my computer for a RISC one I do enough bug myself do not need of Intel I hope you understand my explications John
 2011-06-23, 17:38 #8 Christenson     Dec 2010 Monticello 5×359 Posts John: Time to write us if French, first, then translate....SM88 and I were talking about what to do when the SHIFT key is pressed on the keyboard; you are thinking about shifting around large numbers of bits...and I would expect only very heavy optimizers as P95 or Jason to know about this. Everyone else would start moving bytes around instead of shifting more than 32 bits, or, even better, moving pointers to the start of data around, and shifting just a few bits, which is even easier.
 2011-06-23, 19:35 #9 JohnFullspeed   May 2011 France 7·23 Posts Shift It seems that is not to me to learn English I answer to http://www.mersenneforum.org/images/icons/icon1.gif I was just thinking that a simple shift algorithm ( which actually made it more complicated) could make it simple. Originally Posted by science_man_88 http://www.mersenneforum.org/images/...s/viewpost.gif some times this happens but 2 and @ aren't 32 apart, so it's harder to remember because you might have to have multiple increments other than +32 for a shift press equivalent. I'm guessing this would take a reprogramming of hardware too much ? If you understand a keyboard problem please explain me where You can joint Embarcadero ( new Delphi) and ask the question about the modulo they know the number of the chip While you return to the school learn also informatique Shift is not SHL (how do you say homonime) Let Jason or P92 speaking (I have the code of Jason) If I have remarks for optimization I have the mail and they have mine Be a man Give me YOUR code with all optimization you wouldI give you an friendly lesson . It's easy to speak for you me I need code
 2011-06-24, 00:53 #10 Christenson     Dec 2010 Monticello 34038 Posts John, I think SM88's problem can be stated as follows: Given a sequence of keystrokes (say, created by numbering all the keys on the keyboard, and using the various shift-type keys (shift, ctrl, alt) as modifiers setting attribute bits, what is the simplest function to determine the ASCII code? He was thinking that he could just add 32 for a shift key, but then he looked at the relationship between the numeric keys and the usual symbols atop them, such as !@#$%^&*(). Code? a table lookup, or, if you want a real example, you might want to look at minix or some other unix keyboard driver. 2011-06-24, 01:44 #11 science_man_88 "Forget I exist" Jul 2009 Dumbassville 26·131 Posts Quote:  Originally Posted by Christenson John, I think SM88's problem can be stated as follows: Given a sequence of keystrokes (say, created by numbering all the keys on the keyboard, and using the various shift-type keys (shift, ctrl, alt) as modifiers setting attribute bits, what is the simplest function to determine the ASCII code? He was thinking that he could just add 32 for a shift key, but then he looked at the relationship between the numeric keys and the usual symbols atop them, such as !@#$%^&*(). Code? a table lookup, or, if you want a real example, you might want to look at minix or some other unix keyboard driver.
one thing I've found for a qwerty keyboard layout is that all the character pairs but one (: and ;) as far as I can see ( just realized it looks like I forgot a pair to look up) for printable characters according to the table I have up have a difference that is 0 mod 2 (they have the same parity). this helps a bit especially since most of the alphabet and numbers seem to relate to the pairs by a power of 2 but some don't.

Last fiddled with by science_man_88 on 2011-06-24 at 01:44

 Similar Threads Thread Thread Starter Forum Replies Last Post Antonio Information & Answers 6 2011-09-27 13:20 davar55 Puzzles 3 2009-07-02 19:27 Erasmus Factoring 3 2004-05-21 13:55 dave_0273 Data 1 2004-05-02 15:08 GP2 Data 14 2003-12-28 22:02

All times are UTC. The time now is 03:39.

Thu Mar 4 03:39:24 UTC 2021 up 90 days, 23:50, 1 user, load averages: 0.87, 1.13, 1.38