assembly

What are the values in intel x86 CPU stack before running (on Windows)?

I have been debugging some .exe and noticied that before I start debugging step by step, at the very beginning of the program, there are already some values loaded in the stack? What are these? I am using OllyDbg and some of the "labels" for these values are: return to kernel32.7C8... ntdll.7C9... End of SEH chain SE handler Than...

Assembly: convert floatingpointvalue to signed byte

Hi! I currently try to write a program for the VFP unit of the iPhone using ARM assembly code. The VFP can do floatingpoint calculations, but AFAIK no integer arithmetic. However, it can convert a float to a signed integer (4 bytes). Also, according to this quickreference: http://www.voti.nl/hvu/arm/ARMquickref.pdf it seems it does not ...

Embedded Assembly Files in Visual Studio

I'll make this short and to the point. The _asm block has been completely stripped when creating 64 bit code in Visual Studio. My question is, where can I find some information on how to use assembly in some code that I can call from my project. Like an assembly file I suppose that has some "optimized" function in which I can call direct...

Debugging assembly

How do I debug assembly code? I'm on Linux and have gdb handy. I know I can watch registers. What are some methods for debugging assembly code? ...

Are x86 assembly instructions REPE/REPZ and REPNE/REPNZ equal?

Just a quick question: Are REPE equal to REPZ and REPNE equal to REPNZ? Thanks. ...

Multiple line comments in assembly

Is there a way to comment multiple lines in assembly? I am using Masm32 v9. Thanks. ...

iPhone ARMv6 VFP asm latency, throughput and hazards

Hi! in this document: http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301g/DDI0301G_arm1176jzfs_r0p7_trm.pdf on page 21-25 (pdf page 875) the througput and latency timings are given for the assembly instructions of the VFP unit. Are those numbers independant of vectorsize? 1: let's take FMULS which has throughput of 1 and latenc...

Intel x86 coprocessor assembly question

I am having some trouble understanding how to retrieve the result of a calculation done using the Intel's x86 coprocessor. Please consider the following data segment. .data res real4 ? x real4 5.0 k real4 3.4 and the following code segments, version 1: .code main: fld x ; 5.0 fadd k1 ; 5.0 + 3.4 fistp res ; store as inte...

Assembler task - min and max values of the array..

Hi. I've encountered problems with assembler code. I'm a newbie to assembler, so it seems difficult for me to solve it myself. The task is: "To find minimal and maximal elements of the array." All I've already done is searching for maximal element. I can't find out, how to make check for the minimal element and where I should put suc...

Strange behaviour of ldr [pc, #value]

Hi, I was debugging some c++ code (WinCE 6 on ARM platform), and i find some behavior strange: 4277220C mov r3, #0x93, 30 42772210 str r3, [sp] 42772214 ldr r3, [pc, #0x69C] 42772218 ldr r2, [pc, #0x694] 4277221C mov r1, #0 42772220 ldr r0, [pc, #...

Executing CPU/GPU instructions from managed code

Taking into account the execute disable bit what is the recommended way of executing instructions against a native processor from a high level managed environment such as VB.NET 2008 or C#. In addition has anyone achieved similar in executing GPU instructions against a graphics processor? ...

Extract Digits From An Integer Without sprintf() Or Modulo (SOLVED)

The requirements of this are somewhat restrictive because of the machinery this will eventually be implemented on (a GPU). I have an unsigned integer, and I am trying to extract each individual digit. If I were doing this in C++ on normal hardware & performance weren't a major issue, I might do it like this: (Don't hate on me for this...

implement eq, lt gt in assembly without jumps

Is it possible to write logic using only AND, OR NOT operators to compare 2 operands and return true/false (-1, 0) without the use of jumps. If so can you please give me some hints as it looks impossible to me I don't know if I am explaining this very well but I am trying to implement eq, lt and gt in the assembly language of the book "T...

Reading a register value into a C variable

I remember seeing a way to use extended gcc inline assembly to read a register value and store it into a C variable. I cannot though for the life of me remember how to form the asm statement. Any help is much appreciated. ...

cedecl calling convention -- compiled asm instructions cause crash

Treat this more as pseudocode than anything. If there's some macro or other element that you feel should be included, let me know. I'm rather new to assembly. I programmed on a pic processor back in college, but nothing since. The problem here (segmentation fault) is the first instruction after "Compile function entrance, setup stack f...

gdb without gcc

Is it possible to run GDB with a program assembled with as and linked with ld? With gcc adding the flag -g allows for debugging but I get the error No symbol table is loaded. Use the "file" command when I try to add breakpoints to a loaded program. Thanks! EDIT Maybe I should make it clear that I'm learning and programming in assembly...

How do I use gcc builtin __sync_bool_compare_and_swap in g++ on MacOSX?

I have some code that uses: __sync_bool_compare_and_swap it compiles fine on Linux. But when I try to compile it on MacOSX in g++, I get: error: ‘__sync_bool_compare_and_swap’ was not declared in this scope How do I fix this? (This is Mac OSX 10.5.8, so it's intel .. .and should have this instruction). Thanks! ...

Develop a Bootloader In Assembly

I've already done a part of my OS in Assembly, but now I want to build a own bootloader for it too instead of using GRUB. When I was developing my test OS in Assembly I remember that I boot it like this: org 0x7c00 bits 16 ; OS Kernel Here times 510 - ($-$$) db 0 dw 0xAA55 This I've already know. Now I want to use this and execute t...

Cheap PowerPC Evaluation Board?

Hello all, I've been trying to learn embedded software development for some time (been doing software for almost 15 years, 10 in Java, plus good knowledge of C/C++/X86 Asm from College.) Started playing with a PIC-based evaluation board just for kicks. Where I work, there is a dept. they have some openings on embedded systems from time...

Dummy operations handling of Intel processor

Hello, Admittedly, I have a bit silly question. Basically, I am wondering if there are some special mechanisms provided by Intel processors to efficiently execute a series of dummy, i.e., NOP instructions? For instance,I could imagine there could be some kind of pre-fetch mechanism that identifies NOPS, discards them and tries to fetch ...