Posts

Showing posts with the label assembly

Assembly? LD & MOV

Assembly? LD & MOV What's the difference between that instructions? By example in the ARM9 processor, it shouldn't be: ASM: mov r0, 0 C: r0 = 0; ASM: ld r0, 0 C: r0 = 0; ? I don't know why to use one or other :S @DrBeco: Why did you tag this intel-syntax (stackoverflow.com/tags/intel-syntax/info)? That makes no sense; this is an ARM question. Intel-syntax is one of two major flavours of syntax for x86, which is a separate architecture. x86's mov instruction can have a memory, register, or immediate source, and doesn't have a separate ld instruction. – Peter Cordes Jun 30 at 0:01 mov ld Hi @PeterCordes, I tagged it for clarifying the operand order, only (first DST, second SRC). But I see your point, ok. – Dr Beco Jun 30 at 0:...

how do i convert the ascii character function from this c++ program into pep8 assembly

how do i convert the ascii character function from this c++ program into pep8 assembly I cant get the ascii character to convert when the input is given. I need help converting this C++ into pep8 assembly language #include <iostream> using namespace std; int main() { int num; char ch; cout << "Enter a character: "; cin.get(ch); cout << "The ASCII equivalent of " << ch << " is " << (int)ch << endl; return 0; } this is what i have so farVVVV BR main num: .EQUATE 0 ch: .EQUATE 2 main: STRO msg0,d CHARI ch,d LDA ch,d STRO msg1,d CHARO ch,d STRO msg2,d CHARO num,i CHARO 'n',i STOP msg0: .ASCII "Enter a character: x00 " msg1: .ASCII "The ASCII equivalent of x00 " msg2: .ASCII " is x00" .END You're asking this the wrong way. This would be a better question if you asked "how do I read a character and print its ASCII code as a decimal number in P...

Passing parameters in assembly language irvine Library

Passing parameters in assembly language irvine Library I'm trying to write a program to calculate the area of a circle by passing parameter. the program prompts a user to enter radius through the main PROC. the are is computed in another procedure say; Area and the results returned in the main PROC. this is done using Irvine32 library. I cant fugure out how to pass parameters. this is what i've done INCLUDE Irvine32.inc .data varx BYTE "Enter radius: " radius DWORD ? y DWORD 22d z DWORD 7d varz BYTE "The Area of the circle is " .code area PROC mov ecx, eax mov eax, y mov ebx, z mul ecx mul ecx div ebx mov edx, OFFSET varz call WriteString call WriteInt call DumpRegs ret area ENDP main PROC mov edx, OFFSET varx call WriteString call ReadInt mov ebx, eax call area exit main ENDP END main What is y and z ? What kind of formula do you want to use to calculate circle ...