Ejercicios Básicos en AssemblerDescripción completa
Descripción completa
GENERAR UN PWM DE 5KHZ CADA MEDIO SEGUNDO, Y ENCENDERLA O APAGARLA CON UN PULSADOR. simulacion :PDescripción completa
Descripción completa
Descripción completa
Full description
this is document about assembler directives and it has almost all the assembler directives
Der 13-teilige Assembler-Kurs aus dem 80er-Jahre-Magazin "64er"...
Translate assembly language programs to object programs or machine code is called an Assembler. •
One-pass assemblers are used when it is necessary or desirable to avoid a second pass over the source program •
•
• •
the external storage for the intermediate le between two passes is slow or is inconvenient to use ain problem! forward references to both data and instructions One simple way to eliminate this problem! re"uire that all areas be dened before they are referenced. #t is possible$ although inconvenient$ to do so for data items. %orward jump to instruction items cannot be easily eliminated. • •
&ata structures for assembler!
Op code table 'oo(ed up for the translation of mnemonic code • •
(ey! mnemonic code result!bits
)ashing is usually used • • •
once prepared$ the table is not changed e*cient loo(up is desired since mnemonic code is predened$ the hashing function can be tuned a priori
The table may have the instruction format and length •
to decide where to put op code bits$ operands bits$ o+set bits
• •
for variable instruction si,e used to calculate the address
Symbol table tored and loo(ed up to assign address to labels • •
e*cient insertion and retrieval is needed deletion does not occur
&i*culties in hashing • roblem •
nonrandom(eys
the si,e varies widely
pass /! loop until the end of the program /. 0ead in a line of assembly code 1. Assign an address to this line •
increment 2 3word addressing or byte addressing4
5. ave address values assigned to labels •
insymboltables
6. rocess assembler directives • •
constant declaration space reservation
Algorithm for Pass 1 assembler: begin if starting address is given 'O77T0 8 starting address9 else 'O77T0 8 :9 while O7O&; <8 ;2& do
99 or ;O%
begin read a line from the code if there is a label if this label is in =TA>$ then error else insert 3label$ 'O77T04 into =TA> search OTA> for the op code if found 'O77T0 ?8 2
99 2 is the length of this instruction 36
for #4 else if this is an assembly directive update 'O77T0 as directed else error write line to intermediate le
end program si,e 8 'O77T0 - starting address9 end
'oad-and-go assembler • 'oad-and-go assembler generates their object code in memory for immediate execution. •
2o object program is written out$ no loader is needed.
• #t is useful in a system oriented toward program development and testing such that the e*ciency of the assembly process is an important consideration
%orward 0eference! o o o
o
o
o
o
'oad-and-go assembler Omits the operand address if the symbol has not yet been dened ;nters this undened symbol into =TA> and indicates that it is undened Adds the address of this operand address to a list of forward references associated with the =TA> entry cans the reference list and inserts the address when the de nition for the symbol is encountered. 0eports the error if there are still =TA> entries indicated undened symbols at the end of the program earch =TA> for the symbol named in the ;2& statement and jumps to this location to begin execution if there is no error