Hello, the exercise says to define a group of locations to define months using a standard number of bytes, and to use 8 bit unsigned to set the number of days for each month... i wrote this

DB 'GEN',31D
DB 'FEB',28D
DB 'MAR',31D
DB 'APR',30D
DB 'MAG',31D
DB 'GIU',30D
DB 'LUG',31D
DB 'AGO',31D
DB 'SET',30D
DB 'OTT',31D
DB 'NOV',31D
DB 'DIC',31D

is this correct? how to define the unsigned option?

7 Years
Discussion Span
Last Post by natostanco

Whether a byte is signed or unsigned, depends on how you want to treat it. Maybe you want to study this thread. Whether the value of a byte in memory is teated as signed or unsigned all depends on the instruction you want to use. The value of the byte actually stored in memory can be considered sign-less until the program wants to use it for something.

>>is this correct?
Did you try to assemble it? If not, then you should and then you can answer your own question.

Edited by Ancient Dragon: n/a


well even if i assemble it it is just part of data segment so how can I be sure it is what the exercises requested?
and i know the way they are represented in binary 2 complement etc but I dont how to say to the assembler to make the number of that byte unsigned...

Edited by natostanco: n/a


>>but I dont how to say to the assembler to make the number of that byte unsigned...
You don't. This is not C or C++ languages. In assembler you can not declare a data item to be either signed or unsigned like you do in C/C++. Any byte can be treated as either one.


ah, ok thx, so technically what i have written should be right...3 byte for the name and 1 for the number, maybe it could be more detailed difining a byte for every day after every month, but it would be disorganized in memory, can you rhink to any better organozation of months and days in memory?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.