UMBC | CSEE

UMBC CMSC 211 199


Assembler RECORD Structure

It would be nice to have a more elegant method of specifying packed subfield of words and bytes. Declaring a RECORD in assembly language allows us the means of doing this very easily. It has the form: RecName RECORD field1:size1, ... fieldn:size1 We can initialize it as: someName RecName <1, 1, 1> This means that we can have:
DirDateRECORD Year:7, Month:4, Day: 5
modDateDirDate<1, 1, 1>
This will give us the three following items:
field the number of bits that Field is from the right end of the word or byte
WIDTH Field is the number of bits in Field
MASK Field a bit mask which can be use to extract Field from its word or byte
This allows use to improve the program example2a with:
mov ax, modDate
and ax, MASK Month
mov cl Month
shr ax, cl
mov OKMon, ax


UMBC | CSEE