Tag archive for "instructions"

Turbo Pascal uses few procedures to generate any x86 instruction needed. In general two intermediate code records are used: one for the actual inctruction opcodes and immediate data and one for references.

This procedure processes one assembler instruction. It resets data used for instruction processing, reads next assembler token, checks for label and processes prefix instructions (if present). Then it checks and processes assembler directive (DB, DW or DD) or assembler instruction parameters. Finally it generates intermediate code for assembler instruction.

Assembler instructions (in fact mnemonics) are stored in a symbol table where each instruction has few data bytes which define which procedure will process it and what combinations of parameters are possible.

This procedure generates intermediate code from opcodes and references generated for current assembler instruction.