CPSC 355 FINAL EXAM VERIFIED 2025
ASCII character set - ANSWER-a universal chart which encodes the proper decimal
and binary equivalent of different characters using 7 bits
in assembly character constants can be denoted with hex code and the character in
single quotes
A string is an array of characters and can be initialized in memory one byte at a time
(.byte 'h', 'e', 'l', 'l', 'o') or using the .ascii pseudo op (.ascii "hello")
a string literal is a read only array of characters allocated in the .text section
command line arguments - ANSWER-allow you to pass values from the shell into your
program
External arrays of pointers - ANSWER-are created with a list of labels
.text
fmt: .string "season[%d] = %s\n"
spr_m: .string "spring"
sum_m: .string "summer"
fal_m: .string "fall"
win_m .string "winter"
external arrays of pointers - ANSWER-pointers are double word aligned .balign 8
external variables - ANSWER-.byte .hword .word. dword don't need to be allocated on
the stack.
ldr w20, [x19]
adrp x19, j_m
add x19, x19, :lo12:j_m
used to load value of i_m
External Variables - ANSWER-are non-local variables, allocated in the data or bss
sections and are used to implement global and static local variables
Can be allocated and initialized using .dword .word .hword .byte
Form:
label: pseudo-op values
The labels represent 64 bit addresses.
To use them use adrp and add to put the address into a register and then use ldr and
str to access
Ex:
.data
i_m .word 2
.text
usual stuff
adrp x19, i_m
ASCII character set - ANSWER-a universal chart which encodes the proper decimal
and binary equivalent of different characters using 7 bits
in assembly character constants can be denoted with hex code and the character in
single quotes
A string is an array of characters and can be initialized in memory one byte at a time
(.byte 'h', 'e', 'l', 'l', 'o') or using the .ascii pseudo op (.ascii "hello")
a string literal is a read only array of characters allocated in the .text section
command line arguments - ANSWER-allow you to pass values from the shell into your
program
External arrays of pointers - ANSWER-are created with a list of labels
.text
fmt: .string "season[%d] = %s\n"
spr_m: .string "spring"
sum_m: .string "summer"
fal_m: .string "fall"
win_m .string "winter"
external arrays of pointers - ANSWER-pointers are double word aligned .balign 8
external variables - ANSWER-.byte .hword .word. dword don't need to be allocated on
the stack.
ldr w20, [x19]
adrp x19, j_m
add x19, x19, :lo12:j_m
used to load value of i_m
External Variables - ANSWER-are non-local variables, allocated in the data or bss
sections and are used to implement global and static local variables
Can be allocated and initialized using .dword .word .hword .byte
Form:
label: pseudo-op values
The labels represent 64 bit addresses.
To use them use adrp and add to put the address into a register and then use ldr and
str to access
Ex:
.data
i_m .word 2
.text
usual stuff
adrp x19, i_m