Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 31 Jul 2014, 05:46
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Assembler for puppy?
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [18 Posts]   Goto page: 1, 2 Next
Author Message
KusaNoKaito


Joined: 19 Feb 2010
Posts: 99
Location: Florida

PostPosted: Mon 01 Mar 2010, 18:31    Post subject:  Assembler for puppy?  

Hi! simple question, is there an assembler available for puppy?

If there is not and other people here want the same, I could try packaging some of the assemblers I use?
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4292

PostPosted: Mon 01 Mar 2010, 21:11    Post subject:  

the gnu assembler is on the devx sfs as is nasm
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3357
Location: Oregon

PostPosted: Tue 02 Mar 2010, 03:24    Post subject:  

The version included in devx is 0.98.39 dated Oct 22,2007.
The latest stable version at their site http://www.nasm.us/ is 2.07.
And version 2.08 is in development.
According to their site it supports 64bit processors too.
Back to top
View user's profile Send private message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Tue 02 Mar 2010, 06:23    Post subject:  

You might like to try Linoleum assembler (you will have to compile it first)
http://en.wikipedia.org/wiki/Linoleum_(programming_language)

last Puppy compiling attempted here
http://www.murga-linux.com/puppy/viewtopic.php?p=100613&search_id=1262339951#100613

_________________
Puppy WIKI
Back to top
View user's profile Send private message Visit poster's website 
nooby

Joined: 29 Jun 2008
Posts: 10557
Location: SwedenEurope

PostPosted: Tue 02 Mar 2010, 06:41    Post subject:  

My naive dumb question.

When I used MS DOS and used several of their assemblers and C compilers and Pascal and such. then the executables had .com and was standalone things in that one clicked on them and they run.

what is it in Linux that one do assembler and how does one run them?

What can one do with them?

_________________
I use Google Search on Puppy Forum
not an ideal solution though
Back to top
View user's profile Send private message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Tue 02 Mar 2010, 08:04    Post subject:  

apparently yasm is in at least Quirky 003 and probably later versions . . .

fasm info
http://flatassembler.net/

_________________
Puppy WIKI
Back to top
View user's profile Send private message Visit poster's website 
DMcCunney

Joined: 02 Feb 2009
Posts: 897

PostPosted: Tue 02 Mar 2010, 19:45    Post subject:  

nooby wrote:

When I used MS DOS and used several of their assemblers and C compilers and Pascal and such. then the executables had .com and was standalone things in that one clicked on them and they run.

what is it in Linux that one do assembler and how does one run them?

What can one do with them?

The standard Linix assembler is "as". It's available for Puppy as part of the DEVX toolset. In the old days in Unix, the C compiler "cc" would compile to assembler source, which was then assembled by as to create object filesthat were linked to form an executable by "ld". It was possible for the programmer to interrupt the process before as was called, and hand optimize the assembler code generated by cc for performance, before having it assembled and linked. These days, compilers do their own optimization, and can generally do it better than the programmer.

".com" files are a relic of the addressing model used by the Intel 8088 CPU used in early PCs. Intel CPUs use a "segmented" architecture. On the 8088, with a one megabyte address space, a segment was 64K. There were half a dozen different memory models a DOS programmer had to deal with, depending upon whether both code and data fit in 64K, or code fit in 64K, but data required another segment, or code fit in 64K, but data required more than an additional 64K segment, or code required more than 64K, etc.

Code branching within a 64K segment was fairly simple. Branching was to offset from the current location. Code that needed to cross segments required "far calls", and got more complicated. Branching was to segment:offset. "com" files under DOS and Windows were all programs that could be done in 64K or less. Beyond 64K, you dealt with EXE files. It's entirely possible to write large EXE application entirely in Assembler, and a variety exist. But things tend to be easier to write and maintain in a higher level language like C.

On 32 bit machines using the 80386, 80486, or Pentium class CPUs, a segment is 4 gigabytes, and the issues faced by old DOS programmers don't exist.

Folks used to write write in Assembler for performance. When the CPU on the PC runs at 4.77mhz, you can run into cases where the machine just isn't fast enough to do what you want in a high level language and you need to get low level to get the performance.

On current hardware, CPU speed is seldom the limiting factor. Most PCs are "I/O bound", not "compute bound". The bottleneck will be reading from/writing to disk, which is why more RAM is the first suggestion for boosting performance, to reduce the need to read from and write to disk. In most of what users do on PCs, the CPU spends most time in a wait state, waiting for user input or for a disk operation to complete, and all machines wait at the same speed.

