Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Прочее";
Текущий архив: 2006.12.24;
Скачать: [xml.tar.bz2];

Вниз

delphi 2006 и 64 бита   Найти похожие ветки 

 
vrem   (2006-12-03 15:38) [0]

Хочется поупражняться с asm вставками, причём что бы asm в них был 64-битный, никаких изворотов, только регистры и математические операции. Возможно ли это в сабже? есть примеры?
p.s. я тут теперь и 64 бита и сабж на DVD купил, за 35 рублей на распродаже :)


 
Eraser ©   (2006-12-03 15:39) [1]

> [0] vrem   (03.12.06 15:38)

к сожалению BDS2006 не поддерживает 64бита.. если .NET не считать конечно.


 
vrem   (2006-12-03 15:50) [2]

а если не напрямую, а например "mov (набор кодовых слов)", а компилятор видя это пишет "mov (64 битный регистр)"?


 
Eraser ©   (2006-12-03 16:06) [3]

> [2] vrem   (03.12.06 15:50)

дык у 64 битного исполняемого (PE) файла совершенно другой формат. В 32 разрядный PE вроде нельзя всунуть 64 разрядный код.


 
oxffff ©   (2006-12-03 17:25) [4]


> Eraser ©   (03.12.06 16:06) [3]
> > [2] vrem   (03.12.06 15:50)
>
> дык у 64 битного исполняемого (PE) файла совершенно другой
> формат. В 32 разрядный PE вроде нельзя всунуть 64 разрядный
> код.


Код всунуть можно, никто не мешает.


 
oxffff ©   (2006-12-03 17:43) [5]

Только возникнет исключение процессора скорее всего 6 #UD(Invalid Opcode).


 
vrem   (2006-12-03 18:05) [6]

может кто то придумал как без исключений сделать?
64 бит это же больше и круче! :)


 
Eraser ©   (2006-12-03 18:10) [7]

> [6] vrem   (03.12.06 18:05)

скорее всего как-то можно режим процессора переключить.., только все таки сомневаюсь, что 32 компилятор понимает 64 разрядные команды и регистры :)
но если хочется "больше и круче" почему бы не использовать полноценный 64 разрядный компилятор от MS?


 
Anatoly Podgoretsky ©   (2006-12-03 18:20) [8]

Eraser ©   (03.12.06 18:10) [7]
Компилятор понимает все, что ему дашь, давай db коды


 
Eraser ©   (2006-12-03 18:33) [9]

> [8] Anatoly Podgoretsky ©   (03.12.06 18:20)

ну я имелл ввиду ассемблерные команды )


 
Anatoly Podgoretsky ©   (2006-12-03 19:02) [10]

> Eraser  (03.12.2006 18:33:09)  [9]

Ну вообще то это тоже ассемблерные команды.


 
vrem   (2006-12-03 19:05) [11]

Anatoly Podgoretsky
А пример хоть небольшой покажите?
Если во вставке коды писать разве не будет орфоошибки синтаксиса?


 
oxffff ©   (2006-12-03 19:09) [12]

>Eraser ©   (03.12.06 18:10) [7]
> [6] vrem   (03.12.06 18:05)
>скорее всего как-то можно режим процессора переключить..,

А вот это нельзя в 3 кольце.

>vrem   (03.12.06 18:05) [6]
>может кто то придумал как без исключений сделать?
>64 бит это же больше и круче! :)

А у тебя какая задача?
Математика? так SSE тебе в помощь


 
Чапаев ©   (2006-12-03 19:23) [13]

> >скорее всего как-то можно режим процессора переключить..,
> А вот это нельзя в 3 кольце.
При чём тут режимы, кольца? Для "переключения" между 16- и 32-битными "режимами" были префиксы замены разрядности операнда/адреса. Для переключения 32/64 точно так же, насколько я знаю.


 
vrem   (2006-12-03 19:27) [14]

знаешь сам - скажи пример!


 
Eraser ©   (2006-12-03 19:27) [15]

> [10] Anatoly Podgoretsky ©   (03.12.06 19:02)

такими ассемблерными командами не интересно )


 
Чапаев ©   (2006-12-03 19:34) [16]

> [14] vrem   (03.12.06 19:27)
Конкретных опкодов не знаю.


 
oxffff ©   (2006-12-03 19:42) [17]

Чапаев ©   (03.12.06 19:23) [13]
> >скорее всего как-то можно режим процессора переключить..,
> А вот это нельзя в 3 кольце.
При чём тут режимы, кольца? Для "переключения" между 16- и 32-битными "режимами" были префиксы замены разрядности операнда/адреса. Для переключения 32/64 точно так же, насколько я знаю.

Зачем спорить.

The memory-management functions differ, depending on the
submode, as follows:
�� Protected Mode—Protected mode supports 16-bit and 32-bit
programs with table-based memory segmentation, paging,
and privilege-checking. The segmentation function takes 32-
bit effective addresses and 16-bit segment selectors and
produces 32-bit linear addresses into one of 16K memory
segments, each of which can be up to 4GB in size. Paging is
optional. The 32-bit physical addresses are either produced
by the paging function or the linear addresses are used
without modification as physical addresses.
�� Virtual-8086 Mode—Virtual-8086 mode supports 16-bit
programs running as tasks under protected mode. 20-bit
linear addresses are formed in the same way as in real mode,
but they can optionally be translated through the paging
function to form 32-bit physical addresses that access up to
4GB of memory space.
�� Real Mode—Real mode supports 16-bit programs using
register-based shift-and-add segmentation, but it does not
support paging. Sixteen-bit effective addresses are zeroextended
and added to a 16-bit segment-base address that is
left-shifted four bits, producing a 20-bit linear address. The
linear address is zero-extended to a 32-bit physical address
that can access up to 1MB of memory space.

