Advertisement
KipIngram

Binary Reg/Reg Operations - x64

May 31st, 2023 (edited)
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. ( This is Forth code to generate instruction stream bytes for the )
  2. ( x64 architecture for register-to-register binary operations. )
  3. ( )
  4. ( The code has been tested along each "axis" - starting with )
  5. ( rax rax add and walking each term through its value sequence. )
  6. ( Items in the bulk of the matrix have only been spot checked. )
  7.  
  8. 0 const rax 1 const rcx 2 const rdx 3 const rbx
  9. 4 const rsp 5 const rbp 6 const rsi 7 const rdi
  10. 8 const r8 9 const r9 10 const r10 11 const r11
  11. 12 const r12 13 const r13 14 const r14 15 const r15
  12.  
  13. : bits> rot and swap >> or ;
  14. : <bits rot and swap << or ;
  15. : dest over 16 7 <bits swap 3 8 bits> ;
  16. : src over 19 7 <bits swap 1 8 bits> ;
  17. : inst, swap here ! allot ;
  18. : rrop builds> 11 << x:C00148 or , does> @ src dest 3 inst, ;
  19.  
  20. 0 rrop rradd 1 rrop rror 2 rrop rradc 3 rrop rrsbb
  21. 4 rrop rrand 5 rrop rrsub 6 rrop rrxor 7 rrop rrcmp
Tags: Forth
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement