assembly

Executing the assembly generated by Numba

帅比萌擦擦* 提交于 2021-01-22 05:04:42
问题 In a bizarre turn of events, I've ended up in the following predicament where I'm using the following Python code to write the assembly generated by Numba to a file: @jit(nopython=True, nogil=True) def six(): return 6 with open("six.asm", "w") as f: for k, v in six.inspect_asm().items(): f.write(v) The assembly code is successfully written to the file but I can't figure out how to execute it. I've tried the following: $ as -o six.o six.asm $ ld six.o -o six.bin $ chmod +x six.bin $ ./six.bin

Executing the assembly generated by Numba

断了今生、忘了曾经 提交于 2021-01-22 05:01:43
问题 In a bizarre turn of events, I've ended up in the following predicament where I'm using the following Python code to write the assembly generated by Numba to a file: @jit(nopython=True, nogil=True) def six(): return 6 with open("six.asm", "w") as f: for k, v in six.inspect_asm().items(): f.write(v) The assembly code is successfully written to the file but I can't figure out how to execute it. I've tried the following: $ as -o six.o six.asm $ ld six.o -o six.bin $ chmod +x six.bin $ ./six.bin

Storing addresses in a register for MIPS

倾然丶 夕夏残阳落幕 提交于 2021-01-21 09:14:50
问题 I have allocated a certain amount of memory and would like to assign the location of this memory to variable I have declared in the .data section of the program. I know how to assign the memory location to the variable, but once I do that how can I use that variable to access the allocated memory? 回答1: MIPS has many instructions for loading and storing to memory: load word (lw), load halfword (lh), load byte(lb), store word (sw), store half word (sh), and store byte (sb) just to name a few.

Storing addresses in a register for MIPS

老子叫甜甜 提交于 2021-01-21 09:07:10
问题 I have allocated a certain amount of memory and would like to assign the location of this memory to variable I have declared in the .data section of the program. I know how to assign the memory location to the variable, but once I do that how can I use that variable to access the allocated memory? 回答1: MIPS has many instructions for loading and storing to memory: load word (lw), load halfword (lh), load byte(lb), store word (sw), store half word (sh), and store byte (sb) just to name a few.

How Does BIOS initialize DRAM?

我的梦境 提交于 2021-01-20 20:08:23
问题 I've been searching all over for an explanation of how exactly BIOS works now for quite some time. I have designed a bootloader and have jumped to 32-bit mode with it while successfully initializing the IDT as well as the GDT, but in doing so, I have found "operating systems" seeming to be quite simple, and the feeling as if "BIOS" IS the actual operating system of every computer. So now I have took on a new challenge of trying to discover how BIOS actually initializes itself, discovers how

How Does BIOS initialize DRAM?

牧云@^-^@ 提交于 2021-01-20 20:07:54
问题 I've been searching all over for an explanation of how exactly BIOS works now for quite some time. I have designed a bootloader and have jumped to 32-bit mode with it while successfully initializing the IDT as well as the GDT, but in doing so, I have found "operating systems" seeming to be quite simple, and the feeling as if "BIOS" IS the actual operating system of every computer. So now I have took on a new challenge of trying to discover how BIOS actually initializes itself, discovers how

How Does BIOS initialize DRAM?

寵の児 提交于 2021-01-20 20:07:39
问题 I've been searching all over for an explanation of how exactly BIOS works now for quite some time. I have designed a bootloader and have jumped to 32-bit mode with it while successfully initializing the IDT as well as the GDT, but in doing so, I have found "operating systems" seeming to be quite simple, and the feeling as if "BIOS" IS the actual operating system of every computer. So now I have took on a new challenge of trying to discover how BIOS actually initializes itself, discovers how

How Does BIOS initialize DRAM?

穿精又带淫゛_ 提交于 2021-01-20 20:06:34
问题 I've been searching all over for an explanation of how exactly BIOS works now for quite some time. I have designed a bootloader and have jumped to 32-bit mode with it while successfully initializing the IDT as well as the GDT, but in doing so, I have found "operating systems" seeming to be quite simple, and the feeling as if "BIOS" IS the actual operating system of every computer. So now I have took on a new challenge of trying to discover how BIOS actually initializes itself, discovers how

Difference between an instruction and a micro-op

一曲冷凌霜 提交于 2021-01-20 19:30:51
问题 What is the difference between a machine instruction and a micro-op? I found a following definition here: A small, basic instruction, used in series to make up a high-level machine instruction Here is what I found on Wikipedia In computer central processing units, micro-operations (also known as a micro-ops or μops) are detailed low-level instructions used in some designs to implement complex machine instructions (sometimes termed macro-instructions in this context) Am I correct in

cmp je/jg how they work in assembly

為{幸葍}努か 提交于 2021-01-20 09:34:15
问题 I would like to understand how cmp and je/jg work in assembly. I saw few examples on google but I am still little bit confused. Below I have shown a part of assembly code that I am trying to convert to C language and the corresponding C code. Is it implemented in the right way or do I have a wrong understanding of how cmp works? cmp $0x3,%eax je A cmp $0x3,%eax jg B cmp $0x1,%eax je C int func(int x){ if(x == 3) goto A; if (x >3) goto B; if(x == 1) goto C; A: ...... B: ...... C: ...... 回答1: