Message board for the users of flat assembler.
> Linux > arrays,size,and so on,basic problems
I have got some problems..
Most of these are probably due to 32bit instead of 16bit as i did before.
If someone can write some simple examples/explanations to my questions it would be nice.
Here it comes:
Arrays? In dos, they are really easy, however on Linux I can`t figure out how to
declare them(mayby i can, it can be question number 2`s problem) and how to find 1 element.
This size thing, $-word how do i use it, with an array?
As far as I can figure out, its how many bytes I want to send to stdout.
So, is it posible, (without looping and counting each char each time which would take some CPU)?,
Basicly I want to know whether or not I can use this $-word to find a number of bytes
in a single array cell. (I am able to write arrays out..but only the whole array.)
I want to use it dynamicly, (if the user press 1, it takes [array+1]..but it only writes 4 chars, because [array+0]
How do i use es and ds on 32bit Linux?
Ehhrm before you think Iam too lame..This must be enough for now.
Here at the end, is Linux assembly lacking documentation? or where is it? The only docs I can find is
well written but really small, a half to 1 page or so.
|05 Aug 2005, 11:07||
why you don't try to serach by google with keywords Linux+assembler ?
There is a lot of pages, e.g. http://linuxassembly.org with tutorials and samples. If you take a look to example hello.asm included in fasm-x.xx.tgz you can find here how to grab a string_size to register without counting and waste CPU time. Segment prefixes es: and ds: are useless on Linux, you needn't them. You have everything in one 2^32 bit=4GB page, no 2^16=64KB as on 16-bit OS.
|05 Aug 2005, 13:18||
arrays are declared just as in DOS, the difference may be that you want to declare arrays of dwords instead of words. be more specific.
look for "protected mode programming" or "protected mode programming in ring0" about the segment registers
|05 Aug 2005, 14:39||
Sorry for the delay.
I searched google for hours before posting..However after some more hours i found a lot of nasm source code, which are perfect.
I found some articles about protected mode too, without understanding all of it, i got the most importent things(i hope).
Until now Linux assembly has been much more fun than dos asm!, its much easier with 32 bit registers, (until now).
So, i solved my problems. Thank you for answering.
|08 Aug 2005, 01:12||
< Last Thread | Next Thread >
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.