#include "dt_inc.s" .data .org 0x0 arr: .fill 2 .fill 3 .fill 5 .fill 7 .fill 11 .fill 13 .fill 17 .fill 19 .fill 23 .fill 29 .fill 31 .fill 37 .fill 41 .fill 43 .fill 47 .fill 53 str: .ascii "hier das ergebnis: " .text .org 0x0 start: br+ main br+ main ret main: call+ u_init call+ u_recv_byte call u_send_newline ; benchprolog call t_init call t_stop ldis r1, 0 call t_valset call t_start ; /benchprolog ; max start ldis r1, 16 ldil r2, arr@lo ldih r2, arr@hi call+ max ; max end ; benchepilog push r0 call+ t_init call+ t_stop call+ t_valget subi r0, r0, 0xc ; offset abziehen pop r3 push r0 push r3 ; /benchepilog call u_init ; weil r10 ueberschrieben wird ldis r1, str@lo ldih r1, str@hi ldis r2, 19 call u_send_string pop r1 call+ u_send_uint call u_send_newline pop r1 call+ u_send_uint call u_send_newline br+ main max: ; r1 = len ; r2 = arr ; r4 = arr[x] ; r0 = x = arr[0] ldw r0, 0(r2) subi r1, r1, 1 maxloop: ldw r4, 4(r2) cmp r0, r4 movlt r0, r4 subi r1, r1, 1 addid r2, r2, 4 brnq+ maxloop ret+