From 5a99431c56875937d370784423acf2ded04e9465 Mon Sep 17 00:00:00 2001
From: jdh8d <jdh8d@git.zephyr-software.com>
Date: Wed, 29 Jul 2015 14:26:39 +0000
Subject: [PATCH] Former-commit-id: ea50cbea6d3d6dd0f341dde51592eb91f3f398ad

---
 include/interfaces/irdb/STARSOp.h | 54 +++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/include/interfaces/irdb/STARSOp.h b/include/interfaces/irdb/STARSOp.h
index 4fc6414e..dc698107 100644
--- a/include/interfaces/irdb/STARSOp.h
+++ b/include/interfaces/irdb/STARSOp.h
@@ -34,18 +34,72 @@ class STARS_IRDB_op_t : public STARS_op_t
 		virtual bool operator<(const STARS_op_t &rOp) const { assert(0); } // Less-than operator for use in STL ordered containers, e.g. sets.
 
 		// Get methods
+
+// maybe convert Set/GetOpGlobalIndex to take/return a typedef.
+//typedef unsigned int SSANameIndex_t
+
+		// Get/SetOpGlobalIndex just needs to record a unsigned int so clone can copy it.
 		virtual unsigned int GetOpGlobalIndex(void) const { assert(0); } // Get STARS SSA name index.
+
+		// e.g. mov [eax+addr], 0 		==> return addr, assert
+		// e.g. mov [eax+ebx+8+addr], 0 	==> return addr, assert
+		// e.g. jeq +5 				==> 0x8048005 
+		// e.g. jmp +5 				==> 0x8048005 
+		// e.g. mov eax <- 0x8048f00 		==> assert, assert
+		// e.g. call +5 			==> 0x8048005
+		// e.g. mov [0x8048f00] <- eax 		==> 0x8048f00, assert
+		// e.g. mov fs:[0x8048f00], eax 	==> 0x8048f00, assert
+		// e.g. lea eax <- [0x8048f00] 		==> assert, 0x8048f00
+		// e.g. mov eax <- 0x8048f00 		==> assert, assert
+		// e.g. inc eax 			==> assert
 		virtual STARS_ea_t GetAddr(void) const { assert(0); }
+
+		// should be straightforward enough.
+		// jmp +5 ==> return o_near
+		// mov [ebx+ecx*4+40],0  ==> return STARS_o_displ, STARS_o_imm
+		// mov [ebx+ecx*4],rax  ==> return STARS_o_phrase, STARS_o_reg
+		// mov [ebx], reg  ==> return STARS_o_phrase, STARS_o_reg
+		// mov [ebx+40],imm  ==> return STARS_o_displ, STARS_o_imm
+		// mov [0x8048f040], 0  ==> return STARS_o_mem, STARS_o_imm
+		// mov mm0, [mem]	==> return STARS_o_mmxreg, STARS_o_phrase
+		// mov xmm0, [mem]	==> return STARS_o_xmmreg, STARS_o_phrase
+		// mov ymm0, [mem]	==> return o_ymmreg, o_phrase
+		// also see intel.hpp:56 for o_trreg, o_crreg, o_dbreg, o_fpreg.
 		virtual unsigned char GetOpType(void) const { assert(0); } // Get type o_reg, o_displ, etc.
+
+		
+		// STARS_x86_R_al
+		// STARS_x86_R_ah
+		// STARS_x86_R_ax	(means ax, eax, rax)
+		// STARS_x86_R_mm0	
+		// STARS_x86_R_xmm0	
+		// STARS_x86_R_ymm0	
+		// STARS_x86_R_st0 	(fp stack reg 0)
+		// probably also CR, TR, and DB regs.  
+		// seg registers aren't 
+		// see STARSTypes.h: enum STARS_RegNo
 		virtual uint16_t GetReg(void) const { assert(0); }  // Get reg field of operand, whether it is an addressing reg or directly used reg in register operand
+
+		// mov fs:[0x80481234], eax ==> return seg_fs, assert.
 		virtual uint16_t GetSegReg(void) const { assert(0); } // Get segment register of operand; R_none if no segment register
+
+		// return SIB byte if exists.
 		virtual char GetSIB(void) const { assert(0); } // Get x86 SIB byte (dense encoding of base reg, index reg, and scale factor)
 		virtual int MDGetSIBBaseReg(void) const { assert(0); } // Get x86 SIB byte base register
 		virtual short MDGetSIBIndexReg(void) const { assert(0); } // Get x86 SIB byte index register
 		virtual int GetSIBScaleFactor(void) const { assert(0); } // Extract scale factor from SIB byte
+
+		// clc to investigate removing need for this function in base class
+		// probably will still use in STARS_IDA_Op_t.
 		virtual char GetSpecFlag4(void) const { assert(0); } // Get specflag4 byte, used to hold a copy of the auxpref byte in x86-64 programs.
 		virtual STARS_uval_t GetImmedValue(void) const { assert(0); } // Get value field for immediate operands; uint32 for x86-32, uint64 for x86-64
+
+		// return STARS_dt_byte, etc.
+		// see STARSTypes.h:112
+		// probably don't need it.
 		virtual char GetOpDtyp(void) const { assert(0); }  // Get field that determines byte width
+
+		// return 1, 2, 4, 8, 16, etc.
 		virtual uint16_t GetByteWidth(void) const { assert(0); }
 
 		// Set methods
-- 
GitLab