Skip to content

Don't need a full dissassembler listing when it's going to change anyway #147

@flip111

Description

@flip111

https://rust-embedded.github.io/book/start/qemu.html#inspecting

There is no meaning in displaying the entire assembler output as if we want to say "it should look like this". Or the assembler in the book should be kept updated so it can be verified.

on my pc it's

app:	file format ELF32-arm-little

Disassembly of section .text:
main:
     400:	bl	#0x256
     404:	b	#-0x4 <main+0x4>

Reset:
     406:	bl	#0x24e
     40a:	movw	r0, #0x0
     40e:	movw	r2, #0x0
     412:	movt	r0, #0x2000
     416:	movt	r2, #0x2000
     41a:	cmp	r2, r0
     41c:	bhs	#0xb4 <Reset+0xce>
     41e:	adds	r1, r2, #0x4
     420:	mvn.w	r12, r2
     424:	cmp	r1, r0
     426:	mov.w	r4, #0x1
     42a:	mov	r3, r1
     42c:	it	lo
     42e:	movlo	r3, r0
     430:	add	r3, r12
     432:	add.w	r3, r4, r3, lsr #2
     436:	lsls	r3, r3, #0x1e
     438:	mov	r3, r2
     43a:	beq	#0x48 <Reset+0x80>
     43c:	mov.w	lr, #0x0
     440:	mov	r3, r2
     442:	str	lr, [r3], #4
     446:	cmp	r3, r0
     448:	mov	r5, r3
     44a:	it	lo
     44c:	movlo	r5, r0
     44e:	add	r5, r12
     450:	add.w	r4, r4, r5, lsr #2
     454:	and	r4, r4, #0x3
     458:	cmp	r4, #0x1
     45a:	beq	#0x28 <Reset+0x80>
     45c:	mov	r3, r2
     45e:	movs	r7, #0x1
     460:	str	lr, [r3, #4]!
     464:	cmp	r3, r0
     466:	it	lo
     468:	movlo	r3, r0
     46a:	add	r3, r12
     46c:	add.w	r3, r7, r3, lsr #2
     470:	and	r3, r3, #0x3
     474:	cmp	r3, #0x2
     476:	beq	#0x8 <Reset+0x7c>
     478:	movs	r3, #0x0
     47a:	str	r3, [r2, #0x8]
     47c:	add.w	r3, r2, #0xc
     480:	b	#0x2 <Reset+0x80>
     482:	add.w	r3, r2, #0x8
     486:	cmp	r1, r0
     488:	it	lo
     48a:	movlo	r1, r0
     48c:	add	r1, r12
     48e:	lsrs	r1, r1, #0x2
     490:	cmp	r1, #0x3
     492:	blo	#0x3e <Reset+0xce>
     494:	movs	r1, #0x0
     496:	add.w	r2, r3, #0x10
     49a:	str	r1, [r3]
     49c:	cmp	r2, r0
     49e:	str	r1, [r3, #0x4]
     4a0:	str	r1, [r3, #0x8]
     4a2:	str	r1, [r3, #0xc]
     4a4:	itttt	lo
     4a6:	strlo	r1, [r2]
     4a8:	strlo	r1, [r2, #0x4]
     4aa:	strlo	r1, [r2, #0x8]
     4ac:	strlo	r1, [r2, #0xc]
     4ae:	itt	lo
     4b0:	addlo	r2, #0x10
     4b2:	cmplo	r2, r0
     4b4:	bhs	#0x1c <Reset+0xce>
     4b6:	str	r1, [r2]
     4b8:	str	r1, [r2, #0x4]
     4ba:	str	r1, [r2, #0x8]
     4bc:	str	r1, [r2, #0xc]
     4be:	adds	r2, #0x10
     4c0:	cmp	r2, r0
     4c2:	bhs	#0xe <Reset+0xce>
     4c4:	add.w	r3, r2, #0x10
     4c8:	str	r1, [r2]
     4ca:	cmp	r3, r0
     4cc:	str	r1, [r2, #0x4]
     4ce:	str	r1, [r2, #0x8]
     4d0:	str	r1, [r2, #0xc]
     4d2:	blo	#-0x40 <Reset+0x90>
     4d4:	movw	r8, #0x0
     4d8:	movw	lr, #0x0
     4dc:	movt	r8, #0x2000
     4e0:	movt	lr, #0x2000
     4e4:	cmp	lr, r8
     4e6:	bhs.w	#0x11c <Reset+0x200>
     4ea:	add.w	r2, lr, #0x4
     4ee:	mvn.w	r12, lr
     4f2:	cmp	r2, r8
     4f4:	mov.w	r5, #0x1
     4f8:	mov	r1, r2
     4fa:	movw	r4, #0x664
     4fe:	it	lo
     500:	movlo	r1, r8
     502:	movt	r4, #0x0
     506:	add	r1, r12
     508:	add.w	r1, r5, r1, lsr #2
     50c:	lsls	r1, r1, #0x1e
     50e:	beq	#0x50 <Reset+0x15c>
     510:	mov	r1, r4
     512:	mov	r3, lr
     514:	ldr	r6, [r1], #4
     518:	str	r6, [r3], #4
     51c:	cmp	r3, r8
     51e:	mov	r6, r3
     520:	it	lo
     522:	movlo	r6, r8
     524:	add	r6, r12
     526:	add.w	r5, r5, r6, lsr #2
     52a:	and	r5, r5, #0x3
     52e:	cmp	r5, #0x1
     530:	beq	#0x32 <Reset+0x160>
     532:	ldr	r0, [r4, #0x4]
     534:	mov	r1, lr
     536:	str	r0, [r1, #4]!
     53a:	cmp	r1, r8
     53c:	it	lo
     53e:	movlo	r1, r8
     540:	add.w	r0, r1, r12
     544:	movs	r1, #0x1
     546:	add.w	r0, r1, r0, lsr #2
     54a:	and	r0, r0, #0x3
     54e:	cmp	r0, #0x2
     550:	beq	#0xf8 <Reset+0x246>
     552:	ldr	r0, [r4, #0x8]
     554:	add.w	r1, r4, #0xc
     558:	str.w	r0, [lr, #0x8]
     55c:	add.w	r3, lr, #0xc
     560:	b	#0x2 <Reset+0x160>
     562:	mov	r3, lr
     564:	mov	r1, r4
     566:	cmp	r2, r8
     568:	it	lo
     56a:	movlo	r2, r8
     56c:	add	r2, r12
     56e:	lsrs	r2, r2, #0x2
     570:	cmp	r2, #0x3
     572:	blo	#0x90 <Reset+0x200>
     574:	add.w	r2, r3, #0x10
     578:	mov	r6, r8
     57a:	cmp	r2, r8
     57c:	it	hi
     57e:	movhi	r6, r2
     580:	mvns	r5, r3
     582:	add.w	r12, r6, r5
     586:	movs	r6, #0x1
     588:	add.w	r6, r6, r12, lsr #4
     58c:	ands	lr, r6, #0x3
     590:	beq	#0x1e <Reset+0x1ac>
     592:	ldrd	r6, r5, [r1]
     596:	cmp.w	lr, #0x1
     59a:	ldrd	r4, r7, [r1, #8]
     59e:	strd	r6, r5, [r3]
     5a2:	strd	r4, r7, [r3, #8]
     5a6:	bne	#0x62 <Reset+0x206>
     5a8:	adds	r1, #0x10
     5aa:	cmp.w	r12, #0x30
     5ae:	bhs	#0x8 <Reset+0x1b4>
     5b0:	b	#0x52 <Reset+0x200>
     5b2:	mov	r2, r3
     5b4:	cmp.w	r12, #0x30
     5b8:	blo	#0x4a <Reset+0x200>
     5ba:	ldrd	r3, r7, [r1]
     5be:	ldrd	r6, r5, [r1, #8]
     5c2:	ldrd	r4, r0, [r1, #16]
     5c6:	ldrd	r12, lr, [r1, #24]
     5ca:	strd	r3, r7, [r2]
     5ce:	add.w	r7, r1, #0x20
     5d2:	strd	r6, r5, [r2, #8]
     5d6:	strd	r4, r0, [r2, #16]
     5da:	strd	r12, lr, [r2, #24]
     5de:	add.w	lr, r1, #0x34
     5e2:	ldm	r7, {r0, r3, r7}
     5e4:	ldrd	r6, r5, [r1, #44]
     5e8:	adds	r1, #0x40
     5ea:	ldm.w	lr, {r4, r12, lr}
     5ee:	str	r0, [r2, #0x20]
     5f0:	add.w	r0, r2, #0x34
     5f4:	str	r3, [r2, #0x24]
     5f6:	str	r7, [r2, #0x28]
     5f8:	strd	r6, r5, [r2, #44]
     5fc:	adds	r2, #0x40
     5fe:	cmp	r2, r8
     600:	stm.w	r0, {r4, r12, lr}
     604:	blo	#-0x4e <Reset+0x1b4>
     606:	bl	#-0x20a
     60a:	trap
     60c:	add.w	r5, r1, #0x10
     610:	cmp.w	lr, #0x2
     614:	ldm	r5, {r0, r2, r4, r5}
     616:	str	r0, [r3, #0x10]
     618:	str	r2, [r3, #0x14]
     61a:	str	r4, [r3, #0x18]
     61c:	str	r5, [r3, #0x1c]
     61e:	bne	#0xc <Reset+0x228>
     620:	adds	r1, #0x20
     622:	add.w	r2, r3, #0x20
     626:	cmp.w	r12, #0x30
     62a:	bhs	#-0x74 <Reset+0x1b4>
     62c:	b	#-0x2a <Reset+0x200>
     62e:	add.w	r7, r1, #0x20
     632:	ldm	r7, {r0, r2, r7}
     634:	ldr	r6, [r1, #0x2c]
     636:	adds	r1, #0x30
     638:	str	r0, [r3, #0x20]
     63a:	str	r2, [r3, #0x24]
     63c:	add.w	r2, r3, #0x30
     640:	str	r7, [r3, #0x28]
     642:	str	r6, [r3, #0x2c]
     644:	cmp.w	r12, #0x30
     648:	bhs	#-0x92 <Reset+0x1b4>
     64a:	b	#-0x48 <Reset+0x200>
     64c:	add.w	r1, r4, #0x8
     650:	add.w	r3, lr, #0x8
     654:	b	#-0xf2 <Reset+0x160>

DefaultHandler_:
     656:	b	#-0x4 <DefaultHandler_>

UsageFault:
     657:	strb	r7, [r4, #0x3]

DefaultPreInit:
     658:	bx	lr

__pre_init:
     659:	strb	r7, [r0, #0x1]

__nop:
     65a:	bx	lr

HardFaultTrampoline:
     65c:	mrs	r0, msp
     660:	b	#-0x2 <HardFault_>

HardFault_:
     662:	b	#-0x4 <HardFault_>

HardFault:
     663: <unknown>

Suggestion 1:
Don't show output at all, just say will output dissassembler

Suggestion 2:
Show 3 lines with ... on the 4th line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions