assembly

How can I change the precission of a floating point number in ARM Assembly?

谁说我不能喝 提交于 2020-04-16 04:30:46
问题 I am currently studying computer sciense and in one of my classes (Computer Arquitecture) i am asked to make a function (in ARM assembly) that shows te result of multipying euler to a power (input). In this question they tell me that the result must be calculated with a precission of 0.001, the thing is, i don't know how to do that. If anyone could show me how it would be much apreciated. 来源: https://stackoverflow.com/questions/60645429/how-can-i-change-the-precission-of-a-floating-point

How can I change the precission of a floating point number in ARM Assembly?

让人想犯罪 __ 提交于 2020-04-16 04:29:25
问题 I am currently studying computer sciense and in one of my classes (Computer Arquitecture) i am asked to make a function (in ARM assembly) that shows te result of multipying euler to a power (input). In this question they tell me that the result must be calculated with a precission of 0.001, the thing is, i don't know how to do that. If anyone could show me how it would be much apreciated. 来源: https://stackoverflow.com/questions/60645429/how-can-i-change-the-precission-of-a-floating-point

Am I Writing Assembly Or NASM?

喜夏-厌秋 提交于 2020-04-13 07:12:50
问题 I'm fed up with this. I've been trying to just get a grip on assembly for awhile, but I feel like I'm coding towards my compiler rather than a language. I've been using this tutorial, and so far it's giving me hell. I'm using NASM, which may be the problem, but I figured it was the most popular one. I'm simply trying to learn the most general form of assembly, so I decided to learn x86. I keep running into stupid errors, like not being able to increment a variable. Here's the latest one: not

Am I Writing Assembly Or NASM?

南楼画角 提交于 2020-04-13 07:10:51
问题 I'm fed up with this. I've been trying to just get a grip on assembly for awhile, but I feel like I'm coding towards my compiler rather than a language. I've been using this tutorial, and so far it's giving me hell. I'm using NASM, which may be the problem, but I figured it was the most popular one. I'm simply trying to learn the most general form of assembly, so I decided to learn x86. I keep running into stupid errors, like not being able to increment a variable. Here's the latest one: not

Am I Writing Assembly Or NASM?

核能气质少年 提交于 2020-04-13 07:10:00
问题 I'm fed up with this. I've been trying to just get a grip on assembly for awhile, but I feel like I'm coding towards my compiler rather than a language. I've been using this tutorial, and so far it's giving me hell. I'm using NASM, which may be the problem, but I figured it was the most popular one. I'm simply trying to learn the most general form of assembly, so I decided to learn x86. I keep running into stupid errors, like not being able to increment a variable. Here's the latest one: not

documentation of gnu assembler directives

冷暖自知 提交于 2020-04-13 04:09:17
问题 I'm trying to learn mips assembly at the moment. To that end, I wrote a very simple c program... int main(){} ...and compiled it on a mips machine with the -S option to gcc to generate assembly code. Here is what the beginning of the main function looks like: .ent main main: .frame $fp,8,$31 .mask 0x40000000,-8 .fmask 0x00000000,0 I then tried to figure out what this all means by looking at the documentation for gas, but I couldn't find any of these directives there. So what do they mean?

documentation of gnu assembler directives

走远了吗. 提交于 2020-04-13 04:09:07
问题 I'm trying to learn mips assembly at the moment. To that end, I wrote a very simple c program... int main(){} ...and compiled it on a mips machine with the -S option to gcc to generate assembly code. Here is what the beginning of the main function looks like: .ent main main: .frame $fp,8,$31 .mask 0x40000000,-8 .fmask 0x00000000,0 I then tried to figure out what this all means by looking at the documentation for gas, but I couldn't find any of these directives there. So what do they mean?

Why does the latency of the sqrtsd instruction change based on the input? Intel processors

三世轮回 提交于 2020-04-12 16:10:34
问题 Well on the Intel intrinsic guide it is stated that the instruction called "sqrtsd" has a latency of 18 cycles. I tested it with my own program and it is correct if, for example, we take 0.15 as input. But when we take 256 (or any 2^x) number then the latency is only 13. Why is that? One theory I had is that since 13 is the latency of "sqrtss" which is the same as "sqrtsd" but done on 32bits floating points then maybe the processor was smart enough to understand taht 256 can fit in 32 bit and

Bubble sort on array on Assembly Language

安稳与你 提交于 2020-04-11 07:00:30
问题 I need to Bubblesort an unorganized array with 7 integers from biggest to smallest so it would look like 9,6,5,4,3,2,1. I ran my code through the compiler and it says I can't understand what is the problem with this code: code segment assume ds:code,cs:code start: mov ax,code mov ds,ax ;code start ARR: dw 1,2,4,3,6,5,9 mov ch,0h mov cl,1h mov bh 7h jmp assign_nums restart: mov ch,0h mov cl,1h dec bh jmp assign_nums swap: mov ch,dl mov cl,dh jmp next next: cmp bh,cl je restart add ch,1h add cl

Linux process stack overrun by local variables (stack guarding)

核能气质少年 提交于 2020-04-10 08:44:09
问题 From What is the purpose of the _chkstk() function?: At the end of the stack, there is one guard page mapped as inaccessible memory -- if the program accesses it (because it is trying to use more stack than is currently mapped), there's an access violation. _chkstk() is a special compiler-helper function which ensures that there is enough space for the local variables i.e. it's doing some stack probing (here is an LLVM example). This case is Windows-specific. So Windows has some solution to