Skip to content

Commit 0c7b24e

Browse files
authored
Update assembler.py
Fixed some errors
1 parent 56df82e commit 0c7b24e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Assembler/assembler.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def scanner(string):
152152
elif ch == '_': # catch label for subprogram
153153

154154
state = 40
155-
# not catch the character _
155+
# not catches the character _
156156

157157
elif ch == 'r': # catch ret-command
158158

@@ -971,7 +971,7 @@ def parser():
971971
print("Error: Not found argument!")
972972
return
973973

974-
# converts the token into float, if token contains olny digits.
974+
# converts the token into float, if token contains only digits.
975975
# TODO response of float
976976
if token.t == "identifier": # for variables
977977

@@ -1033,7 +1033,7 @@ def parser():
10331033
return
10341034

10351035

1036-
# converts the token into float, if token contains olny digits.
1036+
# converts the token into float, if token contains only digits.
10371037
if token.t == "register":
10381038

10391039
# for the case that token is register
@@ -1094,7 +1094,7 @@ def parser():
10941094

10951095
else:
10961096

1097-
print("Error: No found register!")
1097+
print("Error: Not found register!")
10981098
return
10991099

11001100
elif token.token == "sub": # sub commando
@@ -1113,7 +1113,7 @@ def parser():
11131113
print("Error: Not found number!")
11141114
return
11151115

1116-
# converts the token into float, if token contains olny digits.
1116+
# converts the token into float, if token contains only digits.
11171117
if token.t == "register":
11181118

11191119
# for the case that token is register
@@ -1141,7 +1141,7 @@ def parser():
11411141
if tmpToken.token == "eax":
11421142
eax -= token.token
11431143

1144-
# update zero flag
1144+
# updated zero flag
11451145
if eax == 0:
11461146
zeroFlag = True
11471147
else:
@@ -1623,7 +1623,7 @@ def parser():
16231623

16241624
def registerLabels():
16251625
"""
1626-
This function search for labels / subprogram-labels and register this in the 'jumps' list.
1626+
This function search for labels / subprogram-labels and registers this in the 'jumps' list.
16271627
"""
16281628
for i in range(len(tokens)):
16291629
if (tokens[i].t == "label"):

0 commit comments

Comments
 (0)