📄 strcmp.s
字号:
/************************************************************* * File: lib/strcmp.s * Purpose: Part of C runtime library * Author: Phil Bunce (pjb@carmel.com) * Revision History: * 970304 Start of revision history *//* Note that the Algorithmics assembler generates 6 warnings for this * file. This is because the assembler considers the load instructions * are not save in the delay slot of a branch. You can safely ignore * the warnings. */#include <regdef.h>#ifdef TEST#define strcmp xstrcmp#endif/*** Loop unrolled four times*/ .globl strcmp .ent strcmpstrcmp: .set noreorder # main loop1: lbu t0, (a0) lbu t1, (a1) beq t0, zero, 2f # brif end of string lbu t2, 1(a0) bne t0, t1, 2f # brif bytes not equal lbu t3, 1(a1) beq t2, zero, 3f # brif end of string lbu t4, 2(a0) bne t2, t3, 3f # brif bytes not equal lbu t5, 2(a1) beq t4, zero, 4f # brif end of string lbu t6, 3(a0) bne t4, t5, 4f # brif bytes not equal lbu t7, 3(a1) beq t6, zero, 5f # brif end of string addu a0, 4 beq t6, t7, 1b # brif bytes equal addu a1, 45: j ra subu v0, t6, t72: j ra subu v0, t0, t13: j ra subu v0, t2, t34: j ra subu v0, t4, t5 .set reorder .end strcmp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -