在这个问题中,我需要跟踪对寄存器和变量的所有更改。包括MAR,MDR,EAX,EBX和EDX。 这是代码
; Description: This program gets the age of the user and and calculates their age in dog years (age x 7).
INCLUDE Irvine32.inc
.data
age DWORD ? ; User's age (0x1000)
hi_there BYTE "Hi there,this is Paris",0 ; Greeting the user (0x1004)
prompt1 BYTE "Can I have your age please?",0 ; Gets age (0x1008)
output BYTE "So,your age in dog years is: ",0 ; Reposts dog age (0x100C)
byebye BYTE "Thanks for passing by,have a great day!",0 ; Bye bye (0x1010)
.code
main PROC
; Greet the user
mov EDX,OFFSET hi_there ; Set up for call to WriteString and greet the user
call WriteString
call Crlf
; Gets the user's age
mov EDX,OFFSET prompt1 ; Asks the user's age
call WriteString
call Crlf
call ReadInt ; Reads the users age. Age in EAX
call Crlf
; Calculate the dog years and stores the dog age
mov EBX,7
mul EBX
mov age,EAX ; Stores the users dog age. Dog age also in EAX
; Reports the dog years and says bye
mov EDX,OFFSET output
call WriteString
mov EAX,age
call WriteDec
call Crlf
mov EDX,OFFSET byebye
call WriteString
call Crlf
exit ;exit to operating system
main ENDP
END main
给出的步骤位于红色中,其余的就是我所做的。为了便于阅读,我特别强调了MAR,MDR,EAX,EBX,EDX和年龄发生变化的任何时候,因为其他所有步骤都发生了变化。
请让我知道这是否正确,我在互联网上的其他地方找不到有关更改注册的任何帮助