Z80汇编程序/机器码中的字节/字/地址是带符号的还是无符号的? [英] Are bytes/words/addresses signed or unsigned in Z80 assembler/machine code?
问题描述
我正在为Z80二进制文件创建模拟器,但是我无法确定所有整数数据类型是带符号的还是无符号的来自手册或来自Google.那么寄存器 A
, B
... HL
, BC
等中的数字是否已签名?>
在机器代码中,指令后的字节/字/地址是带符号还是无符号的?
就像这些示例一样(来自 8080/Z80指令集):
8080助记符Z80助记符机器代码操作------------- ------------ ------------ ---------MVI A,字节LD A,字节3E字节A<-字节LXI B,单词LD BC,单词01单词BC<-单词JMP地址JP地址C3地址PC<-地址
谢谢.
-
由于from the manual or from google. So are the numbers from registers
A
,B
...HL
,BC
etc signed or not?Also, in machine code are the bytes/words/addresses which come after the instructions as arguments signed or unsigned?
Like in these examples (from 8080/Z80 Instruction Set):
8080 Mnemonic Z80 Mnemonic Machine Code Operation ------------- ------------ ------------ --------- MVI A,byte LD A,byte 3Ebyte A <- byte LXI B,word LD BC,word 01word BC <- word JMP address JP address C3address PC <- address
Thanks in advance.
解决方案The registers can contain either, and most operands calculate both answers at the same time because of Two's complement. Some instructions do however need information whether the containing value is signed or unsigned. They exist in two forms, one for signed and one for unsigned. Can't remember whether Z80 has any of these.
See (1.) Absolute addresses are unsigned and relative addresses (branches) are signed, to be able to jump backwards.
这篇关于Z80汇编程序/机器码中的字节/字/地址是带符号的还是无符号的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!