Difference between revisions of "Machine language"

From ThorstensHome
Jump to: navigation, search
Line 1: Line 1:
 
This shows a mapping of x86 machine language to assembler
 
This shows a mapping of x86 machine language to assembler
  
{| class="wikitable sortable" border=1
+
 
! x86 machine language !! assembler command !! remark
+
00 01                 add    BYTE PTR [bx+di],al||
|-
+
00 41 41              add    BYTE PTR [bx+di+0x41],al||
| 00 01               ||  add    BYTE PTR [bx+di],al||
+
00 ff                 add    bh,bh ||
|-
+
0a                   .byte 0xa ||
| 00 41 41              ||  add    BYTE PTR [bx+di+0x41],al||
+
40                   inc    ax ||
|-
+
41                   inc    cx ||
| 00 ff               || add    bh,bh ||
+
42                   inc    dx ||
|-
+
43                   inc    bx ||
| 0a                   || .byte 0xa ||
+
44                   inc    sp ||
|-
+
45                   inc    bp ||
| 40                   || inc    ax ||
+
46                   inc    si ||
|-
+
47                   inc    di ||
| 41                   || inc    cx ||
+
48                   dec    ax ||
|-
+
49                   dec    cx ||
| 42                   || inc    dx ||
+
4a                   dec    dx ||
|-
+
4b                   dec    bx ||
| 43                   || inc    bx ||
+
4c                   dec    sp ||
|-
+
4d                   dec    bp ||
| 44                   || inc    sp ||
+
4e                   dec    si ||
|-
+
4f                   dec    di ||
| 45                   || inc    bp ||
+
50                      push  ax
|-
+
51                      push  cx
| 46                   || inc    si ||
+
52                      push  dx
|-
+
53                      push  bx
| 47                   || inc    di ||
+
54                   push  rsp ||
|-
+
85 c0                 test eax,eax ||  
| 48                   || dec    ax ||
+
90                   NOP ||  
|-
+
b8 00 00 00 00       mov    eax,0x0 ||  
| 49                   || dec    cx ||
+
c3                   ret  ||
|-
+
cd 10                 int 10 ||
| 4a                   || dec    dx ||
+
eb fd                 short jump to executing the byte before eb ||
|-
+
fa                   cli               This will clear the interrupt flag in the processor meaning interrupts will not be processed after the flag is set again. This means a high risk - no more keyboard input etc.. So this is a privileged command and may only be executed by the operating system.
| 4b                   || dec    bx ||
+
|-
+
| 4c                   || dec    sp ||
+
|-
+
| 4d                   || dec    bp ||
+
|-
+
| 4e                   || dec    si ||
+
|-
+
| 4f                   || dec    di ||
+
|-
+
| 54                   || push  rsp ||
+
|-
+
| 85 c0               || test eax,eax ||  
+
|-
+
| 90                   || NOP ||  
+
|-
+
| b8 00 00 00 00       || mov    eax,0x0 ||  
+
|-
+
| c3                   || ret  ||
+
|-
+
| cd 10               || int 10 ||
+
|-
+
| eb fd               || short jump to executing the byte before eb ||
+
|-
+
| fa                   || cli || This will clear the interrupt flag in the processor meaning interrupts will not be processed after the flag is set again. This means a high risk - no more keyboard input etc.. So this is a privileged command and may only be executed by the operating system.
+
 
|}
 
|}

Revision as of 11:12, 14 December 2014

This shows a mapping of x86 machine language to assembler


00 01                 add    BYTE PTR [bx+di],al||
00 41 41              add    BYTE PTR [bx+di+0x41],al||
00 ff                 add    bh,bh ||
0a                    .byte 0xa ||
40                    inc    ax ||
41                    inc    cx ||
42                    inc    dx ||
43                    inc    bx ||
44                    inc    sp ||
45                    inc    bp ||
46                    inc    si ||
47                    inc    di ||
48                    dec    ax ||
49                    dec    cx ||
4a                    dec    dx ||
4b                    dec    bx ||
4c                    dec    sp ||
4d                    dec    bp ||
4e                    dec    si ||
4f                    dec    di ||
50                      push   ax
51                      push   cx
52                      push   dx
53                      push   bx
54                    push   rsp ||
85 c0                 test eax,eax || 
90                    NOP || 
b8 00 00 00 00        mov    eax,0x0 || 
c3                    ret  ||
cd 10                 int 10 ||
eb fd                 short jump to executing the byte before eb ||
fa                    cli               This will clear the interrupt flag in the processor meaning interrupts will not be processed after the flag is set again. This means a high risk - no more keyboard input etc.. So this is a privileged command and may only be executed by the operating system.

|}