1 / 8

Tutorial 5

Tutorial 5. carry flag C. 1 0 1 1 1 1 1 1. +. 1 0 0 1 1 0 1 0. 1. 1. 1. 1. 1. 1. 0. 1. 0. 1. 1. 0. 0. 1. 1. carry. C. logical shift left, LSL. 0. C. operand. C. D2.B (binary). D2.B (hex). 1010 0110. A6. LSL.B #1,D2. 0100 1100. 4C. 1.

ethel
Download Presentation

Tutorial 5

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tutorial 5

  2. carry flag C 1 0 1 1 1 1 1 1 + 1 0 0 1 1 0 1 0 1 1 1 1 1 1 0 1 0 1 1 0 0 1 1 carry C

  3. logical shift left, LSL 0 C operand

  4. C D2.B (binary) D2.B (hex) 1010 0110 A6 LSL.B #1,D2 0100 1100 4C 1 LSL.B #1,D2 1001 1000 98 0

  5. branch if carry clear, BCC BCC alpha • looks at value of carry flag C • branches to alpha if C is 0 • often used with LSL LSL.B #1,D2 BCC alpha

  6. Practical 5 Write subroutines that use LSL to • display on screen contents of D2.B in binary form • read 8-bit binary value from keyboard into D2.B

  7. org $400 program MOVE.B #$23,D2 BSR binaryout MOVE.B #9,D0 TRAP #15 binaryout subroutine binaryout (use RTS to exit subroutine) end program

  8. org $400 program BSR binaryin BSR binaryout MOVE.B #9,D0 TRAP #15 binaryout subroutine binaryout (use RTS to exit subroutine) binaryin subroutine binaryin (use RTS to exit subroutine) end program

More Related