My x86_64 knowledge is nearly non existant, but im wondering how does a CPU know the difference between say db 177
and mov cl, <value>
even though they have the same binary (the only difference being that <value>
is added after the mov
instruction)?
Asked
Active
Viewed 28 times
0

destructioneer
- 150
- 1
- 10

Cezarhg2007
- 63
- 6
-
1Those asm source lines assemble to the same machine code, so there is no difference for the CPU. You can use `db` to put manually encoded machine-code into your program. (And if you aren't doing that, don't put data where it will get executed as code: [Segmentation fault when using DB (define byte) inside a function](https://stackoverflow.com/q/55642600)) – Peter Cordes Jul 29 '23 at 20:17
-
@destructioneer - if you're going to make minor edits for capitalization and spelling, please also look at the tags and whether they're missing anything, especially if you're doing it without 2k rep so the edit has to go through the review queue. In this case, [x86-64] or [x86] are needed at a minimum, as mentioned in the mouseover tag info for [assembly]. I might also tag [machine-code] or [cpu-architecture]. I'd have done it myself but I'm mostly [on strike](https://meta.stackexchange.com/questions/389811/moderation-strike-stack-overflow-inc-cannot-consistently-ignore-mistreat-an). – Peter Cordes Jul 31 '23 at 18:43