diff --git a/CHANGELOG.org b/CHANGELOG.org index aa1e130..0f58d71 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -60,6 +60,7 @@ Fixed bug in stage2 FORTH PRINT function ** Removed the HERE and DP! are gone from ' now in stage3 FORTH +Removed ascii! from stage2 lisp because it can easily be replaced by a simple function * 0.0.8 - 2017-06-17 ** Added diff --git a/stage2/lisp.s b/stage2/lisp.s index 08878ae..4e4e466 100644 --- a/stage2/lisp.s +++ b/stage2/lisp.s @@ -2152,42 +2152,6 @@ "Remaining Cells: " -;; prim_char -;; Recieves a list in R0 -;; Converts all integers to CHARs -:prim_char_String - "ascii!" -:prim_char - CMPSKIPI.NE R0 $NIL ; If NIL Expression - RET R15 ; Just get the Hell out - PUSHR R0 R15 ; Protect R0 - PUSHR R1 R15 ; Protect R1 - PUSHR R2 R15 ; Protect R2 - PUSHR R3 R15 ; Protect R3 - LOADUI R3 $NIL ; Using NIL - -:prim_char_0 - CMPJUMPI.E R0 R3 @prim_char_done - LOAD32 R1 R0 4 ; Get ARGS->CAR - LOAD32 R2 R1 0 ; Get ARGS->CAR->TYPE - LOAD32 R0 R0 8 ; Set ARGS to ARGS->CDR - CMPSKIPI.NE R2 4 ; If Type is INT - JUMP @prim_char_1 ; Convert to CHAR - JUMP @prim_char_0 ; Go to next list item - -:prim_char_1 - LOADUI R2 128 ; Using Type CHAR - STORE32 R2 R1 0 ; Update ARGS->CAR->TYPE - JUMP @prim_char_0 ; Keep looping - -:prim_char_done - POPR R3 R15 ; Restore R3 - POPR R2 R15 ; Restore R2 - POPR R1 R15 ; Restore R1 - POPR R0 R15 ; Restore R0 - RET R15 - - ;; prim_integer_to_char ;; Recieves a list in R0 ;; Converts INT to CHAR @@ -2697,13 +2661,6 @@ CALLI R15 @make_sym ; MAKE_SYM CALLI R15 @spinup ; SPINUP - LOADUI R0 $prim_char ; Using PRIM_CHAR - CALLI R15 @make_prim ; MAKE_PRIM - MOVE R1 R0 ; Put Primitive in correct location - LOADUI R0 $prim_char_String ; Using PRIM_char_STRING - CALLI R15 @make_sym ; MAKE_SYM - CALLI R15 @spinup ; SPINUP - LOADUI R0 $prim_integer_to_char ; Using PRIM_INTEGER_TO_CHAR CALLI R15 @make_prim ; MAKE_PRIM MOVE R1 R0 ; Put Primitive in correct location