Terraspace / UASM

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

cmp qword ptr [64bitregister], "string" #99

Closed exit2 closed 3 years ago

exit2 commented 5 years ago

If I use instruction like: cmp qword ptr [rax], "12345678" UASM doesn't compile it. I think it is correct, because such instruction doesn't exists.

cmp qword ptr [rax], "1234" UASM compile this instruction. But I think it will be better if compiler display warning (not error). Because I think if someone using such instruction it is 99% mistake and warning will be great. I am talking about use with string.

john-terraspace commented 5 years ago

Hi,

Agreed, the string is basically converted into a 32bit number, in the 2nd case I assume the immediate value is small enough to be sign extended to allow the cmp. In the first the value must too great,

Not sure off-hand what “12345678” turns to .. but it would make sense to have a warning if the immediate data is too large.

From: exit2 notifications@github.com Sent: 22 March 2019 13:56 To: Terraspace/UASM UASM@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [Terraspace/UASM] cmp qword ptr [64bitregister], "string" (#99)

If I use instruction like: cmp qword ptr [rax], "12345678" UASM doesn't compile it. I think it is correct, because such instruction doesn't exists.

cmp qword ptr [rax], "1234" UASM compile this instruction. But I think it will be better if compiler display warning (not error). Because I think if someone using such instruction it is 99% mistake and warning will be great. I am talking about use with string.

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

john-terraspace commented 5 years ago

Immediate data being too large will generate an error, warning for valid sized conversion of string immediate data is going to cause some come backs with a lot of legacy code that does this already and doesn't show any warnings, so at the moment I'm not too inclined to change the behaviour.