Author Topic: A test in uploading an image  (Read 243 times)

Caché GB

  • Member
  • **
  • Posts: 58
  • MASM IS HOT
A test in uploading an image
« on: August 09, 2018, 10:34:20 AM »
This is a test designed to provoke an emotional response - Blade Runner (1982)

Image removed to save space.  :icon_cool:
« Last Edit: August 09, 2018, 10:47:22 PM by hutch-- »
Caché GB's 1 and 0-nly language:MASM

jj2007

  • Member
  • *****
  • Posts: 8619
  • Assembler is fun ;-)
    • MasmBasic
Re: A test in uploading an image
« Reply #1 on: August 09, 2018, 06:05:49 PM »
You'll get an emotional response from Hutch for posting fat images :eusa_naughty:

Tips from somebody who didn't grow up with C:

mov Stride, VERTEXTYPE   ; saves typing
and dwValue, 0   ; shorter
.if !eax   ; shorter, less typing
   return eax   ; it's false, right?
.endif

Generally,

.if somecondition
   return something

is a bad idea. The ret and return macros trigger a lot of action - insert an int 3 and have a look at the disassembly. Most of the time it is much better to write

sometest proc uses esi edi ebx arg1, arg2
... code affecting eax ...
test eax, eax
je MyReturn
... other code ...
MyReturn:
  ret              ; one return only for the whole proc
sometest endp

zedd151

  • Member
  • ****
  • Posts: 847
Re: A test in uploading an image
« Reply #2 on: August 09, 2018, 07:27:43 PM »




 :biggrin:

Could I recommend Drop Box ?  image above ^^^
You will want to get Drop Box Basic  (No Charge - 2 GB storage)
I'm not always the sharpest knife in the drawer, but I have my moments.  :P

Caché GB

  • Member
  • **
  • Posts: 58
  • MASM IS HOT
Re: A test in uploading an image
« Reply #3 on: August 09, 2018, 10:49:40 PM »
Worry not jj2007, the last thing on this planet I wish to do is upset Hutch. I am fully aware of the speed of Haley's comet.

I am prepared to bet that if we consolidate a book of all the knowledge that jj2007 gives to the forum it would be thicker
 then the Intel manuals. Thanks for the int 3 instruction, I just used to 'right click -> Run To Cursor'.

O.K. down to business. So this nonsense (old habits die hard)

           .if(eax == 0)
             return  false
           .else
             mov [edi].m_TextureView, eax     ;; m_TextureView as LPID3D11ShaderResourceView
           .endif

becomes this optimized code

            test  eax, eax
              je   @F
             mov [edi].m_TextureView, eax
           @@:

New house rules : Only one ret per proc. Inferred by jj2007.

@zed151. Thank you very much for the Drop Box suggesting. The image you posted, does it reside in Drop Box and display here?
Caché GB's 1 and 0-nly language:MASM

zedd151

  • Member
  • ****
  • Posts: 847
Re: A test in uploading an image
« Reply #4 on: August 09, 2018, 11:04:03 PM »
The image you posted, does it reside in Drop Box and display here?
yes, you upload it to your drop box, and you get a link to post on websites.

There is a download application, it creates a "Drop Box" folder, and automatically synchronizes what is in that folder to what is uploaded to their site. You need a valid email address to create an account with drop box.
Once you have downloaded their program, and created your account, anything you put into your 'Drop Box' folder will be uploaded. ANd you can get a link for it to post on websites. It isn't 100% straightforward to use, if you need any help, just holler.   :t

edit to add, I try not to use .if statements myself. Just look at the code it produces in a debugger, to see where improvements can be made. Often times manually coding the conditional jumps will produce smaller code if done properly.   :bgrin:


How to set up a Drop Box account

The fact that the site I posted is 'dummies.com' does not mean I think you're a dummy, just relaying instructions on how to set up Drop Box.   8)
I'm not always the sharpest knife in the drawer, but I have my moments.  :P

jj2007

  • Member
  • *****
  • Posts: 8619
  • Assembler is fun ;-)
    • MasmBasic
Re: A test in uploading an image
« Reply #5 on: August 10, 2018, 12:14:50 AM »
I try not to use .if statements myself. Just look at the code it produces in a debugger, to see where improvements can be made. Often times manually coding the conditional jumps will produce smaller code if done properly.   :bgrin:

