有人可以帮我理解这段代码的详细工作原理。目前我只了解前三行...
MOV AL,99H
OUT 06H,AL
MOV AL,2
NEXT1: MOV CX,0FFFFH
NEXT2: LOOP NEXT2
OUT 02H,AL
ROL AL,1
JMP NEXT1
END
答案 0 :(得分:2)
对我来说,这对我来说就像某种LED追逐者:
; send 0x99 (binary 10011001) to Port 6, for whaever reason
MOV AL,99H
OUT 06H,AL
MOV AL,2 ; initialize running bit, 2= 00000010b
NEXT1: MOV CX,0FFFFH
NEXT2: LOOP NEXT2 ; this loops 65535 times (decrease
; CX until 0 is reached)
OUT 02H,AL ; send pattern to port 2 (whatever that does)
ROL AL,1 ; 'rol' shifts left one bit each time ...
; putting the 1 back in on the right side,
; when it drops out
JMP NEXT1 ; back to the pausing loop
END
端口2上的:将出现以下内容(重复)
(pause)
00000010
(pause)
00000100
(pause)
00001000
(pause)
00010000
(pause)
00100000
(pause)
01000000
(pause)
10000000
(pause)
00000001
你给我们的小信息不能说什么: