flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
JohnFound 01 Nov 2003, 14:56
eet_1024 wrote: What does ` (back tick) do? Very useful operator for some macroses. It converts name of the label to string. For example: Code: macro DispLabel lbl { display 'The label name is: ', `lbl, $0d, $0a } This macro will display the name of parameter. Look at StdCallEx in Fresh package for working example. Regards. |
|||
![]() |
|
Tomasz Grysztar 03 Nov 2003, 19:43
Yes, I've removed that fix for WDM, because I've done it different way, but I forgot to include the newer fix in the 1.49.9.3
But now you have 1.49.9.4 with both this fix and the %t timestamp support. Only section alignment for object files and the "resource from" generator are left on my TODO list for 1.50. Attachment removed - new release available in some other place. Last edited by Tomasz Grysztar on 27 Nov 2003, 20:38; edited 1 time in total |
|||
![]() |
|
Tomasz Grysztar 03 Nov 2003, 20:31
comrade wrote: I guess so, then you propose to extract day/month/year and hour/time/seconds with macro arithmetics? Yeah. ![]() Code: macro months [dayscount] { forward if DAY <= dayscount else DAY = DAY-dayscount MONTH = MONTH+1 forward end if } TIME = %T DAY = TIME/(24*3600) DAY = DAY - (DAY+365)/(3*365+366) YEAR = 1970+DAY/365 DAY = DAY mod 365 + 1 MONTH = 1 months 31,28,31,30,31,30,31,31,30,31,30,31 TIME = TIME mod (24*3600) HOUR = TIME/3600 MINUTE = (TIME mod 3600)/60 SECOND = (TIME mod 3600) mod 60 display <YEAR,10>,'-',<MONTH,10>,'-',<DAY,10>,13,10 display <HOUR,10>,':',<MINUTE,10>,':',<SECOND,10>,13,10 You need to use fasm 1.49.9.4+ and the display macro from here to compile it. (note that timestamp is UTC time) |
|||
![]() |
|
comrade 03 Nov 2003, 20:57
Cool! Thanks!
![]() ![]() ![]() |
|||
![]() |
|
Kevin_Zheng 04 Nov 2003, 02:04
Hi,Privalov:
Sorry, I found that the 1.49.4 version can't build correct wdm sys format. The complier fill the DllCharacteristics is 0 but it should be 2000h on the wdm sys format. I checked the source and found must added the code, the result file is OK. Code: mov dword [edx+14h],0E0h ; size of optional header mov dword [edx+16h],10B818Eh; flags and magic value mov dword [edx+38h],1000h ; section alignment mov dword [edx+3Ch],200h ; file alignment mov word [edx+40h],1 ; OS version mov eax,[image_base] mov dword [edx+34h],eax mov eax,[subsystem_version] mov [edx+48h],eax mov ax,[subsystem] mov [edx+5Ch],ax cmp ax,1 jne pe_alignment_ok mov eax,20h mov dword [edx+38h],eax mov dword [edx+3Ch],eax mov word [edx+5Eh],2000h ;Kevin Zheng [110403]--WDM SYS Format pe_alignment_ok: mov word [edx+1Ah],VERSION_MAJOR + VERSION_MINOR shl 8 mov dword [edx+60h],1000h ; stack reserve mov dword [edx+64h],1000h ; stack commit mov dword [edx+68h],10000h ; heap reserve mov dword [edx+6Ch],0 ; heap commit mov dword [edx+74h],16 ; number of directories bsf ecx,[edx+3Ch] imul ebx,[number_of_sections],28h add ebx,ebp dec ebx shr ebx,cl inc ebx shl ebx,cl sub ebx,ebp mov ecx,ebx mov eax,[display_buffer] sub eax,ecx cmp edi,eax jae out_of_memory shr ecx,2 xor eax,eax rep stos dword [edi] mov eax,edi sub eax,[code_start] add eax,[stub_size] mov [edx+54h],eax ; size of headers bsf ecx,[edx+38h] dec eax shr eax,cl inc eax shl eax,cl mov [edx+28h],eax ; entry point rva mov [code_type],32 or [reloc_labels],-1 mov [number_of_sections],0 lea ebx,[edx+18h+0E0h] mov [current_section],ebx mov dword [ebx],'.fla' mov dword [ebx+4],'t' mov [ebx+14h],edi mov [ebx+0Ch],eax mov dword [ebx+24h],0E0000060h neg eax add eax,edi sub eax,[edx+34h] mov [org_origin],eax mov [org_registers],0 mov [org_start],edi bt [format_flags],8 jnc instruction_assembled or dword [edx+16h],2000h cmp word [edx+5Ch],1 jne instruction_assembled or word [edx+5Eh],2000h jmp instruction_assembled fp_to_version: In the program flow, the 802 lines code should be executing. But I found that it doesn't work. why? I don't known the reason. Thanks. |
|||
![]() |
|
Tomasz Grysztar 04 Nov 2003, 06:51
You probably forgot to specify the DLL flag with "PE native" format.
|
|||
![]() |
|
Kevin_Zheng 04 Nov 2003, 08:12
Oh,yeah. The reason is I forgot to specify the DLL flag with "PE native" format. Now it is OK.
Thanks. And anothers, The syntax define is invalid: Code: FORMAT PE NATIVE 4.0 DLL AT 10000H ON 'STUB.EXE' But the define is OK: Code: FORMAT PE NATIVE DLL AT 10000H ON 'STUB.EXE' |
|||
![]() |
|
Tomasz Grysztar 04 Nov 2003, 12:16
WFM
|
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.