Skip to content
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

Slave memory out of Bounds (Bugzilla #32) #32

Open
GerbilSoft opened this issue Mar 30, 2016 · 0 comments
Open

Slave memory out of Bounds (Bugzilla #32) #32

GerbilSoft opened this issue Mar 30, 2016 · 0 comments
Labels

Comments

@GerbilSoft
Copy link
Owner

status VERIFIED severity normal in component gens for ---
Reported in version r7.1 on platform i386
Assigned to: David Korth

On 2010-01-28 08:55:25 -0500, Paul Mc Quade wrote:

gens_core/mem/mem_s68k.asm:2772: warning: signed byte value exceeds bounds
gens_core/mem/mem_s68k.asm:2799: warning: signed byte value exceeds bounds
gens_core/mem/mem_s68k.asm:2848: warning: signed byte value exceeds bounds
gens_core/mem/mem_s68k.asm:3496: warning: signed byte value exceeds bounds
gens_core/mem/mem_s68k.asm:3514: warning: signed byte value exceeds bounds
gens_core/mem/mem_s68k.asm:3550: warning: signed byte value exceeds bounds

Its always a register overflow, like

.Reg_Vector_Adr:
and ax, 0xFFFE

(etc)

On 2010-01-28 18:54:40 -0500, David Korth wrote:

This isn't actually a bug. nasm seems a bit overzealous with regards to 16-bit instructions, and is trying to warn us that 0xFE will get sign-extended to 0xFFFFFFFE if a byte operand is used with a 32-bit register in 32-bit mode.

Example: Suppose you want to AND the value in eax with 0xFE.

Correct: and eax, 0xFE
Incorrect: and eax, byte 0xFE

The latter version will sign-extend the value to 0xFFFFFFFE instead of zero-extending it to 0x000000FE.

In the case of mem_s68k.asm, the ANDs are merely for masking out a single bit, so it isn't a problem. However, I may replace it with 32-bit register operations later on for performance purposes.

@GerbilSoft GerbilSoft added the bug label Mar 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant