CPSC 2310 - DAY 19 OCTOBER 17, 2016 ================================================================================ CALLING SCANF IN ARM -------------------- scanf(format_string, addr-list ^r0 ^r1, r2 ldr r0, =F873929 @Allows loading large numbers (when #2 doesn't work) If what follows is a label, then the addr is placed in the register must save the link register to return after scanf is called! mov r0, #0 @return 0 if program is successful Arrays ------ In high level languages, we have several techniques avaliable for constructing data structures: .One dimensional arrays .Multi-dimensional arrays .Structs .Bit Sets .Linked lists .Trees At the assembly language level, all of those approaches map onto single dimension arrays alone. In order to emulate one of the other structures, we must create a mapping from the high level The origin of the array is not always the same: .In C, C++ and Java, arrays start wih index 0 .In BASIC and FORTRAN, arrays start with index 1 In ARM, to allocate arrays, .data .align 2 a: .skip 400 To reference any element in an array, we need to have both the starting