Skip to content

Commit 526afeb

Browse files
Deleted comments
1 parent efe2886 commit 526afeb

File tree

2 files changed

+5
-35
lines changed

2 files changed

+5
-35
lines changed

README.md

Whitespace-only changes.

ast.asm

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
%include "utils/printf32.asm"
21
section .data
32
delim db " ", 0
43

@@ -12,7 +11,6 @@ section .text
1211

1312
extern evaluate_ast
1413
extern create_node
15-
extern printf
1614
global create_tree
1715
global iocla_atoi
1816

@@ -31,21 +29,17 @@ iocla_atoi: ;change string to number
3129
mov [isNegativeAtoi], edx ;the default way is that the number is positive
3230
;we check to see if the number is negative or not
3331
mov bl, [eax]
34-
cmp bl, '-' ;compare to minus character
35-
jnz atoi_loop ;if it is not a minus sign just do the rest as usual
32+
cmp bl, '-' ;compare to minus character
33+
jnz atoi_loop ;if it is not a minus sign just do the rest as usual
3634
mov edx, 1
3735
mov [isNegativeAtoi], edx ;change global variable
3836
inc eax ;get rid of the minus
3937

4038
atoi_loop:
41-
mov bl, [eax] ;get the character
42-
test bl, bl ;check if we reached the end
39+
mov bl, [eax] ;get the character
40+
test bl, bl ;check if we reached the end
4341
jz end_of_atoi
44-
cmp bl, ' '
45-
jz end_of_atoi
46-
cmp bl, 10
47-
jz end_of_atoi
48-
imul ecx, 0xa ;multiply ecx by 10
42+
imul ecx, 0xa ;multiply ecx by 10
4943
sub bl, '0'
5044
add ecx, ebx
5145
inc eax
@@ -128,7 +122,6 @@ is_a_minus:
128122
jmp end
129123

130124
is_an_operator:
131-
;PRINTF32 `OPERATOR:%c:OPERATOR\n\x0`,ecx
132125
mov ebx, 0x1
133126
mov [isOperator], ebx
134127
@@ -155,8 +148,6 @@ create_tree:
155148
pop ecx ;restoring ecx register
156149
pop eax ;restoring eax register
157150

158-
;PRINTF32 `DA:%s:DA\n\x0`,edx
159-
160151
;initializing root Node
161152
push edx ;pushing parameter
162153
call create_node
@@ -180,14 +171,6 @@ traverse_token:
180171
pop ecx ;restoring ecx register
181172
pop eax ;restoring eax register
182173

183-
;PRINTF32 `DA:%s:DA\n\x0`,edx
184-
185-
;push ecx
186-
;mov ecx, [currentNode]
187-
;mov ecx, [ecx]
188-
;PRINTF32 `INLINE:%s:INLINE\n\x0`,ecx
189-
;pop ecx
190-
191174
push ebx ;saving ebx register
192175
push ecx ;saving ecx register
193176
push edx ;saving edx register
@@ -291,19 +274,6 @@ loop_for_poping_remaining_nodes:
291274
very_end:
292275
mov eax, [root] ;put in eax the root
293276
294-
;mov ecx, [eax + 0x8] ; left of "+"
295-
;mov ecx, [ecx + 0x4] ; right of "*"
296-
;mov ecx, [ecx + 4] ; right of "/"
297-
;mov ecx, [ecx + 4]
298-
;mov ecx, [ecx] ;
299-
300-
;push eax
301-
;push ecx
302-
;call iocla_atoi
303-
;PRINTF32 `SFARSIT:%d:SFARSIT\n\x0`,eax
304-
;add esp, 0x4
305-
;pop eax
306-
307277
pop edx
308278
pop ecx
309279
pop ebx

0 commit comments

Comments
 (0)