irvine32

Running asm procedure in cpp file

蹲街弑〆低调 提交于 2019-12-11 12:34:23
问题 I am trying to run procedure from asm file in cpp file but i get such errors: Error 1 error LNK2019: unresolved external symbol _calka referenced in function _main D:\Addem\main.obj Project Error 2 error LNK1120: 1 unresolved externals D:\Addem\Debug\Project.exe 1 1 Project Here is my main.cpp: #include <iostream> using namespace std; extern "C" void calka(); int main() { calka(); system("Pause"); return 0; } And my calka.asm ; The calka Subroutine (calka.asm) public _calka INCLUDELIB

selection sort in assembly language

十年热恋 提交于 2019-12-11 04:58:32
问题 here is my code.. I have to perform a selection sort on an array. It is homework. The Irvine32.inc sets up my memory model. Any suggestions to what I'm doing wrong would be helpful. I've redone the entire thing a few times now. INCLUDE Irvine32.inc .data myArray DWORD 10, 12, 3, 5 .code main PROC call Clrscr MOV EDI, OFFSET myArray MOV ECX, LENGTHOF myArray CALL PRINT_ARRAY MOV EDI, OFFSET myArray MOV ECX, LENGTHOF myArray CALL SORT_ARRAY CALL CRLF MOV EDI, OFFSET myArray MOV ECX, LENGTHOF

\ch03\AddSub.asm(45): fatal error A1010: unmatched block nesting : IsPrime

依然范特西╮ 提交于 2019-12-11 04:41:04
问题 INCLUDE Irvine32.inc .code main PROC .REPEAT mov edx, OFFSET fPrompt ;display a prompt call WriteString call ReadInt ;recordes users number mov var1, eax ;gives var1 the users number .IF var1 == -1 ;jumps to L3 if the user want's to quit jmp L3 .ENDIF call IsPrime ;calls the IsPrime procedure L3: .UNTIL var1 == -1 ;jumps up to repeat if var1 != -1 ret main ENDP mov ebx, 2 ; sets minimum divisor mov eax, var1 ; set dividend cdq ; converts to 64-bit edx:eax mov ecx, ebx ; stores divisor in ecx

How does ASM knows an arithmetic operation is signed or unsigned?

时光总嘲笑我的痴心妄想 提交于 2019-12-10 14:17:30
问题 I am assembling using MASM 14.0, and i am confused with the output of the below code. TITLE Exercise 4 from chapter 4 ; Author : Saad Ahmed INCLUDE Irvine32.inc .code main PROC mov eax, 0 mov al, 255 add al, 1 call DumpRegs ; Display registers mov al, 127 add al, 1 call DumpRegs ; Display registers exit main ENDP END main Both arithmetic operations are done on unsigned integers 255 and 127. However, the CPU is treating the first operation 255, as an unsigned integers and setting the carry

How do you do a selection sort in MASM Assembly?

随声附和 提交于 2019-12-08 08:14:31
问题 So I'm trying to sort an array in ascending order, and it just doesn't seem to work for me. I know my swap procedure is wrong, and my minIndex procedure only works half the time, but the randomly filled array generates just fine. Working Code Thanks to vitsoft: include Irvine32.inc ; Constants NUM_INTEGERS = 20 NUM_RANGE = 99d TO_ENSURE_NOT_ZERO = 1d .data ; Declare Arrays ; Declare Array of 20 Integers array byte NUM_INTEGERS dup(?) ; Displayed Annotation for Unsorted Array unsortedArrayText

Reversing an array in assembly

蓝咒 提交于 2019-12-06 11:26:52
I'm trying to figure out how to reverse an array in assembly in a way that makes it as flexible as possible. The code I have so far is this: ; This program takes an integer array and reverses it's elements, using a loop, the SIZE, TYPE and LENGTHOF ; operators. TITLE lab4 (lab4.asm) INCLUDE Irvine32.inc .data arr DWORD 1h, 2h, 3h, 4h, 5h, 6h ; Array of integers with 6 elements. len DWORD LENGTHOF arr / 2 ; The length of the array divided by 2. ;rng DWORD LENGTHOF arr ; The complete length of the array. .code main PROC mov eax, len ; Moves the length (divided by 2) into the eax register. mov

How to loop in assembly language

我们两清 提交于 2019-12-04 15:56:53
问题 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

Can we use Two 32 bit reg(32 + 32 = 64) at a time to make it able to take 64bit values? Assembly Language 8086

淺唱寂寞╮ 提交于 2019-12-04 06:15:12
问题 Assembly Language 8086: I have make the program for addition it takes two values in console and gives us result.. it can only take value under 32 bits(8 digits) if we give higher value then it will give error of integer overflow in console If i want to give more then 32bit value in input1 and input2 how will i do it? I Want add value1 to value2 by using 32bit register and give value under 64bit(equals to 16 digits).. it is Possible to use the space of 2 reg (32+32 = 64bit)? ... How we can

Strange output with Irvine's WriteString

不打扰是莪最后的温柔 提交于 2019-12-04 04:08:23
问题 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

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