Subversion Repositories Kolibri OS

Rev

Rev 220 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 220 Rev 340
Line 1... Line 1...
1
; flat assembler core
1
; flat assembler core
2
; Copyright (c) 1999-2006, Tomasz Grysztar.
2
; Copyright (c) 1999-2007, Tomasz Grysztar.
3
; All rights reserved.
3
; All rights reserved.
Line 4... Line 4...
4
 
4
 
5
simple_instruction_except64:
5
simple_instruction_except64:
6
	cmp	[code_type],64
6
	cmp	[code_type],64
Line 6342... Line 6342...
6342
	mov	cl,[postbyte_register]
6342
	mov	cl,[postbyte_register]
6343
	shl	cl,3
6343
	shl	cl,3
6344
	or	al,cl
6344
	or	al,cl
6345
	stos	word [edi]
6345
	stos	word [edi]
6346
	jmp	store_address_32bit_value
6346
      address_32bit_value:
-
 
6347
	cmp	[code_type],64
-
 
6348
	jne	store_address_32bit_value
-
 
6349
	mov	eax,edx
-
 
6350
	cdq
-
 
6351
	cmp	edx,[address_high]
-
 
6352
	jne	value_out_of_range
-
 
6353
	mov	edx,eax
-
 
6354
	jmp	store_address_32bit_value
6347
      sib_address_8bit_value:
6355
      sib_address_8bit_value:
6348
	or	al,01000000b
6356
	or	al,01000000b
6349
	mov	cl,[postbyte_register]
6357
	mov	cl,[postbyte_register]
6350
	shl	cl,3
6358
	shl	cl,3
6351
	or	al,cl
6359
	or	al,cl
Line 6372... Line 6380...
6372
	shl	cl,3
6380
	shl	cl,3
6373
	or	al,cl
6381
	or	al,cl
6374
	stos	word [edi]
6382
	stos	word [edi]
6375
	test	ch,44h
6383
	test	ch,44h
6376
	jnz	store_address_32bit_value
6384
	jnz	address_32bit_value
-
 
6385
	test	ch,88h
-
 
6386
	jnz	address_32bit_value
6377
	or	ch,ch
6387
	or	ch,ch
6378
	jnz	invalid_address_size
6388
	jnz	invalid_address_size
6379
	jmp	store_address_32bit_value
6389
	jmp	address_32bit_value
6380
      zero_index_register:
6390
      zero_index_register:
6381
	mov	bl,4
6391
	mov	bl,4
6382
	mov	cl,1
6392
	mov	cl,1
6383
	jmp	base_and_index
6393
	jmp	base_and_index
6384
      only_base_register:
6394
      only_base_register:
6385
	mov	al,bh
6395
	mov	al,bh
Line 6403... Line 6413...
6403
	mov	cl,[postbyte_register]
6413
	mov	cl,[postbyte_register]
6404
	shl	cl,3
6414
	shl	cl,3
6405
	or	al,cl
6415
	or	al,cl
6406
	stos	byte [edi]
6416
	stos	byte [edi]
6407
	jmp	store_address_32bit_value
6417
	jmp	address_32bit_value
6408
      simple_address_8bit_value:
6418
      simple_address_8bit_value:
6409
	or	al,01000000b
6419
	or	al,01000000b
6410
	mov	cl,[postbyte_register]
6420
	mov	cl,[postbyte_register]
6411
	shl	cl,3
6421
	shl	cl,3
6412
	or	al,cl
6422
	or	al,cl
6413
	stos	byte [edi]
6423
	stos	byte [edi]
Line 6450... Line 6460...
6450
	test	ch,0F0h
6460
	test	ch,0F0h
6451
	jz	address_32bit_relocation_ok
6461
	jz	address_32bit_relocation_ok
6452
	mov	eax,ecx
6462
	mov	eax,ecx
6453
	shr	eax,16
6463
	shr	eax,16
6454
	xchg	[value_type],al
6464
	cmp	al,4
-
 
6465
	jne	address_32bit_relocation
-
 
6466
	mov	al,2
-
 
6467
      address_32bit_relocation:
-
 
6468
	xchg	[value_type],al
6455
	mov	ebx,[address_symbol]
6469
	mov	ebx,[address_symbol]
6456
	xchg	ebx,[symbol_identifier]
6470
	xchg	ebx,[symbol_identifier]
6457
	call	mark_relocation
6471
	call	mark_relocation
6458
	mov	[value_type],al
6472
	mov	[value_type],al
6459
	mov	[symbol_identifier],ebx
6473
	mov	[symbol_identifier],ebx