irvine32

Test if value in EAX is the same as any value in a array x86

天涯浪子 提交于 2019-12-02 01:41:13
问题 I am attempting to test if the random value generated in eax is the same as any value in an array I have allocated. The outer loop generates the array and writes it to the screen and in to the array, The inner loop is then supposed to test if the value exists in the array. I know i am not doing the inner loop correctly but I am not sure how to fix it. It assembles just fine but when I try to run I only get a blank cmd window screen. Also I am using Irvine32 libraries. My code is below: EDIT :

error A2070: invalid instruction operands while using nested while loop in assembly language

我与影子孤独终老i 提交于 2019-12-01 23:00:36
I am trying nested while loop in assembly using masm. I am getting the "error A2070: invalid instruction operands" at line 15 i.e at the endw directive of internal while loop while running the following code. INCLUDE Irvine32.inc .data i byte 1 j byte 2 .code main PROC xor eax,eax .while i<5 mov j, 2 .while j<i mov al, j call writeDec call crlf inc j .endw inc i .endw exit main ENDP END main I cant find the reason for this. Can anyone help me? The error is here: .while j<i You cannot compare two memory contents directly. It is possible to compare a memory content with a register, e.g.: mov dl,

How to see the memory occupied by initialised array vs uninitialised array

空扰寡人 提交于 2019-12-01 21:33:51
I'm currently learning assembly programming by following Kip Irvine's "Assembly Language for x86 Processor". In section 3.4.12, the author states: The .DATA? directive declares uninitialized data. When defining a large block of uninitialized data, the .DATA? directive reduces the size of a compiled program. For example, the following code is declared efficiently: .data smallArray DWORD 10 DUP(0) ; 40 bytes .data? bigArray DWORD 5000 DUP(?) ; 20,000 bytes, not initialized The following code, on the other hand, produces a compiled program 20,000 bytes larger: .data smallArray DWORD 10 DUP(0) ;

Strange output with Irvine's WriteString

狂风中的少年 提交于 2019-12-01 20:28:35
the point of the following program is to print out the letter "c" with the combination of every background and foreground color. In the library I'm using the colors are defined 0-15 and with the following code: mov eax,FOREGROUND + (BACKGROUND * 16) call SetTextColor Here is my code: INCLUDE Irvine32.inc .data character BYTE "c" count DWORD ? background DWORD 0 .code main PROC call Clrscr mov ecx, 15 ; our main counter 0-15 colors L1: mov count, ecx ; store our outer loop counter mov ecx, 15 ; set out inner loop counter L2: ; since our color is defined like so... mov eax,FOREGROUND +

Assembly Language New Line

半腔热情 提交于 2019-12-01 12:10:44
I'm brand new to assembly language programming, and I would like my output to have separate lines so that it is easier to read, however, I wrote my code and had it working, but was then informed that I could not in fact use the Irvine procedure to make a new line. My text book only uses the Irvine "Crlf" and the code from other people who asked similar questions on this website completely broke my program so now I'm lost. One I attempted was: mov ah, 0Eh ;print new line sequence mov al, 0Dh int 10h mov al, 0Ah int 10h Anyways, here is my complete code with the Irvine function still. Can

Debugging ASM with Visual Studio - Register content will not display

夙愿已清 提交于 2019-12-01 00:27:23
I have been working on an assembly language project for a class and though I have finally been able to work through all problems in this code ( I believe ), I now can't seem to get the Register contents to display. Here is my code... include C:\Irvine\Irvine32.inc .data ;Variables are listed in following order VAR DATATYPE DIGITS[RADIX] with comments showing binary version of listed digits left DWORD 321 ;101000001b right DWORD 4247 ;1000010010111b total DWORD ? ;uninitialized diff DWORD ? ;uninitialized ;Define a string called message containing HELLO WORLD! message BYTE '"Hello world!"'

Debugging ASM with Visual Studio - Register content will not display

本秂侑毒 提交于 2019-11-30 20:02:17
问题 I have been working on an assembly language project for a class and though I have finally been able to work through all problems in this code ( I believe ), I now can't seem to get the Register contents to display. Here is my code... include C:\Irvine\Irvine32.inc .data ;Variables are listed in following order VAR DATATYPE DIGITS[RADIX] with comments showing binary version of listed digits left DWORD 321 ;101000001b right DWORD 4247 ;1000010010111b total DWORD ? ;uninitialized diff DWORD ?

Assembly Language (x86): How to create a loop to calculate Fibonacci sequence

十年热恋 提交于 2019-11-26 16:47:53
I am programming assembly language (x86) in MASM using Visual Studio 2013 Ultimate. I am trying to use an array to calculate a Fibonacci sequence for n elements using an array. In other words, I am trying to go to an array element, obtain the two elements before it, add those up, and store the result in another array. I am having trouble setting up the index registers to make this work. I have my program setup like this: TITLE fibonacci.asm INCLUDE Irvine32.inc .data fibInitial BYTE 0, 1, 2, 3, 4, 5, 6 fibComputed BYTE 5 DUP(0) .code main PROC MOVZX si, fibInitial MOVZX di, fibComputed MOV cl,

Assembly Language (x86): How to create a loop to calculate Fibonacci sequence

让人想犯罪 __ 提交于 2019-11-26 06:03:45
问题 I am programming assembly language (x86) in MASM using Visual Studio 2013 Ultimate. I am trying to use an array to calculate a Fibonacci sequence for n elements using an array. In other words, I am trying to go to an array element, obtain the two elements before it, add those up, and store the result in another array. I am having trouble setting up the index registers to make this work. I have my program setup like this: TITLE fibonacci.asm INCLUDE Irvine32.inc .data fibInitial BYTE 0, 1, 2,