📄 wf1.sbk
字号:
.global main.section ".text".align 4main:save %sp,-120,%spst %g0,[%fp+-24]set next,%i5st %g0,[%i5]ba .L3; nop.L2:add -20,%fp,%o0add -24,%fp,%o1call lookup; nopld [%o0],%i4add %i4,1,%i4st %i4,[%o0].L3:add -20,%fp,%o0call getword; nopcmp %o0,0; bne .L2; nopld [%fp+-24],%o0call tprint; nopmov %g0,%i0.L1:ret; restore.type main,#function.size main,.-main.global err.align 4err:save %sp,-96,%spset .L6,%o0mov %i0,%o1call printf; nopset 1,%o0call exit; nopmov %g0,%i0.L5:ret; restore.type err,#function.size err,.-err.global getword.align 4getword:save %sp,-96,%sp.L8:.L9:call getchar; nopmov %o0,%i3mov %i3,%i5cmp %i3,-1; be .L11; nopmov %i5,%o0call isletter; nopcmp %o0,0; be .L8; nop.L11:mov %i0,%i4ba .L15; nop.L12:mov %i4,%i3add %i3,1,%i4mov %i5,%i2stb %i2,[%i3].L13:call getchar; nopmov %o0,%i5.L15:mov %i5,%o0call isletter; nopmov %o0,%i5cmp %o0,0; bne .L12; nopstb %g0,[%i4]mov %i4,%i3mov %i0,%i2cmp %i3,%i2; bleu .L16; nopset 1,%i0ba .L7; nop.L16:mov %g0,%i0.L7:ret; restore.type getword,#function.size getword,.-getword.global isletter.align 4isletter:cmp %o0,65; bl .L19; nopcmp %o0,90; bg .L19; nopadd %o0,32,%o0.L19:cmp %o0,97; bl .L21; nopcmp %o0,122; bg .L21; nopba .L18; nop.L21:mov %g0,%o0.L18:retl; nop.type isletter,#function.size isletter,.-isletter.global lookup.align 4lookup:save %sp,-96,%spld [%i1],%i4cmp %i4,%g0; be .L24; nopmov %i0,%o0ld [%i1],%i4ld [%i4+12],%o1call strcmp; nopmov %o0,%i5cmp %i5,0; bge .L26; nopmov %i0,%o0ld [%i1],%i4add %i4,4,%o1call lookup; nopmov %o0,%i0ba .L23; nop.L26:cmp %i5,0; ble .L28; nopmov %i0,%o0ld [%i1],%i4add %i4,8,%o1call lookup; nopmov %o0,%i0ba .L23; nop.L28:ld [%i1],%i0ba .L23; nop.L24:set next,%i4ld [%i4],%i4cmp %i4,2000; bl .L30; nopset .L32,%o0call err; nop.L30:set next,%i4ld [%i4],%i4sll %i4,4,%i4set words,%i3st %g0,[%i4+%i3]set next,%i4ld [%i4],%i4sll %i4,4,%i4set words+8,%i2st %g0,[%i4+%i2]set words+4,%i2st %g0,[%i4+%i2]mov %i0,%o0call strlen; nopmov %o0,%i4add %i4,1,%o0call malloc; nopset next,%i3ld [%i3],%i3sll %i3,4,%i3set words+12,%i2st %o0,[%i3+%i2]set next,%i4ld [%i4],%i4sll %i4,4,%i4set words+12,%i3ld [%i4+%i3],%i4cmp %i4,%g0; bne .L36; nopset .L39,%o0call err; nop.L36:set next,%i4ld [%i4],%i4sll %i4,4,%i4set words+12,%i3ld [%i4+%i3],%o0mov %i0,%o1call strcpy; nopset next,%i4ld [%i4],%i3add %i3,1,%i2st %i2,[%i4]sll %i3,4,%i4set words,%i3add %i4,%i3,%i4st %i4,[%i1]mov %i4,%i0.L23:ret; restore.type lookup,#function.size lookup,.-lookup.global tprint.align 4tprint:save %sp,-96,%spmov %i0,%i5cmp %i5,%g0; be .L42; nopld [%i0+4],%o0call tprint; nopset .L44,%o0ld [%i0],%o1ld [%i0+12],%o2call printf; nopld [%i0+8],%o0call tprint; nop.L42:mov %g0,%i0.L41:ret; restore.type tprint,#function.size tprint,.-tprint.global strcmp.align 4strcmp:save %sp,-96,%spba .L47; nop.L46:mov %i0,%i5add %i5,1,%i0ldsb [%i5],%i5cmp %i5,0; bne .L49; nopmov %g0,%i0ba .L45; nop.L49:add %i1,1,%i1.L47:ldsb [%i0],%i5ldsb [%i1],%i4cmp %i5,%i4; be .L46; nopldsb [%i0],%i5cmp %i5,0; bne .L51; nopset -1,%i0ba .L45; nop.L51:ldsb [%i1],%i5cmp %i5,0; bne .L53; nopset 1,%i0ba .L45; nop.L53:ldsb [%i0],%i5ldsb [%i1],%i4sub %i5,%i4,%i0.L45:ret; restore.type strcmp,#function.size strcmp,.-strcmp.section ".bss".global next.type next,#object.size next,4.common next,4,4.global words.type words,#object.size words,32000.common words,32000,4.section ".rodata".align 1.L44:.byte 37.byte 100.byte 9.byte 37.byte 115.byte 10.byte 0.align 1.L39:.byte 111.byte 117.byte 116.byte 32.byte 111.byte 102.byte 32.byte 119.byte 111.byte 114.byte 100.byte 32.byte 115.byte 116.byte 111.byte 114.byte 97.byte 103.byte 101.byte 0.align 1.L32:.byte 111.byte 117.byte 116.byte 32.byte 111.byte 102.byte 32.byte 110.byte 111.byte 100.byte 101.byte 32.byte 115.byte 116.byte 111.byte 114.byte 97.byte 103.byte 101.byte 0.align 1.L6:.byte 63.byte 32.byte 37.byte 115.byte 10.byte 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -