irvine32

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.*****

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

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

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 11:02:29
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.***** TITLE Program5 (Program5.asm) INCLUDE Irvine32.inc ; (insert constant definitions here) MIN_INPUT = 10 MAX

Program to get user's details, calculate age and display all information

只谈情不闲聊 提交于 2019-12-02 09:15:50
问题 I have some code started but I am having problems saving the users string input into a variable. Using ReadString I can get prompt the user to input a string, but after saving the users input into a variable named AskName1, and then displaying the information saved in AskName1, I have found that it save the number of characters that the user input and not the actual string. So what I need to figure out is how to save the string that the user input into a variable instead of the number of

error A2022: instruction operands must be the same size

旧城冷巷雨未停 提交于 2019-12-02 07:01:55
Hey so I am getting this error when I run this code: 1>------ Build started: Project: Project, Configuration: Debug Win32 ------ 1> Assembling [Inputs]... 1>assign2.asm(32): error A2022: instruction operands must be the same size 1>assign2.asm(33): error A2022: instruction operands must be the same size 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\masm.targets(49,5): error MSB3721: The command "ml.exe /c /nologo /Zi /Fo"Debug\assign2.obj" /Fl"Project.lst" /I "c:\Irvine" /W3 /errorReport:prompt /Taassign2.asm" exited with code 1. ========== Build: 0 succeeded, 1

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

◇◆丶佛笑我妖孽 提交于 2019-12-02 05:33:00
问题 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? 回答1: The error is here: .while j<i You cannot

Assembly bit memory limit in arithmetic

别来无恙 提交于 2019-12-02 05:18:13
I wanted to add the following numbers: 40, 90, 50 and 155 and I get a total of 355. I wanted to experiment and test out whether the register AL will have a bit limit of (2^8) - 1, and when I compiled the code and execute the code, I get decimal of 1376331855. How did that happen? Also, I thought 355 is greater than 255, and as a result should display an overflow exception. I understand if I use MOVZX I will be able to carry the calculation into the higher register of AX. Also, I am very confused with the difference between AL and AH. Is there a different in memory allocation for AL and AH?

Assembly MASM Dealing with Negative Integers

可紊 提交于 2019-12-02 04:48:48
问题 I was instructed to write a program in assembly that will carry out the following arithmetic: ((A + B) / C) * ((D - A) + E) I've succeeded in doing this when no negative values come into to play, but suppose A = 5, B = 4, C = 3, D = 2, and E = 1. This gives us ((5 + 4) / 3) * ((2 - 5) + 1) or -6. this is where I need help. I've done some research, and have found 2's compliment to be a solution, but I'm not sure to implement it into my code. If someone could help me, I'd be very grateful!

Program to get user's details, calculate age and display all information

偶尔善良 提交于 2019-12-02 03:32:57
I have some code started but I am having problems saving the users string input into a variable. Using ReadString I can get prompt the user to input a string, but after saving the users input into a variable named AskName1, and then displaying the information saved in AskName1, I have found that it save the number of characters that the user input and not the actual string. So what I need to figure out is how to save the string that the user input into a variable instead of the number of characters the user input. INCLUDE Irvine32.inc .data AskName BYTE "Please enter your name " ,0dh,0ah,0

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

China☆狼群 提交于 2019-12-02 01:47:43
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 : I appreciate your guys help so far but now I Have two problems. The first is that when I try to