opcodes for movi
Hi,
I was recently frustrated by trying to get the correct opcode information to use in a MOVI instruction so I built the following table:
I am finding having this around is rather usefull. I hope is usefull to others.
Jim
I was recently frustrated by trying to get the correct opcode information to use in a MOVI instruction so I built the following table:
{{opcodeconstants.spin is a table of opcodes that can be used in conjunction with
the MOVI command for self modifing code. This table can be cut and pasted into the
spin code for a PASM object or used with the file include function of bst. }}
CON
a_ABS = $151
a_ABSNEG = $159
a_ADD = $101
a_ADDABS = $111
a_ADDS = $1a1
a_ADDSX = $1b1
a_AND = $0c1
a_ANDN = $0c9
a_call = $0b9
a_CMP = $108
a_CMPSUB = $1c1
A_CMPSX = $188
a_CMPX = $198
a_DJNZ = $1c9
A_HUBOP = $018
a_JMP = $0b8
a_jmpret = $0b9
A_LOCKCLR = $018
A_LOCKNEW = $019
A_LOCKRET = $018
A_LOCKSET = $018
A_MAX = $099
A_MAXS = $089
A_MIN = $091
A_MINS = $081
A_MOV = $141
A_MOVD = $0a9
A_MOVI = $0b1
A_MOVS = $0a1
A_MUXC = $0e1
A_MUXNC = $0e9
A_MUXNZ = $0f9
A_MUXZ = $0f1
A_NEG = $149
A_NEGC = $161
A_NEGNC = $169
A_NEGNZ = $179
A_NOP = $000
A_OR = $0d1
A_RCL = $069
A_RCR = $061
A_RDBYTE = $001
A_RDLONG = $011
A_RDWORD = $009
A_RET = $0b8
A_REV = $079
A_ROL = $049
A_ROR = $041
A_SAR = $071
A_SHL = $059
A_SHR = $051
A_SUB = $109
A_SUBABS = $119
A_SUBS = $1a9
A_SUBSX = $1b9
A_SUBX = $199
A_SUMC = $121
A_SUMNC = $129
A_SUMNZ = $139
A_TEST = $0c0
A_TJNZ = $1d0
A_TJZ = $1d8
A_WAITCNT = $1f1
A_WAITPEQ = $1e0
A_WAITPNE = $1e8
A_WAITVID = $1f8
A_WRBYTE = $000
A_WRLONG = $010
A_WRWORD = $008
A_XOR = $0d9
{ if you add the following to any of the commands you create wc,wz wcwz }
A_WC = 2
A_WZ = 4
A_WCWZ = 6
{ example mov tmp1,A_cmp
add tmp1,A_wcwz
movi loop,tmp1}
opcodeconstants.spinI am finding having this around is rather usefull. I hope is usefull to others.
Jim

