Machine Data Types | ||
---|---|---|
Pentium | UltraSPARC II | JVM |
|
|
|
|
4-bit op-codes (14) | 6-bit op-codes (7) | 9-bit op-codes (8) |
---|---|---|
0000 aaa aaaa aaaa 0001 aaa aaaa aaaa 0010 aaa aaaa aaaa 0011 aaa aaaa aaaa 0100 aaa aaaa aaaa 0101 aaa aaaa aaaa 0110 aaa aaaa aaaa 0111 aaa aaaa aaaa 1000 aaa aaaa aaaa 1001 aaa aaaa aaaa 1010 aaa aaaa aaaa 1011 aaa aaaa aaaa 1100 aaa aaaa aaaa 1101 aaa aaaa aaaa |
ADD R1,R2,R3 # same as R1 = R2 + R3 or R3 = R1 + R2
ADD R1,R2 # same as R1 := R1 + R2
ADD R1 # same as ACC := ACC + R1
MOV R1,4
MOV R1,R4
|
MOV R1,R4
|
"...the Pentium II's standard assembly language syntax (MASM) verges on the bizarre..." --- A.S. Tanenbaum |
MOV R1,#0 ; accumulate the OR in R1, initially 0 MOV R2,#0 ; R2 = index, i, of current product: A[i] and B[i] MOV R3,#4096 ; R3 = first index value not in use LOOP: MOV R4,A(R2) ; R4 = A[i] AND R4,B(R2) ; R4 = A[i] AND B[i] OR R1,R4 ; OR all boolean products into R1 ADD R2,#4 ; i = i + 4 (stpe in units of one word (4 bytes) CMP R2,R3 ; are we done yet? BLT LOOP ; if R2 < R3, we are not done, so continue |
MOV R1,#0 ; accumulate the OR in R1, initially 0 MOV R2,#0 ; R2 = index, i, of current product: A[i] and B[i] MOV R3,#4096 ; R3 = first index value not in use MOV R5,#A ; R5 = address of A MOV R6,#A ; R6 = address of B LOOP: MOV R4,(R2+R5) ; R4 = A[i] AND R4,(R2+R6) ; R4 = A[i] AND B[i] OR R1,R4 ; OR all boolean products into R1 ADD R2,#4 ; i = i + 4 (stpe in units of one word (4 bytes) CMP R2,R3 ; are we done yet? BLT LOOP ; if R2 < R3, we are not done, so continue |
|