Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00.05 --> 00:00:02.06
- [Instructor] We've looked at the MASM32 assembler
2
00:00:02.06 --> 00:00:06.04
but we'll be using the GoAsm64 assembler from here on in.
3
00:00:06.04 --> 00:00:08.02
The assembler instructions are the same
4
00:00:08.02 --> 00:00:10.09
and the syntax is largely similar.
5
00:00:10.09 --> 00:00:12.05
With the coding examples now,
6
00:00:12.05 --> 00:00:13.05
we'll start to build up
7
00:00:13.05 --> 00:00:16.09
our file encryptor demonstration program.
8
00:00:16.09 --> 00:00:20.04
I've got a new GoAsm64 classic console project opened
9
00:00:20.04 --> 00:00:22.04
called an enigmatic.
10
00:00:22.04 --> 00:00:23.08
I'll make a couple of changes to
11
00:00:23.08 --> 00:00:26.05
the skeleton Easy Code provides.
12
00:00:26.05 --> 00:00:30.07
I'll change the constant null to zero
13
00:00:30.07 --> 00:00:35.05
and check change the code to call, GetModuleHandleA.
14
00:00:35.05 --> 00:00:36.06
At the machine level,
15
00:00:36.06 --> 00:00:39.00
our smallest data type is a byte
16
00:00:39.00 --> 00:00:42.02
which we define with the declaration DB.
17
00:00:42.02 --> 00:00:45.06
So in the data section we can, write, for example
18
00:00:45.06 --> 00:00:52.04
slot1 db, and we'll set it to the value five,
19
00:00:52.04 --> 00:00:57.09
slot2 db, we'll set that to the value two,
20
00:00:57.09 --> 00:01:04.00
slot3 db, and we'll set that to the value three.
21
00:01:04.00 --> 00:01:06.08
Sometimes it's useful to declare a number of variables
22
00:01:06.08 --> 00:01:08.06
each with the same value.
23
00:01:08.06 --> 00:01:11.03
We can do this with the juke keyword.
24
00:01:11.03 --> 00:01:14.01
For example, making a three byte array,
25
00:01:14.01 --> 00:01:16.01
each with the value one
26
00:01:16.01 --> 00:01:22.02
we can say settings db three bytes
27
00:01:22.02 --> 00:01:25.00
with a duplicated value of one.
28
00:01:25.00 --> 00:01:26.09
We've used standard decimal values to
29
00:01:26.09 --> 00:01:28.09
initialize these variables
30
00:01:28.09 --> 00:01:32.03
but sometimes we want to use a hexadecimal value.
31
00:01:32.03 --> 00:01:35.07
You can optionally proceed a hexadecimal value with a zero
32
00:01:35.07 --> 00:01:38.08
but it's necessary to add a suffix of h.
33
00:01:38.08 --> 00:01:45.06
For example, plug1 db 2Fh,
34
00:01:45.06 --> 00:01:50.03
plug2 db 16h.
35
00:01:50.03 --> 00:01:55.02
In MASM, we have a dot data question mark section.
36
00:01:55.02 --> 00:01:57.05
However, in GoAsm, if we don't want to initialize
37
00:01:57.05 --> 00:02:02.00
the variable we just declare it with a question mark.
38
00:02:02.00 --> 00:02:06.05
Rotten db question mark.
39
00:02:06.05 --> 00:02:09.00
The assembler doesn't have a string data type
40
00:02:09.00 --> 00:02:11.02
but as we've seen it does recognize a string
41
00:02:11.02 --> 00:02:12.09
as a sequence of bytes
42
00:02:12.09 --> 00:02:25.02
so we can use the welcome db Enigma style file encryptor.
43
00:02:25.02 --> 00:02:29.09
And this declares an array of bytes, which has length 27.
44
00:02:29.09 --> 00:02:33.00
We can also combine data declarations on a line,
45
00:02:33.00 --> 00:02:34.05
so we'll add a carriage return
46
00:02:34.05 --> 00:02:42.07
and line feed to the welcome line with 0Dh, 0Ah.
47
00:02:42.07 --> 00:02:44.04
We can declare a double bytes,
48
00:02:44.04 --> 00:02:48.06
a word in assembler terminology with a DW declaration
49
00:02:48.06 --> 00:02:53.00
and a 32 bit value with a double word DD declaration.
50
00:02:53.00 --> 00:02:57.01
We declare a full 64 bit value as DQ.
51
00:02:57.01 --> 00:02:59.09
Let's declare five quad-word rotor variables
52
00:02:59.09 --> 00:03:04.07
and initialize them with hexadecimal values.
53
00:03:04.07 --> 00:03:09.06
Okay, I'll save this now.
54
00:03:09.06 --> 00:03:11.09
Well, we won't be using them in this course.
55
00:03:11.09 --> 00:03:14.06
GoAsm also allows us to declare a variable
56
00:03:14.06 --> 00:03:17.09
of 10 bytes using the mnemonic DT.
4489
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.