My new PC

screeny14

leviathan@dizzy-6:~/Pictures> cat /proc/cpuinfo                                                                                                                                                                                              
processor       : 0                                                                                                                                                                                                                          
vendor_id       : AuthenticAMD                                                                                                                                                                                                               
cpu family      : 21                                                                                                                                                                                                                         
model           : 2                                                                                                                                                                                                                          
model name      : AMD FX(tm)-8350 Eight-Core Processor                                                                                                                                                                                       
stepping        : 0                                                                                                                                                                                                                          
microcode       : 0x6000822                                                                                                                                                                                                                  
cpu MHz         : 1400.000                                                                                                                                                                                                                   
cache size      : 2048 KB                                                                                                                                                                                                                    
physical id     : 0                                                                                                                                                                                                                          
siblings        : 8                                                                                                                                                                                                                          
core id         : 0                                                                                                                                                                                                                          
cpu cores       : 4                                                                                                                                                                                                                          
apicid          : 16                                                                                                                                                                                                                         
initial apicid  : 0                                                                                                                                                                                                                          
fpu             : yes                                                                                                                                                                                                                        
fpu_exception   : yes                                                                                                                                                                                                                        
cpuid level     : 13                                                                                                                                                                                                                         
wp              : yes                                                                                                                                                                                                                        
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bmi1                                                                                                                            
bogomips        : 8027.43                                                                                                                                                                                                                    
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 2
model name      : AMD FX(tm)-8350 Eight-Core Processor           
stepping        : 0
microcode       : 0x6000822
cpu MHz         : 1400.000
cache size      : 2048 KB
physical id     : 0
siblings        : 8
core id         : 1
cpu cores       : 4
apicid          : 17
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bmi1
bogomips        : 8027.43
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor       : 2
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 2
model name      : AMD FX(tm)-8350 Eight-Core Processor           
stepping        : 0
microcode       : 0x6000822
cpu MHz         : 1400.000
cache size      : 2048 KB
physical id     : 0
siblings        : 8
core id         : 2
cpu cores       : 4
apicid          : 18
initial apicid  : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bmi1
bogomips        : 8027.43
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor       : 3
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 2
model name      : AMD FX(tm)-8350 Eight-Core Processor           
stepping        : 0
microcode       : 0x6000822
cpu MHz         : 1400.000
cache size      : 2048 KB
physical id     : 0
siblings        : 8
core id         : 3
cpu cores       : 4
apicid          : 19
initial apicid  : 3
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bmi1
bogomips        : 8027.43
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor       : 4
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 2
model name      : AMD FX(tm)-8350 Eight-Core Processor           
stepping        : 0
microcode       : 0x6000822
cpu MHz         : 1400.000
cache size      : 2048 KB
physical id     : 0
siblings        : 8
core id         : 4
cpu cores       : 4
apicid          : 20
initial apicid  : 4
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bmi1
bogomips        : 8027.43
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor       : 5
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 2
model name      : AMD FX(tm)-8350 Eight-Core Processor           
stepping        : 0
microcode       : 0x6000822
cpu MHz         : 1400.000
cache size      : 2048 KB
physical id     : 0
siblings        : 8
core id         : 5
cpu cores       : 4
apicid          : 21
initial apicid  : 5
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bmi1
bogomips        : 8027.43
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor       : 6
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 2
model name      : AMD FX(tm)-8350 Eight-Core Processor           
stepping        : 0
microcode       : 0x6000822
cpu MHz         : 1400.000
cache size      : 2048 KB
physical id     : 0
siblings        : 8
core id         : 6
cpu cores       : 4
apicid          : 22
initial apicid  : 6
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bmi1
bogomips        : 8027.43
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor       : 7
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 2
model name      : AMD FX(tm)-8350 Eight-Core Processor           
stepping        : 0
microcode       : 0x6000822
cpu MHz         : 1400.000
cache size      : 2048 KB
physical id     : 0
siblings        : 8
core id         : 7
cpu cores       : 4
apicid          : 23
initial apicid  : 7
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bmi1
bogomips        : 8027.43
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

u-boot mainline from denx

Git clone:

git clone git://git.denx.de/u-boot.git

Configure:

cd u-boot
CROSS_COMPILE=arm-linux-gnueabi- make clean
CROSS_COMPILE=arm-linux-gnueabi- make Cubieboard2_defconfig

Compile:

CROSS_COMPILE=arm-linux-gnueabi- make -j6

Installation:

dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8

Where /dev/sdX is the device file for your SD card. (Hint: use dmesg to find it out)

Using gamma ray as energy source?

A friend asked me a question on how feasible it would be to use gamma rays as an energy source. So let's crunch some numbers: The wavelength of gamma rays is

