简体   繁体   English

加载值来源到寄存器或存储器

[英]Source of loading value to register or memory

When we load a register or memory location with a value (eg MVI 3A or MVI 53 ), what initializes register or memory location with that specific value? 当我们用一个值(例如MVI 3AMVI 53 )加载寄存器或存储位置时,用该特定值初始化寄存器或存储位置的是什么? It is the CPU who performs the initialization, right? 是由CPU执行初始化的,对吗? But where are those values drawn from? 但是,这些价值来自何处?

From the instruction itself! 从指令本身!
An instruction like mvi A, f1 is encoded as 3E F1 , where the second byte is the operand. mvi A, f1这样的指令编码为3E F1 ,其中第二个字节是操作数。

The other mvi are similar: 其他mvi类似于:

mvi B, 34 is 06 34 ; mvi B, 3406 34 ;
mvi C, AA is 0E AA ; mvi C, AA0E AA ;
mvi D, 09 is 16 09 ; mvi D, 0916 09 ;
mvi E, 53 is 1E 53 ; mvi E, 531E 53 ;
mvi H, 00 is 26 00 ; mvi H, 0026 00 ;
mvi L, FF is 2E FF ; mvi L, FF2E FF ;
mvi M, 22 is 36 22 . mvi M, 2236 22

When the CPU read the instruction into the decoder register it also read the data into that register. 当CPU将指令读入解码器寄存器时,它还将数据读入该寄存器。 This kind of operands inserted as data into the instruction flow are called immediates . 作为数据插入指令流中的这种操作数称为立即数

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM