Assembly data types limits and examples
Asked Answered
W

1

6

I'm taking an Assembly Language class and the book gives me a list of data types:

  • BYTE - 8 bit unsigned integer
  • SBYTE - 8 bit signed integer
  • WORD - 16 bit unsigned integer
  • SWORD - 16 bit signed integer
  • DWORD - 32 bit unsigned integer
  • SDWORD - 32 bit signed integer
  • FWORD - 48 bit integer
  • QWORD - 64 bit integer
  • TBYTE - 80 bit (10 byte) integer
  • REAL4 - 32 bit (4 byte) short real
  • REAL8 - 64 bit (8 byte) long real
  • REAL10 - 80 bit (10 byte) extended real

Just as the title says, I'm hoping to get information on the upper/lower limits of each of these data types, and maybe some examples.

Winne answered 30/8, 2015 at 22:10 Comment(0)
J
5

Limit of an unsigned type:

0 to 2^bit_count - 1

Limit of a signed type:

-(2^(bit_count-1)) to (2^(bit_count-1))-1

For example, an unsigned byte's limit is:

0 to 255

And a signed word's limit is:

-32768 to 32767

I'm not entirely sure what the real numbers are, but my assumption is that they are floating point numbers.


For more info, see here.

Joubert answered 30/8, 2015 at 22:17 Comment(7)
Simple enough, thanks for the quick reply. Should the last half (FWORD - REAL10) be treated as signed or unsigned? And whats the significance of calling the last 3 "real"?Winne
@icktoofay Thanks for that! I wasn't entirely sure; I thought that 0 was that last number.Joubert
@Winne To be honest, I'm not entirely sure. But, I bet a quick google search would help.Joubert
It probably would be worthwhile to have at least something about the REAL types.Anthracnose
My guess is that they call them REAL instead of FLOAT, for example, just because Fortran natively supports COMPLEX numbers also, so REAL is just to signify the lack of an imaginary component. The REALs are floating point. But I am sorry I don't know the upper and lower bounds, nor the decimal precision, of them.Fachan
Ugh, Fortran on my mind, sorry. I wonder if Assembly (and the hardware itself) also does.Fachan
@Winne : You can learn about the limits and how REAL4, REAL8, and REAL10 floating point types are encoded at this linkMweru

© 2022 - 2024 — McMap. All rights reserved.