Browse Source

Add proper dot . separator handling

Yann Weber 5 years ago
parent
commit
5d61979a25
1 changed files with 19 additions and 7 deletions
  1. 19
    7
      yaglitch.asm

+ 19
- 7
yaglitch.asm View File

224
 			stosq
224
 			stosq
225
 			xor rax, rax
225
 			xor rax, rax
226
 			stosq
226
 			stosq
227
-			jmp .next_token
228
-
227
+			loop .parse_loop
229
 		.hex_token:
228
 		.hex_token:
230
 			sub al, "A" - 10
229
 			sub al, "A" - 10
231
 			jmp .numeric_token
230
 			jmp .numeric_token
238
 			mov r10, 1
237
 			mov r10, 1
239
 			shl edx, 4
238
 			shl edx, 4
240
 			add edx, eax
239
 			add edx, eax
240
+			loop .parse_loop
241
 		.next_token:
241
 		.next_token:
242
-			;inc rbx ; chrno
243
-		loop .parse_loop
244
-
242
+			test r10, r10 ; check for numeric constant
243
+			jnz .add_numeric
244
+			loop .parse_loop
245
 		.next_line:
245
 		.next_line:
246
 			inc r13
246
 			inc r13
247
 			xor rbx, rbx
247
 			xor rbx, rbx
248
-		loop .parse_loop
248
+		.loop_parse_loop:
249
+			loop .parse_loop
250
+	.add_numeric:
251
+		mov rax, OP.numeric
252
+		stosq
253
+		xor rax, rax
254
+		xor r11, r11
255
+		xor r10, r10
256
+		xchg rax, rdx
257
+		shl rax, 32
258
+		stosq
259
+		xor rax, rax
260
+		jmp .loop_parse_loop
249
 	.trailing_nl:
261
 	.trailing_nl:
250
 		; check that NL is the last chr, else syntax error
262
 		; check that NL is the last chr, else syntax error
251
 		cmp rsi, r15
263
 		cmp rsi, r15
351
 	xor rdi, rdi
363
 	xor rdi, rdi
352
 	call SDL_PauseAudio
364
 	call SDL_PauseAudio
353
 
365
 
354
-	mov rdi, 2000
366
+	mov rdi, 5000
355
 	call SDL_Delay
367
 	call SDL_Delay
356
 
368
 
357
 
369
 

Loading…
Cancel
Save