From 37dc9e6425e3f4355db415b869d1641a79c06bc8 Mon Sep 17 00:00:00 2001 From: cxy004 Date: Mon, 16 Aug 2021 04:34:43 +0800 Subject: [PATCH] ping-pong li -> la --- resources/ping-pong-mips32/game/game/evec.S | 2 +- resources/ping-pong-mips32/game/game/game.S | 26 ++++++++++----------- resources/ping-pong-mips32/game/game/init.S | 16 ++++++------- resources/ping-pong-mips32/game/game/supv.S | 8 +++---- resources/ping-pong-mips32/game/game/trap.S | 12 +++++----- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/resources/ping-pong-mips32/game/game/evec.S b/resources/ping-pong-mips32/game/game/evec.S index f167c12..1280456 100644 --- a/resources/ping-pong-mips32/game/game/evec.S +++ b/resources/ping-pong-mips32/game/game/evec.S @@ -29,7 +29,7 @@ INITLOCATE: or t6, t6, k0 or t7, t7, k0 or t8, t8, k1 - li t9, START + la t9, START /* copy .text.ebase */ 1: diff --git a/resources/ping-pong-mips32/game/game/game.S b/resources/ping-pong-mips32/game/game/game.S index 75818ec..7472310 100644 --- a/resources/ping-pong-mips32/game/game/game.S +++ b/resources/ping-pong-mips32/game/game/game.S @@ -59,12 +59,12 @@ GAME_START: lw t2, %lo(SWITCH)(t0) beqz t2, 1f lw t3, %lo(BUTTON)(t1) - li a0, UART0 - li a1, pause + la a0, UART0 + la a1, pause jal PRINT nop lui t4, %hi(next_thread) - li t1, SUPV_TCB + la t1, SUPV_TCB sw t1, %lo(next_thread)(t4) li t4, 0x1 sw t4, TF_s0(t1) @@ -102,7 +102,7 @@ GAME_START: addiu t0, t0, -2 xor ball_dy, ball_dy, t0 5: - li t0, kb_buffer + la t0, kb_buffer lw t2, -8(t0) lw t3, -4(t0) beq t2, t3, 9f @@ -119,13 +119,13 @@ kb_readbuffer: bne t5, t1, 6f nop addiu t2, t2, 4 - li a0, UART0 + la a0, UART0 sw t2, -8(t0) - li a1, pause + la a1, pause jal PRINT nop lui t4, %hi(next_thread) - li t1, SUPV_TCB + la t1, SUPV_TCB sw t1, %lo(next_thread)(t4) li t4, 0x2 sw t4, TF_s0(t1) @@ -156,7 +156,7 @@ kb_readbuffer: slt t0, ball_x, t6 beqz t0, 10f nop - li a0, UART1 + la a0, UART1 li a1, KB_SCORE jal WRITESERIAL nop @@ -201,12 +201,12 @@ kb_readbuffer: and random, random, t1 xor random, random, t5 sra t3, random, 2 - li t2, spx_table + la t2, spx_table andi t3, t3, 0x7 add t3, t3, t2 lw ball_spx, 0(t3) sra t3, random, 5 - li t2, spy_table + la t2, spy_table andi t3, t3, 0x7 add t3, t3, t2 lw ball_spy, 0(t3) @@ -223,7 +223,7 @@ GAME_TIMER: sw v0, 0(sp) addiu ball_cntx, ball_cntx, 1 addiu ball_cnty, ball_cnty, 1 - li a0, UART0 + la a0, UART0 ori a1, player1_y, 0x80 jal WRITESERIAL nop @@ -257,8 +257,8 @@ KB_HANDLER: sw v1, 4(sp) sw v0, 0(sp) - li a0, UART1 - li t0, kb_buffer + la a0, UART1 + la t0, kb_buffer lw k0, -8(t0) lw k1, -4(t0) kb_writebuffer: diff --git a/resources/ping-pong-mips32/game/game/init.S b/resources/ping-pong-mips32/game/game/init.S index 192c77d..6397d31 100644 --- a/resources/ping-pong-mips32/game/game/init.S +++ b/resources/ping-pong-mips32/game/game/init.S @@ -150,8 +150,8 @@ next_thread: .global START START: - li t0, _sbss - li t1, _ebss + la t0, _sbss + la t1, _ebss beq t0, t1, bss_init_done nop bss_init: @@ -160,11 +160,11 @@ bss_init: bne t0, t1, bss_init nop bss_init_done: - li t2, _text_ebase_begin + la t2, _text_ebase_begin mtc0 t2, CP0_EBASE /* init serial */ - li t0, UART0 + la t0, UART0 // FIFO_ENABLE | FIFO_RCV_RST | FIFO_XMT_RST | FIFO_TRIGGER_1 li t1, 0x1 | 0x2 | 0x4 | 0x0 @@ -184,7 +184,7 @@ bss_init_done: li t1, 0x1 // IRxE sb t1, 1(t0) // IER - li t0, UART1 + la t0, UART1 // FIFO_ENABLE | FIFO_RCV_RST | FIFO_XMT_RST | FIFO_TRIGGER_1 li t1, 0x1 | 0x2 | 0x4 | 0x0 @@ -204,12 +204,12 @@ bss_init_done: li t1, 0x1 // IRxE sb t1, 1(t0) // IER - li a0, UART0 - li a1, pingpong + la a0, UART0 + la a1, pingpong jal PRINT nop - li a0, UART1 + la a0, UART1 li a1, KB_RESET jal WRITESERIAL nop diff --git a/resources/ping-pong-mips32/game/game/supv.S b/resources/ping-pong-mips32/game/game/supv.S index 723b54e..ada3a3d 100644 --- a/resources/ping-pong-mips32/game/game/supv.S +++ b/resources/ping-pong-mips32/game/game/supv.S @@ -24,7 +24,7 @@ SUPV_START: sltiu t1, t1, 1 xor t1, t1, zero and s0, s0, t1 - li t0, kb_buffer + la t0, kb_buffer lw t2, -8(t0) lw t3, -4(t0) beq t2, t3, 3f @@ -52,12 +52,12 @@ kb_readbuffer: sw t2, -8(t0) 3: bnez s0, SUPV_START - li a0, UART0 - li a1, resume + la a0, UART0 + la a1, resume jal PRINT nop lui t0, %hi(next_thread) - li t1, GAME_TCB + la t1, GAME_TCB sw t1, %lo(next_thread)(t0) syscall j SUPV_START diff --git a/resources/ping-pong-mips32/game/game/trap.S b/resources/ping-pong-mips32/game/game/trap.S index 9eea86a..a513082 100644 --- a/resources/ping-pong-mips32/game/game/trap.S +++ b/resources/ping-pong-mips32/game/game/trap.S @@ -8,16 +8,16 @@ .section .text.ebase .p2align 2 - li a0, UART0 - li a1, pingpong + la a0, UART0 + la a1, pingpong jal PRINT nop .section .text.ebase180 .p2align 2 - li a0, UART0 - li a1, pingpong + la a0, UART0 + la a1, pingpong jal PRINT nop @@ -155,8 +155,8 @@ RESTART_SAVE: .global RESTART_LOAD RESTART_LOAD: - li a0, UART0 - li a1, pingpong + la a0, UART0 + la a1, pingpong jal PRINT nop lui k0, %hi(next_thread)