You must do it very, very improperly to produce longer code. And once your programs exceed the 1,000 lines mark, you will be grateful to yourself that you used .if ... .elseif ... .else ... .endif and .Repeat ... .Until ItsDone instead of all the jxx label stuff. OTOH, I read recently that RealMenTM need such challenges, sleepless nights of bug chasing included :bgrin:

Sometimes I even do it myself. Just checked the RichMasm source, 75*je, 38*jne, 14*jle; plus 248*.Repeat and 1490*.endif ;)

Caché GB

  • Member
  • **
  • Posts: 58
  • MASM IS HOT
Re: A test in uploading an image
« Reply #6 on: August 10, 2018, 05:30:03 AM »
Hello zed151
O.K. got the Drop Box and a link. Now how to display the image on the forum?
Caché GB's 1 and 0-nly language:MASM

zedd151

  • Member
  • ****
  • Posts: 847
Re: A test in uploading an image
« Reply #7 on: August 10, 2018, 06:14:55 AM »
[ i m g ] url here [ / i m g ]

without the spaces

the url ends with dl=0

change that to dl=1 and it will display properly   :t

to reiterate:

square bracket + img + closing square bracket

url

square bracket + forward slash + img + closing square bracket.
 
I'm not always the sharpest knife in the drawer, but I have my moments.  :P

Caché GB

  • Member
  • **
  • Posts: 58
  • MASM IS HOT
Re: A test in uploading an image
« Reply #8 on: August 10, 2018, 06:21:09 AM »
Part 2 :
'Operation Drop The Box On The Head'
Operational mastermind:-  zed151



Thank You so much zed151 :t
Caché GB's 1 and 0-nly language:MASM

zedd151

  • Member
  • ****
  • Posts: 847
Re: A test in uploading an image
« Reply #9 on: August 10, 2018, 06:32:11 AM »
No problem, yeah I don't know why the url link they provide ends with dl=0   :icon_confused:

We found out the trick when another member first open his account (with DropBox) and the download wouldnt work.
I had noticed the url ended with dl=0, so I tried it with dl=1 and it then worked - go figure.   ::)   Silly people at Drop Box.   :P

You can post normal downloads with the url, and the fix I mentioned. Then we can see your stuff.  :biggrin:

To post a normal link so we can download your examples, the link you post would be formatted similar but like this:

[u r l ="then the full url here dl=1"] Your text description [/u r l ]

again without the spaces and quotes - - dont forget to change the ending to dl=1  ;)
I'm not always the sharpest knife in the drawer, but I have my moments.  :P

Caché GB

  • Member
  • **
  • Posts: 58
  • MASM IS HOT
Re: A test in uploading an image
« Reply #10 on: August 10, 2018, 08:43:20 AM »
Cool zed151, I truly appreciate all the help you gave me. Once again thank you.
Caché GB's 1 and 0-nly language:MASM

HSE

  • Member
  • ****
  • Posts: 769
  • <AMD>< 7-32>
Re: A test in uploading an image
« Reply #11 on: August 11, 2018, 12:08:43 AM »
WoW!!

Shaders, RocketEngine...

Look impressive :t

Caché GB

  • Member
  • **
  • Posts: 58
  • MASM IS HOT
Re: A test in uploading an image
« Reply #12 on: August 11, 2018, 07:31:02 AM »
Hello HSE.

O.K. let me explain 'RocketEngine'
I am currently working through and converting to assembly the DirectX 11 tutorials at both these websites

here : http://www.braynzarsoft.net/index.php             (now on no. 21)
and here : http://www.rastertek.com/index.html         (now on no. 12)

That way I get to kill feed two birds with one stone seed. (Graphics programming and assembly)

In the tutorials at rastertek.com he calls his framework 'Engine' and since this is an assembly translation
the term 'RocketEngine' is implied.
Caché GB's 1 and 0-nly language:MASM

HSE

  • Member
  • ****
  • Posts: 769
  • <AMD>< 7-32>
Re: A test in uploading an image
« Reply #13 on: August 11, 2018, 08:29:06 AM »
That can be usefull to learn graphics, C and VS... to kill a bird with three stones?  :biggrin:

Very interesting  :t



Caché GB

  • Member
  • **
  • Posts: 58
  • MASM IS HOT
Re: A test in uploading an image
« Reply #14 on: August 11, 2018, 08:42:35 AM »
Wouldn't that be killing three birds with one pip?
Caché GB's 1 and 0-nly language:MASM