Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .EQU LED_PORT_1 = 0x033 ; port for output 1
- .EQU SWITCH_PORT_1 = 0x99 ; port for input 1
- .EQU LED_PORT_2 = 0xA7 ; port for output 2
- .EQU SWITCH_PORT_2 = 0x0B8 ; port for input 2
- .CSEG
- .ORG 0x01 ; program starts here
- main: IN R0, SWITCH_PORT_1
- LSR R0 ; shift right twice to divide by four
- LSR R0
- OUT R0, LED_PORT_1
- IN R1, SWITCH_PORT_2
- EXOR R1, 0xFF ; take two's compliment
- ADD R1, 0x01
- OUT R1, LED_PORT_2
- BRN main ; endless loop
Add Comment
Please, Sign In to add comment