deleting line
[sped.git] / repl.asm
index 3c7f429..738da94 100644 (file)
--- a/repl.asm
+++ b/repl.asm
@@ -1,11 +1,14 @@
 
-%include "fileutils.S"
-
 extern printf
 extern fflush
 extern stdout
 extern free
 
+extern readLine
+extern writeFile
+extern shiftLeft
+extern shiftRight
+
 global repl
 
 section .data
@@ -190,8 +193,16 @@ repl:
     mov eax, DWORD [ebp-CMDSTR]
     cmp BYTE [eax], 'd'
     jne _repl_cmd_delete_end
-
     
+    ; check to make sure we don't have only one line
+
+    ; delete the line
+    push DWORD [buffer]
+    push DWORD [buffer_lines]
+    push DWORD [cur_line]
+    call shiftLeft
+
+    sub DWORD [buffer_lines], 1
 
     jmp _repl_continue
     _repl_cmd_delete_end: