Author Topic: joke  (Read 7365 times)

Mikl__

  • Member
  • ****
  • Posts: 794
joke
« on: February 15, 2018, 02:01:17 PM »
Code: [Select]
format PE GUI
include 'win32ax.inc'
; import data in the same section
   invoke MessageBox,NULL,wText1,wTitle,MB_OK
   retn
wTitle db   'Iczelion Tutorial #2:MessageBox',0
wText1 db 87,105,110,51,50,32,65,115,115,101,109,98,108,121,32,119
db 105,116,104,32,77,65,83,77,32,105,115,32,71,114,101,97,116,33,10
wText2 dw 26967, 13166, 8242, 29505, 25971, 25197, 31084, 30496, 29801
dw 8296, 16717, 19795, 26912, 8307, 29255, 24933, 8564, 3338
wText3 dd 5.55095E-8,1.5300999E31,1.0947971E21,3.2548056E33
dd 1.9689681E-19,2.21516896E8,2.0617684E-19,2.6453368E20,4.25648E-31
wText4 dq 8304954587831232855, 8583994396182930803, 5571868963499439209,7018141244139464992,8564
data import
 library user32,'USER32.DLL'
 import user32,\
        MessageBox,'MessageBoxA'
end data
Let's try to compile and run Find the word "FASM"
« Last Edit: February 15, 2018, 04:49:18 PM by Mikl__ »

jj2007

  • Member
  • *****
  • Posts: 10018
  • Assembler is fun ;-)
    • MasmBasic
Re: joke
« Reply #1 on: February 15, 2018, 02:41:13 PM »
For known reasons, I prefer a MACRO assembler - UAsm rocks :P

Mikl__

  • Member
  • ****
  • Posts: 794
Re: joke
« Reply #2 on: February 15, 2018, 04:30:16 PM »
Ciao, jj2007!
I prefer MACRO assembler too

AW

  • Member
  • *****
  • Posts: 2549
  • Let's Make ASM Great Again!
Re: joke
« Reply #3 on: February 15, 2018, 06:17:31 PM »
As far as I know all current assemblers support macros.  :dazzled:

jj2007

  • Member
  • *****
  • Posts: 10018
  • Assembler is fun ;-)
    • MasmBasic
Re: joke
« Reply #4 on: February 15, 2018, 06:37:38 PM »
Try a simple print str$(ecx) with FASM or NASM...

AW

  • Member
  • *****
  • Posts: 2549
  • Let's Make ASM Great Again!
Re: joke
« Reply #5 on: February 15, 2018, 07:43:02 PM »
Have you searched the web and did not find the answer, do you believe that such a macro is particularly difficult, or both?

PS:
I believe the answer is "both", but a simple search gave me this:
https://board.flatassembler.net/topic.php?t=9605

caballero

  • Member
  • *****
  • Posts: 1287
  • Matrix - Noah
    • abre ojos ensamblador
Re: joke
« Reply #6 on: February 15, 2018, 07:53:24 PM »
No time to see it now, but the capabilities of fasm and nasm for macros are out of any doubt.

Regarding Mikl__ example, it's nice. Just bear in mind that ascii text is also (byte) numbers. I guess that it's just and example of encoding ascii in numbers, each line I guess ended in CR and the final text ending in '0' that is 30h. :t
The logic of the error is hidden among the most unexpected lines of the program

jj2007

  • Member
  • *****
  • Posts: 10018
  • Assembler is fun ;-)
    • MasmBasic
Re: joke
« Reply #7 on: February 15, 2018, 08:26:24 PM »
Have you searched the web and did not find the answer, do you believe that such a macro is particularly difficult, or both?

PS:
I believe the answer is "both", but a simple search gave me this:
https://board.flatassembler.net/topic.php?t=9605

FASM macros can do print eax, but they can't do print str$(eax).

Other example, the rv() macro:
Code: [Select]
include \masm32\include\masm32rt.inc

.code
start:
  .if rv(exist, "somefile.txt")
print "yeah"
  .else
print "nooo"
  .endif
  exit

end start

Show me how to do that in FASM or NASM, and I will keep my mouth shut 8)

P.S.:
Quote
inlining the macros is something against the fasm's concept

AW

  • Member
  • *****
  • Posts: 2549
  • Let's Make ASM Great Again!