\lambda=\frac{c}{f}=0.005 nm


Since the optimum length l for an antenna is

l=\frac{\lambda}{4}=0.00125 nm=1.25 pm


We are a bit in trouble here since the radius of the atom Sodium for instance is approximately 160 pm.
Physically it's just not possible to build such a small antenna.

My trip to China (Chapter 4)

Today... Let's just say: I've found the StarBucks.
It's exactly as the StarBucks in Switzerland. I mean exactly the same.
Only that an Americano middle sized cup (for take away) is only 3.50 CHFr and not 5.00 CHFr.! ^_^

Agricultural paradise

Well... I didn't find it in time... Also as far as I could see... It's not really as interesting as some travelling blogs have described it.

20150204_170612

20150204_170624

20150204_170641

Lovers road

Well. I didn't go straight there either because I was stuck at the bubble tea and steamed bread corner where I've found fresh Manju (with red bean stuffing! *_*) as you can find a recipe for on my blog.
Also I've found Banh Bao... After this dinner I was so stuffed that I decided to roll back home.
Ahh! I talked Chinese a lot more today ^_^

20150204_185722

20150204_191321

My trip to China (Chapter 2)

Park in Zhuhai (珠海)

Actually just one of so many parks in 珠海. I passed by this place on my way to the 客车68号 (Bus number 68) to the office of Allwinner Technology.

20150202_12134420150202_12132520150202_12132020150202_121313

My way to Allwinner Technology

Since the security guard at the entrance already looked a bit confused when I sat down and tried to make clear to him with my dictionary that I was two hours too early for the meeting I've let it be to make pictures of the entrance.
Just be told, that the company has a beautiful modern new building now with leather seats and mings vases and two big red Chinese lanterns at the entrance.
A beautiful office building! *_*

20150202_13523820150202_13523120150202_13504120150202_13503720150202_13480920150202_13480420150202_13475720150202_13475220150202_13474720150202_133625

Dinner (sponsored by Allwinner)

