flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > Portable assembly code?(between archs)

Goto page Previous  1, 2, 3, 4  Next
Author
Thread Post new topic Reply to topic
m



Joined: 28 Dec 2006
Posts: 304
Location: in
m
Okay!
I thought the Processors today are really-really Powerful !!!
Looks like they have a long-long way to go!
Post 11 Jul 2007, 11:33
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Modern processors are pretty powerful, yes, but it would be a big wasted having one execute a high-level language directly. Languages like C/C++ were designed to be compiled, and they were designed to map well to the instruction sets available on just about any CPU.

Besides, portability isn't just about language, there's more to it as well... graphics libraries, networking, threading, ...
Post 11 Jul 2007, 11:45
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8476
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
hll compiler embedded into processor, hmm .... why not just put java/.net framework into processor, and let users learn how to flash their processor once in a while Smile Very Happy

my prediction is, AI would get embedded into processor, but user still need to code in asm. parallel computing sounds nice, but it adds a burden "timing" layer.

of course, 50 years in future wouldn't be same like now, currently, it seems like the architecture is moving towards multiple cores. maybe intel or amd will make their own board to come with intergrated processor, vga & sound with a basic OS (high level bios?) like vmware esx as a layer to access hardwares. or they probably split everything to separate entity, eg. encryption processor, maths processor, database processor, internet gateway processor and etc that written specifically to handle those situation. who know, maybe u wouldn't get windows in CD or DVD anymore, u need to buy a windows processor Wink and attach them on your board..... Smile no more cheap pirate Smile

or maybe processor that communicate through gigabit network card Smile
so, you could put processor remotely and abundantly where each of it has a gigabit hole that just need lan cable to links. so each individual could have a sort of processors farm to deal with ever increasing software, games demand.

eg. like buying a cooling box, put 24 gigabit conn processor, (the box allow u to switch on/off any processor in it) the jack the cable from box to router, then any pc that connect through router/switch would/could use the processors farm.

just idea, but who knows. my prediction sometime quite accurate also !! Smile
Post 11 Jul 2007, 15:55
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
sleepsleep wrote:

it seems like the architecture is moving towards multiple cores.

Not just moving, we're already here - even very cheap Pentium-D and AMD64 processors are dualcore now, quadcores are dropping in price, and octa-cores are on their way.

sleepsleep wrote:

Maybe intel or amd will make their own board to come with intergrated processor, vga & sound with a basic OS (high level bios?) like vmware esx as a layer to access hardwares.

AMD bought VIA basically to integrate GPU with CPU, intel are working on massive-multicore CPUs, etc. UEFI might be thought of as "a basic OS", though (in my understanding) it's mainly intended as a boot/pre-boot environment.

sleepsleep wrote:

or they probably split everything to separate entity, eg. encryption processor, maths processor, database processor, internet gateway processor and etc that written specifically to handle those situation.

VIA already has AES/Rijndael in hardware on their EPIA CPUs (overlaid on SSE hardware), "database processor" doesn't make much sense imho, and "internet gateway processor" is sorta already possible on advanced NICs (although imho it duplicates too much effort and is too complex to be there).

sleepsleep wrote:

so each individual could have a sort of processors farm to deal with ever increasing software, games demand.

See "cell computing" and "playstation 3" Smile
Post 11 Jul 2007, 23:34
View user's profile Send private message Visit poster's website Reply with quote
m



Joined: 28 Dec 2006
Posts: 304
Location: in
m
Oh!
Post 12 Jul 2007, 04:28
View user's profile Send private message Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 954
Location: Czechoslovakia
MazeGen
MazeGen wrote:
It reminds me my idea of "Portable Flat Syntax" - a syntax that allows your asm code to compile to both x86-32 and x86-64. I was seriously thinking about it, but never realized it.


I have turned this weird idea into an article:

http://x86asm.net/articles/portable-x86-flat-syntax/

Small demo (using MASM macros) is included.
Post 18 Apr 2008, 11:20
View user's profile Send private message Visit poster's website Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP
Very nice article MazeGen, I'll be sure to read it. Unfortunately I don't have an x64 yet Sad.... I'll get one in a few years when they get more popular...
Post 18 Apr 2008, 11:57
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: 16847
Location: In your JS exploiting you and your system
revolution
I think what would be good/wanted is to take existing 32bit code (say the fasm sources) and compile to 64bit using just macros. Anyone keen for some "macro practice"?
Post 18 Apr 2008, 12:01
View user's profile Send private message Visit poster's website Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP
Smile that would be quite the 'macro practice'. I have seen someone use a lot of definitions to make x64 code look much like x86 code, I believe it was 'Brian Gladman' in his 64-bit conversion of AES code.
Post 18 Apr 2008, 14:31
View user's profile Send private message Visit poster's website Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 954
Location: Czechoslovakia
MazeGen
revolution, that wouldn't be possible. You need to know which operands hold pointers, because these need to be widened to 64 bits. Ordinary asm code doesn't include this information (unless you use some operand typing).
Post 18 Apr 2008, 15:06
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: 16847
Location: In your JS exploiting you and your system
revolution
MazeGen wrote:
revolution, that wouldn't be possible. You need to know which operands hold pointers, because these need to be widened to 64 bits. Ordinary asm code doesn't include this information (unless you use some operand typing).
Overload db, dw, dd, rb, etc. and make a "pointer.#labelname" to tag the labels as needed. It should be possible for a lot of cases, but you might need to enforce things like "string: db 'hello world'" to be edited to "string db 'hello world'". For smaller programs a little bit of editing won't be so terrible, and it will still compile as native 32bit.
Post 18 Apr 2008, 15:15
View user's profile Send private message Visit poster's website Reply with quote
Raedwulf



