assembly1 - Week 4 8088/8086 Microprocessor Programming I...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Week 4 8088/8086 Microprocessor Programming I
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Example. The PC Typewriter Write an 80x86 program to input keystrokes from the PC’s keyboard and display the characters on the system monitor. Pressing any of the function keys F1-F10 should cause the program to end. Algorithm: 1. Get the code for the key pressed 2. If this code is ASCII, display the key pressed on the monitor and continue 3. Quit when a non-ASCII key is pressed INT 16, BIOS service 0 – Read next keyboard character Returns 0 in AL for non-ASCII characters or the character is simply stored in AL To display the character, we use INT 10, BIOS service 0E- write character in teletype mode. AL should hold the character to be displayed. INT 20 for program termination
Background image of page 2
3 Example continued AGAIN: MOV AH,0 INT 16 CMP AL,00 JZ QUIT MOV AH, 0E INT 10 JUMP AGAIN QUIT: INT 20
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Example continued with sign-on messages MOV DX, OFFSET MES MOV AH,09 INT 21 AGAIN: MOV AH,0 INT 16 CMP AL,00 JZ QUIT MOV AH, 0E INT 10 JUMP AGAIN QUIT: INT 20 MES DB ‘type any letter, number or punctuation key’ DB ‘any F1 to F10 to end the program” DB 0d,0a,0a,’$’
Background image of page 4
5 Data Transfer Instructions - MOV None (D) & (S) MOV D, S Move MOV Flags Affected Operation Format Meaning Mnemonic Seg reg Memory Seg reg Reg 16 Mem16 Seg reg Reg16 Seg reg Immediate Memory Immediate Register Register Memory Memory Register Register Register Memory Accumulator Accumulator Memory Source Destination Memory to memory is not allowed
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon