Специфичность этого ассемблера, например, в том, что
- порядок вычислений слева направо без учёта приоритетов, как в С--
2 + 3 * 4 будет вычислено как (2 + 3) * 4, результат 20; - не нужно объявлять внешние символы как extern, например, успешно скомпилируется
mov eax, [X]
даже если X нигде не объявлено, это только линкер потом скажет что-то типа "undefined reference"
Поэтому можно спокойно написать нигде не объявляя процедуру DrawWindowиз плюсов: меньше писать кодаCode: Select all
Invoke DrawWindow, [Window.Left], [Window.Top], [Window.Right], [Window.Bottom], Offset szHello, WINDOW_COLOR, WS_SKINNED_FIXED | WS_COORD_CLIENT | WS_CAPTION, CS_MOVABLE
из минусов: нет контроля передаваемых параметров - так как ассемблер разработан специально для Windows, то считается, что все процедуры StdCall(а для 64 bit FastCall).
- для улучшения читаемости кода используются так называемые индикаторы направления, используемые совместно с jump-инструкциями
Code: Select all
JZ >forward_label JMP <backward_label
- безымянная метка это просто двоеточие, также используется индикатор направления
Code: Select all
CMP EAX,EDX JZ > CALL PROCESS : RET
GoAsm можно скачать тут http://www.godevtool.com
KolibriOS.Lib можно взять из темы Delphi7 examples http://board.kolibrios.org/viewtopic.php?f=33&t=3469
Только почему-то линкер выдаёт warnings:
Скриншот тестового приложения:LD: Warning: type of symbol `GetSkinHeight' changed from 8192 to 32
LD: Warning: type of symbol `WaitEvent' changed from 8192 to 32
LD: Warning: type of symbol `BeginDraw' changed from 8192 to 32
LD: Warning: type of symbol `DrawText' changed from 8192 to 32
LD: Warning: type of symbol `GetButton' changed from 8192 to 32