64-bit mode—This mode uses a flat segmentation model of
virtual memory. The 64-bit virtual-memory space is treated
as a single, flat (unsegmented) address space. Program
addresses access locations that can be anywhere in the
linear 64-bit address space. The operating system can use
separate selectors for code, stack, and data segments for
memory-protection purposes, but the base address of all
these segments is always 0. (For an exception to this general
rule, see “FS and GS as Base of Address Calculation” on
page 20.)
�� Compatibility mode—This mode uses a protected, multisegment
model of virtual memory, just as in legacy
protected mode. The 32-bit virtual-memory space is treated
as a segmented set of address spaces for code, stack, and
data segments, each with its own base address and
protection parameters. A segmented space is specified by
adding a segment selector to an address.


 
oxffff ©   (2006-12-03 19:44) [18]


> Чапаев ©   (03.12.06 19:23) [13]
> > >скорее всего как-то можно режим процессора переключить.
> .,
> > А вот это нельзя в 3 кольце.
> При чём тут режимы, кольца? Для "переключения" между 16-
>  и 32-битными "режимами" были префиксы замены разрядности
> операнда/адреса. Для переключения 32/64 точно так же, насколько
> я знаю.


Так что если Protected Mode(32 бита) будешь использовать префиксы замены разрядности операнда/адреса (64бита) получишь исключение процессора.


 
vrem   (2006-12-03 19:51) [19]

[18] oxffff ©   (03.12.06 19:44)
а если windows 64 бита? для 32 битных программ что то вроде виртуальной машины эмулируется, а так всё 64 битное!


 
oxffff ©   (2006-12-03 19:57) [20]

vrem   (03.12.06 19:51) [19]
[18] oxffff ©   (03.12.06 19:44)
а если windows 64 бита? для 32 битных программ что то вроде виртуальной машины эмулируется, а так всё 64 битное!

Programs provide effective addresses to the hardware prior to
segmentation and paging translations. Long-mode effective
addresses are a maximum of 64 bits wide, as shown in Figure 2-3
on page 14. Programs running in compatibility mode generate
(by default) 32-bit effective addresses, which the hardware zeroextends
to 64 bits. Legacy-mode effective addresses, with no
address-size override, are 32 or 16 bits wide, as shown in
Figure 2-4. These sizes can be overridden with an address-size
instruction prefix, as described in “Instruction Prefixes” on
page 87.

In 64-bit mode, with no address-size override, the size of
effective-address calculations is 64 bits. An effective-address
calculation uses 64-bit base and index registers and signextends
displacements to 64 bits. Due to the flat address space
in 64-bit mode, virtual addresses are equal to effective
addresses. (For an exception to this general rule, see “FS and
GS as Base of Address Calculation” on page 20.)
Long-Mode Zero-Extension of 16-Bit and 32-Bit Addresses. In long mode,
all 16-bit and 32-bit address calculations are zero-extended to
form 64-bit addresses. Address calculations are first truncated
to the effective-address size of the current mode (64-bit mode or
compatibility mode), as overridden by any address-size prefix.
The result is then zero-extended to the full 64-bit address width.
Because of this, 16-bit and 32-bit applications running in
compatibility mode can access only the low 4GB of the longmode
virtual-address space. Likewise, a 32-bit address
generated in 64-bit mode can access only the low 4GB of the
long-mode virtual-address space.
Displacements and Immediates. In general, the maximum size of
address displacements and immediate operands is 32 bits. They
can be 8, 16, or 32 bits in size, depending on the instruction or,
for displacements, the effective address size. In 64-bit mode,
displacements are sign-extended to 64 bits during use, but their
actual size (for value representation) remains a maximum of 32
bits. The same is true for immediates in 64-bit mode, when the
operand size is 64 bits. However, support is provided in 64-bit
mode for some 64-bit displacement and immediate forms of the
MOV instruction.


 
oxffff ©   (2006-12-03 20:01) [21]

64-Bit Mode - 64 бита
Compatibility Mode только 32 и 16


 
oxffff ©   (2006-12-03 20:08) [22]

In 64-bit mode, the default address size is 64
bits. The address size can be overridden to 32 bits. 16-bit
addresses are not supported in 64-bit mode. In compatibility
mode, the address-size prefix works the same as in the legacy
x86 architecture.



Страницы: 1 вся ветка

Форум: "Прочее";
Текущий архив: 2006.12.24;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.5 MB
Время: 0.04 c
15-1164981137
tesseract
2006-12-01 16:52
2006.12.24
Гм, гредёт новый виток беспорядков?


4-1155972674
Handle
2006-08-19 11:31
2006.12.24
TSysListView32


2-1165090318
sat
2006-12-02 23:11
2006.12.24
списки


15-1165203395
Slider007
2006-12-04 06:36
2006.12.24
С днем рождения ! 3 декабря


6-1154406596
Тореро
2006-08-01 08:29
2006.12.24
Калькуляция TCP-чексуммы





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский