assembler

Assembly: compile a COM program

Hi! Can COM program be 32 bit? How can I compile COM program? I have TLINK32 and TASM32. tasm32 \t alex_7.asm pause tlink32 alex_7.obj pause td32 main.exe I ve got following error: Fatal: 16 bit segments not supported in module alex_7.asm I have DOSBOX and I'am running Windows 7 x64 I got same when I try to compile my program in...

Choosing the right and learning assembler for compiler-writing

I'm writing a compiler and I have gone through all the steps (tokenizing, parsing, syntax tree structures, etc.) that they show you in all the compiler books. (Please don't comment with the link to the "Resources for writing a compiler" question!). I have chosen to use NASM together with alink as my backend. Now my problem is: I just c...

Compile IL code at runtime using .NET 3.5 and C# from file

I would like to take a file that is an IL file, and at run time compile it back to an exe. Right now I can use process.start to fire off the command line with parameters (ilasm.exe) but I would like to automate this process from a C# service I will create. Is there a way to do this with reflection and reflection.emit? While this ...

How Do Assemblers Map x86 Instruction Mnemonics to Binary Machine Instructions?

I'm interested in writing an x86 assembler. I'm wondering what is a good way to map x86 assembly mnemonic instructions (using an Intel-like syntax) into the corresponding binary machine code instructions. ...

Is there kind of runtime C++ assembler library around?

Hi guys! For my small hobby project I need to emit machine code from C++ program in runtime. I have base address 0xDEADBEEF and want to write something like this: Assembler a((void*)0xDEADBEEF); a.Emit() << Push(Reg::Eax) << Push(Reg::Ebx) << Jmp(0xFEFEFEFE); Inline assembler isn't my choice because generated machine code is d...

Mach-O binaries using FASM

is anybody using FASM to produce Mach-O binaries? it's my assembler of choice and I thought it would be nice to learn whether that's possible to accomplish and whether somebody is already doing it. thanks in advance. ...

Illegal instruction gcc assembler.

In assembler: .globl _test _test: pushl %ebp movl %esp, %ebp movl 8(%ebp), %eax pushl %eax call printf popl %ebp ret Calling from c main() { _test("Hello"); } Compile: gcc -m32 -o test test.c test.s This code gives me illegal instruction sometimes and segment fault other times. In gdc i always get illegal instruction, this ...

x86 instruction encoding tables

I'm in middle of rewriting my assembler. While at it I'm curious about implementing disassembly as well. I want to make it simple and compact, and there's concepts I can exploit while doing so. It is possible to determine rest of the x86 instruction encoding from opcode (maybe prefix bytes are required too, a bit). I know many people ha...

How to execute machine language from memory?

I wrote a program to compile a simple text program to a compiled executable... Is it possible that I can load an executable to memory an some how point a pc counter to the memory space at will? Here is what I made that I would like to store the programs to memory for execution on demand... Kind of wanting to make a little web language l...

Building ARM assembler vorbis decoder lib 'Tremolo' for iPhone

I'm trying to compile Tremolo for iPhone. I've pulled in the files bitwise.c bitwiseARM.s codebook.c dpen.s dsp.c floor0.c floor1.c floor1ARM.s floor_lookup.c framing.c info.c mapping0.c mdct.c mdctARM.s misc.c res012.c into a new target, added the following custom settings: GCC_PREPROCESSOR_DEFINITIONS = _ARM_ASSEM_ GCC_C_LANGUAGE_STAN...

How to write a X86_64 _assembler_ ?

Goal: I want to write an X86_64 assembler. Note: marked as community wiki Background: I'm familiar with C. I've written MIPS assembly before. I've written some x86 assembly. However, I want to write an x86_64 assembler -- it should output machine code that I can jump to and start executing (like in a JIT). Question is: what is the best...

How to use C defines in ARM assembler

How can I use external defines such as LONG_MIN and LONG_MAX in ARM assembler code? Let's say my_arm.h looks like this: int my_arm(int foo); Let's say I have a my_main.c as follows: ... #include <limits.h> #include "my_arm.h" ... int main (int argc, char *argv[]) { int foo=0; ... printf("My arm assembler function returns (%d)...

Does a compiler have an assembler too?

My understanding is that a compiler converts the high level language into machine code. I have a question as to whether a compiler(say VC++) in-turn uses an assembler too? I remember seeing assembly code, whenever there is a crash or something like that. ...

Compile/run assembler in linux?

I'm fairly new to linux(ubuntu 10.04) and a total novice to assembler. I was following some tutorials and I couldn't find anything specific to linux. So, my question is, what is a good package to compile/run assembler and what are the command line commands to compile/run for that package? ...

assembler multiple line array+ can't trace in the compiler

I have a project where i manually define a very long array(over 30, every one is a struct object with 2 values). When I define the array in multiple rows I get an error for every row, I don't get the error after I define it one row.how can i write the array in multiple rows? i have a second problem that when i compile the code include ...

Writing an assembler , need help

I'm writing an 8086 assembler for a college project . I've gone through some material on compiler design on the internet and am reading the 'dragon book' of compilers . But the problem is I couldn't find much about the assembling (generating object code) part here . Are there any good books or links for assembler design . Where do I star...

8086 Assembler - Generating the object code from opcodes

I'm working on an assembler for the 8086 . My question is how do you convert the hex opcodes to an executable file like .EXE,.ELF,.COM,a.out etc .Looking for links/resources for this and should the assembler do the linking process or is it done by the OS automatically? ...

Assembler translator or transcriptor

Is assembler a translator or transcriptor? I think it is a translator because when it converts assembly language to machine code, then that code can be understood by hardware. Could somebody explain this concept to me? ...

GNU assembler for MIPS: how to emit sync_* instructions?

MIPS32 ISA defines the following format for the sync instruction: SYNC (stype = 0 implied) SYNC stype here, stype may be SYNC_WMB (SYNC 4), SYNC_MB (SYNC 16), etc. In inline assembler, I may use default sync: __asm__ volatile ("sync" ::);. But, if I write something like __asm__ volatile ("sync 0x10" ::), it doesn't compile: Error: ...

64 bits binary form in assembler....

I'm kind a of making a "JIT" for a numeric routine that I need to compute fast, for x86-64. I'm only using sse instructions for arithmetics and of course some moves. My application generates all of those by simply writing the binary form of machine instructions to some part of memory and then executing. For getting the binary form of ins...