masm

Decrypt file using XOR

First I'm using MASM, I'm opening an encrypted file and putting it's contents into a buffer and exporting it to a new file. I have everything working except the decrypting portion. I'm not sure if I need to XOR the buffer itself or do I reference edx (where I store the buffer), or do I need to XOR the bytes read which I put in the eax r...

Assembly Programming in Visual Studio 2008

Does anyone have a best practice Project Template for Visual Studio 2008 MASM projects? I don't know why Microsoft shipped VS with MASM but epxect you to use a blank C++ project when there is so much that could have been added by default using a Project Template. Also, is there a project connector for TFS 2008 for MASM projects as I ha...

Can't break out of a simple Assembly loop

Hello, I've been asked to create a simple loop in assembly language but I am having trouble as the loop doesn't end when it should, it continues in an infinite loop. I need to give the ECX a variable which is taken by input, but in my code below even when I specify the counter directly is still falls into an infinite loop. My code is ...

Masm indirect addressing mode for MOV commmand

I've tried the following forms and masm doesnt like any of them: mov byte [myVariable], al mov byte ptr [myVariable], al mov [byte myVariable], al what am i missing? why cant i seem to use indirect addressing. the error i get from masm is 'Missing operator in expression" on some of the lines, some of them say "Structure field expecte...

Assembly Error, Can't figure out reason why

.386 .model small,C .data .code AdjustedSum proc uses ebx ecx esi edi numbers:ptr, used:dword ;int AdjustedSum(int numbers[], int used);{ mov ebx, numbers ;move base address of array in ebx mov eax,0 ...

linking assembly and c problem

Trying to understand how to link a function that is defined in a struct, the function is in the assembly code, and am trying to call it from c. I think am missing a step cause when I call the function, I get an unresolved external symbol... ;Assembly.asm .686p .mmx .xmm .model flat include Definitions.inc .code ?Initialize@Foo@@SIXPA...

windbg 6.11 doesnt work properly, and didnt load my pdb file. the old version works

i wrote a masm test program, compiled it with ml /c /coff /Zi then linked with link /debug /subsystem:console /entry:start test.obj kernel32.lib it works after compile/link . now , i just open the windbg 6.11, load the exe then press F10 twice, it doesnt show the source code. and the test.pdb is not loaded. my symbol path include the ...

Is assembly language `assembler` specific too? Which assembler is best?

Hello, I'm learning assembly language. I started with Paul A. Carter's PC Assembly Language which uses NASM (The Netwide Assembler). Then in the middle I switched and started reading Introduction to 80×86 Assembly Language and Computer Architecture which uses MASM. In NASM I used to write, for initializing a byte db 110101b In MA...

MASM/NASM Differences

What are the syntax differences between the NASM and MASM assemblers? ...

masm assembly unresolved externals

My class is working out of the "Assembly programming for Intel computers" book (5th edition) and I'm trying to get the programs to assemble. The book comes with Irvine32.inc which is supposed to make IO and stuff easier. I have those in the same directory as the .asm file I'm trying to compile. Whenever I do ml /Fe test.exe test.asm /lin...

help on win32 api in assembly

why are the structure declarations in assembly different from those in the win32 api documentation.(i am coming from c++ and trying my hand at assembly language) for example i got this function prototype from icezelion's tutorials(tutorial3) WNDCLASSEX STRUCT DWORD cbSize DWORD ? style DWORD ? ...

What am I doing wrong? (Simple Assembly Loop)

It won't let me post the picture. Btw, Someone from Reddit.programming sent me over here. So thanks! TITLE MASM Template ; Description ; ; Revision date: INCLUDE Irvine32.inc .data myArray BYTE 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 .code main PROC call Clrscr mov esi, OFFSET myArray mov ecx, LENGTHOF myArray mov e...

Taking an Assembly Course, Stuck in DOS!

I'm taking a course on Microprocessor Programming as part of my Electronic Engineering degree. Unfortunately, in the labs, we have to work in DOS using MASM. Now, I don't really find DOS a hindrance, but I just don't have it on a computer at home (and none of the computers that I have have floppy drives), so I am unable to practice writ...

masm division overflow

I'm trying divide two numbers in assembly. I'm working out of the Irvine assembly for intel computers book and I can't make division work for the life of me. Here's my code .code main PROC call division exit main ENDP division PROC mov eax, 4 mov ebx, 2 div ebx call WriteDec ret divison ENDP END main Whe...

Assembly - Trying to reverse string, but it adds an extra character on the final string.

Hi folks. I'm rather new to Assembly (And programming in general, to be honest). I'm trying to play with the stack. The purpose of this code: Take in a String, limited to 80 characters Reprint the String as entered Print each character as it is pushed to the stack Print each character as it is popped from the stack Print the reversed S...

getting starting address of a stack in assembly programming

is it possible to get the effective starting address of a stack after completing stack operations like push and pop in assembly programming? ...

Force visual studio to always 'rebuild all' when debugging

Edit: Basically what I need is for visual studio to always rebuild all when I hit debug. I'm currently using visual studio to compile my assembly programs, using MASM and in general it's working fine. However I've run into an annoying issue: If I include a file (say, a file with functions) like this Include functions.inc and comp...

MOV src dest (or) MOV dest src?

MOV is probably the first instruction everyone learns while learning ASM. Just now I encountered a book Assembly Language Programming in GNU/Linux for IA32 Architectures By Rajat Moona which says: But I learnt that it is MOV dest, src. Its like "Load dest with src". Even Wiki says the same. I'm not saying that the author is wrong. I...

reading a BYTE as a DWORD in Masm

Hi, once again I'm doing MASM programming. I'm trying to write a procedure using the Irvine32 library where the user enters a string which is put into an array of BYTEs with ReadString. Then it loops over that arrray and determines if each character is a number. However, when I try cmp [buffer + ecx], 30h MASM complains about comparin...

error A2070: invalid instruction operands IN SSE MASM64

when compiling this in ml64.exe 64bit (masm64) the SSE command give me an error what do i need to do to include the SSE commands in 64 bit? .code foo PROC movlps [rdx], xmm7 ;;error A2070: invalid instruction operands movhlps xmm6, xmm7 movss [rdx+8], xmm6 ;;rror A2070: invalid instruction operands ret foo ENDP end i get t...