assembly

Branching to labels

I'm writing a MIPS code for a simple calculator, and was wondering how you branch to the corresponding function according to the user input. For example, if the user wishes to add two numbers, how would you make sure the calculator jumps to the add label, instead of perhaps the multiply or subtract? ...

Need Assembly Programming Help (TASM) - Booth's Algorithm

I've written an algorithm to simulate Booth's Algorithm using only Add, Sub, and Logical Operators and return a hexadecimal value. My Tasm compiler keeps throwing me these errors. When I try to omodify the code, it still doesn't work. Could someone help me out please. (29) Extra characters on line (38) Illegal immediate (44) Ille...

Create Executable From Assembly Code

Hello, I need to create an executable from the next assembly code: .MODEL SMALL .DATA TEXT DB 'Hello world!$' .CODE .STACK 20 .STARTUP MOV AX, @DATA MOV DS, AX MOV AH, 9 MOV BL, 02H INT 10H MOV Dx, OFFSET TEXT INT 21H MOV AH, 4CH INT 21H END It works with Turbo Assembler (tasm.exe), but I don't want to continue working with it, becau...

What does "int 0x80" mean in assembly code?

Can someone explain what the following assembly code does? int 0x80 ...

Assembly Segmentation Fault

Hi, I encountered an Error during running of the following Assembly Code #cpuid using C library Functions .section .data output: .asciz "The Processor Vendor ID is '%s'\n" .section .bss .lcomm buffer, 12 .section .text .globl main main: movq $0, %rax cpuid movq $buffer, %rdi movq %rbx, (%rdi) movq %rdx, (%rdi) movq %rcx, (%rdi...

Integer Problem in MIPS assembly

Using MIPS assembly if I prompt a user to input an integer how can I then take that integer and break it up into it's requisite parts? Example: # User inputs a number li $v0, 5 # read value of n syscall I then store the value in $v0 in a temporary register, say $t0, and need to break it up into each part that...

Why is a 16-bit register used with BSR instruction in this code snippet?

In this hardcore article there's a function find_maskwidth() that basically detects the number of bits required to represent itemCount dictinct values: unsigned int find_maskwidth( unsigned int itemCount ) { unsigned int maskWidth, count = itemCount; __asm { mov eax, count mov ecx, 0 mov maskWidth, ecx ...

Complete x86/x64 JIT Assembler for C Language.

Hi Do you know something just like this, but embeddable in a C program? ...

Java, ASM org.objectweb.asm.util.CheckClassAdapter causes Unsupported major.minor version 0.0

Hello! I am getting following exception: java.lang.UnsupportedClassVersionError: net/sourceforge/barbecue/BarcodeException : **Unsupported major.minor version 0.0** at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.lang.ClassLoader.defineClass(ClassLoader...

Limit user input through Text I/O (68k Assembly)

I'm writing a program in Assembly (68k) and I'm using Easy68k. I am trying to prompt a user to input a string of characters. However, I must limit the amount of characters accepted. I was told I could do that using task #5, through text I/O, but I could really use an example Thanks! ...

MIPS program! need help- i m not sure if i m doing it right.

i m trying to write a MIPS program that will examine set of ten single digit numbers (positive, zero,or negative) that can be inputted from the terminal. After examining the numbers, only the negative numbers (with appropriate sign) along with their count needs to be outputted to the terminal. BELOW IS MY MIPS PROGRAM .data pr...

MIPS Assembly assignment HELP!!

My closest friend is going through an EE course (I'm his last hope : /), I have knowledge of Java from about 7 years ago, but his (outline) latest EE programming assignment is to use the MIPS Assembly to do the following: Write a program that takes two positive integers (m and n) and computes: x= (m^n) - (1+2+3+…+n) * min(m,n)! Both...

C++ CPU Register Usage

In C++, local variables are always allocated on the stack. The stack is a part of the allowed memory that your application can occupy. That memory is kept in your RAM (if not swapped out to disk). Now, does a C++ compiler always create assembler code that stores local variables on the stack? Take, for example, the following simple code:...

How to write to & read from network card in x86 assembly?

Hi, does anyone know how to gain access to devices such as an ethernet port on a mainboard or on a pci card? Are there special registers? Opcodes? Do I have to make a call to the OS? If so, how? Thanks in advance. ...

Pad instruction so end is aligned

I'm working with GNU assembler on i386, generally under 32-bit Linux (I'm also aiming for a solution under Cygwin). I have a "stub" function: .align 4 stub: call *trampoline .align 4 stub2: trampoline: ... The idea is that the data between stub and stub2 will be copied into allocated memory, along with a function poi...

Intro To x86 Assembly With Windows

There's a chapter in Robbins' Debugging Microsoft Windows Applications where he discusses the assembly code created for Windows apps. This is a community wiki question--please post links to other books, websites, blogs, articles etc. which discuss the x86 assembly code generated by Windows. I'm looking for a little more in-depth discus...

How to get address of base stack pointer

I am in the process of porting an application from x86 to x64. I am using Visual Studio 2009; most of the code is C++ and some portions are plain C. The __asm keyword is not supported when compiling towards x64 and our application contains a few portions of inline assembler. I did not write this code so I don't know exactly what et is su...

How to inspect the stack using an ASM visitor?

I am attempting to use the Java byte code engineering library ASM to perform static analysis. I have the situation where I would like to inspect the variables being assigned to a field. I have MethodVisitor which implements the visitFieldInsn() method. I am specifically looking for the putfield command. That is no problem. The problem i...

Fast sine/cosine for ARMv7+NEON: looking for testers…

Could somebody with access to an iPhone 3GS or a Pandora please test the following assembly routine I just wrote? It is supposed to compute sines and cosines really really fast on the NEON vector FPU. I know it compiles fine, but without adequate hardware I can't test it. If you could just compute a few sines and cosines and compare the...

Purpose of ESI & EDI registers?

What is the actual purpose and use of the EDI & ESI registers in assembler? I know they are used for string operations for one thing. Can someone also give an example? ...