程序代写代做代考 C Memory Elements

Memory Elements
PROGRAMMING
M for HACK asm RAMLA
operation
Aw
CHEAT SHEET
HACK
D A
on chip
data needs to be in CPU
For any
Always start with a Pseudocode comprising D A M
otherwise copy from RAMM’s U Use RO 1215 SCREEN HBD
for accessing RAM o RAME’s
RAM 16,3847RAM24576
Use LABEL
has
o
if code if DCO
any
TRUE
Branching
example
1 jump to TRUE
2 3
4 REMAINING 50 JMP
TRUE
6 t
SREMAINING
else 11
FALSE 11Remaining code
HEAD with
a loop
9
END 10
17
Di JLT 11FALSE
END Oi JMP

Note LABEL declaration is
address on ROM comment
on
of
in
HACK
sumI i
CPU
RAM
order example
8
any operation involving RAM registers has
zMqg RAMS
togothrough CPU
not
LABEL is stored in symbol Table
assigned any with value as i r
RIMaddress of HACK asm instructiona after
dldahfztrmon.n¦Ì null 8 i e FA A example True116ie DG
END
User definedvariables are mapped based
referabove
11 appearance
sum MO
first sum _O
2
Mi D
i M
to ie
in asm code
1O1 valid constants as
per HACK comp D 2A
2 sin
Fog

memory
they Example
gets
are mapped to in symbol Table
RO 0 ROM view sum 10
END
refer above
Note Userdefined variables are stored in
starting RAMCH Refer Above A
in rest of the code A register on Cpu will stone Dib respectively
Keywords in built symbols Labels
User defined Variables
are write
convenience to asm code
for
However what
data
memory
onwards RAM
example
ie ADI everytime sum are now used
sum A lb ie Di
E H17 A RAM
Programmer’s HACK
stored in ROM Einstruction is the corresponding numericvat
161J sum

15
16,384
24,576
resist SCREEN Screen
8K
keyboard KBD
256 512 display 0l 511
A register can have 3
based on the HACK asm statement
which
example
D
20
a
as constant 11 used as RAMEzo
example
20
D Mag
20
D Igel 11 used
interpretations immediately follows
example
any jump
as ROM ko
MEMORY
M
ro This
11 used
Ol i
255
C
Z O 255
c
O 511

256 x 512
28 217
17
213
23 8K
RAM 8K screen
bits 22
I
Registers
2 Registers
I
x
pixels Iuues
pixels
row in Display
Each
512 pixels
512 5,61
32
Registers
29 bits
217 Pixel.IE
Registers
lb bits
1 register
112 210
chip to implement Memory
Registers

8
1
Registers
i e
256 rows 256
I 28
each requires 32 Registers
D
32 Registers
RAM 16,384 32 onwards
0,0
0,511 16,3874
12
37
1,511
n
or SCREEN onwards
1,0
I
213 812Registers againverified
16
2I
384 132
mo Msm
2
37
Registers 25
32
RAM 16,384 SCREEN
32
RAM 16,384 32
as
starting register

to
register
index
32xtl f.TT
Forany e in a given r
to index
register Registers
C
refers assigned to
Example 0,0
map in
c C
pixels
the within the 32
ff
given r
c
0,15
6,18043 RAM 16,3841 31
pixels to register index 0
0,16 0,31 PAmf tf
Example
map to register index 1
RAM 16,384 Example 1,16
in RAM 16,384 31
pixels map
cC
1131 1 in
RAM116,384 32 1 RAMLlbi384 RAM176,384 32 1 t 31
far
Cr c px mapped to
So
RAM 16,384 32 r t Ltd

Remainder of 1,6 ie Yo16
which cell position corresponds to
2 0 c O
It
specifies
6ft
me
Example
7
32 0 RAM 16,3841Lfo
pixel 10,0
0,15
RAM 16,384
15
RAMI6,384T LYE
c
RAM
16,384
15 co is
RAM lb 384 RAM 16,384
1 16 15
16,384
16

Summary of G
c px mapping Memory
onto
r RAMLI6384
Pixel
Black 1
M
M
in
Example
example
all corresponding 16
on screendisplay colored
e
o 75
screen
LEG left to Right
8 with cell position go16
Coloring
0
white Co
single pixel 7 1 pixels
or
at 1010101
32
from
bit
afferentatt comesponding colored
16
bit on screendisplay BLACK
b
I
WHITE
H 16pixels

example 3 DA
into RAMESH 0 101 I0101111
M
D
will color pixelsars BLACK
Jg SCREEN
Storing
3 Ramli6,387
0 0,13 will
beWHITE
0,14 and0,75