News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

What if I mess up?

Started by Evan, December 07, 2013, 04:09:51 PM

Previous topic - Next topic

Gunther

Evan,

Quote from: Evan on December 10, 2013, 07:15:32 AM
Yeah well don't we always need a 0 in computers?

in most cases. Otherwise we would give away one digit.

Quote from: Evan on December 10, 2013, 07:15:32 AM
Does 0xFFU meaning 256(baseten) make sense?

0xffh = 255 decimal.

Gunther
You have to know the facts before you can distort them.

Evan

Quote from: Gunther on December 10, 2013, 07:24:10 AM
Evan,

Quote from: Evan on December 10, 2013, 07:15:32 AM
Yeah well don't we always need a 0 in computers?

in most cases. Otherwise we would give away one digit.

Quote from: Evan on December 10, 2013, 07:15:32 AM
Does 0xFFU meaning 256(baseten) make sense?

0xffh = 255 decimal.

Gunther
Gunther I hope it is recognized we tried to declare hexadecimal notation twice in the assembler.
With 0x
and h






Or could you please explain the one way to declare an hexadecimal number in the assembler?


Or where do we use one or the other?

dedndave

the 0xFF notation is used in C and other languages
normal MASM syntax is 0FFh
the leading 0 is only required if the first hex digit is a letter
so, 96h is also acceptable form

hexadecimal format values are not generally used for signed values
we would use decimal format
bNeg db -128
bPos db 127

Evan

I just ran this
MOV EAX, cons1mille
with many code exits.

Defining the cons1mille using this
INCLUDE CONS.INC

By making a CONS.INC file.

dedndave

i don't know what you defined it as, but ok

Evan

Quote from: dedndave on December 10, 2013, 09:31:55 AM
the 0xFF notation is used in C and other languages
normal MASM syntax is 0FFh
the leading 0 is only required if the first hex digit is a letter
so, 96h is also acceptable form

hexadecimal format values are not generally used for signed values
we would use decimal format
bNeg db -128
bPos db 127


Would

96(base hex) = FF(base hex)
Annihilate the hex number system then?
-----------------------------------------------------------


0FFh
vs
0x01
vs
01h
vs
1h


My question is 0FFh going to be the way of the byte?

Basically there are many variations of a full byte.

I'll try to figure out more about hex and bytes later.

I take it
0FFh
0FEh
0FDh
0FCh
0FBh
0FAh
0F9h
0F8h
0F7h
0F6h
0F5h
0F4h
0F3h
0F2h
0F1h
0F0h
; lol
0E0h

0E1h
0E2h
0E3h
0E4h
0E5h
0E6h
0E7h
0E8h
0E9h
0EAh
0EBh
0ECh
0EDh
0EEh
0EFh
will work too for a byte.

Evan

Quote from: dedndave on December 10, 2013, 09:40:49 AM
i don't know what you defined it as, but ok
I defined it like this cons1mille  EQU 1000
.

dedndave

here's a good exercise....

write a little program that display all the hex values from 0 to FF, seperated by a space
so - you want to make 256 passes through a single loop
or - 16 passes on an outer loop and 16 passes on an inner loop

Evan

Quote from: dedndave on December 10, 2013, 10:49:08 AM
here's a good exercise....

write a little program that display all the hex values from 0 to FF, seperated by a space
so - you want to make 256 passes through a single loop
or - 16 passes on an outer loop and 16 passes on an inner loop

That sounds like a really fun time. I will try.