Difference between revisions of "Move Unit Forward+/Back-"
Jump to navigation
Jump to search
(Created page with "<font face='Courier New'> 00084770: 94820070 lhu r2,0x0070(r4) 00084774: 00000000 nop 00084778: 30430c00 andi r3,r2,0x0c00 0008477c: 34020400 ori r2,r0,0x0400 00084780:...") |
m (Talcall moved page 00084770 - 00084814 to Move Unit Forward+/Back-) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
<font face='Courier New'> | <font face='Courier New'> | ||
− | 00084770: 94820070 lhu r2,0x0070(r4) | + | 00084770: 94820070 lhu r2,0x0070(r4) Load current facing |
00084774: 00000000 nop | 00084774: 00000000 nop | ||
− | 00084778: 30430c00 andi r3,r2,0x0c00 | + | 00084778: 30430c00 andi r3,r2,0x0c00 obtain facing |
− | 0008477c: 34020400 ori r2,r0,0x0400 | + | 0008477c: 34020400 ori r2,r0,0x0400 r2 = 0x400 |
− | 00084780: 10620019 beq r3,r2,0x000847e8 | + | 00084780: 10620019 beq r3,r2,0x000847e8 branch if facing west |
− | 00084784: 28620401 slti r2,r3,0x0401 | + | 00084784: 28620401 slti r2,r3,0x0401 r2 = true if < 401 |
− | 00084788: 10400005 beq r2,r0,0x000847a0 | + | 00084788: 10400005 beq r2,r0,0x000847a0 branch if not facing < 0x401 (west or south) |
0008478c: 00000000 nop | 0008478c: 00000000 nop | ||
− | 00084790: 10600010 beq r3,r0,0x000847d4 | + | 00084790: 10600010 beq r3,r0,0x000847d4 branch if facing south |
00084794: 00051600 sll r2,r5,0x18 | 00084794: 00051600 sll r2,r5,0x18 | ||
− | 00084798: 08021204 j 0x00084810 | + | 00084798: 08021204 j 0x00084810 skip to end if facing west or south, but not facing west or south. |
0008479c: 00000000 nop | 0008479c: 00000000 nop | ||
− | 000847a0: 34020800 ori r2,r0,0x0800 | + | 000847a0: 34020800 ori r2,r0,0x0800 r2 = 0x800 |
− | 000847a4: 10620005 beq r3,r2,0x000847bc | + | 000847a4: 10620005 beq r3,r2,0x000847bc branch if facing north |
− | 000847a8: 34020c00 ori r2,r0,0x0c00 | + | 000847a8: 34020c00 ori r2,r0,0x0c00 r2 = 0xc00 |
− | 000847ac: 10620014 beq r3,r2,0x00084800 | + | 000847ac: 10620014 beq r3,r2,0x00084800 branch if facing east |
000847b0: 00051600 sll r2,r5,0x18 | 000847b0: 00051600 sll r2,r5,0x18 | ||
− | 000847b4: 08021204 j 0x00084810 | + | 000847b4: 08021204 j 0x00084810 branch if not facing west or south, but also not facing east or north. |
000847b8: 00000000 nop | 000847b8: 00000000 nop | ||
+ | |||
+ | North | ||
000847bc: 00051600 sll r2,r5,0x18 | 000847bc: 00051600 sll r2,r5,0x18 | ||
− | 000847c0: 94830054 lhu r3,0x0054(r4) | + | 000847c0: 94830054 lhu r3,0x0054(r4) Load Y ? |
000847c4: 00021603 sra r2,r2,0x18 | 000847c4: 00021603 sra r2,r2,0x18 | ||
− | 000847c8: 00431021 addu r2,r2,r3 | + | 000847c8: 00431021 addu r2,r2,r3 |
− | 000847cc: 08021204 j 0x00084810 | + | 000847cc: 08021204 j 0x00084810 finish |
− | 000847d0: a4820054 sh r2,0x0054(r4) | + | 000847d0: a4820054 sh r2,0x0054(r4) save Y + input |
+ | |||
+ | South | ||
000847d4: 94830054 lhu r3,0x0054(r4) | 000847d4: 94830054 lhu r3,0x0054(r4) | ||
000847d8: 00021603 sra r2,r2,0x18 | 000847d8: 00021603 sra r2,r2,0x18 | ||
000847dc: 00621823 subu r3,r3,r2 | 000847dc: 00621823 subu r3,r3,r2 | ||
− | 000847e0: 08021204 j 0x00084810 | + | 000847e0: 08021204 j 0x00084810 finish |
− | 000847e4: a4830054 sh r3,0x0054(r4) | + | 000847e4: a4830054 sh r3,0x0054(r4) save Y - input |
+ | |||
+ | |||
000847e8: 00051600 sll r2,r5,0x18 | 000847e8: 00051600 sll r2,r5,0x18 | ||
− | 000847ec: 94830050 lhu r3,0x0050(r4) | + | 000847ec: 94830050 lhu r3,0x0050(r4) Load X ? |
000847f0: 00021603 sra r2,r2,0x18 | 000847f0: 00021603 sra r2,r2,0x18 | ||
000847f4: 00621823 subu r3,r3,r2 | 000847f4: 00621823 subu r3,r3,r2 | ||
000847f8: 08021204 j 0x00084810 | 000847f8: 08021204 j 0x00084810 | ||
− | 000847fc: a4830050 sh r3,0x0050(r4) | + | 000847fc: a4830050 sh r3,0x0050(r4) Save X - Input |
+ | |||
00084800: 94830050 lhu r3,0x0050(r4) | 00084800: 94830050 lhu r3,0x0050(r4) | ||
00084804: 00021603 sra r2,r2,0x18 | 00084804: 00021603 sra r2,r2,0x18 | ||
00084808: 00431021 addu r2,r2,r3 | 00084808: 00431021 addu r2,r2,r3 | ||
− | 0008480c: a4820050 sh r2,0x0050(r4) | + | 0008480c: a4820050 sh r2,0x0050(r4) Save X + input |
00084810: 03e00008 jr r31 | 00084810: 03e00008 jr r31 | ||
00084814: 00000000 nop | 00084814: 00000000 nop | ||
</font> | </font> |
Latest revision as of 02:58, 16 March 2024
00084770: 94820070 lhu r2,0x0070(r4) Load current facing 00084774: 00000000 nop 00084778: 30430c00 andi r3,r2,0x0c00 obtain facing 0008477c: 34020400 ori r2,r0,0x0400 r2 = 0x400 00084780: 10620019 beq r3,r2,0x000847e8 branch if facing west 00084784: 28620401 slti r2,r3,0x0401 r2 = true if < 401 00084788: 10400005 beq r2,r0,0x000847a0 branch if not facing < 0x401 (west or south) 0008478c: 00000000 nop 00084790: 10600010 beq r3,r0,0x000847d4 branch if facing south 00084794: 00051600 sll r2,r5,0x18 00084798: 08021204 j 0x00084810 skip to end if facing west or south, but not facing west or south. 0008479c: 00000000 nop 000847a0: 34020800 ori r2,r0,0x0800 r2 = 0x800 000847a4: 10620005 beq r3,r2,0x000847bc branch if facing north 000847a8: 34020c00 ori r2,r0,0x0c00 r2 = 0xc00 000847ac: 10620014 beq r3,r2,0x00084800 branch if facing east 000847b0: 00051600 sll r2,r5,0x18 000847b4: 08021204 j 0x00084810 branch if not facing west or south, but also not facing east or north. 000847b8: 00000000 nop North 000847bc: 00051600 sll r2,r5,0x18 000847c0: 94830054 lhu r3,0x0054(r4) Load Y ? 000847c4: 00021603 sra r2,r2,0x18 000847c8: 00431021 addu r2,r2,r3 000847cc: 08021204 j 0x00084810 finish 000847d0: a4820054 sh r2,0x0054(r4) save Y + input South 000847d4: 94830054 lhu r3,0x0054(r4) 000847d8: 00021603 sra r2,r2,0x18 000847dc: 00621823 subu r3,r3,r2 000847e0: 08021204 j 0x00084810 finish 000847e4: a4830054 sh r3,0x0054(r4) save Y - input 000847e8: 00051600 sll r2,r5,0x18 000847ec: 94830050 lhu r3,0x0050(r4) Load X ? 000847f0: 00021603 sra r2,r2,0x18 000847f4: 00621823 subu r3,r3,r2 000847f8: 08021204 j 0x00084810 000847fc: a4830050 sh r3,0x0050(r4) Save X - Input 00084800: 94830050 lhu r3,0x0050(r4) 00084804: 00021603 sra r2,r2,0x18 00084808: 00431021 addu r2,r2,r3 0008480c: a4820050 sh r2,0x0050(r4) Save X + input 00084810: 03e00008 jr r31 00084814: 00000000 nop