diff options
| author | Irene Knapp <ireneista@irenes.space> | 2026-09-10 23:40:19 -0700 |
|---|---|---|
| committer | Irene Knapp <ireneista@irenes.space> | 2026-09-10 23:40:19 -0700 |
| commit | 1b5ddcbadd1eaa0375da61a0eed0b810b239a4b4 (patch) | |
| tree | 695e60ffb1417282b6d3a372f5942c6f27ecf503 /amd64.e | |
| parent | 0ede3fcd608979edbb3a81f5da95d0bd05646ae9 (diff) | |
began to check and correct the exact hex-transformed instruction output
the checking is only a little way down the file, but there's a new feature needed, so this is being checked in now to protect the work that's already been done Force-Push: yes Change-Id: If8c29d4b417288e5cfb2aa08ce6d41adadc64279
Diffstat (limited to 'amd64.e')
| -rw-r--r-- | amd64.e | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/amd64.e b/amd64.e index e76f33a..a6503f0 100644 --- a/amd64.e +++ b/amd64.e @@ -497,8 +497,9 @@ s" :cc-greater" keyword ~ (equality result, output point) ~ If the R/M register was rsp, we need an SIB byte; otherwise, skip it. swap { - 0 4 :rsp reg64 sib + 0 4 :rsp reg64 ~ : drop-subitem + sib } if exit } if @@ -515,8 +516,9 @@ s" :cc-greater" keyword reg64 1 3unroll modrm ~ If the R/M register was rsp, we need an SIB byte; otherwise, skip it. 3roll { - 0 4 :rsp reg64 sib + 0 4 :rsp reg64 ~ : drop-subitem + sib } if ~ The displacement byte. @@ -549,8 +551,9 @@ s" :cc-greater" keyword reg64 2 3unroll modrm ~ If the R/M register was rsp, we need an SIB byte; otherwise, skip it. 3roll { - 0 4 :rsp reg64 sib + 0 4 :rsp reg64 ~ : drop-subitem + sib } if ~ The displacement value. This is subject to the same considerations as in @@ -644,10 +647,10 @@ s" :cc-greater" keyword ~ (output point, target register -- output point) : pop-reg64 - ~ : 1 # pop-reg64 + ~ : 0 # pop-reg64 reg64 0x58 opcodereg ; : pop-extrareg64 - ~ : 2 # pop-extrareg64 + ~ : 0 # pop-extrareg64 swap rex-b swap extrareg64 0x58 opcodereg ; ~ Note the use of the B rex bit here; this instruction puts the register ~ number in the opcode field, so it uses Table 3-1. @@ -728,16 +731,17 @@ s" :cc-greater" keyword ~ (output point, source register, target register -- output point) : mov-reg64-reg64 - ~ : 1 # # mov-reg64-reg64 + ~ : 1 #swap # # mov-reg64-reg64 3roll rex-w 0x89 pack8 3unroll swap reg64 swap addressing-reg64 ; : mov-indirect-reg64-reg64 - ~ : 1 # # mov-indirect-reg64-reg64 + ~ : 1 #swap # # mov-indirect-reg64-reg64 3roll rex-w 0x89 pack8 3unroll swap reg64 swap addressing-indirect-reg64 ; ~ (output point, source register, target register, target displacement value ~ -- output point) +~ TODO IAK this is where the verification is up to : mov-disp8-reg64-reg64 ~ : 1 # # # mov-disp8-reg64-reg64 4 roll rex-w 0x89 pack8 4 unroll |