Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .EQU INPUT_DIV_PORT = 0x99
  2. .EQU OUTPUT_DIV_PORT = 0x33
  3. .EQU INPUT_RC_PORT = 0xA7
  4. .EQU OUTPUT_RC_PORT = 0xB8
  5. .CSEG
  6. .ORG 0x10
  7.  
  8. main:
  9.       IN r9,INPUT_DIV_PORT
  10.       IN r10,INPUT_RC_PORT
  11.  
  12.       LSR r9                   ;LSR(logical right shift) twice to divide by four
  13.       CLC                      ;Clear carry flags after each shift
  14.       LSR r9
  15.       CLC
  16.       OUT r9, OUTPUT_DIV_PORT
  17.  
  18.       EXOR r10,0xFF            ;XOR eight bits and adds one to get opposite sign
  19.       ADD r10, 0x01
  20.       OUT r10, OUTPUT_RC_PORT
  21.  
  22.       BRN main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement