СДЕЛАЙТЕ СВОИ УРОКИ ЕЩЁ ЭФФЕКТИВНЕЕ, А ЖИЗНЬ СВОБОДНЕЕ

Благодаря готовым учебным материалам для работы в классе и дистанционно

Скидки до 50 % на комплекты
только до 12.07.2025

Готовые ключевые этапы урока всегда будут у вас под рукой

Организационный момент

Проверка знаний

Объяснение материала

Закрепление изученного

Итоги урока

Презентация "Machine code"

Нажмите, чтобы узнать подробности

Machine code or machine language is a set of instructions executed directly by a computer's central processing unit (CPU). Each instruction performs a very specific task, such as a load, a jump, or an ALU operation on a unit of data in a CPU register or memory.

Просмотр содержимого документа
«Презентация "Machine code"»

Machine code Fulfilled the: Korepanov Daniil Grebenyuk Leonid

Machine code

Fulfilled the:

Korepanov Daniil

Grebenyuk Leonid

Machine code Machine code  or  machine language  is a set of instructions executed directly by a computer's central processing unit (CPU). Each instruction performs a very specific task, such as a load, a jump, or an ALU operation on a unit of data in a CPU register or memory.

Machine code

Machine code  or  machine language  is a set of instructions executed directly by a computer's central processing unit (CPU). Each instruction performs a very specific task, such as a load, a jump, or an ALU operation on a unit of data in a CPU register or memory.

In program A computer program is a sequence of instructions that are executed by a CPU. While simple processors execute instructions one after another, superscalar processors are capable of executing several instructions at once.   .code begin:  mov ax,@Data  mov ds,ax  mov ax,y  imul z  cwd  idiv u  add ax,v  sub ax,w  mov x,ax  mov ah,4ch  int 21h end begin

In program

A computer program is a sequence of instructions that are executed by a CPU. While simple processors execute instructions one after another, superscalar processors are capable of executing several instructions at once.

.code

begin:

mov ax,@Data

mov ds,ax

mov ax,y

imul z

cwd

idiv u

add ax,v

sub ax,w

mov x,ax

mov ah,4ch

int 21h

end begin

Program flow may be influenced by special 'jump' instructions that transfer execution to an instruction other than the numerically following one. Conditional jumps are taken (execution continues at another address) or not (execution continues at the next instruction) depending on some condition.

Program flow may be influenced by special 'jump' instructions that transfer execution to an instruction other than the numerically following one. Conditional jumps are taken (execution continues at another address) or not (execution continues at the next instruction) depending on some condition.

Practical programs All practical programs today are written in higher-level languages or assembly language. The source code is then translated to executable machine code by utilities such as compilers, assemblers, and linkers, with the important exception of interpreted programs, which arenot translated into machine code.

Practical programs

All practical programs today are written in higher-level languages or assembly language. The source code is then translated to executable machine code by utilities such as compilers, assemblers, and linkers, with the important exception of interpreted programs, which arenot translated into machine code.

However, the  interpreter  itself, which may be seen as an executor or processor, performing the instructions of the source code, typically consists of directly executable machine code (generated from assembly or high-level language source code).

However, the  interpreter  itself, which may be seen as an executor or processor, performing the instructions of the source code, typically consists of directly executable machine code (generated from assembly or high-level language source code).

Assembly languages A much more readable rendition of machine language, called assembly language, uses mnemonic codes to refer to machine code instructions, rather than using the instructions' numeric values directly. For example, on the Zilog Z80 processor, the machine code  00000101 , which causes the CPU to decrement the  B  processor register, would be represented in assembly language as 

Assembly languages

A much more readable rendition of machine language, called assembly language, uses mnemonic codes to refer to machine code instructions, rather than using the instructions' numeric values directly. For example, on the Zilog Z80 processor, the machine code  00000101 , which causes the CPU to decrement the  B  processor register, would be represented in assembly language as 

Exapmle The MIPS architecture provides a specific example for a machine code whose instructions are always 32 bits long. The general type of instruction is given by the  op  (operation) field, the highest 6 bits. J-type (jump) and I-type (immediate) instructions are fully specified by  op . R-type (register) instructions include an additional field  funct  to determine the exact operation. The fields used in these types are:

Exapmle

The MIPS architecture provides a specific example for a machine code whose instructions are always 32 bits long. The general type of instruction is given by the  op  (operation) field, the highest 6 bits. J-type (jump) and I-type (immediate) instructions are fully specified by  op . R-type (register) instructions include an additional field  funct  to determine the exact operation. The fields used in these types are:

For example, adding the registers 1 and 2 and placing the result in register 6 is encoded:

For example, adding the registers 1 and 2 and placing the result in register 6 is encoded:

Load a value into register 8, taken from the memory cell 68 cells after the location listed in register 3:

Load a value into register 8, taken from the memory cell 68 cells after the location listed in register 3:

Jumping to the address 1024:

Jumping to the address 1024:

Example full assembler program model small .code  .stack 100h begin:  .data x dw ?  mov ax,@Data  mov ds,ax y dw -2  mov ax,y z dw 3  imul z u dw 2  cwd w dw 4  idiv u v dw 5   add ax,v  sub ax,w  mov x,ax  mov ah,4ch  int 21h end begin

Example full assembler program

model small

.code

.stack 100h

begin:

.data

x dw ?

mov ax,@Data

mov ds,ax

y dw -2

mov ax,y

z dw 3

imul z

u dw 2

cwd

w dw 4

idiv u

v dw 5

add ax,v

sub ax,w

mov x,ax

mov ah,4ch

int 21h

end begin


Скачать

Рекомендуем курсы ПК и ППК для учителей

Вебинар для учителей

Свидетельство об участии БЕСПЛАТНО!