declaration - MIPS - loading individual bits -
Peer SO user,
If I have a value, then 1010 is saved in memory, How do I load each of the bits starting with the LSB one at a time from MSB? By this I mean,
while the number of loop load $ 1 T1 with 1 pipes loads with a value of $ 1 t1 (1) from the amount indicated by $ 1 Is there some number in the number of 0 signal numbers, from the value in the value of $ T1 (0), unless you do not load the LSB, at MSB (right?) And loop This value is the .data segment in memory first. Do I declare it like this: Value: Byte 00001010 And how do I load individual bits in the registers?
You can call it SLT You can do this with instructions. Here's some pseudo: lbu $ s0, value # load byte slal $ s0, $ s0, 24 # move it to the upper byte of $ s0 (i = 0; i & lt; 8; I ++) {# $ t0 is set to 1, if signature bit of $ s0 (i.e. bitt 31) slt $ t, $ s, $ zero # $ t is set, now value Keeps the value of ith bit. . . # $ TLL $ s0, $ s0, change it to the next bit with # 1 In the assembler, implementing the loop for the left it as one Exercise for the reader goes
Comments
Post a Comment