Question

char readKey() { char ch do { PORTA = OxOF; //set PA7-PA4 to 0 while (PORTA OXOF) { //keep checking PORTA until a key is pres
translate this pseudocode to assmbler

0 0
Add a comment Improve this question Transcribed image text
Answer #1

char;
readKey();
{char;
ch;
for
(
; // TODO: Warning!!!! NULL EXPRESSION DETECTED...
;
) {
    PORTA
= 0;
    
x0F;
    
(PA7 - PA4);
    
0;
    while
() {
        
0;
        
x0F;
        
key;
        
checking;
        
PORTA;
        
a;
        
(key == pressed);
        
keycode;
        
delayms(10);
        
debounce;
        
from;
        
pressing;
        
key;
        while
(code) {
            PORTA
;
            
check;
            if
(PORTA) {
                changed
;
                
code = readKeyCode();
                
determine;
                
code;
                
of;
                
key;
                
pressed;
                
PORTA = 0;
                
(PA7 - PA4);
                
0;
                while
(PORTA) {
                    
0;
                    
x0F;
                    
wait;
                    for
(release; ; release++) {
                        of
;
                        
key;
                        
delayms(10);
                        
debounce;
                        
from;
                        
release;
                        
of;
                        
key;
                        
ch = translate(code);
                        
translate;
                        
keycode;
                        
ascii;
                        return
ch;
                        
1110;
                        
1111;
                        
1101;
                        
1111;
                        
1011;
                        
1111;
                        
111;
                        
1111;
                    
}
                    
                }
                
            }
            
        }
        
    }
    
}

Carlos Aguilar Mares © 2017

Add a comment
Know the answer?
Add Answer to:
translate this pseudocode to assmbler char readKey() { char ch do { PORTA = OxOF; //set...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT