Ma ne, nismo se razumjeli. Nisam mislio da QBasic ima operacije s bitovima.
Koliko sam ja zakljućio, operacije s bitovima vrše nekakve matematičke operacije. Dakle tu se radi o binarnoj algebri , samo što odavna nisam radio ništa u vezi toga pa sam pozaboravljao. Jedino što sam uspio naći je
Citat:
3.1.2 Use of shifts
Fast multiplication and division are the most common uses of a shift
operations. Recall that in the decimal system, multiplication and division
by a power of ten are simple, just shift digits. The same is true for powers
of two in binary. For example, to double the binary number 10112 (or 11
in decimal), shift once to the left to get 101102 (or 22). The quotient of a
division by a power of two is the result of a right shift. To divide by just 2,
use a single right shift; to divide by 4 (22), shift right 2 places; to divide by
8 (23), shift 3 places to the right, etc. Shift instructions are very basic and
are much faster than the corresponding MUL and DIV instructions!
Actually, logical shifts can be used multiply and divide unsigned values.
They do not work in general for signed values. Consider the 2-byte value
FFFF (signed -1). If it is logically right shifted once, the result is 7FFF
which is +32, 767! Another type of shift can be used for signed values.
Dakle ako program u asmu radi SHR EAX,n a mene zanima samo ta vrijednost u EAX nakon operacije, tada ja ne moram pomicati bitove da dobijem rezultat već samo podijelim broj u EAX sa 2^n i uzmem njegov cijeli dio. SHL je suprotno i on množi.