flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Combined stdcall and invoke macros to one |
Author |
|
Kevin_Zheng 19 Aug 2005, 10:47
Dear All:
I've come back, now. Last year, I can't access fasm network address because China CNIC blocked this address. I have to use proxy server to access it. On the Flat assember 1.64 and previous versions, we have to use stdcall and invoke for invoking other sub-routines. Why don't we combine it to alone one? The simplest is the best method. I write some of macros and it worked normally. Code: IMAGE_ORDINAL_FLAG32 = 80000000h macro import name,[label,string] { common name#.lookup: forward if used label if string eqtype '' local _label dd RVA _label else dd IMAGE_ORDINAL_FLAG32 + string end if API.#label = 1 end if common if $ > name#.lookup name#.redundant = 0 dd 0 else name#.redundant = 1 end if name#.address: forward if used label if string eqtype '' label dd RVA _label else label dd 80000000h + string end if end if common if ~ name#.redundant dd 0 end if forward if used label & string eqtype '' _label dw 0 db string,0 end if } ;============================================================================ ; It's used for call "stdcall" type procedure. ; If arg is a char, it should be complied the instruction" pushw arg or pushd arg" ; else if arg is a string, it should be complied the instruction "call @f ; db arg,0 ; @@: " macro call proc,[arg] { common get_seg_attr reverse local .str_param if arg eq else if arg eqtype "" call .str_param db arg,0 .str_param: else if attr@seg=..use16 pushw arg else pushd arg end if end if common call proc } ; It's used for call "standcall" type procedure and API. macro stdcall proc,[arg] { common if defined API.#proc call [proc],arg else call proc,arg end if } Do you think it? Kevin Zheng August 19th,2005
|
|||||||||||
19 Aug 2005, 10:47 |
|
pelaillo 19 Aug 2005, 12:37
Welcome back Kevin_Zheng
|
|||
19 Aug 2005, 12:37 |
|
madmatt 19 Aug 2005, 22:36
Glad you could make it back! Lots of exciting things happening in Fasm land. This is an interesting macro, there was more than a few times I wished the two were one. I'll give this a try. thanks for the Macro.
MadMatt |
|||
19 Aug 2005, 22:36 |
|
madmatt 19 Aug 2005, 22:48
Here's a welcome back for you, this macro gives me an error in the call macro: get_seg_attr - "illegal instruction error"
|
|||
19 Aug 2005, 22:48 |
|
Kevin_Zheng 22 Aug 2005, 01:21
Hi, Madmatt:
Please see the attached file proc.inc on package private.zip, you can find the macro "get_seg_attr". And others, I extended the call,ccall, proc and enp macro defines, it can use on win32, 32 bit linux and dos platform. Please see the demo source code (template.zip and dos_seg.zip). In the future, I think that it should use on win64 and linux64 platforms. Other friends: Thank you very much. Kevin Zheng August 22th,2005
|
|||||||||||||||||||||||||||||||
22 Aug 2005, 01:21 |
|
tom tobias 22 Aug 2005, 18:18
Hi Kevin, glad to read of your return.
Gosh, WHY is FASM blocked in ZG? I tried so hard, FOR MONTHS, last year, to discover WHY FASM was blocked, and I just met with one denial after another. The most frustrating part was that for my first few days in ZG, I had access to an UNRESTRICTED, UNFILTERED line, so that I COULD receive FASM, even in a backwoods province in the hinterlands, but then, after I criticised Stalin as a mass murderer, the filters were applied, and FASM disappeared. I kept asking various government representatives, wherever I went, including BeiJing, but I never found anyone who could explain why FASM was blocked. The concept of blocking a site is so ALIEN to the philosophy of the internet, I can't imagine what rationale the CCP has for denying Chinese people the opportunity to learn about FASM. My difficult experience in ZG left me filled with admiration for you and your several colleagues who have NEVERTHELESS succeeded, despite living in such a hostile environment, which still considers Stalin a hero. Europeans, and others on this forum HAVE NO IDEA how difficult it is for Chinese programmers. The problem is not SIMPLY government suppression of FASM, it is also the entire culture, which is DEVOTED to the concept of both restricting personal freedom, and insisting on mediocrity, in every domain, in every component of society. I visited one university's computer science department: All the university students there were busy watching CARTOONS, not programming. These cartoons were appropriate for children, perhaps age 7, or 8. In Russia, such kids are studying assembly language programming. In USA and China, kids, AND adults, are busy watching such mind numbing nonsense--the cartoons were childish and stupid 50 years ago, when first created, in Hollywood. Today they are just silly, and completely inappropriate for university students anywhere. I asked them (maybe 100 or so undergraduate students, i.e. a SMALL group, by Chinese standards) whether or not any of them ever used assembly language. Answer: no idea. What's that? They really had no interest in my questions, (I had interrupted their close attention to the cartoons), so it wasn't just a problem of FASM being unavailable, and the students being uninformed, it is also a CULTURAL attitude. Of the 30 faculty members I met, in that department, only ONE guy had the slightest notion of programming in Assembly language. Blocking FASM, for those students and faculty at that university, was irrelevant. I guess I would feel the same way if someone asked me incredulously how it was possible to live one's life absent Chinese television. Since I have no interest in Chinese television, if some government blocks my reception of it, then, how is it harming anyone? That explanation, seemed to be the generally accepted opinion, whenever I raised the question of FASM. I mentioned Menuet, again, zero interest. I hope, Kevin, you will be promoted within the CCP soon, so that there will be someone in ZG who understands FASM's potential contribution. Regards, tom |
|||
22 Aug 2005, 18:18 |
|
comrade 22 Aug 2005, 19:06
STALIN IS GREAT
|
|||
22 Aug 2005, 19:06 |
|
Kevin_Zheng 23 Aug 2005, 01:50
Hi, Tom:
I think that I have to tell you this rule: This is a technology forum. Please don't talk any topics without related technologies in this forum. There are serval cultures on this world, I think that all of people in this earth is equal, they have right to select their belief. Thank you. Kevin Zheng August,23th,2005 |
|||
23 Aug 2005, 01:50 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.