Giter Site home page Giter Site logo

Comments (8)

jsmolka avatar jsmolka commented on June 29, 2024

No, it reads the word at address r0 into the pc, just as described in the test.

t513:
        ; ARM 10: Load empty rlist
        adr     r0, t514
        str     r0, [mem]
        mov     r0, mem
        dw      0xE8B00000  ; ldmia r0!, {}

f513:
        m_exit  513

t514:

from gba-tests.

DipeshChouhan avatar DipeshChouhan commented on June 29, 2024

Is it adr instruction. My decoder decoding it as add instruction

from gba-tests.

jsmolka avatar jsmolka commented on June 29, 2024

The adr instruction loads the address of label t514 into r0. This is done by the assembler and ends up being an add instruction.

from gba-tests.

DipeshChouhan avatar DipeshChouhan commented on June 29, 2024

Sorry for asking another question but which instruction is going to load pc. My emulator just exit with 513 code. Is pc (r15) included in ldmia r0!, {}

from gba-tests.

fleroviux avatar fleroviux commented on June 29, 2024

ldm with an empty register list loads from the base register into r15 and updates the base register by +/- 64 (if writeback is enabled). This is likely due to quirks in how the hardware finds the next set bit in the register list (trailing zero count) as well as how it computes the sum of set bits (population count) when the register list is empty.

from gba-tests.

DipeshChouhan avatar DipeshChouhan commented on June 29, 2024

Is it undefined behavior

from gba-tests.

jsmolka avatar jsmolka commented on June 29, 2024

Yes, it is. You don't need it for an emulator, but I included it out of curiosity.

from gba-tests.

DipeshChouhan avatar DipeshChouhan commented on June 29, 2024

Thanks for your help.

from gba-tests.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.