Title: (a)??
15.5 ??????????(1)????????????
- ?????
- ????
- ???????????????????
???????????????????????????????????
???????????????????????? ????????????
2(2)?????????
- ? ?????????????????????????????
- ? ??????????????????????????????????????
3(a)??
- ? ???1?(???????4????2???)
- ? ????2?????
- 10 0000 0000 0000 1010(000A16)
- 14 0000 0000 0000 1110 (000E16)
- -1 1111 1111 1111 1111 (FFFF16)
- -2 1111 1111 1111 1110 (FFFE16)
-
-
-
- -10 1111 1111 1111 0110 (FFFD16)
- -11 1111 1111 1111 0101 (FFFC16)
4????
??(1???)
2???(15???)
4???(32???)?? -2,147,483,648
-2,147,483,647
??(1???)
2???(31???)
-32,768 (??(3)??(2)??(7)??(6)??(8)) -2,147,483,64
8 (??(???(21))????(47)??(483)??(648)
5(b)?????
- ???????????????????
- ???4???????4??????
?? ????1?(???????4????2???) ?????2?????
?2???(16???)???? -32,768( -215)32,767( 215 -
1) (??(3)??(2)??(7)??(6)??(8)) ?4???(32???)???
? -2,147,483,648 ( -231)2,147,483,648 (
231-1) (??(???(21))????(47)??(483)??(648)
6??(?????)2????
- ?????????(?????????????)
- (?)?????4???(32???)??
- 8???(64??????)???
??( 1 ???)
??( 7 ???)
????(24 ???)
?? 0?????,1???? ??(n) 2?????(????????) ??(a)
??? 1?alt1
7???2?????
????? 0 000 0000 1101 1000 0000 0000 0000
0000 16????????,00 D8 00 00
8(c)???
- ?????1??????????????????
- 1????1????????????????
?True??? (1??????) (1??????) 0000 0001
0000 0000 0000 0001 0000 1111
0000 0000 0000 1111 1000 0000
1000 0000 0000 0000 1111 0000
1111 0000 0000 0000 1111 1111
1111 1111 1111 1111
9(d)??
8 ???? ASCII?EBCDIC 16???? JIS???????JIS
EUC(Extended UNIX Code)
??????????? ????????????????, ????????
10ASCII????
CRCarriage Return LFLine Feed
????? 16??? ???? ???? ??, 0D?CR 0F?LF
11JIS????????
?????? 2byte??? ????
12(e)??
- ????????????(?????????)
- Xj x s j
- x Xj???????
- s X?1??????
- ?2??????
- Xm, n (C??? Xmn)???
- Xi,j x s n i s j
- x Xi, j???????
- s X?1??????
13(f)???/??????/?????
- ??????????(?????????)
- struct int p char c, double f
??? ????(boundary alignment)??????????????????????
????????????????
14????????????????
struct int p char c, double f
??????????
p
p
c
c
f
f
Ada ???????????????????????????(representation
specification)????
15(g)???
- Pascal ????????????1????
- C ????? 0 ? 1??????????????
- Prolog ??????
-
16(h)????
- ?????????????
- ??????????????
- ????????????????????
- ??????????????????(Java)?????????????????????????
???(C)??????
17(3)???????
- ? ?????????????(?????)????????????
- ? ????????????????????????????????????????????????
??? - ? ??????????????????????????????(temporary
variable, work variable)??????????????????????????
?????????
18MC68000????????
MOV B, R0 ADD C, R0 MOV R0, Temp MOV D,
R0 SUB E, R0 MUL Temp, R0 MOV R0, A
Temp DA 1
MOV B, R0 ADD C, R0 MOV D, R1
Temp???? SUB E, R1 R1??? MUL R1, R0
MOV R0, A
(????????????????????)
19???????????
- ? ???????????(8??16???)??????????????????????
- ? ?????????????????????????
- ? ????????????????????????????????????????????????
?????????????????????
?????????????????????????????????? ????????(re
gister allocation)???????????
20(4)????
- ? ??????????????????????????????????
- ? ????????????????????????????
???????(data frame) ????(frame) ??????(activati
on record) ????????(data segment)
21?????????
- ? ?????????????????????
- ? ??????????????????????
- ? ????????????(return address)
- ? ????????????(register save area)
FORTRAN??COMMON????????????
???????????????? ????????????????? ???????????????
?
22(5)????????????????
- ????????????????
- ??????????????????
- ?????????
- ????????????????
??????????? fib(int n) int m if(n lt 2) m
1 else m fib(n - 2) fib(n - 1)
return m
23????????????
- ? ????????????????????????????????(????)?????????
- ? ?????????????????????????????????????
- ???????????(Deep Binding)
- ???????????(Shadow Binding)
- ???(??)???????? Deep Binding ???????Lisp ??
Shadow Binding??????????? - ? ??????????????????????????????
24(6)??????(a)Deep Binding????
???? A ? B ? C ? B ? D ? ?????????????????
Pascal
- Procedure A
- Procedure B
- Procedure C
- begin end
- begin end
- Procedure D
- begin end
- begin end
A
??????????????(offset)???
B
D
B
C
???????
25?????????
??????(display)?
(E.W.Dijkstra ???)
??????
A
A
B
B
1
2
D
D
3
B
B
C
C
???????
26(b)Shadow Binding(????????????????????LISP)
- ? ?????????
- ? ????????????????????????????????????????????????
?(??????????????????????????????????????????)? - ? ?????????????????????
- ? ????????????????????????????(??????????????????)
? - ? ?????????????????????????????????
27(7)???(heap)??
- ???????????????????????????
- ???????????(GC??)???????
- ????????????????????????