1
0
UAHCode/CPE325/Lab11/ReverseMe_Modified.txt

125 lines
16 KiB
Plaintext
Raw Normal View History

2022-08-28 21:12:16 +00:00
<EFBFBD><EFBFBD>
naken_util - by Michael Kohn
Joe Davisson
Web: http://www.mikekohn.net/
Email: mike@mikekohn.net
Version:
Loaded ti_txt RetrievedHEX_Stripped.txt from 0x3100 to 0x31d3
Type help for a list of commands.
Addr Opcode Instruction
------- ------ ----------------------------------
0x3100: 0x40b2 mov.w #0x5a80, &0x0120 ; Stop WatchDog Timer
0x3102: 0x5a80
0x3104: 0x0120
0x3106: 0xd2e2 bis.b #4, &0x002a ; port 2 bit3 direction for output
0x3108: 0x002a
0x310a: 0xc3e2 bis.b #2, &0x002a ; port 2 bit1 direction for output
0x310c: 0x002a
0x310e: 0xc2e2 bic.b #4, &0x0029 ; P2OUT bit3 is cleared
0x3110: 0x0029
0x3112: 0xd3e2 bic.b #2, &0x0029 ; P2OUT BIT1 is cleared
0x3114: 0x0029
0x3116: 0xc3d2 bic.b #1, &0x0022 ; P1DIR bit0 is cleared (set to input)
0x3118: 0x0022
0x311a: 0xc3e2 bic.b #2, &0x0022 ; P1DIR BIT1 is cleared (set to input)
0x311c: 0x0022
0x311e: 0xb3e2 bit.b #2, &0x0020 ; P1IN BIT1 test to be high
0x3120: 0x0020
0x3122: 0x23fd jne 0x311e (offset: -6) ; Bit test with bit1 - if zero is reset, test again;
; loops until switch is pressed
0x3124: 0x120d push.w r13 ; pushing register13 onto stack
0x3126: 0x403d mov.w #0x031d, r13 ; move whatever is at 0x031d to r13
0x3128: 0x031d
0x312a: 0x831d sub.w #1, r13 ; subtract 1 from r13
0x312c: 0x23fe jne 0x312a (offset: -4) ; if r13 is not 1 (equal to zero), loop back to subtracting 1
0x312e: 0x413d pop.w r13 -- mov.w @SP+, r13
0x3130: 0x3c00 jmp 0x3132 (offset: 0) ; jump to address 0x3132
0x3132: 0xb3e2 bit.b #2, &0x0020 ; testing BIT1
0x3134: 0x0020
0x3136: 0x23f3 jne 0x311e (offset: -26) ; if switch is pressed, zero is set
; if switch is not pressed, zero is reset
0x3138: 0xb3e2 bit.b #2, &0x0020 ; P1IN BIT1 test to be high
0x313a: 0x0020
0x313c: 0x23fd jne 0x3138 (offset: -6) ; if zero is reset, test again;
; if zero, move on
0x313e: 0x120d push.w r13 ; pushing r13 onto stack
0x3140: 0x403d mov.w #0x031d, r13 ; same as 0x3126
0x3142: 0x031d
0x3144: 0x831d sub.w #1, r13 ; subtract 1 from r13
0x3146: 0x23fe jne 0x3144 (offset: -4) ; if r13 is not 1 (equal to zero), loop back to subtracting 1
0x3148: 0x413d pop.w r13 -- mov.w @SP+, r13 ; pop r13 off stack
0x314a: 0x3c00 jmp 0x314c (offset: 0) ; jump to address 0x314c
0x314c: 0xb3e2 bit.b #2, &0x0020 ; testing BIT1 high
0x314e: 0x0020
0x3150: 0x23f3 jne 0x3138 (offset: -26) ; loop back to 0x3138
0x3152: 0xb3d2 bit.b #1, &0x0020 ; testing BIT0 high
0x3154: 0x0020
0x3156: 0x23fd jne 0x3152 (offset: -6) ; if zero is reset, test again;
; if zero, move on
0x3158: 0x120d push.w r13 ; push r13 onto stack
0x315a: 0x403d mov.w #0x031d, r13 ; move whatever is at 0x031d to r13
0x315c: 0x031d
0x315e: 0x831d sub.w #1, r13 ; subtract 1 from r13
0x3160: 0x23fe jne 0x315e (offset: -4) ; if r13 is not 1 (equal to zero), loop back to subtracting 1
0x3162: 0x413d pop.w r13 -- mov.w @SP+, r13 ; pop r13 off stack
0x3164: 0x3c00 jmp 0x3166 (offset: 0) ; jump to 0x3166
0x3166: 0xb3d2 bit.b #1, &0x0020 ; testing BIT0 high
0x3168: 0x0020
0x316a: 0x23f3 jne 0x3152 (offset: -26) ; if zero bit reset, test again;
; loops until switch is pressed
0x316c: 0xe2e2 xor.b #4, &0x0029 ; toggle P2.3
0x316e: 0x0029
0x3170: 0x120d push.w r13 ; push r13 onto stack
0x3172: 0x120e push.w r14 ; push r14 onto stack
0x3174: 0x403d mov.w #0x8b80, r13 ; move 0x8b80 into r13
0x3176: 0x8b80
0x3178: 0x430e mov.w #0, r14 ; move 0 into r14
0x317a: 0x831d sub.w #1, r13 ; subtract 1 from r13
0x317c: 0x730e subc.w #0, r14 ; subtract with carry 0 from r14
0x317e: 0x23fd jne 0x317a (offset: -6) ; jump to 0x317a if not zero, if zero move on - debouncing for LEDs
0x3180: 0x930d cmp.w #0, r13 ; Compare zero to r13
0x3182: 0x23fb jne 0x317a (offset: -10) ; jump to 0x317a if zero bit is set
0x3184: 0x413e pop.w r14 -- mov.w @SP+, r14 ; pop r14 from stack
0x3186: 0x413d pop.w r13 -- mov.w @SP+, r13 ; pop r13 from stack
0x3188: 0x3c00 jmp 0x318a (offset: 0) ; jump to 0x318a
0x318a: 0x4303 nop -- mov.w #0, CG ; nop
0x318c: 0xe3e2 xor.b #2, &0x0029 ; toggle P2.1
0x318e: 0x0029
0x3190: 0x120d push.w r13 ; push r13 onto stack
0x3192: 0x120e push.w r14 ; push r14 onto stack
0x3194: 0x403d mov.w #0x2844, r13 ; move #0x2844 into r13
0x3196: 0x2844
0x3198: 0x431e mov.w #1, r14 ; move 1 into r14
0x319a: 0x831d sub.w #1, r13 ; subtracting 1 from r13
0x319c: 0x730e subc.w #0, r14 ; subtract with carry 0 from r14
0x319e: 0x23fd jne 0x319a (offset: -6) ; jump to 0x319a if not zero, if zero move on
0x31a0: 0x930d cmp.w #0, r13 ; Compare zero to r13
0x31a2: 0x23fb jne 0x319a (offset: -10) ; jump to 0x319a if not zero, if zero move on
0x31a4: 0x413e pop.w r14 -- mov.w @SP+, r14 ; pop r14 off stack
0x31a6: 0x413d pop.w r13 -- mov.w @SP+, r13 ; pop r13 off stack
0x31a8: 0x3c00 jmp 0x31aa (offset: 0) ; jump to 0x31aa
0x31aa: 0x4303 nop -- mov.w #0, CG ; nop for debouncing
0x31ac: 0x3fdf jmp 0x316c (offset: -66) ; jump to bic at 0x316c
0x31ae: 0x4031 mov.w #0x3100, SP ; set SP to 0x3100
0x31b0: 0x3100
0x31b2: 0x12b0 call #0x31c8 ; call function at 0x31c8
0x31b4: 0x31c8
0x31b6: 0x430c mov.w #0, r12 ; move 0 into r12
0x31b8: 0x12b0 call #0x3100 ; call function at 0x3100
0x31ba: 0x3100
0x31bc: 0x431c mov.w #1, r12 ; move 1 into r12
0x31be: 0x12b0 call #0x31c2 ; call function at 0x31c2
0x31c0: 0x31c2
0x31c2: 0x4303 nop -- mov.w #0, CG ; nop
0x31c4: 0x3fff jmp 0x31c4 (offset: -2) ; jump to itself - infinite loop
0x31c6: 0x4303 nop -- mov.w #0, CG ; nop
0x31c8: 0x431c mov.w #1, r12 ; move 1 into r12
0x31ca: 0x4130 ret -- mov.w @SP+, PC ; return from main
0x31cc: 0xd032 bis.w #0x0010, SR ; set BIT4 in SR
0x31ce: 0x0010
0x31d0: 0x3ffd jmp 0x31cc (offset: -6) ; jump to bis instruction
0x31d2: 0x4303 nop -- mov.w #0, CG ; nop