Can you write in assembler for Linux? Sure. The question is why you would need to. Writing in C or C++, standard system libraries handle a lot of things for you, like startup code. Writing in assembler, you have to handle that yourself. About the only time I can see resorting to assembler is when writing a device driver where you must do low lever hardware access. Even then, you may not have to.

In addition, assembler is by nature processor specific. The assembler code for an Intel or compatible CPU will be quite different from the code for the IBM/Motorola PPC chips used in older Macs, or the SPARC RISC processors used in Sun Microsystems machines, or the ARM processors used by various smartphones. Write your code in portable C or C++ and you ought to be able to move it to a machine running Linux using a different architecture and compile and build it. Write in assembler and you'll have to rewrite from scratch
______
Dennis
Back to top
View user's profile Send private message 
nooby

Joined: 29 Jun 2008
Posts: 10557
Location: SwedenEurope

PostPosted: Wed 03 Mar 2010, 04:41    Post subject:  

Dennis, I trust you on this so when do we use assembler in Linux then?

The thread starter seems to at least want to have it available just in case him needs it?

One good thing would be to be able to run it all in RAM? Instead of having some 1GB programs fighting over a 1GB Netbook that can not be given more memory we can have a 100KB OS that leave 900KB for applications?

_________________
I use Google Search on Puppy Forum
not an ideal solution though
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3357
Location: Oregon

PostPosted: Wed 03 Mar 2010, 12:34    Post subject:  

nooby,
The operating system ISO is around 100 megs, not 100kb.
But.....
When you have the operating system running and setting at the desktop, open a terminal and type "free" in it to see actual memory usage by the operating system.
You will find memory usage is more than 100 megs.
Back to top
View user's profile Send private message 
KusaNoKaito


Joined: 19 Feb 2010
Posts: 99
Location: Florida

PostPosted: Thu 06 May 2010, 14:58    Post subject:  

technosaurus wrote:
the gnu assembler is on the devx sfs as is nasm

I question NASMs power because it is not coded in assembler, its coded in C.
Lobster wrote:
You might like to try Linoleum assembler (you will have to compile it first)
http://en.wikipedia.org/wiki/Linoleum_(programming_language)

last Puppy compiling attempted here
http://www.murga-linux.com/puppy/viewtopic.php?p=100613&search_id=1262339951#100613

Will have a look at that.
nooby wrote:

The thread starter seems to at least want to have it available just in case him needs it?

One good thing would be to be able to run it all in RAM? Instead of having some 1GB programs fighting over a 1GB Netbook that can not be given more memory we can have a 100KB OS that leave 900KB for applications?

You're right! i enjoy writing programs from the ground up!

---------

I compiled YASM so people here can use it without installing devx. Note: it appears to be written in several languages.
yasm-1.0.0-i486.pet
Description 
pet

 Download 
Filename  yasm-1.0.0-i486.pet 
Filesize  1.66 MB 
Downloaded  329 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
2lss

Joined: 20 Sep 2009
Posts: 225

PostPosted: Fri 07 May 2010, 02:02    Post subject:  

I've been playing around with writing asm programs for my ti -83 graphing calculator. I have an ide that is set up for the z80 type microprocessor, it's pretty nice. So far I like the "ground up" part but I've only done a couple 'hello world' type programs so my opinion may change later...

I read somewhere that assembly is used by people who reverse engineer software by some how disassembling binaries into asm. Not sure if its true but sounds interesting.
Back to top
View user's profile Send private message 
KusaNoKaito


Joined: 19 Feb 2010
Posts: 99
Location: Florida

PostPosted: Fri 07 May 2010, 02:42    Post subject:  

2lss wrote:
I've been playing around with writing asm programs for my ti -83 graphing calculator. I have an ide that is set up for the z80 type microprocessor, it's pretty nice. So far I like the "ground up" part but I've only done a couple 'hello world' type programs so my opinion may change later...

I read somewhere that assembly is used by people who reverse engineer software by some how disassembling binaries into asm. Not sure if its true but sounds interesting.


Yes there is "dissassemblers" out there people use them to change software crack product keys etc. but why do that when there is open source?

Assembly language teaches really good programing, and how your computer actually works. but its not very useful unless you wanna do something really low level.

