Terraspace / UASM

UASM - Macro Assembler
http://www.terraspace.co.uk/uasm.html
Other
220 stars 49 forks source link

Incorrect error message #51

Closed gwoltman closed 7 years ago

gwoltman commented 7 years ago

Two lines of bad code follow. The code is identical except for a unary negation operator. The first error message is clearly incorrect. lea rcx, [rcx+-4*r8+64] Error A2235: Constant value too large: FFFFFFFF00000040h lea rcx, [rcx-4*r8+64] ;; Next dest pointer Error A2065: Constant expected

john-terraspace commented 7 years ago

Hi,

With regards to these I’ve not been able to make it assemble in anything as yet..

In both cases the scale is required to be positive (1,2,4,8) in SIB addressing.

In the first case I think the expression evaluator gets the right answer, but being negative complains that would exceed the scale values of 1,2,4 or 8.

In the second case once again SIB addressing modes can only be positive so

BASE + INDEXSCALE + DISPLACEMENT, so the negative would through it out thinking that’s a displacement then there is a reg straight after it.

Out of interest do these lines assemble anywhere for you ? I’d be curious to see what they output but I can’t imagine it’s meaningful! :)

From: gwoltman [mailto:notifications@github.com] Sent: 01 May 2017 06:18 AM To: Terraspace/HJWasm HJWasm@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [Terraspace/HJWasm] Incorrect error message (#51)

Two lines of bad code follow. The code is identical except for a unary negation operator. The first error message is clearly incorrect. lea rcx, [rcx+-4r8+64] Error A2235: Constant value too large: FFFFFFFF00000040h lea rcx, [rcx-4r8+64] ;; Next dest pointer Error A2065: Constant expected

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Terraspace/HJWasm/issues/51 , or mute the thread https://github.com/notifications/unsubscribe-auth/AQGQVHzpZyyRzNQicv1kGCP18tZRbUBaks5r1WsHgaJpZM4NM1bM .

gwoltman commented 7 years ago

Hi,

Yes, these lines should not assemble. I'm sorry I did not make that clearer.

The first error message is wrong in that hjwasm is reporting "+-r8*64" equals the constant "FFFFFFFF00000040h". The second error message isn't wrong, but the error "index multiplier must be 1, 2,4, or 8" would be better.

Again, not at all a major issue. Heck, barely even a minor issue.

Regards, George

On Mon, May 1, 2017 at 8:09 AM, John Hankinson notifications@github.com wrote:

Hi,

With regards to these I’ve not been able to make it assemble in anything as yet..

In both cases the scale is required to be positive (1,2,4,8) in SIB addressing.

In the first case I think the expression evaluator gets the right answer, but being negative complains that would exceed the scale values of 1,2,4 or 8.

In the second case once again SIB addressing modes can only be positive so

BASE + INDEXSCALE + DISPLACEMENT, so the negative would through it out thinking that’s a displacement then there is a reg straight after it.

Out of interest do these lines assemble anywhere for you ? I’d be curious to see what they output but I can’t imagine it’s meaningful! :)

From: gwoltman [mailto:notifications@github.com] Sent: 01 May 2017 06:18 AM To: Terraspace/HJWasm HJWasm@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [Terraspace/HJWasm] Incorrect error message (#51)

Two lines of bad code follow. The code is identical except for a unary negation operator. The first error message is clearly incorrect. lea rcx, [rcx+-4r8+64] Error A2235: Constant value too large: FFFFFFFF00000040h lea rcx, [rcx-4r8+64] ;; Next dest pointer Error A2065: Constant expected

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ Terraspace/HJWasm/issues/51 , or mute the thread https://github.com/ notifications/unsubscribe-auth/AQGQVHzpZyyRzNQicv1kGCP18tZRbU Baks5r1WsHgaJpZM4NM1bM .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Terraspace/HJWasm/issues/51#issuecomment-298324717, or mute the thread https://github.com/notifications/unsubscribe-auth/AVPFM8HSMwhxDZ5uBeSOS5g0nhQPuQ9cks5r1ctygaJpZM4NM1bM .

john-terraspace commented 7 years ago

Ahhh got you, I agree the error messages could be more helpful, I’ll see what we can do about it right now for 2.29, else I’ll put it on the to-do list (the never ending one ;) )

From: gwoltman [mailto:notifications@github.com] Sent: 01 May 2017 06:03 PM To: Terraspace/HJWasm HJWasm@noreply.github.com Cc: John Hankinson john@terraspace.co.uk; Comment comment@noreply.github.com Subject: Re: [Terraspace/HJWasm] Incorrect error message (#51)

Hi,

Yes, these lines should not assemble. I'm sorry I did not make that clearer.

The first error message is wrong in that hjwasm is reporting "+-r8*64" equals the constant "FFFFFFFF00000040h". The second error message isn't wrong, but the error "index multiplier must be 1, 2,4, or 8" would be better.

Again, not at all a major issue. Heck, barely even a minor issue.

Regards, George

On Mon, May 1, 2017 at 8:09 AM, John Hankinson notifications@github.com wrote:

Hi,

With regards to these I’ve not been able to make it assemble in anything as yet..

In both cases the scale is required to be positive (1,2,4,8) in SIB addressing.

In the first case I think the expression evaluator gets the right answer, but being negative complains that would exceed the scale values of 1,2,4 or 8.

In the second case once again SIB addressing modes can only be positive so

BASE + INDEXSCALE + DISPLACEMENT, so the negative would through it out thinking that’s a displacement then there is a reg straight after it.

Out of interest do these lines assemble anywhere for you ? I’d be curious to see what they output but I can’t imagine it’s meaningful! :)

From: gwoltman [mailto:notifications@github.com] Sent: 01 May 2017 06:18 AM To: Terraspace/HJWasm HJWasm@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [Terraspace/HJWasm] Incorrect error message (#51)

Two lines of bad code follow. The code is identical except for a unary negation operator. The first error message is clearly incorrect. lea rcx, [rcx+-4r8+64] Error A2235: Constant value too large: FFFFFFFF00000040h lea rcx, [rcx-4r8+64] ;; Next dest pointer Error A2065: Constant expected

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ Terraspace/HJWasm/issues/51 , or mute the thread https://github.com/ notifications/unsubscribe-auth/AQGQVHzpZyyRzNQicv1kGCP18tZRbU Baks5r1WsHgaJpZM4NM1bM .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Terraspace/HJWasm/issues/51#issuecomment-298324717, or mute the thread https://github.com/notifications/unsubscribe-auth/AVPFM8HSMwhxDZ5uBeSOS5g0nhQPuQ9cks5r1ctygaJpZM4NM1bM .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Terraspace/HJWasm/issues/51#issuecomment-298374907 , or mute the thread https://github.com/notifications/unsubscribe-auth/AQGQVFcVk5Aia4fHp7pcfu3NsToaNcqtks5r1hBYgaJpZM4NM1bM .