MASM

When using the MOV mnemonic to load/copy a string to a memory register in MASM, are the characters stored in reverse order?

心已入冬 提交于 2019-12-24 03:49:17
问题 I want to know if using the MOV instruction to copy a string into a register causes the string to be stored in reverse order. I learned that when MASM stores a string into a variable defined as a word or higher (dw and larger sizes) the string is stored in reverse order. Does the same thing happen when I copy a string to a register? Based on this questions (about the SCAS instruction and about assigning strings and characters to variables in MASM 32) I assumed the following: When MASM loads a

macro to allocate space in memory

自闭症网瘾萝莉.ら 提交于 2019-12-24 01:55:13
问题 i need to make an assembly programmer to calculate pascal triangle . so that every line of pascal triangle stored in memory place separate from other line i want to make one but i have no idea how to do it in assembly using macro . macro take an number and allocate that number of dword in memory i did a try but i don't know if it is the correct way to do it %macro Malloc 2 %2 : resd %1 %endmacro i want to know 2 thing : first i want the second arg ( %2 ) to have a string name automatically

macro to allocate space in memory

时光怂恿深爱的人放手 提交于 2019-12-24 01:54:59
问题 i need to make an assembly programmer to calculate pascal triangle . so that every line of pascal triangle stored in memory place separate from other line i want to make one but i have no idea how to do it in assembly using macro . macro take an number and allocate that number of dword in memory i did a try but i don't know if it is the correct way to do it %macro Malloc 2 %2 : resd %1 %endmacro i want to know 2 thing : first i want the second arg ( %2 ) to have a string name automatically

how to create .com files using masm 5.10?

独自空忆成欢 提交于 2019-12-24 00:49:18
问题 .model tiny .code org 100h host: mov ah,9 mov dx,offset hi int 21h mov ax,4c00h int 21h hi db 'HELLO' end host c: masm hello.asm output of this says operand expected on line 1. Please tell me how to generate com files using this version of masm... 回答1: I know this is raising a long dead thread but I thought I'd chime in here as I could not find the answer to this online very easily. Cannot be done with 5.1, however you can use EXE2BIN (just search on google) to convert it to a com file. You

How is Carry Flag set when subtrahend is larger?

痞子三分冷 提交于 2019-12-24 00:15:43
问题 I know the Carry flag during SUB is set whenever the minuend is smaller than the subtrahend and a borrow is required, but haven't been able to find anything explaining this in more detail. Since subtraction is actually just adding with two's complement, how does the CPU know that the subtrahend is larger and a borrow has occurred? The only thing I can think of is that maybe the Carry flag is set automatically during SUB , whenever converting the subtrahend to its 2's complement. Then unless

Custom keyboard interrupt handler

别来无恙 提交于 2019-12-23 13:09:51
问题 I'm trying to write a simple program that will replace standard keyboard interrupt with a custom one that will decrement a variable. However, it won't work without a call to the old handler. Here is my interrupt handler: handler proc push ax push di dec EF ;pushf ;when these to instructions commented keyboard interrupts handling hangs ;call [OLD] mov al,20h out 20h,al pop di pop ax iret handler endp What actions I should also execute in my handler to make it works without calling the old

How to remove unused .CONST data in MASM?

孤者浪人 提交于 2019-12-23 08:52:19
问题 I'm using macros in MASM to generate about 2000 functions, for each of which I define a string, but I only use around ~30 of them in any given program. (There is no way to predict which ones I will use ahead of time; I use them as needed.) Is there any way to tell the linker to "strip out" the strings that I don't end up using? They blow up the binary size by quite a lot. 回答1: Why don't you just put those 2000 functions and strings into a static library? Make the procs public, and use

Taking an Assembly Course, Stuck in DOS!

五迷三道 提交于 2019-12-23 08:51:30
问题 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 writing programs. I have tried under Windows, but it just doesn't assemble (I am guessing this is because of Protected Mode). Any advice on what should I do?

Assembler switch lower case for upper case and vice versa

空扰寡人 提交于 2019-12-23 06:21:22
问题 im trying to do an Assembler program, that change the upper cases for lower cases and vice versa, all at the same time. For example: the input would be: Hello, this is AN EXAMPLE. And i want the output to be: hELLO, THIS IS an example. all i have get is to change the string to Uppercase only, im using Assembler 8086 and Microsoft Macro Assembler (MASM) as far i know. Thanks! This is my code stackseg segment para stack 'stack' db 32 dup (' ') stackseg ends datasgmt segment para 'data' show db

Assembly Programming in Visual Studio 2008

时光总嘲笑我的痴心妄想 提交于 2019-12-23 04:09:20
问题 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 have been unable to find one? 回答1: Well, after some checking, it appears that VS 2008 at least contains the masm .rules file (the one that gives you all the