Tutorial 5
Download
1 / 8

Tutorial 5 - PowerPoint PPT Presentation


  • 83 Views
  • Uploaded on

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.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Tutorial 5' - ethel


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Carry flag c
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



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


Branch if carry clear bcc
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


Practical 5
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


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


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


ad