MASM

How to loop in assembly language

穿精又带淫゛_ 提交于 2019-12-03 09:08:10
How would I calculate the first 12 values in the Fibonacci number sequence and be able to place it in EAX reg. and display calling DumpRegs? Using Indirect addressing I know I need a for loop here but I'm not sure how to even go about this. Any help or tips are appreciated. INCLUDE Irvine32.inc ; (insert symbol definitions here) .data ; (insert variables here) Fibonacci BYTE 1, 1, 10 DUP (?) .code main PROC ; (insert executable instructions here) ; (This below will show hexa contents of string.) mov esi, OFFSET Fibonacci ; offset the variables mov ebx,1 ; byte format mov ecx, SIZEOF Fibonacci

ASM: MASM, NASM, FASM?

余生颓废 提交于 2019-12-03 03:12:02
问题 I have done ARM assembly programming and I would like to learn the Intel Assembler. I keep hearing all these different F/M/N/ASMs mentioned- but I am unsure how they related to what I wish to achieve? Could somebody please help me identify what I would need to learn how to program low level on the Intel architecture? I dont quite understand how the "different Assemblers" correlate, even more so with x86, IA64, AMD64/x86-64 etc? If it is of any help, I am most comfortable with Eclipse and

Assembly language for Reverse Engineering [closed]

旧街凉风 提交于 2019-12-03 02:32:24
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . What should I choose NASM or MASM for learning assembly. I want to learn assembly, motivation being Reverse Engineering. So that when

ASM: MASM, NASM, FASM?

守給你的承諾、 提交于 2019-12-02 16:41:10
I have done ARM assembly programming and I would like to learn the Intel Assembler. I keep hearing all these different F/M/N/ASMs mentioned- but I am unsure how they related to what I wish to achieve? Could somebody please help me identify what I would need to learn how to program low level on the Intel architecture? I dont quite understand how the "different Assemblers" correlate, even more so with x86, IA64, AMD64/x86-64 etc? If it is of any help, I am most comfortable with Eclipse and Visual Studio 08/10 IDEs. MASM (Microsoft Assembler) is the popular assembler for Windows. MASM is for 16

My program won't sort arrays that are larger than 130

只谈情不闲聊 提交于 2019-12-02 16:02:49
问题 So my program is supposed to take in user input (an integer between 10 and 200) and print out an array of random numbers and print out a sorted version of that array. However, this only works when I enter in 130 or less. I don't know what else I can do. It works but only half way. Is there any way to optimize this code? I have placed lines to help show which procedure I am having problems with. ****I ran debugger and I have left a comment where the program throws an exception error.*****

Assembly language for Reverse Engineering [closed]

此生再无相见时 提交于 2019-12-02 16:01:20
What should I choose NASM or MASM for learning assembly. I want to learn assembly, motivation being Reverse Engineering. So that when I disassemble some executable, I can understand the code by looking at disassembled code. Update: I think I dint make my self clear.. I understand those are assemblers, but to understand the output of a disassembler I need to know assembly and that's the reason I'm asking where to start(with MASM or NASM) Assuming you want to learn how to do reverse-engineering on Windows , here's how. The Linux Way is very different (although eventually you get to more or less

Assembly program crashes on call or exit

僤鯓⒐⒋嵵緔 提交于 2019-12-02 15:56:20
问题 Debugging my code in VS2015, I get to the end of the program. The registers are as they should be, however, on call ExitProcess , or any variation of that, causes an "Access violation writing location 0x00000004." I am utilizing Irvine32.inc from Kip Irvine's book. I have tried using call DumpRegs , but that too throws the error. I have tried using other variations of call ExitProcess , such as exit and invoke ExitProcess,0 which did not work either, throwing the same error. Before, when I

Assign values to registers and add and subtract them

时光怂恿深爱的人放手 提交于 2019-12-02 15:33:02
问题 I am completely lost with this. I need to program that calculates the following expression, using registers: varA = (varA + varB) − (varC + varD), where varA, varB, etc., are variables. Assign integer values to the EAX, EBX, ECX, and EDX registers for the aforementioned variables. (Meaning, you may hardcode the inputs) My Code: ; AddTwo.asm - adds two 32-bit integers. ; Chapter 3 example .386 .model flat,stdcall .stack 4096 ExitProcess proto,dwExitCode:dword .data varA dword 5 varB dword 3

how to convert floating-point number to IEEE 754 using assembly

随声附和 提交于 2019-12-02 13:10:47
can you please help me to convert floating-point number to IEEE 754 using assembly i have this number -1.75 and i know it equla to -1.11000000000000000000000 E+0 on IEEE754 but i dont know how to do the convert in assembly Did you mean something like this: ; Conversion of an ASCII-coded decimal rational number (DecStr) ; to an ASCII-coded decimal binary number (BinStr) as 32-bit single (IEEE 754) include \masm32\include\masm32rt.inc ; MASM32 headers, mainly for printf .data DecStr db "-1.75",0 BinStr db 40 dup (0) result REAL4 ? number dd 0 frac dd 0 divisor dd 1 .code main PROC mov edi,

jump destination too far : by 3 byte(s)

人走茶凉 提交于 2019-12-02 13:00:42
I m having a problem with my loop, the code contained in it is long and it gives me error jump destination too far : by 3 byte(s) . When ı remove: mov edx,offset str1 call writestring this part below the main PROC, it doesnt give an error. But ı need this string user enters a negative number to give a message. How can ı? INCLUDE Irvine32.inc .data money dword 200,100,50,20,10,5,1 str1 byte "Enter the amounts for each value of money : ",0 str2 byte "The sum of your moneys are:",0 total dword 0 buffer dword 1000 dup(0),0 str3 byte "Do not enter neg number ",0 .code main PROC mov edx,offset str1