📄 timers.lss
字号:
mov Zh, r1h
288: f9 2f mov r31, r25
lpm ; until all strings out.
28a: c8 95 lpm
tst R0
28c: 00 20 and r0, r0
brne Hello1
28e: c1 f7 brne .-16 ; 0x280
ldi tmp0, lo8(0x60)
290: 20 e6 ldi r18, 0x60 ; 96
mov Addressl, tmp0
292: 42 2e mov r4, r18
ldi tmp0, hi8(0x60)
294: 20 e0 ldi r18, 0x00 ; 0
mov Addressh, tmp0
296: 52 2e mov r5, r18
clr ObjectIDl
298: 88 24 eor r8, r8
clr ObjectIDh
29a: 99 24 eor r9, r9
clr MonFlags
29c: bb 24 eor r11, r11
clr DumpLength
29e: aa 24 eor r10, r10
clr EEAddressl
2a0: 66 24 eor r6, r6
clr EEAddressh
2a2: 77 24 eor r7, r7
000002a4 <DebugMonitor>:
_ENDFUNC
_FUNCTION(DebugMonitor)
DebugMonitor:
rcall PutCR
2a4: 95 d1 rcall .+810 ; 0x5d0
ldi p1l, '>'
2a6: 8e e3 ldi r24, 0x3E ; 62
rcall PutChar
2a8: bb d1 rcall .+886 ; 0x620
rcall m_Parse
2aa: 01 d0 rcall .+2 ; 0x2ae
rjmp DebugMonitor
2ac: fb cf rjmp .-10 ; 0x2a4
000002ae <m_Parse>:
m_Parse:
rcall _GetChar
2ae: 8e d1 rcall .+796 ; 0x5cc
cpi r1l, 'm' ; Modify Memory
2b0: 8d 36 cpi r24, 0x6D ; 109
breq m_ModifyMemory
2b2: d9 f0 breq .+54 ; 0x2ea
cpi r1l, 'd' ; Dump RAM
2b4: 84 36 cpi r24, 0x64 ; 100
breq m_DumpMemory
2b6: e1 f0 breq .+56 ; 0x2f0
cpi r1l, 'h' ; Halt (suspend) Process
2b8: 88 36 cpi r24, 0x68 ; 104
breq m_HaltProcess
2ba: 59 f1 breq .+86 ; 0x312
cpi r1l, 's' ; Step process
2bc: 83 37 cpi r24, 0x73 ; 115
breq m_StepProcess
2be: d9 f1 breq .+118 ; 0x336
cpi r1l, 'k' ; Terminate Process
2c0: 8b 36 cpi r24, 0x6B ; 107
breq m_Terminate
2c2: b1 f1 breq .+108 ; 0x330
#ifdef SINGLESTEPSUPPORT
cpi r1l, 'n' ; Next instruction
2c4: 8e 36 cpi r24, 0x6E ; 110
breq m_SingleStep
2c6: e9 f1 breq .+122 ; 0x342
#endif
cpi r1l, 'r' ; Resume Process
2c8: 82 37 cpi r24, 0x72 ; 114
breq m_ResumeProcess
2ca: 31 f1 breq .+76 ; 0x318
cpi r1l, 'i' ; Signal Semaphore
2cc: 89 36 cpi r24, 0x69 ; 105
breq m_SetSemaphore
2ce: 69 f1 breq .+90 ; 0x32a
cpi r1l, 'c' ;
2d0: 83 36 cpi r24, 0x63 ; 99
breq m_CancelTimer
2d2: 29 f1 breq .+74 ; 0x31e
cpi r1l, 'x'
2d4: 88 37 cpi r24, 0x78 ; 120
breq m_PrintProcessContext
2d6: 31 f1 breq .+76 ; 0x324
cpi r1l, 'p'
2d8: 80 37 cpi r24, 0x70 ; 112
breq m_InitTask
2da: c1 f0 breq .+48 ; 0x30c
cpi r1l, 'q'
2dc: 81 37 cpi r24, 0x71 ; 113
breq m_quit
2de: 11 f0 breq .+4 ; 0x2e4
000002e0 <m_err>:
m_err:
ldi p1l, '?'
2e0: 8f e3 ldi r24, 0x3F ; 63
rjmp PutChar
2e2: 9e c1 rjmp .+828 ; 0x620
000002e4 <m_quit>:
m_quit:
pop Xl ; Hack to allow user i/f to call monitor
2e4: af 91 pop r26
pop Xl
2e6: af 91 pop r26
ret
2e8: 08 95 ret
000002ea <m_ModifyMemory>:
m_ModifyMemory:
rcall GetFlagsAndAddress
2ea: 6a d0 rcall .+212 ; 0x3c0
brtc m_err
2ec: ce f7 brtc .-14 ; 0x2e0
rjmp _ModifyMemory
2ee: b5 c0 rjmp .+362 ; 0x45a
000002f0 <m_DumpMemory>:
m_DumpMemory:
rcall GetFlagsAndAddress
2f0: 67 d0 rcall .+206 ; 0x3c0
mov TempWl, p1l
2f2: c8 2e mov r12, r24
mov TempWh, p1h
2f4: d9 2e mov r13, r25
brtc m_err ; Flags in Xh, Addr in Z
2f6: a6 f7 brtc .-24 ; 0x2e0
lds tmp0, _RxByte
2f8: 20 91 22 01 lds r18, 0x0122
cpi tmp0, 0x0D ; See if terminated with a CR
2fc: 2d 30 cpi r18, 0x0D ; 13
breq m1b
2fe: 11 f0 breq .+4 ; 0x304
rcall GetDumpLength ; Leave count in Xl
300: 56 d0 rcall .+172 ; 0x3ae
brtc m_err
302: 76 f7 brtc .-36 ; 0x2e0
00000304 <m1b>:
m1b:
mov p2l, TempWl
304: 6c 2d mov r22, r12
mov p2h, TempWh
306: 7d 2d mov r23, r13
mov p1l, DumpLength
308: 8a 2d mov r24, r10
rjmp _DumpMemory
30a: 87 c0 rjmp .+270 ; 0x41a
0000030c <m_InitTask>:
m_InitTask:
rcall GetHexWord ; This is a word address, not byte.
30c: b8 d1 rcall .+880 ; 0x67e
brtc m_err
30e: 46 f7 brtc .-48 ; 0x2e0
rjmp AvrXInitTask
310: 99 c2 rjmp .+1330 ; 0x844
00000312 <m_HaltProcess>:
m_HaltProcess:
rcall GetObjectID
312: 42 d0 rcall .+132 ; 0x398
brtc m_err
314: 2e f7 brtc .-54 ; 0x2e0
rjmp AvrXSuspend
316: a0 c3 rjmp .+1856 ; 0xa58
00000318 <m_ResumeProcess>:
m_ResumeProcess:
rcall GetObjectID
318: 3f d0 rcall .+126 ; 0x398
brtc m_err
31a: 16 f7 brtc .-60 ; 0x2e0
rjmp AvrXResume
31c: b6 c2 rjmp .+1388 ; 0x88a
0000031e <m_CancelTimer>:
m_CancelTimer:
rcall GetObjectID
31e: 3c d0 rcall .+120 ; 0x398
brtc m_err
320: fe f6 brtc .-66 ; 0x2e0
rjmp AvrXCancelTimer
322: 22 c4 rjmp .+2116 ; 0xb68
00000324 <m_PrintProcessContext>:
m_PrintProcessContext:
rcall GetObjectID
324: 39 d0 rcall .+114 ; 0x398
brtc m_err
326: e6 f6 brtc .-72 ; 0x2e0
rjmp _PrintContext
328: d6 c0 rjmp .+428 ; 0x4d6
0000032a <m_SetSemaphore>:
m_SetSemaphore:
rcall GetObjectID
32a: 36 d0 rcall .+108 ; 0x398
brtc m_err
32c: ce f6 brtc .-78 ; 0x2e0
rjmp AvrXSetSemaphore
32e: f8 c2 rjmp .+1520 ; 0x920
00000330 <m_Terminate>:
m_Terminate:
rcall GetObjectID
330: 33 d0 rcall .+102 ; 0x398
brtc m_err
332: b6 f6 brtc .-84 ; 0x2e0
rjmp AvrXTerminate
334: 78 c3 rjmp .+1776 ; 0xa26
00000336 <m_StepProcess>:
m_StepProcess:
rcall GetObjectID
336: 30 d0 rcall .+96 ; 0x398
brtc m_err
338: 9e f6 brtc .-90 ; 0x2e0
rcall AvrXStepNext
33a: 5a d3 rcall .+1716 ; 0x9f0
tst r1l
33c: 88 23 and r24, r24
brne ms_NOTSUSPENDED
33e: d9 f4 brne .+54 ; 0x376
ret
340: 08 95 ret
00000342 <m_SingleStep>:
#ifdef SINGLESTEPSUPPORT
m_SingleStep:
rcall GetObjectID
342: 2a d0 rcall .+84 ; 0x398
brtc m_err
344: 6e f6 brtc .-102 ; 0x2e0
00000346 <NextStep>:
NextStep:
rcall AvrXSingleStepNext ; This will return after
346: 3f d3 rcall .+1662 ; 0x9c6
tst r1l
348: 88 23 and r24, r24
brne ms_NOTSUSPENDED ; the step is done
34a: a9 f4 brne .+42 ; 0x376
mov Zh, ObjectIDh
34c: f9 2d mov r31, r9
mov Zl, ObjectIDl
34e: e8 2d mov r30, r8
ldd Yl, Z+PidSP+NextL ; Y = Frame Pointer
350: c4 81 ldd r28, Z+4 ; 0x04
ldd Yh, Z+PidSP+NextH
352: d5 81 ldd r29, Z+5 ; 0x05
ldd p1l, Y+_RetLo+2 ; Y = Address of Next inst
354: 8b a1 ldd r24, Y+35 ; 0x23
ldd p1h, Y+_RetHi+2
356: 9a a1 ldd r25, Y+34 ; 0x22
ldd Xh, Z+bp1+NextH ; Breakpoints are stored in
358: b7 81 ldd r27, Z+7 ; 0x07
ldd Xl, Z+bp1+NextL ; the PID..
35a: a6 81 ldd r26, Z+6 ; 0x06
adiw Xl, 0
35c: 10 96 adiw r26, 0x00 ; 0
breq BreakPoint
35e: 51 f0 breq .+20 ; 0x374
cp p1l, Xl
360: 8a 17 cp r24, r26
cpc p1h, Xh
362: 9b 07 cpc r25, r27
breq BreakPoint
364: 39 f0 breq .+14 ; 0x374
ldd Xh, Z+bp2+NextH
366: b1 85 ldd r27, Z+9 ; 0x09
ldd Xl, Z+bp2+NextL
368: a0 85 ldd r26, Z+8 ; 0x08
adiw Xl, 0
36a: 10 96 adiw r26, 0x00 ; 0
breq NextStep ; If we dont hit the breakpoint
36c: 61 f3 breq .-40 ; 0x346
cp p1l, Xl ; the monitor hangs here
36e: 8a 17 cp r24, r26
cpc p1h, Xh
370: 9b 07 cpc r25, r27
brne NextStep
372: 49 f7 brne .-46 ; 0x346
00000374 <BreakPoint>:
BreakPoint:
rjmp PutHexWord ; Print out our breakpoint address
374: c1 c1 rjmp .+898 ; 0x6f8
00000376 <ms_NOTSUSPENDED>:
#endif
ms_NOTSUSPENDED:
rcall PutCR
376: 2c d1 rcall .+600 ; 0x5d0
mov p1l, ObjectIDl
378: 88 2d mov r24, r8
mov p1h, ObjectIDh
37a: 99 2d mov r25, r9
rcall PutHexWord
37c: bd d1 rcall .+890 ; 0x6f8
ldi p1l, lo8(NotSuspended)
37e: 84 e8 ldi r24, 0x84 ; 132
ldi p1h, hi8(NotSuspended)
380: 93 e0 ldi r25, 0x03 ; 3
rjmp _PrintString
382: 2a c1 rjmp .+596 ; 0x5d8
00000384 <NotSuspended>:
384: 20 2d mov r18, r0
386: 20 4e sbci r18, 0xE0 ; 224
388: 6f 74 andi r22, 0x4F ; 79
38a: 20 53 subi r18, 0x30 ; 48
38c: 75 73 andi r23, 0x35 ; 53
38e: 70 65 ori r23, 0x50 ; 80
390: 6e 64 ori r22, 0x4E ; 78
392: 65 64 ori r22, 0x45 ; 69
394: 21 0d add r18, r1
...
00000398 <GetObjectID>:
_ENDFUNC
NotSuspended:
_DB " - Not Suspended!\r"
_ALIGN
;
; void * GetObjectID()
;
; Little helper routine to get and return a byte value with
; carry set if all Ok. e.g. entered 2 hex digits, or terminated
; with whitespace.
;
; Puts the ID in the R25:R24 register because that is what all the
; AvrX routines expect.
;
_FUNCTION(GetObjectID)
GetObjectID:
rcall GetHexWord
398: 72 d1 rcall .+740 ; 0x67e
brts goi00
39a: 16 f0 brts .+4 ; 0x3a0
rcall IsWhite
39c: 89 d1 rcall .+786 ; 0x6b0
brtc goi02
39e: 36 f4 brtc .+12 ; 0x3ac
000003a0 <goi00>:
goi00:
tst p2l
3a0: 66 23 and r22, r22
brne goi01 ;
3a2: 11 f4 brne .+4 ; 0x3a8
mov p1l, ObjectIDl ; Restore default
3a4: 88 2d mov r24, r8
mov p1h, ObjectIDh
3a6: 99 2d mov r25, r9
000003a8 <goi01>:
goi01:
mov ObjectIDl, p1l
3a8: 88 2e mov r8, r24
mov ObjectIDh, p1h
3aa: 99 2e mov r9, r25
000003ac <goi02>:
goi02:
ret
3ac: 08 95 ret
000003ae <GetDumpLength>:
_ENDFUNC
;
; unsigned char GetDumpLength()
;
; Another helper to manage defaults with the dump length
; counter
;
_FUNCTION(GetDumpLength)
GetDumpLength:
rcall GetHexByte ; get a dump counter
3ae: 69 d1 rcall .+722 ; 0x682
brts gdl00 ; If term invalid,
3b0: 16 f0 brts .+4 ; 0x3b6
rcall IsWhite ; check for whitespace
3b2: 7e d1 rcall .+764 ; 0x6b0
brtc gdl02
3b4: 26 f4 brtc .+8 ; 0x3be
000003b6 <gdl00>:
gdl00:
tst p2l ; If no user entry
3b6: 66 23 and r22, r22
brne gdl01
3b8: 09 f4 brne .+2 ; 0x3bc
mov p1l, DumpLength ; load up default
3ba: 8a 2d mov r24, r10
000003bc <gdl01>:
gdl01:
mov DumpLength, p1l
3bc: a8 2e mov r10, r24
000003be <gdl02>:
gdl02:
ret
3be: 08 95 ret
000003c0 <GetFlagsAndAddress>:
_ENDFUNC
;
; void * GetFlagsAndAddress()
;
; Parse input stream for byte/word flag and address. All are optional
; as long as the input stream is terminated with whitespace.
;
_FUNCTION(GetFlagsAndAddress)
GetFlagsAndAddress:
clt
3c0: e8 94 clt
rcall _GetChar
3c2: 04 d1 rcall .+520 ; 0x5cc
mov tmp0, MonFlags
3c4: 2b 2d mov r18, r11
cpi r1l, 's'
3c6: 83 37 cpi r24, 0x73 ; 115
brne gbTRYEERAM
3c8: 11 f4 brne .+4 ; 0x3ce
cbr tmp0, 1<<EEFLAG; If "s" , clear flag
3ca: 2d 7f andi r18, 0xFD ; 253
rjmp gbCONTINUE
3cc: 03 c0 rjmp .+6 ; 0x3d4
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -