Computers Have THUMBS and You Didn't Even Notice

Поділитися
Вставка
  • Опубліковано 18 січ 2025

КОМЕНТАРІ • 32

  • @mytechnotalent
    @mytechnotalent 3 роки тому +28

    This is truly brilliant how you take the time to break this down. I teach RE on C in ARM 64 and ARM 32 and I rarely see such good coverage of ARM well done!

    • @LowLevelTV
      @LowLevelTV  3 роки тому +3

      Glad you enjoyed it!

    • @mytechnotalent
      @mytechnotalent 3 роки тому +2

      @@LowLevelTV its brilliant thank for taking the time to do it. I would love t see a Raspberry Pi Pico raw Assembly tut if that interested you. We have the SDK from the RPI but its binding are focused more on C which is good but anyway im babbling...

  • @dragonofmissingno170
    @dragonofmissingno170 3 роки тому +6

    Just found your channel through another video. I have already learned how to enter thumb mode for the purpose of more efficient programs on the Nintendo GBA. The UA-camr ChibiAkumas has several videos on ARM assembly as well. Just for a computer/game system angle. Subbed for more Pi Pico and Assembly videos. I like lower-level programming over those generic Python and other programming tutorial videos UA-cam wants to recommend me.

    • @LowLevelTV
      @LowLevelTV  3 роки тому +2

      Happy to hear it! Welcome to the channel

    • @williamdrum9899
      @williamdrum9899 2 роки тому +3

      Same here, I learned about thumb mode from Chibiakumas' videos too. Something else I learned about GBA was that the bios calls are different depending on whether you're in ARM or THUMB mode. In ARM mode they're bit-shifted to the left 16 times. So in thumb mode you would do SWI 0x06 but in ARM you do SWI 0x06

  • @kurtttttttt
    @kurtttttttt 2 роки тому

    i wish you were around when i was learning arm assembly in undergrad!

  • @hanspeterbestandig2054
    @hanspeterbestandig2054 2 роки тому

    Excellent explanation! Thank your!

  • @hugoboyce9648
    @hugoboyce9648 2 роки тому

    Wow I wish I would have found this channel earlier!
    Thanks man!

  • @JGHFunRun
    @JGHFunRun 2 роки тому

    4:59 that was so funny to me I literally fell out of my chair

  • @pokemettilp8872
    @pokemettilp8872 3 роки тому +6

    I have two questions. What exactly does branch exchange do? And can you write thumb for aarch64 or is that not supported, are the only two modes aarch64 and aarch32?

    • @LowLevelTV
      @LowLevelTV  3 роки тому +4

      From the ARMv8 manual "AArch64 state supports only a single instruction set, called A64. This is a fixed-length instruction set that uses 32-bit instruction encodings."
      :(

  • @balbino4
    @balbino4 3 роки тому

    Thank you very much!

  • @danielmagnus5239
    @danielmagnus5239 3 роки тому

    What type of computer are you using? Where did you get that? And what OS is you running under?

  • @eFeXuy
    @eFeXuy 3 роки тому +4

    Cool. Now, let's say you would want to do that from the comfort of C, how would one tell the compiler?
    Asking for a friend.

    • @LowLevelTV
      @LowLevelTV  3 роки тому +2

      Good question!
      With ARM gcc, you can you the -mthumb flag to compile that piece of code to thumb mode. You will need to separate your C files into which ones you want to be thumb mode and which ones you want to be ARM.
      This is the answer at the compiler level, there may be C preprocessor flags that I'm not aware of that will have the same effect.

    • @eFeXuy
      @eFeXuy 3 роки тому

      @@LowLevelTV I tried compiling for the RPi Pico with #pragma GCC target ("thumb") but the output files are a couple of bytes larger instead of smaller, and then I tried passing to Cmake CMAKE_C_FLAGS "-mthumb" but that spews errors about processor does not support such and such instruction in thumb mode.

    • @minirop
      @minirop 2 роки тому

      @@eFeXuy the pico is an M0+ than only support thumb mode.

  • @snandi1603
    @snandi1603 2 роки тому

    Awesome!!

  • @ruditook2367
    @ruditook2367 2 роки тому +1

    how did you run the programs without qemu-arm.

  • @hstrinzel
    @hstrinzel 2 роки тому

    Thumbs UP. BIGLY!

  • @triularity
    @triularity 2 роки тому

    Would it be cleaner to jump/unconditional branch to the thumb address (+1) during assemble time rather than compute it at runtime? And than same to switch back (masking out the lsb, if needed). That way you're not eating up all the saved bytes with mode swapping instructions.
    I'm kind of surprised the assembler doesn't emit a warning (or even an error) if you switch between modes and don't modify the instruction pointer in some way immediately before the transition.

  • @sebscripts
    @sebscripts Рік тому

    Can you make a arm32/aarch32 tutorial?

  • @williamdrum9899
    @williamdrum9899 2 роки тому

    1:58 Once the CPU performs the jump, is PC odd or even? Does it actually start executing at an odd address?

    • @LowLevelTV
      @LowLevelTV  2 роки тому

      No, its starts executing at an even address, but in Thumb mode.

  • @jasonlin5884
    @jasonlin5884 2 роки тому

    Cool !
    But question here, in Thumb mode any conditional instruction (except conditional branch instructions ) need to be in a IT block ( if then block ), am i right ?
    for example
    it eq
    moveq r0,r1

  • @LambdaJack
    @LambdaJack 2 роки тому

    That's like the Great Architect from Happy Three Friends.

  • @MDarkus3
    @MDarkus3 3 роки тому

    When I run my binary I got an error : -bash: ./001.elf: cannot execute binary file: Exec format error

  • @xtdycxtfuv9353
    @xtdycxtfuv9353 2 роки тому

    Why is it called THUMB?

  • @lostulutz8526
    @lostulutz8526 2 роки тому

    When I run my binary I got an error : -bash: ./001.elf: cannot execute binary file: Exec format error

    • @lostulutz8526
      @lostulutz8526 2 роки тому

      Searching for fault, fault detected, failure sits for device! ARM M type can only use thumb mode, ARM A type thumb and A32 using
      OS. But it is not possible, never ever executing a program in AMD64 written for ARM. Sorry, my fault!

    • @alexk4894
      @alexk4894 2 роки тому

      ​@@lostulutz8526 It's possible to emulate. On linux you can install binfmt-support and qemu-user-static. This allows you to execute binaries for different architectures.