machine-language

Is there anything that assembly language can't do but only machine language can?

ε祈祈猫儿з 提交于 2020-05-28 04:41:27
问题 Recently I'm going to learn some basic assembly language, I have searched wiki and what I realize is that assembly language is just a "text version" of machine language in order to let human read? So it means that anything machine language can do assembly language can also finish, right? Or it exists some limitation in assembly language just like a gap between high level programming language and assembly language(Something we can't do well in high level language so we have to use assembly),

How to call machine code stored in char array?

允我心安 提交于 2019-12-29 10:13:09
问题 I'm trying to call native machine-language code. Here's what I have so far (it gets a bus error): char prog[] = {'\xc3'}; // x86 ret instruction int main() { typedef double (*dfunc)(); dfunc d = (dfunc)(&prog[0]); (*d)(); return 0; } It does correctly call the function and it gets to the ret instruction. But when it tries to execute the ret instruction, it has a SIGBUS error. Is it because I'm executing code on a page that is not cleared for execution or something like that? So what am I

How to call machine code stored in char array?

拈花ヽ惹草 提交于 2019-12-29 10:13:04
问题 I'm trying to call native machine-language code. Here's what I have so far (it gets a bus error): char prog[] = {'\xc3'}; // x86 ret instruction int main() { typedef double (*dfunc)(); dfunc d = (dfunc)(&prog[0]); (*d)(); return 0; } It does correctly call the function and it gets to the ret instruction. But when it tries to execute the ret instruction, it has a SIGBUS error. Is it because I'm executing code on a page that is not cleared for execution or something like that? So what am I

Are Instruction set architecture binary (not readable) or human-readable?

孤街醉人 提交于 2019-12-25 04:00:20
问题 If I am correct, an ISA is the set of instructions in a machine language. So are the instructions in an ISA 0/1 binary sequences? Why did I see the instructions in an ISA are human-readable words in books? Are the human-readable words that represent the instructions in an ISA the same as the mnemonics used in the assembly language of the ISA? Are the human-readable words of the instructions in an ISA part of the ISA? If yes, is there a translation process that translate from the human

MIPS labels storage location

痞子三分冷 提交于 2019-12-22 01:32:34
问题 In MIPS, while using a jump instruction, we use a label. again: nop $j again So when we reach the jump instruction, we use the label again to show where to go and the value of the actual address there is used. I wanted to know where the label again is stored. Meaning, say nop is stored at 0x00400000, and the jump instruction is at 0x00400004. Where, then is again kept, how does MIPS know again is pointing to 0x00400000? Is it stored in the Dynamic Data area of the memory map? This is the

Help with 68k assembly - jump tables?

巧了我就是萌 提交于 2019-12-21 07:27:12
问题 I'm working on reverse engineering a large Amiga program in IDA, and I've made a ton of progress. However, there is some stuff I can't quite figure out. Namely, I have found several subroutines which use what I believe to be "jump tables" - but I can't quite figure out how they work. Does anyone have any advice? moveq #0,d0 move.b d7,d0 ; set D0 to a byte from CTRL subq.w #1,d0 ; subtract 1 from it blt.w finish_29ABA ; if D0 is less than 1, branch cmpi.w #$16,d0 bge.w finish_29ABA ; if D0 is

Does a C/C++ program run the CPU or on the Kernel?

独自空忆成欢 提交于 2019-12-12 09:05:39
问题 I'm programming for quite some years now, but there's one thing that I never understood exactly: There are 2 types of programming languages. Compiled ones and interpreted ones, while compiled ones first need to be to compiled to a interpreted language, before they can be executed. For example, C/C++ needs to be compiled to machine language first, before it can be executed. And here comes my question: Who does actually run a compiled C/C++ Windows/Linux program? Is it interpreded by the CPU

Looking for some input on my C++ program. Simpletron, Machine language

☆樱花仙子☆ 提交于 2019-12-12 04:32:03
问题 Edit: So, seems I do have a problem somewhere in my coding. Whenever I run the program and input a variable, it always returns the same answer.."The content at location 76 is 0. Okay guys, I posted on here a few days ago about a question but it was just a compilation error, so if this looks familiar, thats why. I will reiterate, I'm new to programming, I'm not the best, so I'm going for simplicity. Also this is an SML program. Anyway, this IS a homework assignment and I'm wanting a good grade

Encoding/decoding PDP-11 assembly language to binary and hex?

依然范特西╮ 提交于 2019-12-08 08:08:09
问题 I've been given an assignment where I'm to write the actionPreformed methods for Encode and Decode buttons for an application where a user can hypothetically encode/decode PDP-11 instructions (that are limited to ADD , SUB , MOV[B] , CMP[B] ). The application is supposed to be able to take a 4 digit hex number or a 16 digit binary and decode it to assembly, or enter one of the assembly instructions and encode it to binary/hex. This is all rather new to me and I can't seem to wrap my head

PowerPC moving to variable SPR

ⅰ亾dé卋堺 提交于 2019-12-06 06:41:17
问题 I'm writing an assembly macro to a C-program, and being quite new with this I have gotten stuck on something. I'm trying to write a macro for moving data from a general purpose register to a special purpose register. My problem is that the syntax I've found to move data from a GPR to an SPR takes a constant SPR value, while I want to use a variable one stored in another register. # SPR is constant, rA is the value to be written mtspr SPR, rA I'm after something that looks like this: # rA