Monday, January 19, 2009

My Debugging Exam Answer

I reviewed and researched much for my MS-debug exam this morning, and as I expected, I was overpowered over the exam, since it was basic logic problems only, here are my answer to the first question:(This exam was written)

Type 2 characters and if one of them is Y then print Y or else Print N both followed by a line break
100:mov ah,1; //COMMENT: activate function 1 of int21(Keyboard Scan w/ Echo) 102:int21; //Execute function 1 104:mov dl,al //Move the first one to a temporary register 106:int21;//Execute function 1 again 108:cmp dl,59; //is first equal to "Y"(ascii of Y is 59) ? 10A:je 11A //Jump to line 11A "mov ah,2" 10E:cmp al,59; //is 2nd equal to "Y"? 110:je 11A 112:mov ah,2 //activate function 2 of int21 (Char Output) 114:mov dl,4e //4e = ascii of "N" 116:int21 //print the N 118:jmp 120//Jump to the mov dl,0d for line breaks 11A:mov ah,2 11C:mov dl,59 11E:int21 //Print "Y" 120:mov dl,0d 122:int21 124:mov dl,0a 126:int21 //0d and 0a = line break 128:int20 //Terminate
This is the logic of my program but I am not sure if my messy writing would let my prof to read it well XD

Labels: ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home