_________________
Puppy Packages
My Website
Back to top
View user's profile Send private message Visit poster's website 
DMcCunney

Joined: 02 Feb 2009
Posts: 897

PostPosted: Fri 07 May 2010, 09:02    Post subject:  

KusaNoKaito wrote:
technosaurus wrote:
the gnu assembler is on the devx sfs as is nasm

I question NASMs power because it is not coded in assembler, its coded in C.

So is just about everything else. So what?

Remember that Assembler is low level code. Each Assembler language instruction normally translates to one machine language instruction.

With a high level language like C/C++. one line in the source file might compile to hundreds of machine language instructions.

With something like GCC, you rely on the compiler to optimize for you, and generate the best machine code from the high level source. and there will always be tradeoffs, as you can optimize for small code size or high speed, but they are largely mutually exclusive.

With Assembler, optimization is on you. You are specifying exactly what machine code is created, instruction by instruction. The assembler is mostly just translating an assembler mnemonic into the equivalent machine instruction.

Writing an assembler in assembler may make it faster to assemble source to object code, but isn't going to make it more powerful.

C was originally designed for systems programming, to be efficient enough that you didn't have to write in assembler to get performance, and you could do things like write operating systems in it. Linux is written in C.

Unless you absolutely have to for some reason, it's usually better to work in a higher level language than to write in assembler. High level coder is easier to write and maintain, and current hardware is fast enough that performance normally isn't a problem.
______
Dennis
Back to top
View user's profile Send private message 
efiguy


Joined: 06 Sep 2006
Posts: 169

PostPosted: Fri 07 May 2010, 13:46    Post subject: Assembler for puppy
Subject description: Embedded systems
 

Hi Group,
I work with a few of the automotive computer systems, most of the analysis programs and system programs from processor manufacturers are in windows or old dos format. - Getting tools together to program for microprossers has always been my downfall - always missing some lib or other obscure tidbit.
Some of this involves direct hex editing of binary data files.

Thinking about this thread, - In my simple probing of the Puppy system, it seems that programing or modifing an application is more of a natural state of inherent operation - rather than the windows system - at least it is for me, not being very savvy visual basic programer. And having been able to follow and mod apps with Geany.

Are there cross libraries for 8051, old Motorola, Xilinx, and such for use within Puppy? Dah! never even considered the posibility - for all the other researchers i've been in contact used windo tech.

Jay
Back to top
View user's profile Send private message 
DMcCunney

Joined: 02 Feb 2009
Posts: 897

PostPosted: Fri 07 May 2010, 21:01    Post subject: Re: Assembler for puppy
Subject description: Embedded systems
 

efiguy wrote:
Are there cross libraries for 8051, old Motorola, Xilinx, and such for use within Puppy? Dah! never even considered the posibility - for all the other researchers i've been in contact used windo tech.

I think what you're asking for is not Puppy specific.

Linux development is normally done in GCC, the Gnu Compiler Suite. GCC is modular, and implemented as a front-end parser for the languages GCC supports (C, C++, Ada, Fortran, Objective C and Java), and a back end code generator. This separation makes it possible to use GCC as a cross-compiler, writing code on one architecture (in this case, Intel), but compiling machine code for another, like Motorola 680X0 or ARM.

I don't deal with things like Xilinx microcontrollers, but as far as I know, you can use GCC to build code for them.

Puppy does not include GCC by default. To get GCC for Puppy, you'll need to install the appropriate Devx SFS file, which will get you GCC and the related tools. Setting up GCC as a cross-compiler is a non-trivial process. (I have not done it, but know enough to know it's not simple.)

I'd also look at installing Java and Eclipse. Eclipse is IBM's open source programmer's IDE, written in Java, Eclipse is extensible, and has plugins for embedded development. I believe you can find plugins for Eclipse intended for supporting development on things like 8051 chips.

Take Puppy out of the equation for the moment, and do some research on using GCC for this sort of thing, and using Eclipse as your environment. If you determine it's feasible and you want to pursue it, it should be doable in Puppy or any other Linux distro. The most important limitation will be hardware. GCC and Eclipse aren't small programs, and you'll probably want a reasonable machine running Puppy simply so that doing things doesn't take forever.
______
Dennis
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [18 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

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


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1007s ][ Queries: 12 (0.0052s) ][ GZIP on ]