Minor modifications to prog2

This commit is contained in:
Jonathan Chan 2018-01-16 15:54:27 -08:00
parent 48cb4f349c
commit 8c969ec493
2 changed files with 6 additions and 7 deletions

View File

@ -5,16 +5,15 @@ RESET:
mov.w #0x400, SP
mov.w #WDTPW|WDTHOLD, &WDTCTL
mov.b #11110111b, &P1DIR ; all pins outputs except P1.3
mov.b #01001001b, &P1OUT ; LED1, LED2 on, P1.3 HI (?)
mov.b #00001000b, &P1REN ; enable resistor for P1.3
mov.b #00001000b, &P1IE ; P1.3 set as an interrupt
mov.w #0x0049, R7 ; R7 = 0000 0000 0100 1001
mov.b R7, &P1OUT ; LED1, LED2 on, P1.3 HI (?)
mov.b R7, &P1OUT ; LED1, LED2 on
mov.b #0x0041, R8 ; value to xor with R7
EINT ; enable interrupts
bis.w #CPUOFF, SR
PUSH:
xor.w R8, R7
xor.w R8, R7 ; next LED state
xor.w #0x0040, R8 ; 0x0041 -> 0x0001 -> 0x0041
mov.b R7, &P1OUT ; set LEDs to new state
bic.b #00001000b, &P1IFG ; interrupt flag P1.3 set to 0

View File

@ -1,7 +1,7 @@
:10C0000031400004B240805A2001F240F700220083
:10C01000F24049002100F2422700F2422500374059
:10C020004900C24721007840410032D232D010008E
:10C0300007E838E04000C2472100F2C223000013A5
:02FFE40030C02B
:10C01000F2422700F242250037404900C247210082
:10C020007840410032D232D0100007E838E04000BA
:0AC03000C2472100F2C223000013F2
:02FFE4002AC031
:02FFFE0000C041
:00000001FF