assembly

MASM under Linux?

I want to ask if there is any way to code in MASM under Linux. Even tough NASM is quite popular under Linux, it still differs for some instruction style on code. Currently I am using Ubuntu 8.10 (Intrepid Ibex). ...

Good library/libraries for datastructures in assembler

Are there any good libraries (preferably with commented source) for standard datastructures (Linked list, array list, queue, stack etc.) for x86 (or others) in Assembler ? I don't like to reinvent (and debug !) the wheel.... ...

How to call python2.5 function from x86asm/x64asm?

I'll have couple of python functions I must interface with from the assembly code. The solution doesn't need to be a complete solution because I'm not going to interface with python code for too long. Anyway, I chewed it a bit: What does a python object look like in memory? How can I call a python function? How can I pass python object...

Best resource for serious Commodore 64 programming.

What is the best resource for serious Commodore 64 programming? Assume that serious programming on the Commodore 64 is not done in BASIC V2 that ships with the Commodore 64. I feel like most of the knowledge is tied up in old books and not available on the internet. All that I have found online are either very beginner style introduct...

PPC breakpoints

How is a breakpoint implemented on PPC (On OS X, to be specific)? For example, on x86 it's typically done with the INT 3 instruction (0xCC) -- is there an instruction comparable to this for ppc? Or is there some other way they're set/implemented? ...

How many asm-instructions per C-instruction?

I realize that this question is impossible to answer absolutely, but I'm only after ballpark figures: Given a reasonably sized C-program (thousands of lines of code), on average, how many ASM-instructions would be generated. In other words, what's a realistic C-to-ASM instruction ratio? Feel free to make assumptions, such as 'with curre...

What techniques are available for memory optimizing in 8051 assembly language?

I need to optimize code to get room for some new code. I do not have the space for all the changes. I can not use code bank switching (80c31 with 64k). ...

Why does this NASM code print my environment variables?

I'm just finishing up a computer architecture course this semester where, among other things, we've been dabbling in MIPS assembly and running it in the MARS simulator. Today, out of curiosity, I started messing around with NASM on my Ubuntu box, and have basically just been piecing things together from tutorials and getting a feel for h...

assembly resources

Could you give some guidance for good resources (books, online tutorials) about embedded assembly in C/C++ for windows? ...

Have you ever actually coded an app in pure ASM?

I think asm-app will forever be in my 'to-do' list, simply because I never had any project in mind that would require benefits I get with assembler... Simple description of problem you've solved in assembler would be nice, and especially why you choose asm over high-level languages... ...

Relocatable symbols in ELF format (assembly language)

We are developing a port of the GNU Assembler for a client architecture. Now the problem being faced is that: If an immediate operand to an instruction is an expression involving more than one relocatable symbols, how is it handled in output file in elf format. What will be the relocation information produced in such a case? For exampl...

How to mask bytes in ARM assembly?

hello, i have got an 32bit (hexadecimal)word 0xaabbccdd and have to swap the 2. and the 3. byte. in the end it should look like 0xaaccbbdd how can i "mask" the 2nd and the 3rd byte to first load them up to register r1 and r2 and the swap them.. i also know that i have to work with lsl and lsr commands but dont know how to start. sorry...

SSE4 instructions in VS2005?

I need to use the popcnt instruction in a project that is compiled using Visual Stdio 2005 The intrinsic __popcnt() only works with VS2008 and the compiler doesn't seem to recognize the instruction even when I write in a __asm {} block. Is there any way to do this? ...

Learning x64 on a linux system

I am looking for some good resources on x64 assembly on a linux system, in order to write code myself. I am also looking for some introductory notions like memory spaces (stack, heap, etc.). I found a good free book online, Programming From the Ground UP, the trouble is, it is targeted at x32 linux systems. I also played a lot with gcc -...

Algorithm for finding the smallest power of two that's greater or equal to a given value

I need to find the smallest power of two that's greater or equal to a given value. So far, I have this: int value = 3221; // 3221 is just an example, could be any number int result = 1; while (result < value) result <<= 1; It works fine, but feels kind of naive. Is there a better algorithm for that problem? EDIT. There were some nic...

Calculator using 2 stacks

Hi all. I have an intel assembly assignment. I need to write a calculator which uses 2 stacks. For example, i have an expression like 23+4/2^4$ .So that $ indicates the end of expression. What I will do is to have two stacks, one for numbers, one for operators and push and pop them according to the operator precedence. What I need is ho...

unaligned memory accesses

I'm working on an embedded device that does not support unaligned memory accesses. For a video decoder I have to process pixels (one byte per pixel) in 8x8 pixel blocks. The device has some SIMD processing capabilities that allow me to work on 4 bytes in parallel. The problem is, that the 8x8 pixel blocks aren't guaranteed to start on...

Does anybody have any experience with SSEPlus?

SSEPlus is an open source library from AMD for unified handling of SSE processor extensions. I'm considering to use this library for my next small project and would like to know, if anybody have experience with it? Can I use it on Intel machines? Any performance issues in comparison to direct SSE calls? Any issues on 64bit machines? Wha...

What's the best way to learn how to build circuits

I've always wanted to have a better understanding of what is happening at the hardware level. As a practical level, anything after compile equals 'magic' and I'd like to remedy that. I'd like to investigate building circuits and then moving up to assembly programming on basic chip sets, both for my own sake and also for my son's, as som...

Online Assembly language resources

Hi, does anyone have any resources for learning assembly language on x86? I'm trying to debug a program in MSVC++6 and frequently come across assembly (like stepping into memcpy).. Previously I just ignored these but memcpy keeps throwing exceptions and I need to find out why.. Any help would be appreciated :) EDIT:Wow, lots of great r...