If I use register names I get:
Error: illegal operands `add $t0,$zero,$zero'
If I use register number ($8 instead of $t0 and $0 instead of $zero) it works.
(I'm using binutils 2.17).
...
I have no prior knowledge of assembly programming, and would like to learn how to code x86 assembly on a Linux platform. However, I'm having a hard time finding a good resource to teach myself with.
The Art of Assembly book looks good, but it teaches HLA. I'm not interested in having to learn one way, then relearning it all over again. ...
I am developing a compiler for my senior project in school, and I am using AS (GNU Assembler) to assemble. All of my tests have been fairly successful, but no interrupt lists I have seen have seemed to work or match up with my test code.
The relevant information for this version of AS:
GNU assembler 2.17 Debian GNU/Linux
Copyright 2005...
I'm working on some MIPS code for my Computer Organizations class, and well I just can't seem to get the MIPS to work correctly and there's not that many MIPS resources online. I'm running the code on PCSPIM. The code is supposed to add 10 to the contents of array2 and store them in array1 and then print array 1. Reworked the code works ...
I have a class, C. C has a member variable declared as: bool markerStart;
From within C a call to sizeof(*this) gives a value of 0x216 bytes.
Elsewhere within C, I do: markerStart = false;
Rather than setting markerStart to false, this call is actually clobbering the start of the next class in memory!
Looking at the disassembled code...
I'm trying to learn mips assembly at the moment. To that end, I wrote a very simple c program...
int main(){}
...and compiled it on a mips machine with the -S option to gcc to generate assembly code. Here is what the beginning of the main function looks like:
.ent main
main:
.frame $fp,8,$31
.mask 0x40000000,-8
.f...
What are some good online resources (references, books, tutorials, documentation, etc) for learning and programming in assembly language (more specifically nasm)? It seems as though some of assembly language is rather arcane and I sometimes have problems finding any good info on it.
...
I'm trying to port some assembly code written in Visual Studio into GNU inline assembly on Linux. The original code uses _emit which MSDN describes as a pseudo instruction and explains as:
The _emit pseudoinstruction is similar to the DB directive of MASM. You use _emit to define a single immediate byte at the current location in the...
I have an exam coming up on HC12 Motorola assembly code. Any tips to improve my time in read and understanding asm code efficiently and accurately?
My problems:
I take a long time to read asm code accurately and if I rush my stack is messed up!
...
I am working on a program which produces assembler code from expressions. One of the functions required is tan(x) which currently works using the following sequence of code (the addresses are filled in at run time):
fld [0x00C01288];
fld st(0);
fsin;
fld st(1);
fcos;
fdivp;
fst [0x0030FA8C];
However, I would like to use the FPTAN opco...
When using inline assembly under MSVC, one is allowed to jump outside of the assembly block by referencing a label in the C/C++ code, as explained in this MSDN article.
Can such thing be done when using inline assembly under GCC?
Here's an example of what I'm trying to accomplish:
__asm__ __volatile__ (
" /* assembly code */ "
" j...
I'm messing with assembly language programming and I'm curious how I could tell if a number is a multiple of 4 using the logic operator AND?
I know how to do it using "div" or "remainder" instructions but I'm trying to do this with bit manipulation of number/word.
Can anyone point me in the right direction? I'm using MIPs but a Langua...
I'm writing a program and I need to determine if bits 3 and 6 are set. I know that I can rotate a word or left/right shift it.
But how do I access individual bit's state? Do I use a bitwise operator like and/xor?
...
I'm now willing to compile my project with -std=c99 and I'm facing an error I'm not understanding for the moment. This line :
my_type* td = ({ register kmy_type* arg0 asm("eax"); arg0; });
gives me the following error only in C99 :
warning: ISO C forbids nested functions
error: syntax error before ‘asm’
error: ‘arg0’ undeclared (firs...
At my university the Assembly Programming (x86 and MIPs) class is drawing to an end.
I've thoroughly enjoyed my work in assembly and I would really like to continue working with it. You would think that having to do everything myself would be a drag but I have found that there is a level of transparency that I don't get with higher le...
What does the RSWAI bit in the RTICTL register do?
...
Write a MIPS program that generates and adds up all even numbers from 1 to 100.
it must have at least one loop
it should store the sum in register R12
And this is what I wrote:
main:
li $t0, 0 # clear register $t0 to zero
li $t4, 0 # clear register $t4 to zero
loop:
add $t0, $t...
I'm using shift operations to divide a long word in register D3 by three and storing the result in memory address specified by A2:
Move.L D1, D2, D3, -(SP)
CLR.L D5
MOVE.B #1, D4
Loop LSR.L D2, D3
ROXR.L #1,D5
BCS DONE
SUBI.B #1, D2
BLT Loop
CLR.B D4
DONE ...
please can someone tell how i will approach this Question..thanks
The contents of selected registers and memory locations are specified as follows; D1:2; D3:$80A3; D4:$91EF; D4: $91EF; A2:$00008000; SP: $9000; $ABCDEF7 stored at $8000; $00124300 at $7FFC for the following independent segments of code statements, determine the modifie...
I'm using shift operations to divide a long word in register D3 by three and storing the result in memory address specified by A2:
MOVE.L D1, D2, D3, -(SP)
CLR.L D5
MOVE.B #1, D4
Loop LSR.L D2, D3
ROXR.L #1,D5
BCS DONE
SUBI.B #1, D2
BLT Loop
CLR.B D4
...