Page 3 of 3

Re: Why does my subroutine crash when called from an ISR?

Posted: Wed Aug 12, 2015 5:38 pm
by Nutterts
onlyonemac wrote:
iansjack wrote:I'd respectfully suggest that you need to use a different package system. (Yeah - I know - no-one's going to tell you what package system to use).
Actually I use apt with my Ubuntu system.

Code: Select all

sudo apt-get update && sudo apt-get install nasm
Replace nasm for yasm if you prefer that assemblers. (You also might want to take a look at fasm. But it's not in the repositories)

Guessing you did a apt-cache search or something like that? Don't expect the descriptions to tell you everything. Only use it to find the exact package name you want or other packages that are related to it. On debian based systems google (or duckduckgo) is still your best friend.

Re: Why does my subroutine crash when called from an ISR?

Posted: Thu Aug 13, 2015 12:23 am
by onlyonemac
nutterts wrote:Guessing you did a apt-cache search or something like that? Don't expect the descriptions to tell you everything. Only use it to find the exact package name you want or other packages that are related to it. On debian based systems google (or duckduckgo) is still your best friend.
I searched using the Synaptic package manager which was my preferred tool at the time, before I had learnt to use the apt command-line utilities. Synaptic's search tool is rather poor...

Anyway I might take a look at another of those assemblers when I have the time to translate all my assembler directives and some of the code etc. The other thing, by the way, which I liked about as86 is that it can produce raw binaries which is what I need due to my lack of knowledge of how to use a linker. Again, I might try using a linker some time but for now I can do what I need to do.

Re: Why does my subroutine crash when called from an ISR?

Posted: Thu Aug 13, 2015 12:40 am
by Octocontrabass
onlyonemac wrote:Anyway I might take a look at another of those assemblers when I have the time to translate all my assembler directives and some of the code etc.
Every line of code you write for as86 is another line of code you will need to translate. It's better to switch assemblers now, instead of writing hundreds of lines of code for an obsolete assembler.
onlyonemac wrote:The other thing, by the way, which I liked about as86 is that it can produce raw binaries which is what I need due to my lack of knowledge of how to use a linker.
Both yasm and nasm can do this. (You need a linker or objdump to produce raw binaries with gas.)

Re: Why does my subroutine crash when called from an ISR?

Posted: Thu Aug 13, 2015 2:56 am
by Nable
nutterts wrote:You also might want to take a look at fasm. But it's not in the repositories.
Debian Testing has FASM in its repo:

Code: Select all

$ apt-cache show fasm
Package: fasm
Version: 1.71.39-1
Installed-Size: 286
Maintainer: Tomasz Buchert <[email protected]>
Architecture: amd64
Depends: libc6-i386 (>= 2.1)
Description-en: fast assembler for the x86 and x86-64 architectures
 Flat assembler is a fast, self-compilable assembly language compiler for the
 x86 and x86-64 architecture processors, which does multiple passes to optimize
 the size of generated machine code.
Description-md5: bc56833ca51013cf84753cdfae7d97a4
Homepage: http://flatassembler.net/
Section: devel
Priority: optional
Filename: pool/main/f/fasm/fasm_1.71.39-1_amd64.deb
Size: 142978
MD5sum: fcddd2f4d9be3795d0a9babb4aa0f994
SHA1: 38fe913775838c20ac388605fb11c45ad441262d
SHA256: 815c9b810a4d51e8e3dae171ef4399079cb111a06245cb452dab477af7ef0dba

Re: Why does my subroutine crash when called from an ISR?

Posted: Thu Aug 13, 2015 4:01 am
by iansjack
Anyway I might take a look at another of those assemblers when I have the time to translate all my assembler directives and some of the code etc.
If you have made a mistake (and, without wishing to tell you which assembler you should use, I believe you have) it is easier to correct it sooner rather than later.
The other thing, by the way, which I liked about as86 is that it can produce raw binaries which is what I need due to my lack of knowledge of how to use a linker. Again, I might try using a linker some time but for now I can do what I need to do.
As has been pointed out, all assemblers can produce raw binaries; but it's not normally a good choice as it leads to the sort of problems you have encountered. It really is a good idea to learn how to use the tools before getting too deeply into coding as it will save you a lot of work undoing what you have done and it will protect you from the even worse situation of sticking with bad design choices and habits because you can't be bothered to undo them.

The more you get right to start with the easier life is in the long run.