From 0ecbaa957c734d593ca13681a5ed9f87614d3611 Mon Sep 17 00:00:00 2001 From: aht2nguy <aht2nguy@student.cs.uwaterloo.ca> Date: Sun, 20 May 2018 11:21:48 -0400 Subject: [PATCH] everything --- src/Makefile | 6 +- src/first.map | 0 src/libsrc/Makefile | 5 +- src/libsrc/bwio.a | Bin 0 -> 5592 bytes src/libsrc/bwio.o | Bin 0 -> 5288 bytes src/libsrc/bwio.s | 982 ++++++++++++++++++++++++++++++++++++++++++++ src/main.o | Bin 0 -> 676 bytes src/main.s | 12 + 8 files changed, 997 insertions(+), 8 deletions(-) create mode 100644 src/first.map create mode 100644 src/libsrc/bwio.a create mode 100644 src/libsrc/bwio.o create mode 100644 src/libsrc/bwio.s create mode 100644 src/main.o create mode 100644 src/main.s diff --git a/src/Makefile b/src/Makefile index 1305961..17a2cda 100644 --- a/src/Makefile +++ b/src/Makefile @@ -17,7 +17,7 @@ ASFLAGS = -mcpu=arm920t -mapcs-32 ARFLAGS = rcs -LDFLAGS = -init main -Map first.map -N -T orex.ld -L/u/wbcowan/gnuarm-4.0.2/lib/gcc/arm-elf/4.0.2 -L../lib +LDFLAGS = -init main -Map bwio.map -N -T orex.ld -L/u/wbcowan/gnuarm-4.0.2/lib/gcc/arm-elf/4.0.2 -L../lib all: main.elf @@ -31,7 +31,5 @@ main.elf: main.o $(LD) $(LDFLAGS) -o $@ main.o -ltaskdescriptor -lscheduler -lbwio -lgcc clean: - -rm -f *.elf *.s *.o main.map *.a *~ ../../lib/*.a + -rm -f *.elf *.s *.o *.a *~ ../../lib/*.a - -: \ No newline at end of file diff --git a/src/first.map b/src/first.map new file mode 100644 index 0000000..e69de29 diff --git a/src/libsrc/Makefile b/src/libsrc/Makefile index 7f40a82..1131426 100644 --- a/src/libsrc/Makefile +++ b/src/libsrc/Makefile @@ -1,6 +1,6 @@ # Makefile for busy-wait IO tests # -XCC = /u/wbcowan/gnuarm-4.0.2/arm-elf/bin/gcc +XCC = /u/wbcowan/gnuarm-4.0.2/arm-elf/bin/gcc AS = /u/wbcowan/gnuarm-4.0.2/arm-elf/bin/as AR = /u/wbcowan/gnuarm-4.0.2/arm-elf/bin/ar CFLAGS = -c -fPIC -Wall -I. -I../../include -mcpu=arm920t -msoft-float @@ -17,7 +17,6 @@ ARFLAGS = rcs all: bwio.a - scheduler.s: scheduler.c $(XCC) -S $(CFLAGS) scheduler.c @@ -27,7 +26,6 @@ taskdescriptor.s: taskdescriptor.c bwio.s: bwio.c $(XCC) -S $(CFLAGS) bwio.c - scheduler.o: scheduler.s $(AS) $(ASFLAGS) -o scheduler.o scheduler.s @@ -37,7 +35,6 @@ taskdescriptor.o: taskdescriptor.s bwio.o: bwio.s $(AS) $(ASFLAGS) -o bwio.o bwio.s - scheduler.a: scheduler.o $(AR) $(ARFLAGS) $@ scheduler.o diff --git a/src/libsrc/bwio.a b/src/libsrc/bwio.a new file mode 100644 index 0000000000000000000000000000000000000000..c6d72c4a94e17c459261ef8d8d8bf159e9066a76 GIT binary patch literal 5592 zcmb_gU2Ggz6+W};7RO$@lh%U8UdpuDiX|kQ$!6m^u%eNYwkb9hO47zCk>ZWl#)i6H zdDp}sBa9sh^HZs6q^fFDu@b3>A|zb34;2DoHF=1lNEn=lJoLdo8POIVN~s_ZQQhym zbFMovwi-cKT7UPPd+zx^cRYJvp*Yez@b!ir-mRaVyL0Uwxjnh|cF*(8R`jpu?R*d$ z=F`(4B6s2Y!T<U_akA1^?H}wP7PG39`}#^)mPf0-(wiF#mkJ{xRjKOYB<Sz-LGZ-M zVveVZxk3CL9n2L0;ott@k)dK0WO-!p>1sdu!`b1FBaX(J+qE<Ad%N3r?m~>d-=5EV z-tJsShmG~e4|hG{I8G6<nvWwHaV!D6nh1%!fsAaDJEdv1wkX%Ozf(8UwUnCs=2B7` zgOuACB>lD^<2T~l7Kj{LZW3wW+QHhz`W}&Y$NgUgEs*&v*44;b{DtK-_*=nm;d%db z;DS!6E)VBjtX+R<*#mzI<U;y_p*^$L7_@kl;rU5?Yer`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#{>MLhG3{2PjMifQym8!mx@ z;$b2#fRbVjNISEn@q-KRDbm+<->nPjG?3?fr3;GPiZ#Ur#eXQir-*Sd=QBX+-=<hl zep%_7;%^ma6fY`XQ@pNtQ}HnRn0k8@%ZlTQ(~2)Bo>iPtoK<W=e^XCdu?N_O!L2HN zMe%L&TSaav&C7=85<v3PL_7#Ol<v~~ZpD&fS#ezPieeq+i24e^wiN26bXjqNeAMHV z(tl9Aq<B^Fn&J(`WCPB99{moa{=JG_irtDO#j;{maYFHw;<Jip6l;nXf%NZ^(jSn< zk9aqf_HbD<t^yJKy+HaiK>7=aOZn5vpCJwTE6Sf!{sL*(adFS^`~hIwy&@k0UW>!U literal 0 HcmV?d00001 diff --git a/src/libsrc/bwio.o b/src/libsrc/bwio.o new file mode 100644 index 0000000000000000000000000000000000000000..1f01e290b85e1e1a3aedabe0cb298ef39089b2f4 GIT binary patch literal 5288 zcmb_gU1%It6h5;XHBB~g+6G;dRR_D`THAGq5vv9)v}!d`q^&m6LbJ&xHfqe0Y;2T> zF)0}TKrD!8#RV&tA{fyJ5yfEpP)fmQ`p}0y<fnu6=b={7J{05k-8naoF~Nc^Ouu{1 zJ@@>dJDEOvXY*Z-<K#qtj%38K1n_twBpM84WSLwnRpX^;IkEQpva#lw)Wm%=NvRA{ zZe@`4>w=75iKi|Q*)m%tQo*%@wTtyiksk*AcY+$oT!wWqvKD`8HVyu2@N0P9-y67~ zQ>x3uc^7NfADQ*QUj@04K4fUm>{SLe9%Xob7*EOQOoNU~X*w~{G$RMzK3y&^50%R+ zLrca19ciyJ;5o)|2W+Rob7b@EMy&6F?N8MAF(CbH2Je9K_D6V(i~c@}{S<U$pqDv$ zy?V>+PUvDjGT_H$^YlZYcR`LZ(09h*a!=RfSzQZdzO*tPWMG5#tZn8d8h--uyLb}F zfs04Ja{gA+q}J5&OVcU8$<&p#vH2KbKA@9z9mV<;*m_)J-=(p?3SO)7c0_pAr+ti* z`9+=ItuIYGetc#Q5A%()wJC3VSVwQf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K_gfV6iUq|%#bb(Pm?P?I1lFZcFQp5LL*%0# zdzAiM@rdGa#S@C>6q6M=cLn+#Nd4;-n-yCW^NIz<qT-O^9>rG`_bHYX4+H7n5v6}6 zjsL_ur?iL5nsGG}!Cw!gKf6d@iMW(Ms{Aq1kUysU3FS|bh8-9849{-@)?Fp?Cp&v~ AdjJ3c literal 0 HcmV?d00001 diff --git a/src/libsrc/bwio.s b/src/libsrc/bwio.s new file mode 100644 index 0000000..1131732 --- /dev/null +++ b/src/libsrc/bwio.s @@ -0,0 +1,982 @@ + .file "bwio.c" + .text + .align 2 + .global bwsetfifo + .type bwsetfifo, %function +bwsetfifo: + @ args = 0, pretend = 0, frame = 28 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #28 + str r0, [fp, #-24] + str r1, [fp, #-28] + ldr r3, [fp, #-24] + str r3, [fp, #-40] + ldr r3, [fp, #-40] + cmp r3, #0 + beq .L3 + ldr r3, [fp, #-40] + cmp r3, #1 + beq .L4 + b .L2 +.L3: + ldr r3, .L11 + str r3, [fp, #-20] + b .L5 +.L4: + ldr r3, .L11+4 + str r3, [fp, #-20] + b .L5 +.L2: + mvn r3, #0 + str r3, [fp, #-36] + b .L6 +.L5: + ldr r3, [fp, #-20] + ldr r3, [r3, #0] + str r3, [fp, #-16] + ldr r3, [fp, #-28] + cmp r3, #0 + beq .L7 + ldr r3, [fp, #-16] + orr r3, r3, #16 + str r3, [fp, #-32] + b .L9 +.L7: + ldr r3, [fp, #-16] + bic r3, r3, #16 + str r3, [fp, #-32] +.L9: + ldr r3, [fp, #-32] + str r3, [fp, #-16] + ldr r2, [fp, #-20] + ldr r3, [fp, #-16] + str r3, [r2, #0] + mov r3, #0 + str r3, [fp, #-36] +.L6: + ldr r3, [fp, #-36] + mov r0, r3 + sub sp, fp, #12 + ldmfd sp, {fp, sp, pc} +.L12: + .align 2 +.L11: + .word -2138308600 + .word -2138243064 + .size bwsetfifo, .-bwsetfifo + .align 2 + .global bwsetspeed + .type bwsetspeed, %function +bwsetspeed: + @ args = 0, pretend = 0, frame = 28 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #28 + str r0, [fp, #-24] + str r1, [fp, #-28] + ldr r2, [fp, #-24] + str r2, [fp, #-36] + ldr r3, [fp, #-36] + cmp r3, #0 + beq .L15 + ldr r2, [fp, #-36] + cmp r2, #1 + beq .L16 + b .L14 +.L15: + ldr r3, .L23 + str r3, [fp, #-20] + ldr r3, .L23+4 + str r3, [fp, #-16] + b .L17 +.L16: + ldr r3, .L23+8 + str r3, [fp, #-20] + ldr r3, .L23+12 + str r3, [fp, #-16] + b .L17 +.L14: + mvn r3, #0 + str r3, [fp, #-32] + b .L18 +.L17: + ldr r2, [fp, #-28] + str r2, [fp, #-40] + ldr r3, [fp, #-40] + cmp r3, #2400 + beq .L20 + ldr r3, .L23+16 + ldr r2, [fp, #-40] + cmp r2, r3 + beq .L21 + b .L19 +.L21: + ldr r2, [fp, #-20] + mov r3, #0 + str r3, [r2, #0] + ldr r2, [fp, #-16] + mov r3, #3 + str r3, [r2, #0] + mov r3, #0 + str r3, [fp, #-32] + b .L18 +.L20: + ldr r2, [fp, #-20] + mov r3, #0 + str r3, [r2, #0] + ldr r2, [fp, #-16] + mov r3, #191 + str r3, [r2, #0] + mov r2, #0 + str r2, [fp, #-32] + b .L18 +.L19: + mvn r3, #0 + str r3, [fp, #-32] +.L18: + ldr r3, [fp, #-32] + mov r0, r3 + sub sp, fp, #12 + ldmfd sp, {fp, sp, pc} +.L24: + .align 2 +.L23: + .word -2138308596 + .word -2138308592 + .word -2138243060 + .word -2138243056 + .word 115200 + .size bwsetspeed, .-bwsetspeed + .align 2 + .global bwputc + .type bwputc, %function +bwputc: + @ args = 0, pretend = 0, frame = 24 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #24 + str r0, [fp, #-24] + mov r3, r1 + strb r3, [fp, #-28] + ldr r3, [fp, #-24] + str r3, [fp, #-36] + ldr r3, [fp, #-36] + cmp r3, #0 + beq .L27 + ldr r3, [fp, #-36] + cmp r3, #1 + beq .L28 + b .L26 +.L27: + ldr r3, .L33 + str r3, [fp, #-20] + ldr r3, .L33+4 + str r3, [fp, #-16] + b .L29 +.L28: + ldr r3, .L33+8 + str r3, [fp, #-20] + ldr r3, .L33+12 + str r3, [fp, #-16] + b .L29 +.L26: + mvn r3, #0 + str r3, [fp, #-32] + b .L30 +.L29: + ldr r3, [fp, #-20] + ldr r3, [r3, #0] + mov r3, r3, lsr #5 + and r3, r3, #1 + and r3, r3, #255 + cmp r3, #0 + bne .L29 + ldrb r2, [fp, #-28] @ zero_extendqisi2 + ldr r3, [fp, #-16] + str r2, [r3, #0] + mov r3, #0 + str r3, [fp, #-32] +.L30: + ldr r3, [fp, #-32] + mov r0, r3 + sub sp, fp, #12 + ldmfd sp, {fp, sp, pc} +.L34: + .align 2 +.L33: + .word -2138308584 + .word -2138308608 + .word -2138243048 + .word -2138243072 + .size bwputc, .-bwputc + .align 2 + .global c2x + .type c2x, %function +c2x: + @ args = 0, pretend = 0, frame = 8 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #8 + mov r3, r0 + strb r3, [fp, #-16] + ldrb r3, [fp, #-16] @ zero_extendqisi2 + cmp r3, #9 + bhi .L36 + ldrb r3, [fp, #-16] @ zero_extendqisi2 + add r3, r3, #48 + and r3, r3, #255 + and r3, r3, #255 + str r3, [fp, #-20] + b .L38 +.L36: + ldrb r3, [fp, #-16] @ zero_extendqisi2 + add r3, r3, #87 + and r3, r3, #255 + and r3, r3, #255 + str r3, [fp, #-20] +.L38: + ldr r3, [fp, #-20] + mov r0, r3 + sub sp, fp, #12 + ldmfd sp, {fp, sp, pc} + .size c2x, .-c2x + .align 2 + .global bwputx + .type bwputx, %function +bwputx: + @ args = 0, pretend = 0, frame = 12 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #12 + str r0, [fp, #-20] + mov r3, r1 + strb r3, [fp, #-24] + ldrb r3, [fp, #-24] @ zero_extendqisi2 + mov r3, r3, lsr #4 + and r3, r3, #255 + mov r0, r3 + bl c2x(PLT) + mov r3, r0 + strb r3, [fp, #-14] + ldrb r3, [fp, #-24] @ zero_extendqisi2 + and r3, r3, #15 + mov r0, r3 + bl c2x(PLT) + mov r3, r0 + strb r3, [fp, #-13] + ldrb r3, [fp, #-14] @ zero_extendqisi2 + ldr r0, [fp, #-20] + mov r1, r3 + bl bwputc(PLT) + ldrb r3, [fp, #-13] @ zero_extendqisi2 + ldr r0, [fp, #-20] + mov r1, r3 + bl bwputc(PLT) + mov r3, r0 + mov r0, r3 + sub sp, fp, #12 + ldmfd sp, {fp, sp, pc} + .size bwputx, .-bwputx + .align 2 + .global bwputr + .type bwputr, %function +bwputr: + @ args = 0, pretend = 0, frame = 16 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #16 + str r0, [fp, #-24] + str r1, [fp, #-28] + sub r3, fp, #28 + str r3, [fp, #-16] + mov r3, #3 + str r3, [fp, #-20] + b .L43 +.L44: + ldr r3, [fp, #-20] + mov r2, r3 + ldr r3, [fp, #-16] + add r3, r2, r3 + ldrb r3, [r3, #0] @ zero_extendqisi2 + ldr r0, [fp, #-24] + mov r1, r3 + bl bwputx(PLT) + ldr r3, [fp, #-20] + sub r3, r3, #1 + str r3, [fp, #-20] +.L43: + ldr r3, [fp, #-20] + cmp r3, #0 + bge .L44 + ldr r0, [fp, #-24] + mov r1, #32 + bl bwputc(PLT) + mov r3, r0 + mov r0, r3 + sub sp, fp, #12 + ldmfd sp, {fp, sp, pc} + .size bwputr, .-bwputr + .align 2 + .global bwputstr + .type bwputstr, %function +bwputstr: + @ args = 0, pretend = 0, frame = 12 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #12 + str r0, [fp, #-16] + str r1, [fp, #-20] + b .L48 +.L49: + ldr r3, [fp, #-20] + ldrb r3, [r3, #0] @ zero_extendqisi2 + ldr r0, [fp, #-16] + mov r1, r3 + bl bwputc(PLT) + mov r3, r0 + cmp r3, #0 + bge .L50 + mvn r3, #0 + str r3, [fp, #-24] + b .L52 +.L50: + ldr r3, [fp, #-20] + add r3, r3, #1 + str r3, [fp, #-20] +.L48: + ldr r3, [fp, #-20] + ldrb r3, [r3, #0] @ zero_extendqisi2 + cmp r3, #0 + bne .L49 + mov r3, #0 + str r3, [fp, #-24] +.L52: + ldr r3, [fp, #-24] + mov r0, r3 + sub sp, fp, #12 + ldmfd sp, {fp, sp, pc} + .size bwputstr, .-bwputstr + .align 2 + .global bwputw + .type bwputw, %function +bwputw: + @ args = 0, pretend = 0, frame = 24 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #24 + str r0, [fp, #-24] + str r1, [fp, #-28] + str r3, [fp, #-36] + mov r3, r2 + strb r3, [fp, #-32] + ldr r3, [fp, #-36] + str r3, [fp, #-16] + b .L56 +.L57: + ldr r3, [fp, #-28] + sub r3, r3, #1 + str r3, [fp, #-28] +.L56: + ldr r3, [fp, #-16] + ldrb r3, [r3, #0] @ zero_extendqisi2 + cmp r3, #0 + moveq r3, #0 + movne r3, #1 + and r2, r3, #255 + ldr r3, [fp, #-16] + add r3, r3, #1 + str r3, [fp, #-16] + eor r3, r2, #1 + and r3, r3, #255 + cmp r3, #0 + bne .L60 + ldr r3, [fp, #-28] + cmp r3, #0 + bgt .L57 + b .L60 +.L61: + ldrb r3, [fp, #-32] @ zero_extendqisi2 + ldr r0, [fp, #-24] + mov r1, r3 + bl bwputc(PLT) +.L60: + ldr r3, [fp, #-28] + cmp r3, #0 + movle r3, #0 + movgt r3, #1 + and r2, r3, #255 + ldr r3, [fp, #-28] + sub r3, r3, #1 + str r3, [fp, #-28] + cmp r2, #0 + bne .L61 + b .L63 +.L64: + ldrb r3, [fp, #-17] @ zero_extendqisi2 + ldr r0, [fp, #-24] + mov r1, r3 + bl bwputc(PLT) +.L63: + ldr r3, [fp, #-36] + ldrb r3, [r3, #0] + strb r3, [fp, #-17] + ldrb r3, [fp, #-17] @ zero_extendqisi2 + cmp r3, #0 + moveq r3, #0 + movne r3, #1 + and r2, r3, #255 + ldr r3, [fp, #-36] + add r3, r3, #1 + str r3, [fp, #-36] + cmp r2, #0 + bne .L64 + sub sp, fp, #12 + ldmfd sp, {fp, sp, pc} + .size bwputw, .-bwputw + .align 2 + .global bwgetc + .type bwgetc, %function +bwgetc: + @ args = 0, pretend = 0, frame = 24 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #24 + str r0, [fp, #-28] + ldr r3, [fp, #-28] + str r3, [fp, #-36] + ldr r3, [fp, #-36] + cmp r3, #0 + beq .L69 + ldr r3, [fp, #-36] + cmp r3, #1 + beq .L70 + b .L68 +.L69: + ldr r3, .L75 + str r3, [fp, #-24] + ldr r3, .L75+4 + str r3, [fp, #-20] + b .L71 +.L70: + ldr r3, .L75+8 + str r3, [fp, #-24] + ldr r3, .L75+12 + str r3, [fp, #-20] + b .L71 +.L68: + mvn r3, #0 + str r3, [fp, #-32] + b .L72 +.L71: + ldr r3, [fp, #-24] + ldr r3, [r3, #0] + mov r3, r3, lsr #6 + and r3, r3, #1 + cmp r3, #0 + beq .L71 + ldr r3, [fp, #-20] + ldr r3, [r3, #0] + strb r3, [fp, #-13] + ldrb r3, [fp, #-13] @ zero_extendqisi2 + str r3, [fp, #-32] +.L72: + ldr r3, [fp, #-32] + mov r0, r3 + sub sp, fp, #12 + ldmfd sp, {fp, sp, pc} +.L76: + .align 2 +.L75: + .word -2138308584 + .word -2138308608 + .word -2138243048 + .word -2138243072 + .size bwgetc, .-bwgetc + .align 2 + .global bwa2d + .type bwa2d, %function +bwa2d: + @ args = 0, pretend = 0, frame = 8 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #8 + mov r3, r0 + strb r3, [fp, #-16] + ldrb r3, [fp, #-16] @ zero_extendqisi2 + cmp r3, #47 + bls .L78 + ldrb r3, [fp, #-16] @ zero_extendqisi2 + cmp r3, #57 + bhi .L78 + ldrb r3, [fp, #-16] @ zero_extendqisi2 + sub r3, r3, #48 + str r3, [fp, #-20] + b .L81 +.L78: + ldrb r3, [fp, #-16] @ zero_extendqisi2 + cmp r3, #96 + bls .L82 + ldrb r3, [fp, #-16] @ zero_extendqisi2 + cmp r3, #102 + bhi .L82 + ldrb r3, [fp, #-16] @ zero_extendqisi2 + sub r3, r3, #87 + str r3, [fp, #-20] + b .L81 +.L82: + ldrb r3, [fp, #-16] @ zero_extendqisi2 + cmp r3, #64 + bls .L85 + ldrb r3, [fp, #-16] @ zero_extendqisi2 + cmp r3, #70 + bhi .L85 + ldrb r3, [fp, #-16] @ zero_extendqisi2 + sub r3, r3, #55 + str r3, [fp, #-20] + b .L81 +.L85: + mvn r3, #0 + str r3, [fp, #-20] +.L81: + ldr r3, [fp, #-20] + mov r0, r3 + sub sp, fp, #12 + ldmfd sp, {fp, sp, pc} + .size bwa2d, .-bwa2d + .align 2 + .global bwa2i + .type bwa2i, %function +bwa2i: + @ args = 0, pretend = 0, frame = 28 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #28 + str r1, [fp, #-32] + str r2, [fp, #-36] + str r3, [fp, #-40] + mov r3, r0 + strb r3, [fp, #-28] + ldr r3, [fp, #-32] + ldr r3, [r3, #0] + str r3, [fp, #-16] + mov r3, #0 + str r3, [fp, #-24] + b .L90 +.L91: + ldr r2, [fp, #-20] + ldr r3, [fp, #-36] + cmp r2, r3 + bgt .L92 + ldr r2, [fp, #-24] + ldr r3, [fp, #-36] + mul r2, r3, r2 + ldr r3, [fp, #-20] + add r3, r2, r3 + str r3, [fp, #-24] + ldr r3, [fp, #-16] + ldrb r3, [r3, #0] + strb r3, [fp, #-28] + ldr r3, [fp, #-16] + add r3, r3, #1 + str r3, [fp, #-16] +.L90: + ldrb r3, [fp, #-28] @ zero_extendqisi2 + mov r0, r3 + bl bwa2d(PLT) + mov r3, r0 + str r3, [fp, #-20] + ldr r3, [fp, #-20] + cmp r3, #0 + bge .L91 +.L92: + ldr r2, [fp, #-32] + ldr r3, [fp, #-16] + str r3, [r2, #0] + ldr r2, [fp, #-40] + ldr r3, [fp, #-24] + str r3, [r2, #0] + ldrb r3, [fp, #-28] @ zero_extendqisi2 + mov r0, r3 + sub sp, fp, #12 + ldmfd sp, {fp, sp, pc} + .size bwa2i, .-bwa2i + .global __udivsi3 + .global __umodsi3 + .align 2 + .global bwui2a + .type bwui2a, %function +bwui2a: + @ args = 0, pretend = 0, frame = 28 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #28 + str r0, [fp, #-28] + str r1, [fp, #-32] + str r2, [fp, #-36] + mov r3, #0 + str r3, [fp, #-24] + mov r3, #1 + str r3, [fp, #-16] + b .L96 +.L97: + ldr r3, [fp, #-16] + ldr r2, [fp, #-32] + mul r3, r2, r3 + str r3, [fp, #-16] +.L96: + ldr r0, [fp, #-28] + ldr r1, [fp, #-16] + bl __udivsi3(PLT) + mov r3, r0 + mov r2, r3 + ldr r3, [fp, #-32] + cmp r2, r3 + bcs .L97 + b .L109 +.L100: + ldr r0, [fp, #-28] + ldr r1, [fp, #-16] + bl __udivsi3(PLT) + mov r3, r0 + str r3, [fp, #-20] + ldr r3, [fp, #-28] + mov r0, r3 + ldr r1, [fp, #-16] + bl __umodsi3(PLT) + mov r3, r0 + str r3, [fp, #-28] + ldr r0, [fp, #-16] + ldr r1, [fp, #-32] + bl __udivsi3(PLT) + mov r3, r0 + str r3, [fp, #-16] + ldr r3, [fp, #-24] + cmp r3, #0 + bne .L101 + ldr r3, [fp, #-20] + cmp r3, #0 + bgt .L101 + ldr r3, [fp, #-16] + cmp r3, #0 + bne .L99 +.L101: + ldr r3, [fp, #-20] + cmp r3, #9 + bgt .L104 + mov r1, #48 + str r1, [fp, #-40] + b .L106 +.L104: + mov r3, #87 + str r3, [fp, #-40] +.L106: + ldr r3, [fp, #-20] + and r3, r3, #255 + ldr r1, [fp, #-40] + mov r2, r1 + add r3, r2, r3 + and r3, r3, #255 + and r3, r3, #255 + ldr r2, [fp, #-36] + strb r3, [r2, #0] + ldr r3, [fp, #-36] + add r3, r3, #1 + str r3, [fp, #-36] + ldr r3, [fp, #-24] + add r3, r3, #1 + str r3, [fp, #-24] +.L99: +.L109: + ldr r3, [fp, #-16] + cmp r3, #0 + bne .L100 + ldr r3, [fp, #-36] + mov r2, #0 + strb r2, [r3, #0] + sub sp, fp, #12 + ldmfd sp, {fp, sp, pc} + .size bwui2a, .-bwui2a + .align 2 + .global bwi2a + .type bwi2a, %function +bwi2a: + @ args = 0, pretend = 0, frame = 8 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #8 + str r0, [fp, #-16] + str r1, [fp, #-20] + ldr r3, [fp, #-16] + cmp r3, #0 + bge .L111 + ldr r3, [fp, #-16] + rsb r3, r3, #0 + str r3, [fp, #-16] + ldr r2, [fp, #-20] + mov r3, #45 + strb r3, [r2, #0] + ldr r3, [fp, #-20] + add r3, r3, #1 + str r3, [fp, #-20] +.L111: + ldr r3, [fp, #-16] + mov r0, r3 + mov r1, #10 + ldr r2, [fp, #-20] + bl bwui2a(PLT) + sub sp, fp, #12 + ldmfd sp, {fp, sp, pc} + .size bwi2a, .-bwi2a + .align 2 + .global bwformat + .type bwformat, %function +bwformat: + @ args = 0, pretend = 0, frame = 40 + @ frame_needed = 1, uses_anonymous_args = 0 + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #40 + str r0, [fp, #-36] + str r1, [fp, #-40] + str r2, [fp, #-44] + b .L133 +.L116: + ldrb r3, [fp, #-14] @ zero_extendqisi2 + cmp r3, #37 + beq .L117 + ldrb r3, [fp, #-14] @ zero_extendqisi2 + ldr r0, [fp, #-36] + mov r1, r3 + bl bwputc(PLT) + b .L115 +.L117: + mov r3, #0 + strb r3, [fp, #-13] + mov r3, #0 + str r3, [fp, #-32] + ldr r2, [fp, #-40] + ldrb r3, [r2, #0] + strb r3, [fp, #-14] + add r3, r2, #1 + str r3, [fp, #-40] + ldrb r3, [fp, #-14] @ zero_extendqisi2 + str r3, [fp, #-52] + ldr r3, [fp, #-52] + cmp r3, #48 + beq .L120 + ldr r3, [fp, #-52] + cmp r3, #48 + blt .L119 + ldr r3, [fp, #-52] + cmp r3, #57 + bgt .L119 + b .L121 +.L120: + mov r3, #1 + strb r3, [fp, #-13] + ldr r2, [fp, #-40] + ldrb r3, [r2, #0] + strb r3, [fp, #-14] + add r3, r2, #1 + str r3, [fp, #-40] + b .L119 +.L121: + ldrb r3, [fp, #-14] @ zero_extendqisi2 + sub r2, fp, #40 + sub ip, fp, #32 + mov r0, r3 + mov r1, r2 + mov r2, #10 + mov r3, ip + bl bwa2i(PLT) + mov r3, r0 + strb r3, [fp, #-14] +.L119: + ldrb r3, [fp, #-14] @ zero_extendqisi2 + str r3, [fp, #-48] + ldr r3, [fp, #-48] + cmp r3, #115 + beq .L126 + ldr r3, [fp, #-48] + cmp r3, #115 + bgt .L129 + ldr r3, [fp, #-48] + cmp r3, #99 + beq .L124 + ldr r3, [fp, #-48] + cmp r3, #99 + bgt .L130 + ldr r3, [fp, #-48] + cmp r3, #0 + beq .L132 + ldr r3, [fp, #-48] + cmp r3, #37 + beq .L123 + b .L115 +.L130: + ldr r3, [fp, #-48] + cmp r3, #100 + beq .L125 + b .L115 +.L129: + ldr r3, [fp, #-48] + cmp r3, #117 + beq .L127 + ldr r3, [fp, #-48] + cmp r3, #120 + beq .L128 + b .L115 +.L124: + ldr r3, [fp, #-44] + add r3, r3, #4 + str r3, [fp, #-44] + ldr r3, [fp, #-44] + sub r3, r3, #4 + ldrb r3, [r3, #0] @ zero_extendqisi2 + ldr r0, [fp, #-36] + mov r1, r3 + bl bwputc(PLT) + b .L115 +.L126: + ldr r2, [fp, #-32] + ldr r3, [fp, #-44] + add r3, r3, #4 + str r3, [fp, #-44] + ldr r3, [fp, #-44] + sub r3, r3, #4 + ldr r3, [r3, #0] + ldr r0, [fp, #-36] + mov r1, r2 + mov r2, #0 + bl bwputw(PLT) + b .L115 +.L127: + ldr r3, [fp, #-44] + add r3, r3, #4 + str r3, [fp, #-44] + ldr r3, [fp, #-44] + sub r3, r3, #4 + ldr r3, [r3, #0] + sub r2, fp, #26 + mov r0, r3 + mov r1, #10 + bl bwui2a(PLT) + ldr r3, [fp, #-32] + ldrb r2, [fp, #-13] @ zero_extendqisi2 + sub ip, fp, #26 + ldr r0, [fp, #-36] + mov r1, r3 + mov r3, ip + bl bwputw(PLT) + b .L115 +.L125: + ldr r3, [fp, #-44] + add r3, r3, #4 + str r3, [fp, #-44] + ldr r3, [fp, #-44] + sub r3, r3, #4 + ldr r3, [r3, #0] + sub r2, fp, #26 + mov r0, r3 + mov r1, r2 + bl bwi2a(PLT) + ldr r3, [fp, #-32] + ldrb r2, [fp, #-13] @ zero_extendqisi2 + sub ip, fp, #26 + ldr r0, [fp, #-36] + mov r1, r3 + mov r3, ip + bl bwputw(PLT) + b .L115 +.L128: + ldr r3, [fp, #-44] + add r3, r3, #4 + str r3, [fp, #-44] + ldr r3, [fp, #-44] + sub r3, r3, #4 + ldr r3, [r3, #0] + sub r2, fp, #26 + mov r0, r3 + mov r1, #16 + bl bwui2a(PLT) + ldr r3, [fp, #-32] + ldrb r2, [fp, #-13] @ zero_extendqisi2 + sub ip, fp, #26 + ldr r0, [fp, #-36] + mov r1, r3 + mov r3, ip + bl bwputw(PLT) + b .L115 +.L123: + ldrb r3, [fp, #-14] @ zero_extendqisi2 + ldr r0, [fp, #-36] + mov r1, r3 + bl bwputc(PLT) +.L115: +.L133: + ldr r1, [fp, #-40] + ldrb r3, [r1, #0] + strb r3, [fp, #-14] + ldrb r3, [fp, #-14] @ zero_extendqisi2 + cmp r3, #0 + moveq r3, #0 + movne r3, #1 + and r2, r3, #255 + add r3, r1, #1 + str r3, [fp, #-40] + cmp r2, #0 + bne .L116 +.L132: + sub sp, fp, #12 + ldmfd sp, {fp, sp, pc} + .size bwformat, .-bwformat + .align 2 + .global bwprintf + .type bwprintf, %function +bwprintf: + @ args = 4, pretend = 12, frame = 8 + @ frame_needed = 1, uses_anonymous_args = 1 + mov ip, sp + stmfd sp!, {r1, r2, r3} + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #16 + sub sp, sp, #8 + str r0, [fp, #-20] + add r3, fp, #8 + str r3, [fp, #-16] + ldr r0, [fp, #-20] + ldr r1, [fp, #4] + ldr r2, [fp, #-16] + bl bwformat(PLT) + sub sp, fp, #12 + ldmfd sp, {fp, sp, pc} + .size bwprintf, .-bwprintf + .ident "GCC: (GNU) 4.0.2" diff --git a/src/main.o b/src/main.o new file mode 100644 index 0000000000000000000000000000000000000000..a1e35354b3bb9a576f984e954fef13f5a77ef7ff GIT binary patch literal 676 zcma)2%}T>S5S}%)wt}Euy~I-^ltrYcf}oU|9>kjuut^sUHd#p)X;0pK3LnQ8@(FaN znIY?`4h-LXGvCh7zR&OPlu`!R6eOU8AbxQ?*<u1i=);Sx*M-;lG+x-%${ikIt;^l! zzIZdfsGg|M<x}UD*~U^boz13kl0H0M#1nm~uK;wjDZR-Mecj@-MBc7F=%w)nbk;PW zYuA$8m8GpbFZd5QLk->5XKi~^_fYOWXI->IH^TY=eV1;`{q}->Hyji6IHrAM2TIXt zrxdVB?F6~Zq|yiaH3e*<Bb1p`8Y6i{q@54YY3?!l5IyYoi8|7VNk8F&VZI07KawYm a{#-&l+=O^Ik+}Rq+a-d1fYKC|&fyn?yEi=m literal 0 HcmV?d00001 diff --git a/src/main.s b/src/main.s new file mode 100644 index 0000000..6cff729 --- /dev/null +++ b/src/main.s @@ -0,0 +1,12 @@ + .file "main.c" + .section .rodata + .align 2 +.LC0: + .ascii "kerxit.c: Hello\012\015\000" + .align 2 +.LC1: + .ascii "kerxit.c: Activating\012\015\000" + .align 2 +.LC2: + .ascii "kerxit.c: Goodbye\012\015\000" + .ident "GCC: (GNU) 4.0.2" -- GitLab