Joined: 13 Jul 2005
Posts: 375
Location: United Kingdom
Raedwulf
From what my 1 minute skim read of all posts gathered, I think this would ultimately lead to the idea of what CIL, Java bytecode and LLVM etc. is.

http://en.wikipedia.org/wiki/Low_Level_Virtual_Machine

_________________
Raedwulf
Post 01 May 2008, 20:20
View user's profile Send private message MSN Messenger Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4217
Location: 2018
edfed
Quote:
Portable assembly code?(between archs)

without sucking the dick of Intel(c)(r)(tm), we can say that x86 style is one of the best asm coding style, then, instead of trying to make a source code, syntax, etc... portable across architectures, why not all architectures sharing the same OPCODES and Environment, boot at 7c00h, ivt at 0h, 8 general purpose registers, etc etc... you all know what is good in x86.

90h ==> nop for everybody.
etc... ( i don't care about the opcodes but i know the machine don't know anything else.

then, all arch with the only one binary syntax. mov eax,ebx

edit:
we cannot decide it. the power to make it is in the "hands" of the companies.
Post 01 May 2008, 22:52
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: 16847
Location: In your JS exploiting you and your system
revolution
edfed wrote:
we can say that x86 style is one of the best asm coding style, then, instead of trying to make a source code, syntax, etc... portable across architectures, why not all architectures sharing the same OPCODES and Environment, boot at 7c00h, ivt at 0h, 8 general purpose registers, etc etc... you all know what is good in x86.

90h ==> nop for everybody.
etc... ( i don't care about the opcodes but i know the machine don't know anything else.

then, all arch with the only one binary syntax. mov eax,ebx

edit:
we cannot decide it. the power to make it is in the "hands" of the companies.
So how do you accommodate ARM with your one-opcode-to-rule-them-all idea? You are missing the point, x86 is CISC little-endian, not everyone want or needs that type of CPU.
Post 02 May 2008, 01:08
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4217
Location: 2018
edfed
little endian is the more logic , lsb first, msb last.

after, my arguments are more heap related than on topic, but all with only one syntax is not a bad deal.RISC, CISC, little & big endian, with or without extensions (SSEx..), low and high speed.. all can be doen with only one syntax.

mov al,ah exists in x86 and can exist in every archs.
Post 02 May 2008, 01:25
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: 16847
Location: In your JS exploiting you and your system
revolution
edfed wrote:
mov al,ah exists in x86 and can exist in every archs.
This is not true, some architectures only have one register, some architectures only have 16bit or larger registers.
Post 02 May 2008, 01:56
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4217
Location: 2018
edfed
then, Learn all assemblers. It is not a problem for assembly programmer.

some coders learn at least 5 langages ( C, C++, JAVA, PHP, JAVASCRIPT, Visual Basic, etc...). learning 5 different arch is not a big problem. having the best tools to devellop in is a problem. fasm can be a good start for all assemblers.

i guess it is possible to use fasm interface for any arch.
you still have adapted it to ARM.
Post 02 May 2008, 08:53
View user's profile Send private message Visit poster's website Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2468
Location: Bucharest, Romania
Borsuc
Assembly is a single 'language'. Learning the instructions is only a slighter "low-level stuff" you need to handle, like learning conventions used in different platforms too (regardless of language).

What is important, for me (as a guy who started with C, and uses both C and asm) is the mentality that asm helps you develop. The low-level mentality that you will keep even when coding in HLL -- like knowing how a processor works. This is pretty universal to every arch.

The compiler is brain-dead and thus good at optimizing low-level obvious instruction tricks (rearrangements for example). What's important is how you think about the low-level algorithm so you can decide it. Usually even in C you can find such low-level optimizations (small example of this is in this thread).

But of course some optimizations only flourish in assembly Wink
Post 02 May 2008, 22:30
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7106
Location: Slovakia
vid
I agree that most important aspect of assembly programming is knowing it. There is very little real-world use of Assembly programming today, but C or C++ programmer who doesn't know assembly doesn't seem "complete" to me.
Post 02 May 2008, 23:12
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
vid, I disagree about the "little real-world use" since we are the proof against that. Just because MS or Linux doesn't rely on it (much) doesn't mean it's not useful. Don't worry about marketing trends, worry instead about what you want to accomplish and how to achieve it.
Post 03 May 2008, 07:04
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3, 4  Next

< 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-2019, Tomasz Grysztar.

Powered by rwasa.