Best food of my life (2.0)! ^^
我不想回来瑞士! (I don't wanna go back to Switzerland) *_*

Ah and btw, maybe I don't have to.
I seems as if the dinner has brought up some additional business ideas which would justify my employment at their company =D

20150202_18432820150202_184324

My trip to China (Chapter 1)

Lost clothes

Thanks to the Russian duty and tax office my clothes are still all in Moscow, which forced me to buy new ones at the stores around the corner (first pic). Actually it's not such a problem I guess, I think I look quiet good in these 0.30$ clothes ^^ (second pic) 20150131_18451820150131_192221

Food

After having had some trouble making myself understood I managed to get my favourite food after all. 20150201_183602

Spot the Durian

20150201_191002

Way back from the restaurant to my hotel

20150201_191013

Current mirror

Given, a complicated darlington circuitry:
darlington
We now replace the darlington pairs with single NPN transistors by defining: I_C=I_B \cdot a with a=(\beta+1)\cdot\beta and I_E=I_B \cdot b with b=(\beta+1)^2
darlington_replacement

Now we set:
I_{KD} = I_{B1} + I_{C3} = I_{B1} + I_{B3} \cdot a and I_{RL}=I_{C4}=I_{B4}\cdot a and I_{B2}=I_{B5} and I_{KD} + I_{C1} + I_{RL} = I_{E5} + I_{E2}
I_{KD} + I_{B1} \cdot a + I_{RL} = I_{B5} \cdot b + I_{B2} \cdot b = 2\cdot I_{B5}\cdot b = 2\cdot I_{B2}\cdot b
\Rightarrow I_{RL}=- a \cdot I_{KD} - I_{KD} + a^2 \cdot I_{B3} + 2 \cdot b \cdot I_{B2}

And resolve the current equation:
I_{B3} \cdot b = I_{E3} = I_{C5}+I_{B2}+I_{B5}
=I_{C5}+2 \cdot I_{B2}
=I_{C5}+2 \cdot I_{B5}
=a \cdot I_{B5}+2 \cdot I_{B5}=(a+2)\cdot I_{B5}=(a+2)\cdot I_{B2}

\Rightarrow I_{B2} = I_{B5} = \frac{1}{a+2} \cdot I_{E3} =\frac{b}{a+2} \cdot I_{B3}
I_{E1} = I_{B1} \cdot b = I_{B3}+I_{B4}

I_{C2} = I_{B2} \cdot a
= I_{E4}=I_{B4} \cdot b
\Rightarrow I_{B4} = \frac{a}{b}\cdot I_{B2}=\frac{a}{b}\cdot\frac{b}{a+2} \cdot I_{B3}

I_{RL}=\frac{a^2 b}{a^2 b + 2 a b +2}

ARM assembly, take 3

After having considered some comments from Mr./Ms. G I optimized my assembly code a little bit.
Here a better approach:

Output
deadbeef

11011110101011011011111011101111

00000000111111111111111111111111

Code:

.equ STRING_LENGTH, 32
.equ ZERO_CHARACTER, 0x30
.equ ONE_CHARACTER, 0x31
 
.data
Mask:
	.ascii  "%x\n\n"
.align 4 
 
varToPrint:
	.long 0xdeadbeef
.balign 8 
 
varToUnspace:
	.long 0xdeadbeef
.balign 8 
 
unspacedVarToPrint:
	.long 0xdeadbeef
.balign 8 
 
stringToPrint:
	.ascii "                                                                                  \n\n"
len = STRING_LENGTH
.balign STRING_LENGTH
 
unspacedStringToPrint:
	.ascii "                                                                                  \n\n"
len = STRING_LENGTH
.balign STRING_LENGTH
 
.text
.globl main
main:
	stmfd	sp!, {r0, r1, r2, r3, r4, r5, r6, r7, lr}	@ save the registers we use to the stack
 
	ldr	r3, AddrVarToPrint
	ldr	r6, [r3]
	ldr	r3, AddrVarToPrint
	str	r6, [r3]
 
	/*
	Generating string of binary representation:
		Address of variable in r0
		Address of target string in r1
	*/
	ldr	r0, AddrVarToPrint
	ldr	r1, AddrStringToPrint
	bl make_binary_number
	/*------------------------------------------*/
 
	/*
	Removing zeroes between the ones in binary value:
		Address of variable in r0
		Address of target variable in r1
	*/
	ldr	r0, AddrVarToPrint
	ldr	r1, AddrUnspacedVarToPrint
	bl remove_spaces
 
	/*
	Generating string of binary representation:
		Address of variable in r0
		Address of target string in r1
	*/
	ldr	r0, AddrUnspacedVarToPrint
	ldr	r1, AddrUnspacedStringToPrint
	bl make_binary_number
	/*------------------------------------------*/
 
	bl print_out_result
 
	b exit
 
/*-Fetching the values and printing them-----------------------*/
print_out_result:
	push	{r0, r1, r2, r3, r4, lr}
 
	ldr     r3, AddrMask
	movs	r0, r3
	ldr	r3, AddrVarToPrint
	ldr	r1, [r3]
	bl	printf
 
	ldr     r3, AddrStringToPrint 
	movs	r0, r3
	bl	printf
 
	ldr     r3, AddrUnspacedStringToPrint
	movs	r0, r3
	bl	printf
 
	pop	{r0, r1, r2, r3, r4, pc}
 
/*-Generate a binary representation string from integer--------*/
/* Address of variable in r0 */
/* Address of target string in r1 */
make_binary_number:
	push	{r2, r3, r4, r5, r6, r7, lr}
	ldr	r3, [r0] /* integer value of variable */
 
	movs	r4, $0 /* loop counter */
bin_loop:
	movs    r2, $0x1
	lsls	r2, r4 /* r2 = (0x01 >> counter) */
 
	movs	r6, $STRING_LENGTH-1
	subs	r6, r6, r4 /* idx = reg_length-counter */
 
	tst	r3, r2
	beq	no_one
 
	movs	r5, $ONE_CHARACTER
	strb	r5, [r1,r6]
	b end_bin_loop
 
no_one:
	movs	r5, $ZERO_CHARACTER
	strb	r5, [r1,r6]
	b end_bin_loop
 
end_bin_loop:
	adds	r4, r4,$1
	cmp	r4, $STRING_LENGTH
	bne	bin_loop
 
	pop	{r2, r3, r4, r5, r6, r7, pc}
 
/*-Removes spaces between ones---------------------------------*/
/* Taken we have: 0xdeadbeef
	Binary representation: 11011110101011011011111011101111
	Then the ones will be shifted together so that we get
	the following result: 00000000111111111111111111111111
*/
/* Address of variable in r0 */
/* Address of target variable in r1 */
remove_spaces:
	push	{r2, r3, r4, r5, r6, r7, lr}
	ldr	r6, [r0]
 
	movs	r4, $0
	movs	r5, $0
	movs	r7, $0
 
unspace_loop:
	movs    r2, $0x1
 
	lsls	r2, r4
 
	tst	r6, r2
	beq	end_unspace_loop
 
	lsls	r5, r5, $1
	adds	r5, r5, $1
 
end_unspace_loop:
	adds	r4, r4,$1
	cmp	r4, $STRING_LENGTH
	bne	unspace_loop
 
	str	r5, [r1]
 
	pop	{r2, r3, r4, r5, r6, r7, pc}
/*-------------------------------------------------------------*/
 
/*--------EXIT main(void) function -> return 0-----------------*/
exit:
	ldmfd	sp!, {r0, r1, r2, r3, r4, r5, r6, r7, pc}	@ restore registers before exit
	movs	r7, $1                  @ set r7 to 1 - the syscall for exit
	swi	0                       @ then invoke the syscall from linux
 
 
/*-----Variable pointers---------------------------------------*/
AddrMask:
	.word	Mask
 
AddrVarToPrint:
	.long	varToPrint
 
AddrVarToUnspace:
	.long	varToUnspace
 
AddrStringToPrint:
	.word stringToPrint
 
AddrUnspacedStringToPrint:
	.word unspacedStringToPrint
 
AddrUnspacedVarToPrint:
	.long unspacedVarToPrint

ARM assembly

Eliminating zeroes between ones from binary number:
Output
deadbeef

11011110101011011011111011101111

111111111111111111111111

Code

.data
Mask:
	.ascii  "%x\n\n"
.align 4 
 
varToPrint:
	.long 0xdeadbeef
.balign 8 
 
stringToPrint:
	.ascii "                                                                                  \n\n"
len = 32
.balign 32
 
unspacedStringToPrint:
	.ascii "                                                                                  \n\n"
len = 32
.balign 32
 
.text
.globl main
main:
	stmfd	sp!, {r0, r1, r2, r3, r4, r5, r6, r7, lr}	@ save the registers we use to the stack
 
	ldr	r3, AddrVarToPrint
	ldr	r6, [r3]
	ldr	r3, AddrVarToPrint
	str	r6, [r3]
 
	bl make_binary_number
 
	bl remove_spaces
 
	bl print_out_result
 
	b exit
 
print_out_result:
	push	{r0, r1, r2, r3, r4, lr}
 
	ldr     r3, AddrMask
	movs	r0, r3
	ldr	r3, AddrVarToPrint
	ldr	r1, [r3]
	bl	printf
 
	ldr     r3, AddrStringToPrint 
	movs	r0, r3
	bl	printf
 
	ldr     r3, AddrUnspacedStringToPrint
	movs	r0, r3
	bl	printf
 
	pop	{r0, r1, r2, r3, r4, pc}
 
make_binary_number:
	push	{r0, r1, r2, r3, r4, r5, r6, r7, lr}
	ldr	r3, AddrVarToPrint
	ldr	r1, [r3]
 
	movs	r4, $0
bin_loop:
	movs    r2, $0x1
 
	lsls	r2, r4
	movs	r6, $31
	subs	r6, r6, r4
 
	tst	r1, r2
	beq	no_one
 
	ldr	r3, AddrStringToPrint
	movs	r5, $0x31
	strb	r5, [r3,r6]
	b end_bin_loop
 
no_one:
	ldr	r3, AddrStringToPrint
	movs	r5, $0x30
	strb	r5, [r3,r6]
	b end_bin_loop
 
end_bin_loop:
	adds	r4, r4,$1
	cmp	r4, $32
	bne	bin_loop
 
	pop	{r0, r1, r2, r3, r4, r5, r6, r7, pc}
 
remove_spaces:
	push	{r0, r1, r2, r3, r4, r5, r6, r7, lr}
	ldr	r3, AddrVarToPrint
	ldr	r1, [r3]
 
	ldr	r3, AddrUnspacedStringToPrint
	movs	r5, $0x31
 
	movs	r4, $0
	movs	r7, $0
 
unspace_loop:
	movs    r2, $0x1
 
	lsls	r2, r4
 
	tst	r1, r2
	beq	end_unspace_loop
 
	strb	r5, [r3,r7]
 
	adds	r7,r7,$1
 
end_unspace_loop:
	adds	r4, r4,$1
	cmp	r4, $32
	bne	unspace_loop
 
	pop	{r0, r1, r2, r3, r4, r5, r6, r7, pc}
 
exit:
	ldmfd	sp!, {r0, r1, r2, r3, r4, r5, r6, r7, pc}	@ restore registers before exit
	movs	r7, $1                  @ set r7 to 1 - the syscall for exit
	swi	0                       @ then invoke the syscall from linux
 
AddrMask:
	.word	Mask
 
AddrVarToPrint:
	.long	varToPrint
 
AddrStringToPrint:
	.word stringToPrint
 
AddrUnspacedStringToPrint:
	.word unspacedStringToPrint

Mein potentielles schlechte Laune Ablassventil