|
|
GPS and assembly language files
I'm trying to create a standalone (run on the bare metal) program for
a PC using GPS GPL 2009. Obviously, I need an assembly language file
(to setup the stack and transition the CPU to 32-bit mode), which
would then call my Ada main entry point. Is it possible to have GPS
compile and build this? I cannot figure out how to tell GPS about my
assembly language file.
-Brian
|
|
0
|
|
|
|
Reply
|
brian
|
3/30/2010 6:35:18 AM |
|
On 30 Mrz., 08:35, brian <brian.cat...@gmail.com> wrote:
> I'm trying to create a standalone (run on the bare metal) program for
> a PC using GPS GPL 2009. =A0Obviously, I need an assembly language file
> (to setup the stack and transition the CPU to 32-bit mode), which
> would then call my Ada main entry point. =A0Is it possible to have GPS
> compile and build this? =A0I cannot figure out how to tell GPS about my
> assembly language file.
>
> =A0-Brian
First a caveat: the gnat runtime system relies on an operating system
for quite some functionality. e.g. file access, task scheduling, etc.
If you want to run your program on a bare voard you need a
corresponding run time system.
You have (at least) two ways to include assembler routines in your
program, you either use inline assembly (see System.Machine_Code and
the corresponding chapter in the GNAt user's guide
http://gcc.gnu.org/onlinedocs/gcc-4.4.3/gnat_ugn_unw/Inline-Assembler.html#=
Inline-Assembler)
or you write your assembly code in a separate file and access it via
pragma Import.
Next look in your linker script (and the GNU ld info pages). There
are different init sctions and you can place your code into one of the
sections via pragma Linker_Section. This obviously only works for Ada
code (i.e. inline assembly), not for imported routines.
procedure My_Startup_Code;
pragma Linker_Section (My_Startup_Code, ".init3");
I don't use GPS and connot tell anything about it.
HTH
Rolf
|
|
0
|
|
|
|
Reply
|
Rolf
|
3/30/2010 8:13:18 AM
|
|
|
1 Replies
497 Views
(page loaded in 0.028 seconds)
Similiar Articles: FAQ -- assembly-language/x86/general/part1 - comp.lang.asm.x86 ...cpuid3a.asm - This source code file contains two assembly language functions. One determines the type of cpu from 8088/8086 to Pentium. FAQ -- assembly-language/x86/general/part2 - comp.lang.asm.x86 ...This encyclopedia is available online at the PC-GPE web page: http://www.qzx.com/pc-gpe/ 19.7 PROGRAMMERS DISTRIBUTION NETWORK ASSEMBLY LANGUAGE FILES ... Two 8086 Assembly Language Questions.. - comp.lang.asm.x86 ...Hi, I'm a rookie in assembly language, this question just came up my mind, so I ... ... HP64000 ASM - comp.lang.asm.x86 Those files contain Intel 8086 assembler for the ... Agena - a new procedural programming language - comp.unix.solaris ...Can anyone help me with assembly language? - comp.lang.asm.x86 ... lang.idl-pvwave Agena - a new procedural programming language - comp.unix.solaris ... IDL Save File ... Static library created from MASM to link to Visual C++ app - comp ...The ASM file has to be stdcall, so the top of it should look like this: ..586 ... works in C, then the visual ... than now and programmers thought more in assembly language ... C.Net Assembly interface and Methods - comp.soft-sys.matlab ...API: center of mass calculation of parts in an assembly ... soft-sys.matlab ... Power ... Okino's IGES 3D CAD File ... ... Recursive Programming and Assembly Language - comp.lang ... Best Assembler for 8-bit Apples? - comp.sys.apple2.programmer ...I'm learning assembly language using Roger Wagner's book Assembly Lines and some other ... easy to transfer source and object code to a modern machine (ie, source files ... HP64000 ASM - comp.lang.asm.x86Those files contain Intel 8086 assembler for the HP64000. The HP64000 is dying. ... Two 8086 Assembly Language Questions.. - comp.lang.asm.x86 ... HP64000 ASM - comp.lang.asm ... Array initializing in MASM - comp.lang.asm.x86... the end pointer? - comp.lang.c For example: int my_array[X]; int *p ... or file ... actually point to a nul-terminated array of ... Can anyone help me with assembly language ... Understanding code - comp.lang.asm.x86Part of what I am doing is learning by example, looking at other assembly language routines ... dword ptr ss:[ebp+c] ; [ebp+c] contains a pointer to a string that gives file ... Assembly (CLI) - Wikipedia, the free encyclopediaAn assembly in the Common Language Infrastructure (CLI ... part of the Common Language Runtime (CLR). An assembly can consist of one or more files. ... Navigation Assembly language - Wikipedia, the free encyclopediaAssembly language is a low-level programming language for ... them as if they existed in the source code file ... real-time programs such as simulations, flight navigation ... 7/28/2012 11:52:15 PM
|
|
|
|
|
|
|
|
|