-
Notifications
You must be signed in to change notification settings - Fork 0
Add LEA instruction implementation #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@copilot Please try again. I would expect the following changes:
|
Co-authored-by: PaulTrampert <5550942+PaulTrampert@users.noreply.github.com>
Co-authored-by: PaulTrampert <5550942+PaulTrampert@users.noreply.github.com>
Co-authored-by: PaulTrampert <5550942+PaulTrampert@users.noreply.github.com>
|
@copilot It looks like you specified (A3) as the effective address source and set the value of A3 to 0xAABBCCDD. Rather than copying 0xAABBCCDD into A5, this should copy the 32-bit value found from |
I want to clarify the expected behavior. LEA (Load Effective Address) traditionally loads the computed address itself into the destination register, not the data at that address. For Are you saying that for this codebase, LEA should instead read from memory at the effective address? Or should I use a different addressing mode in the test (like absolute addressing or displacement mode) to make the test more meaningful? |
|
@copilot I'm sorry, your PR is correct. My understanding of the documentation was mistaken. |
|
@copilot Please add a check to the instruction that checks for ea modes of 0b000, 0b001, 0b011, and 0b100. If the ea mode is any of these, |
Co-authored-by: PaulTrampert <5550942+PaulTrampert@users.noreply.github.com>
Added the check in 8e2109e. The LEA execute method now returns |
|
@copilot Please add a test for the illegal instruction case. |
Co-authored-by: PaulTrampert <5550942+PaulTrampert@users.noreply.github.com>
Added in 771456b. Added 4 tests covering each of the illegal EA modes (0b000 Data Register Direct, 0b001 Address Register Direct, 0b011 Post-Increment, 0b100 Pre-Decrement), verifying they return 34 cycles and trigger the illegal instruction trap handler. |
Fixes #51
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.