|
RIP #04
13 декабря 1997 |
|
School Hacker - Cycle BASE -1: Legend, Arithmetic.

BASE-1
The first seminar. Base.
(Okonchanie. Beginning RIP # 1 - # 3)
B1: 6 Legend.
=================
In fact, such a global role, and hexadecimal
octal number system are exclusively due to
algorithms manual dragon. Inside the machine considers only
"A binary. Hexadecimal (or octal, the
DEC'ovskih machines) number system instead of allowing long
chains of O and the number of units to write short, make
hekerskuyu life is more diverse. These systems - Intermediate
between machine and man, between binary and decimal systems
notation.
The role of number systems is enormous. For example, access
rights file on UNIX systems vary from the shell command chmod.
And this command requires a job argument (access rights) in
octal number system! So the team
chmod 666 / etc / passwd
opens full access to all users to the password file in
system UNIX. You see now that even the most stupid system
administrators must understand the octal
notation. So what to talk about hackers!
In the various programming languages numbers in these
systems indicated differently. Here is a summary table for the
main Languages:
+-------------+-------+--------+--------+--------- -------+
| | C / C + + | Pascal | BASIC | Assembler |
+-------------+-------+--------+--------+--------+ -------+
| DECimal | 12 | 12 | 12 | 12,12 d | 12T |
| HEXadecimal | 0xC | $ C | 'hC | 0Ch | |
| OCTal | 014 | No | 'o14 | 14o | 14Q |
| BINary | no | no | 'b1100 | 1100b | 1100Y |
+-------------+-------+--------+--------+--------+ -------+
In B1: 1, we noted that the number of zeros in the
beginning did not affect his value. The creators of C decided
differently. Since no one in the their right mind starts with
the number zero - who wants to fill nuliki extra zero in the
beginning they used to refer to octal number.
In all ways of writing uppercase and lowercase letters is
not important. Even strict to register C will begin as
hexadecimal numbers with 0x, and with 0X. By the way, the guru
of the Kiev Center for our Schools Sergei Golovko (2:463 /
140), said that in earlier versions C compilers various firms
hexadecimal numbers have been start with 0x0, otherwise they
glucan.
When programming in assembler if hex
number starts with the letter in front of him must be put
zero. Otherwise the assembler will think that you were
referring to a variable Ch, but not the number of C_16. A
number of people with low intelligence, not able to accommodate
this rule, put a zero in front of all hexadecimal numbers.
Worst of all, when these people start write books ...
[IBM PC teaching on]
Suffixes T, Q and Y are introduced into the assembler MASM
relatively recently. The fact that the directive. RADIX
assembler allows you to change the number system, the default
action. Previously, when the number system changed to
hexadecimal, numbers such as 12D, which at first sight are the
usual hexadecimal, interpreted as 12_10. This led to
network of small obscure psychedelic bugs hindering teapots
use. RADIX 16.
[IBM PC teaching off]
We will use all methods of writing numbers using
assembly method as principal. You should be proficient in all
ways, because in the technical discussions on networks, they all
actively used.
>>>
To translate numbers into BASIC'e of the decimal number
system in hex, binary and octal are used
function HEX $, BIN $ and OCT $.
To translate the numbers of those systems to decimal should
be use cunning.
? VAL ("'hFC")
<<<
B1: 7 Arithmetic.
================
In any of their number systems can still add,
subtract, divide and multiply.
12A3h 10011b 220_3
- 134h +10101 b + 11_3
---- ------ ---
16Fh 101000b 1001_3
Try to solve a bunch of examples of addition and
subtraction in the "computer" number system and beyond.
14A3h 1701o | 11o 1101
* 21h -11 +----- * 1011
----- - | 152o ---
14A3 1960 1101
+2946 -55 + 1101
----- - 0000
2A903h 1931 1101
-22 -------
- 10001111
7
Try to divide and multiply these number systems.
Produce more Deytvie in mind, develop their abilities
quickly take to memorize information. All this is very
important for appraisals.
[IBM PC teaching on]
Hiew program allows to display the dump file.
The program has a team debug.exe d, which would display a dump
(Dump) of memory. Even Norton Commander allows for F4 to display
contents of the file in hexadecimal.
Now you have a very good understanding and
feel hexadecimal and other systems. Finally, you
be able to understand the dump.
[IBM PC teaching off]
There are special hex calculators
for believing in these widespread systems
notation. I recommend you CITIZEN SRP-75 and its analogs. He
inexpensive and no graphics, but other than hexadecimal
arithmetic and logic, he is also programmable! 128 steps!
Good luck!
Arvi Hacker
(AtH / /
HPG)
Ars: At this point we interrupt the publication of the School.
How would someone not to her treated, but some knowledge, you
see, learn from it it was possible. Anyway, everyone who wanted
it done ...
Other articles:
Similar articles:
В этот день... 5 November