assembly2 - Week 5 8088/8086 Microprocessor Programming II...

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

View Full Document Right Arrow Icon
Week 5 8088/8086 Microprocessor Programming II
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 Flag Control Instructions LAHF Load AH from flags (AH) (Flags) SAHF Store AH into flags (Flags) (AH) – Flags affected: SF, ZF, AF, PF, CF CLC Clear Carry Flag (CF) 0 STC Set Carry Flag (CF) 1 CLI Clear Interrupt Flag (IF) 0 STI Set interrupt flag (IF) 1 Example (try with debug) LAHF MOV [MEM1], AH MOV ah, [MEM2] SAHF ; MEM1 = 150 (FF) MEM2 = 151 (01) SF ZF AF PF CF
Background image of page 2
3 Jump Instructions Unconditional vs conditional jump Example. JMP [BX] Assume BX = 1000h Ds:1000 = 200h
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 Compare
Background image of page 4
5 Conditional Jump Above and below for comparison of unsigned numbers • Less and greater for comparison of signed numbers
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Subroutines and Subroutine Handling Functions A subroutine is a special segment of a program that can be called for execution from any point in the program A returm instruction must be included at the end of the subroutineto initiate the return sequence to the main program environment Examples. Call 1234h Call BX Call [BX] Two calls intrasegment intersegment
Background image of page 6
7 Example Write an 8086 program that adds two packed BCD numbers input
Background image of page 7

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

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 21

assembly2 - Week 5 8088/8086 Microprocessor Programming II...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online