To Do
Assembler Design
Program Files
MOT table reader
Pass 1 Files
Assembly File Reader
LC Processing
Symbol Table Generation
Protected Words
Pass 2 Files
Error Checking
Whole ASM program error
correction
Single line Error correction
Assembly Language reference
Statements
Mnemonics Types
AD
IS
DL
Fields of MOT Table / Attributes of
Mnemonics
Symbol / Label
Two Types of Symbol
Symbols Uses Type
Operand Types
[Label](#label)
Register
Constant
Literal
-
Make working v1.0
-
execute subroutine from MOT file instead of program files
-
To pass support argument pass for main program (asm = sample.asm and ltorgmode = False)
-
LTORG support
- Support Ltorg mode by changing a Variable
-
Check path return by
os.path
module when run inside module -
comment can be at the end of line with statements
Statemnt #comment123
-
Implement
warning
library instead of print statement -
START
andEND
must be only used once-
START
must be first -
END
must be last
-
-
Uppercase ? How to deal with case?
-
Mnemonics , Protected Values must be UPPER case .
-
code can't be similar to them in any case
-
-
To implement operands checker for each Mnemonics
-
Implement Protected Symbols(LT LE ET GE GT for jump). Mnemonics are already protected as
-
Operand1 and Operand2 in binary (112) = 3 op1 present (102) both absent(002) = 0
-
-
Separate leftover LC Processing from assembly file reader
-
Learn Hyperlinking within markdown file
-
it reads mot table - which is in file format TSV (tab separated values)
-
provides functions
-
For getting other values from given Mnemonics
-
Checking if Mnemonics is valid or not
-
Return dict with all attributes of given Mnemonics
def get_Mnemonics_attribute(mnemonic :str , attribute = 'Size'): def isMnemonics(mnemonic: str): def return_given_mnemonics_dict(mnemonic :str):
-
-
It reads Assembly (asm) file .
-
True 1 pass reader
- It reads by iterator so each line is only read once thought out whole program
-
Supports Comments
-
Comment line start with "#" .
-
there can be white space before "#"
-
removes comment part of line , if it contains both statement and comment
Statement #comment
-
-
Supports Empty Line
-
Splits the Statement into Label , Mnemonics , Operand1 and Operand2 fields
-
Supports
START
andSTART 200
like commands -
Supports
ORG
commands -
Deals with
DC
andDS
Statement
-
All Mnemonics
-
For Branch condition [LE , LT , ET , GT , GE]
-
Registers Name [AREG, BREG, CREG, DREG]
-
START
must be first command and only used once -
END
must be last command and only used once -
Label
- Todo
-
Symbol
- List line No of the command with error, in Exception reporting
Standard Statements - Label: Menmonics Operand1, Operand2
or [Label[:] ]Menmonics[ Operand1[, Operand2]]
where []
fields are
Optional
-
START
-
ORG
-
LTORG
-
END
-
JUMP [Branch_condiction] , Symbol(Address)
orJUMP Symbol(Address)
-
-
ADD Operand1 , Operand2
-
SUB Operand1 , Operand2
-
MUL Operand1 , Operand2
-
DIV Operand1 , Operand2
-
INC Operand1
-
DEC Operand1
-
-
MOVER Register , [Operand2]
-
Mnemonics
-
Opcode
-
Size
-
Type
-
DS_routine ?
-
Address Symbols
-
Variable Symbols
-
Declaration
-
Usage(Mnemonics Opcode Table)
Operand 1 | Operand 2 |
---|---|
Label(Address or Data) or Register | label(Address or Data) or register or constant or Literal |
May change | Does not Change |
AREG
,BREG
,CREG
,DREG
- +ve Whole Number
-
Used in only older system which need
LTORG
support -
in form of
='<constant>'
eg.='5'