请考虑以下内容
func session(_ session: MCSession, didFinishReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, at localURL: URL?, withError error: Error?) {
do {
let localData = try Data(contentsOf: localURL!)
let image = UIImage(data: localData)
DispatchQueue.main.async {
// DispatchQueue.main.async necessary because modifying UI
self.imageView.image = image
}
}
catch let error {
print("error \(error)")
}
}
我在DosBox中得到的输出是:
根据此网站(https://www.ascii-codes.com/),笑脸和心脏是STX和ETX字符,而不是预期的括号。
如果我按如下所示更改JMP start
leftbr DB '('
rightbr DB ')'
key DB ''
start:
MOV AH, 08
INT 21h ; Read keypress
MOV [key], AL ; Store the key pressed in variable 'key'
output:
MOV DL, leftbr ; Move the value from 'leftbr' to DL
MOV AH, 02
INT 21h ; Should output (
MOV DL, [key] ; Put the value from 'key' in the DL register
INT 21h ; Output 'key'
MOV DL, rightbr
INT 21h ; Output )
exit:
MOV AH, 4Ch
MOV AL, 00
INT 21h ; Terminate the program
块,则会得到正确的输出:
start:
谁能解释为什么会这样?我应该能够声明一个具有初始值的变量。