IcpuED Assembler icasm.c Version 5.2 Input source code file "bmk2.src". Pass 1: 0 errors. 1 000000 c000000c ldi r12, #0 r12 holds an msb mask 2 000004 c18000cc ldiu r12, #%8000 3 000008 c0000008 ldi r8, #0 r8 - running negative sum 4 00000c c0000009 ldi r9, #0 r9 - running positive sum 5 000010 c0000807 ldi r7, #8 r7 - loop count limit-1 6 000014 c0000000 ldi r0, #0 r0 - used for constant 0 7 000018 c0000101 ldi r1, #1 r1 - used for constant 1 8 00001c c0007c0f ldi r15, stack r15 - stack pointer 9 000020 c0000002 ldi r2, #0 r2 - loop counter 10 000024 c0007004 ldi r4, data r4 - pointer to the data 11 12 000028 89200243 lp add r3, r4, r2 add loop count to data pointer (byte) 13 00002c c2800035 ldb r5, #0(r3) get the byte from the array 14 000030 410005f0 st #0(r15), r5 save the byte on the stack (param) 15 000034 a000014e brl r14, elmnt branch to the subroutine 16 000038 89200212 add r2, r1, r2 increment the loop counter 17 00003c 8a200726 sub r6, r2, r7 see if the count has been reached 18 000040 10fff960 brt r6, lp if not, go back (loop) 19 000044 40808840 stb #8(r4), r8 save the negative sum in memory 20 000048 40809940 stb #9(r4), r9 save the positive sum in memory 21 00004c 03000000 halt stop the CPU, assert "cpu-halted" 22 23 * pc #%100 24 000050 c30000fb elmnt ld r11, #0(r15) get the datum off of the stack 25 000054 8a2000ba sub r10, r11, r0 dummy; subtract 0 from the datum 26 000058 85000caa and r10, r10, r12 test the msb (negative datum?) 27 00005c 120002a0 brf r10, pos if not, go to positive # handler 28 000060 89200b88 add r8, r8, r11 negative, so add to negative sum 29 000064 12000100 brf r0, ret skip to return 30 000068 89200b99 pos add r9, r9, r11 positive, so add to positive sum 31 00006c 200000e0 ret bri r14 return from subroutine 32 000070 f00238f9 data dw #%f00238f9 data, first four bytes 33 000074 0ffde700 dw #%0ffde700 data, last four bytes 34 *15, -3, -25, 0; 0ffde700 data, last four bytes 35 *data: -16, 2, 56, -7; f00238f9 data, first four bytes 36 000078 00ffeedd results dw #%00ffeedd garbage; last two bytes --> 49 and cd 37 00007c ffffffff stack dw #%ffffffff garbage; stack 38 Pass 2: 0 errors.