flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
muratselim
defining byte like
char db 65 signed by default is there a way to define unsigned or we have to convert it to/from twos complement before writing and after reading? |
|||
![]() |
|
muratselim
but this variable can have -128 --> 255
what is the size of this type |
|||
![]() |
|
muratselim
i dont want to be misunderstood . but im trying to implement a crc32 calculation . so i need precious variable and clear code.
thanks for the response |
|||
![]() |
|
DOS386
> but this variable can have -128 --> 255
NO. ![]() > but im trying to implement a crc32 calculation . so i need precious variable and clear code. Use UINT32 - dd ![]() |
|||
![]() |
|
muratselim
qqhar: db -128
compiling succesfully qqhar: db -129 error:value out of range qqhar: db 255 compiling succesfully qqhar: db 256 error:value out of range |
|||
![]() |
|
DOS386
Quote: qqhar: db -128 into + 128 !!! ![]() Last edited by DOS386 on 22 Aug 2007, 07:59; edited 2 times in total |
|||
![]() |
|
muratselim
qqhar: db -129
error:value out of range why not +129 |
|||
![]() |
|
DOS386
Because (optional) signed understanding of byte has a range -128 ... +127 !!!
![]() |
|||
![]() |
|
muratselim
what is the deal with colon ( : )
qqchar: db 123 qqchar db 123 and if i use with other types what is the effect? |
|||
![]() |
|
DOS386
http://flatassembler.net/docs.php?article=design
> types what is the effect? The effect is FATAL !!! ![]() |
|||
![]() |
|
muratselim
thanks everything is clear now...
|
|||
![]() |
|
vid
muratselim: learn how signed numbers work.
In assembly, there is not much difference between signed and unsigned numbers, and you don't have any separate types for signed and unsigned. thy both are just 8 bit values, which you can treat as signed, or as unsigned. Sorry, i am lazy to go into deeper explaination right now. PS: difference between "x: db 10" and "x db 10" is that "x: db 10" declares label without size assigned, and "x db 10" declares label with byte size assigned. try this: Code: a db 10 b: db 10 mov ax, [a] ;error, trying to move byte value into word register mov ax, [b] ;same effect as "mov ax, word [b]" |
|||
![]() |
|
asmfan
In addition - how fasm treats signed/unsigned comparison in HLL like sintax? Say masm check - BYTE/WORD/DWORD for unsigned and SBYTE/SWORD/SDWORD for signed comparison via .if/.while and other runtime HLL written operations.
|
|||
![]() |
|
muratselim
what i understand is
fasm is an OS (construction) assembler. not for general purpose althoug have some extensions for win32, dos etc.. i have never tried hla . in my opinion assembler must be bare in most cases. this what makes assembly programming. i have a look some nasm samples. it's look like another choice. it has macro capability but yet plain intel syntax. gasm not for programming. it's a tool for gcc to embemded assembly. tasm and masm(micro$oft) os specific... the only reason for trying fasm before nasm was the idea behind fasm. compiler coded bare assembly as i know and nasm not as you know. have good time and appriciated for responses.... |
|||
![]() |
|
vid
FASM and NASM are basically the same, except that NASM is written in C (and is thus portable), and FASM has better assembling/macro capabilities
|
|||
![]() |
|
DOS386
> fasm is an OS (construction) assembler. not for general purpose althoug have some extensions for win32, dos etc..
Wrong. FASM is a general purpose assembler ... but good for OS construction also ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.