flat assembler
Message board for the users of flat assembler.

Index > Main > ia32e consditional jumps

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
a115433 wrote:
why you assume that range between jnz and @@ is < 2 GB?
I can assume that because I wrote this code and I know the implications it bears. For example: jnz is a short jump, what 2 GBs are you talking about? 127 bytes max. Wink
a115433 wrote:
i can patch this code, and it will crash.
Brainless patching can lead you anywhere.
Post 14 Mar 2010, 13:15
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17671
Location: In your JS exploiting you and your system
revolution
OMG the 8086 only has single byte signed conditional jumps. We will never be able to program anything in the 8086. Shocked

Hehe, there is always a way around things. Don't complain, be pragmatic, and don't waste your time worrying about something that will never happen in your programming career. Who can write even 2MB+ of assembled code? 1000 times bigger, 2GB+ ... forget about it, there would be so many bugs that it wouldn't run well anyway.
Post 14 Mar 2010, 13:21
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17671
Location: In your JS exploiting you and your system
revolution
Okay a quick computation:

  • 2GB of assembled code (minimum size to trigger a problem with a long jump)
  • Leads to probably around 20GB of source code
  • Assuming you can type perfect code without bugs and without need to edit and whatnot, let's say about 5 characters per second
  • There are ~31557600 seconds in a year
  • 20GB/5cps/31557600 = ~136 years just to type the source code
  • And that is without any form of debugging or even toilet/food/sleep breaks (408 years with 8 hours per day of constant typing)
  • Can you honestly say you can produce 2GB+ of assembled code (not data) and need to jump huge distances and have it all run satisfactorily without too many bugs?
  • And what app needs such a huge code base anyway?
Confused
Post 14 Mar 2010, 13:34
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
Laughing

sometimes, problems are created to be just problems.

maybe a recursive virtual code or a set of useless macros can create a 2GB executable.

for example:

Code:
mov eax,ebx
add eax,ecx
    


then, convert every instructions by a macro.

Code:
macro moveaxebx {
push dword 0 dword 0 dword0 dword0
mov al,bl
mov ah,bh
ror eax,16
ror ebx,16
mov al,bl
mov ah,bh
ror eax,16
pop dword 0 dword 0 dword 0 dword 0
}
....
macro addeaxecx { 
push dword 0 dword 0 dword0 dword0
push ebx edx
mov ebx,eax
mov edx,ecx
shr ebx,16
shr edx,16
add al,cl
adc ah,ch
adc bl,dl
adc bh,dh
ror eax,16
mov al,bl
mov ah,bh
ror eax,16
pop edx ebx
pop dword 0 dword 0 dword 0 dword 0
}

moveaxebx
addeaxedx

    


making that for all instructions, and then, code with these macros.
i presume executable will be very big.

Laughing
Post 14 Mar 2010, 16:23
View user's profile Send private message Visit poster's website Reply with quote
a115433



Joined: 05 Mar 2010
Posts: 144
a115433
i have a better idea.
create hardware that will probe your mind and translate yout thoughts into program.
your idea -> machine representation.

and now using this neural link create complicated simulation of something, for example some biological process on subatomic scale.

And here we are. code is 2GB+, and we cant conditional jump or even return to highle nested loops.


Now intel/amd must do something about this, they add 8 byte jumps to the list, dumping all existing PCs in the world.

If this neural interface would do HLL code, problem is partial, because on unsupported machines you can use cmov'c (with penalty of bigger code).
Post 14 Mar 2010, 18:17
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17671
Location: In your JS exploiting you and your system
revolution
a115433 wrote:
i have a better idea.
create hardware that will probe your mind and translate yout thoughts into program.
your idea -> machine representation.
Sounds scary. Translating my thoughts into machine code? Yikes, some of the things I think would be best to never be translated into code!
Post 14 Mar 2010, 18:24
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
When your idea comes true, CPU will probably already have FPGA-like features that will work more efficiently. GPUs (which today are already capable of more than just graphics, see CUDA for instance), will be enormously parallel (they already are, but will much more, again, probably with some FPGA-like structure if not already). In any case, looks that the idea needs to be data driven much more that code driven.

The penalty BTW, it is not so clear, having a ten bytes instruction for conditional jumps seriously consumes decoding bandwidth, so unless you add separate opcodes for those not-needed-in-our-lifetime Jcc rel64 but instead promote Jcc rel32 to rel64 then thanks but I prefer the CPU just as it is now.
Post 14 Mar 2010, 18:28
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
if it is for a neural network, you can use 16 bit structures and values, then, work on them with 32 bits code, and then, you will have all the needed features to do a neural network.

let imagine a neron like a structure.
Code:
neuron:
value dw ?
vptr dw ?
k dw ?
p dw ?
i dw ?
d dw ?
    

value is a 16bits value
vptr, k, p, i and d will be pointers, not values.
then, if it is 16bits pointers, it will be easy to fit in a cyclic address space.
k = cooeficient for the PID
p = product of value and [vptr]
i = integral of value
d = differential of value


create 65536 neurons like this.
use a pointer to point to a vlaue of a neuron

and maybe it will do something interresting. i don't know, but i imagine it can be interesting.

with 32 bits, you will need a lot of memory just to contain the 4G neurons.

but all in all, a conditional jump don't have to jump so far, because it is in a local algorythm, it is named functions.

we create functions to simplify the code, and avoid bugs.
Post 14 Mar 2010, 19:58
View user's profile Send private message Visit poster's website Reply with quote
a115433



Joined: 05 Mar 2010
Posts: 144
a115433
fpga?
wtf i though it was my idea Sad
Post 14 Mar 2010, 20:01
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.