Re: joke
« Reply #8 on: February 15, 2018, 08:32:34 PM »
 :badgrin: :badgrin:
Unless the post has been changed in the meantime what I read was that "The arguments can be combined, and if the exact same arguments has been used before, print will recognise it and reuse the data (which may not always be the best thing to do)."

Quote
Show me how to do that in FASM or NASM, and I will keep my mouth shut
Currently, I am not accepting free work-to-order assignments, but of course, I could do it if I really wanted to do it.  :biggrin:

jj2007

  • Member
  • *****
  • Posts: 10018
  • Assembler is fun ;-)
    • MasmBasic
Re: joke
« Reply #9 on: February 15, 2018, 08:38:56 PM »
Unless the post has been changed in the meantime what I read was that "The arguments can be combined, and if the exact same arguments has been used before, print will recognise it and reuse the data (which may not always be the best thing to do)."

Whose post? I certainly did not write that. Btw Print does reuse the data (and I can't imagine a case where this would not be the best thing to do).

Quote
I could do it if I really wanted to do it.  :biggrin:

Well, not with FASM - see my P.S. above 8)

AW

  • Member
  • *****
  • Posts: 2549
  • Let's Make ASM Great Again!
Re: joke
« Reply #10 on: February 15, 2018, 08:46:53 PM »
Now I am lost, I was talking about assembly language and you bring in Masm Basic functions.  :icon_eek:

Quote
Whose post?
I was talking about the FASM forum post.

Quote
inlining the macros is something against the fasm's concept
Nice try! You removed the context and don't provide the source of the statement.  :dazzled:

Quote
Should I use FASM or MASM?
ANSWER: FASM is better maintained and has superior macro support.
No need to add anything else.


jj2007

  • Member
  • *****
  • Posts: 10018
  • Assembler is fun ;-)
    • MasmBasic
Re: joke
« Reply #11 on: February 15, 2018, 10:20:32 PM »
Quote
inlining the macros is something against the fasm's concept
Nice try! You removed the context and don't provide the source of the statement.  :dazzled:

Sorry, I even linked to it - too lazy to click on a link? And if Tomasz Grysztar writes "No, inlining the macros is something against the fasm's concept", then my post is certainly not out of context. He means it :t

Quote
FASM is better maintained and has superior macro support.

That is plain ridiculous :P

AFAICS the whole FASM community is addicted to the bare metal concept. Show me one major FASM application that a) makes significant use of macros and b) arrives at over a thousand lines of code.

caballero

  • Member
  • *****
  • Posts: 1287
  • Matrix - Noah
    • abre ojos ensamblador
Re: joke
« Reply #12 on: February 15, 2018, 10:26:15 PM »
I wouldn't say that anyone of them is better than any other. What I miss in fasm or nasm is the possibility of defining local structures. You may define bytes, words, dwords, qwords. Maybe it is possible to do such a thing now. In any case I'm pretty sure that using macros it would be possible to do that.

Masm is very good, the pitty is that there's no full package for 64 bits programming. What I value in Fasm and NasmX, just unzip and programming.


P.S. a) Why is so good the intensive use of macros? b) MenuetOS, KolibriOS, Fasm
The logic of the error is hidden among the most unexpected lines of the program

AW

  • Member
  • *****
  • Posts: 2549
  • Let's Make ASM Great Again!
Re: joke
« Reply #13 on: February 15, 2018, 10:36:57 PM »
Except little exercises, nobody makes full blown assembly language applications these days.
But FASM has been intensively used in important developments, like the GMP arbitrary precision library.

I very rarely use FASM or NASM, still I don't have the habit of despising tools that I don't use or understand in full, like others do.  ::)

Quote
Masm is very good, the pitty is that there's no full package for 64 bits programming
For me, Masm is not that good, but is the closest to the baremetal you can go. And for 64-bit, neither HLL constructs nor pseudo-instructions at all! In addition, no support and bugs are never fixed.

caballero

  • Member
  • *****
  • Posts: 1287
  • Matrix - Noah
    • abre ojos ensamblador
Re: joke
« Reply #14 on: February 15, 2018, 10:55:14 PM »
When I say masm you can also understand masm, uasm, jwasm or anything related. Particularly what I miss is a package ready to go, unzip and programming (without external needs)
The logic of the error is hidden among the most unexpected lines of the program