flat assembler, the next generation

Check-in [7f73ae3a29]
Login
Overview
Comment:minor correction in x64 macros
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:7f73ae3a2929a298332e391138035860aebe5ef1
User & Date: Tomasz on 2017-05-07 21:48:29
Other Links: manifest | tags
Context
2017-05-08
15:07
minor corrections in x86 macros check-in: f986a2d540 user: Tomasz tags: trunk
2017-05-07
21:48
minor correction in x64 macros check-in: 7f73ae3a29 user: Tomasz tags: trunk
2017-05-06
09:01
corrections in x86 macros check-in: 78eacec1c9 user: Tomasz tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Modified examples/x86/include/x64.inc from [d8dba6cb08] to [716dd1366e].

151
152
153
154
155
156
157
158
159
160
161
162



163
164
165
166
167
168
169
170
171
172
173
174
...
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
		ns.mod = 0
		if x86.mode = 64
			ns.displacement_size = 4
			if ns.mode = 0
				ns.mode = 64
				ns.rm = 5
				ns.auto_relative = 1
			else if ns.mode < 64
				ns.rm = 4
				ns.base = 5
				ns.index = 4
				ns.scale = 1



				if ~ ns.displacement relativeto 0 | ns.displacement < 80000000h
					ns.mode = 64
				end if
			else
				ns.displacement_size = 8
			end if
		else
			if ns.mode = 0
				ns.mode = x86.mode
				if ns.mode = 16 & ns.displacement relativeto 0 & ns.displacement >= 10000h
					ns.mode = 32
				end if
................................................................................
			if rm_operand.displacement - 1 shl 64 >= -80000000h & rm_operand.displacement < 1 shl 64
				rm_operand.displacement = rm_operand.displacement - 1 shl 64
			else if rm_operand.displacement < -80000000h | rm_operand.displacement >= 80000000h
				err 'address value out of signed range'
			end if
		end if
		dd rm_operand.displacement
	else if rm_operand.displacement_size = 8
		err 'long address not encodable'
	end if
	if imm_size = 1
		db imm
	else if imm_size = 2
		dw imm
	else if imm_size = 4
		dd imm







|




>
>
>




|







 







<
<







151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
...
535
536
537
538
539
540
541


542
543
544
545
546
547
548
		ns.mod = 0
		if x86.mode = 64
			ns.displacement_size = 4
			if ns.mode = 0
				ns.mode = 64
				ns.rm = 5
				ns.auto_relative = 1
			else if ns.mode > 16
				ns.rm = 4
				ns.base = 5
				ns.index = 4
				ns.scale = 1
				if ns.mode = 32 & ns.displacement relativeto 0
					ns.displacement = ns.displacement and 0FFFFFFFFh
				end if
				if ~ ns.displacement relativeto 0 | ns.displacement < 80000000h
					ns.mode = 64
				end if
			else
				err 'invalid size of address value'
			end if
		else
			if ns.mode = 0
				ns.mode = x86.mode
				if ns.mode = 16 & ns.displacement relativeto 0 & ns.displacement >= 10000h
					ns.mode = 32
				end if
................................................................................
			if rm_operand.displacement - 1 shl 64 >= -80000000h & rm_operand.displacement < 1 shl 64
				rm_operand.displacement = rm_operand.displacement - 1 shl 64
			else if rm_operand.displacement < -80000000h | rm_operand.displacement >= 80000000h
				err 'address value out of signed range'
			end if
		end if
		dd rm_operand.displacement


	end if
	if imm_size = 1
		db imm
	else if imm_size = 2
		dw imm
	else if imm_size = 4
		dd imm