hspl

sentenceInterpretYa: ; HSPL Human Speakable Programming Language

changelog.txt

October 21, 2011, hexDay 15, hexWeek 2,1, ya
 14:42 hmmm, perhaps I should get the ya function working, of writing to file
       likely should add them to a new book, leave the root book for root functions.
       it would allow for making more proper functions, that modify the sentence by adding a so argument.
       then a look up would be able to find the result, rather than having to go through the hassel of resolving.
 17:07 I’ve been thinking about lysh, lambda sysh, or three-clause sysh, since most of the functions only have 2 arguments..
       ….. I guess it’s been done before,  but it would be fairly easy to write an interpreter for such a thing,
       also the whole three clause thing has been used for intermediary representation and bytecode.
       that was kind of the idea with the older version of sysh… though datastruc made it rather confusing…
       okay so lets figure this out…. how will it run?    I write something and read stuff….
       basically modifying a file,  and it’s sentences,  variables can be stored as sentence arguments…
       name su  value bo variable be ya
       danger being that we’re making a full-fledged programming language, in assembly, rather than through our virtual machine…
      so how do we do the virtual machine stuff huh? like maybe we should make a bytecode interpreter kinda thing…
      but we can simply optimize by having the equivalent spacing option,  though I guess that might not work so easily.
      sysh was never meant to be the full fledged HSPL, it’s just we’ve gotten so good at assembly coding it’s becoming that way…
      maybe we’ll be able to finish this, even though it’s all sentence based now…
      currently I have the do functions working with sentenceInterpret,
      perhaps I need to make a sentenceWrite or sentencePut for ya
 19:37 so what’s the algorithm for the sentencePut function?
       input be context(book), and sentence,
       algorithm is sentenceSpace bookAppend
 20:20 wrote sentenceInterpretYa
October 20, 2011, hexDay 14, hexWekk 2,1, ya
 09:54 so what now? seems like I might get turing complete with a few more additions,
       need mov, cmp, jmp and some conditional jmps
changelog.txt quote

interpert.asm

sentenceInterpretYa:
       ;input be context(book), and sentence,
       ;algorithm is sentenceSpace, textAppend or textInsert
           pushr [sentenceInterpretLength]
           pushr [sentenceInterpretAddress]
        pushr bookletSize
        pushr [book]
        call textInsert
        movr eax,[sentenceInterpretAddress]
        movr ebx,[sentenceInterpretLength]
        jmp sentenceInterpretYes

interpert.asm sourcecode

Nemu foto ini waktu pelatihan susulan dulu. Hmm Terimakasih Bapak guru Bapak pembina Bpk. S. Khalistyo Bapak kita semua atas ilmu dan pengalaman yg telah di berikan, selamat jalan, semoga amal ibadah beliau di terima Allah SWT dan di tempatkan di surgaNya. Aamiiin. We love you Bapak. Sbpl💚Kds💛Hspl💙 – View on Path.

compare be glyph by 0.4.1.3.1 sysh HSPL human speakable programming language

Also updated the readme.txt,  now with Linux and Windows installation instructions.

Also implemented the compare,  have by glyphs debugged so far.

readme.txt

*************
 install on linux
******************
  requires nasm

  cd sysh/
  ./run.sh will compile and take you into interperter
  executable is bin/sysh
*******************
 install on windows
*******************
 get linux emulator like cygwin,
 and follow linux instructions

…..

to text compare, note to remember leading space
 loki bo loki to compare be glyph by do

readme.txt te

November 1, 2011, 10th hexDay, 3,1 hexWeek.
    14:00 updated readme.txt added translation, sql, and reorganized releases to be alpha, beta, theta, delta
    15:19 okay so how about making caseInterpret into a register function
    15:57 omg! I’m wasting time,  I have to finish debugging the sentence and number function
        if afterwards I still have time in the week, then I’ll have time to do register function conversions.
       for future, I should do a version release at the begining of the week, and maintenance in second half
     okay, so what do we have so far…, we can probably make a 0.4.1.3 segment release
        16:29 compare glyphs completely operational! 0.4.1.3.1 woohoo!
    16:50 eliminated extra zero’s in numberToGlyphs output
October 31, 2011, 9th hexDay, 3,1 hexWeek
 15:13 fixed the program!!! issue was matchCaseGet was calling caseGetEnd
 15:14 todo, in terms of converting from stack to register functions
    generic exit functions, usually ret is all that’s required,
       always convert top level functions before lower level ones,
        i.e. if I had converted matchCaseGet before caseGet would have had much less debugging time
        meanwhile caseRetrieve is a function we should implement,
         arguments could be context and case_word,
    since it’s week 3 the main thing is to get compare working
        afterwards we can do register-function optimizations
 15:46 fixed wordCompare working :-)
 16:04 fixed glyphCompare working
 17:43  okay, so time to get working….
     what to do?   first caseRetrieve or perhaps caseConstrue
        then we also have the set up the te function to return the string inside the quote
     hmmm perhaps we could rename caseInterpret caseConstrue, and then use caseInterpret?
        nah,  perhaps caseConstrue is better for the action at hand, getting and interpreting.
         dictionary says construe is related to syntax.
    thing is we also need context, for caseConstrue, as caseInterpret technically needs context
    we’re more likely to use the case and line as arguments,
    however context would be an implicit argument.
    We’ll have to change the [book] and bookletSize to [context] and [contextSize] for ease of modification.
    then we can store the base functions in the root book, which for testing purposes can be the context.
    as always we can port this incrementally,  starting with just the caseInterpret or caseConstrue function.
 18:11    string input variables are possible it occured to me.
    that way can have all three arguments as input,  eax would be address and eax+byteBase would be length
    it would also reduce the amount of mov operating which are required, as fewer arguments could be loaded
    can also reduce bugs related to improper argument order.
18:30 wrote caseConstrue  
 18:34 hmmm perhaps we can make context a global variable
 19:20 ya, maybe for now it’ll just be easier to make caseInterpret a register function
October 30, 2011, 8th hexDay, 3,1 hexWeek
 11:35 began fixing strange occurence of do not working after a ya statement
 12:20 identified codeGet as a potential issue location
 13:30  sentenceGet seems to be the issue now
 14:30 nap
 17:00 back
 17:50 stil fixing…
 18:07 implemented extra space at end when saving ya sentences
 18:42 fixed say
 22:42 hmm, if we can’t get this thing working tommorrow, might have to revert :-S
    er but yes in any case we should make a caseRetrieve function to summarize caseGet and caseInterpret
 22:44 most of the errors are stack errors. of calls made on arguments. that’s kinda why I’d prefer to work with register functions, as it seems there would be less time spent fixing,  allowing for quicker progress.
October 29, 2011, 7th hexDay, 3,1 hexWeek
 10:37 still todo, is the compare finalizing functions
 12:00 finished writing finalizing functions
 16:28 strongly advized to make caseGet a register function.. er after debugged thiss…
 19:28 fixed caseGet
 20:30 updated readme.txt developer info
 21:30 updated readme.txt install info

changelog.txt te

bookCommands.asm

section .data
    ;datr address_name,”address”
    ;address_length equ $-address_name
    ;datr length_name,”length”
    ;length_length equ $-length_name
    datr glyph_name,”glyph”
    glyph_length equ $-glyph_name
    datr number_name,”number”
    number_length equ $-number_name
    datr word_name,”word”
    word_length equ $-word_name
    datr sentence_name,”sentence”
    sentence_length equ $-sentence_name
section .bss
    resr compareInputAddress,byteBase
    resr compareInputLength,byteBase
    resr compareInputSentence,byteBase*2
    resr compareBoAddress,byteBase
    resr compareBoLength,byteBase
    resr compareBoCase,byteBase*2
    resr compareToAddress,byteBase
    resr compareToLength,byteBase
    resr compareToCase,byteBase*2
    resr compareByAddress,byteBase
    resr compareByLength,byteBase
    resr compareByCase,byteBase*2
    resr compareResultNumber,byteBase
section .text
codePut compare,”compare”,7,0,[book]; compare be unknown bo standard to type by flags so
    ; input be eax sentenceAddress ebx sentenceLength
    ; output be eax resultADdress ebx resultLength
    ; algorithm:
    ;      get bo, to and by
    ;     ;if by address, then cmp address; that’s silly the address can’t be the same,
    ;                             since bo and to are different places
    ;    if by length, then cmp length
    ;    if by glyphs, then stringCompare
    ;    if by numbers, then glyphsToNumbers cmp
    ;    if by words, then wordsCompare
    ;    if by sentence, then sentenceGet standard from unknown,
    ; algorithm:
    movr [compareInputAddress],eax
    movr [compareInputLength],ebx
    movr [compareInputSentence],eax
    movr [compareInputSentence+byteBase],ebx
    ;      get bo, to, and by
    movr edx,bo_length
    movr ecx,bo_name
    movr ebx,[compareInputLength]
    movr eax,[compareInputAddress]
    call caseGet
    ; if none then exit
    cmp eax,no
    jz compareNo
    movr ecx,1; drop case marker
    call wordDrop
    movr [compareBoAddress],eax
    movr [compareBoLength],ebx
    movr [compareBoCase],eax
    movr [compareBoCase+byteBase],ebx
    ; get to
    movr edx,to_length
    movr ecx,to_name
    movr ebx,[compareInputLength]
    movr eax,[compareInputAddress]
    call caseGet
    ; if none then exit
    cmp eax,no
    jz compareNo
    movr ecx,1
    call wordDrop; drop case marker
    movr [compareToAddress],eax
    movr [compareToLength],ebx
    movr [compareToCase],eax
    movr [compareToCase+byteBase],ebx
    ; get by
    movr edx,by_length
    movr ecx,by_name
    movr ebx,[compareInputLength]
    movr eax,[compareInputAddress]
    call caseGet
    movr ecx,1
    call wordDrop; drop case marker
    movr [compareByAddress],eax
    movr [compareByLength],ebx
    movr [compareByCase],eax
    movr [compareByCase+byteBase],ebx
    ;;     if by address, then cmp address
    ;pushr [compareByLength]
    ;pushr [compareByAddress]
    ;pushr address_name
    ;pushr address_length
    ;call wordsCompare
    ;pop eax
    ;cmp bax,no
    ;jnz addressCompare
    ;;    if by length, then cmp length
    ;pushr [compareByLength]
    ;pushr [compareByAddress]
    ;pushr length_name
    ;pushr length_length
    ;call wordsCompare
    ;pop eax
    ;cmp eax,no
    ;jnz lengthCompare
    ;    if by glyphs, then stringCompare
    pushr [compareByLength]
    pushr [compareByAddress]
    pushr glyph_length
    pushr glyph_name
    call wordsCompare
    pop eax
    cmp eax,no
    jnz glyphCompare
    ;    if by numbers, then glyphsToNumbers and cmp ,
    pushr [compareByLength]
    pushr [compareByAddress]
    pushr number_length
    pushr number_name
    call wordsCompare
    pop eax
    cmp eax,no
    jnz numberCompare
    ;    if by words, then wordsCompare
    pushr [compareByLength]
    pushr [compareByAddress]
    pushr word_length
    pushr word_name
    call wordsCompare
    pop eax
    cmp eax,no
    jnz wordCompare
    ;    if by sentence, then sentenceGet standard from unknown,
    pushr [compareByLength]
    pushr [compareByAddress]
    pushr sentence_length
    pushr sentence_name
    call wordsCompare
    pop eax
    cmp eax,no
    jnz sentenceCompare
        jmp wordCompare
;addressCompare:
;    ;    compare to and bo addresses
;    ;     return flags
;    movr eax,[compareBoAddress];object
;    movr ebx,[compareToAddress];standard
;    cmp eax,ebx
;    pushf ; flags
;    pop eax
;    movr ebx,byteBase
;    jmp numberConvert
;lengthCompare:
;    ;    compare to and bo length
;    ;     return flags
;    movr eax,[compareBoLength];object
;    movr ebx,[compareToLength];standard
;    cmp eax,ebx
;    pushf ; flags
;    pop eax
;    movr ebx,byteBase
;    jmp numberConvert
glyphCompare:
    ; compare to and bo strings
    ; use stringCompare
    pushr [compareToLength]
    pushr [compareToAddress]
    pushr [compareBoLength]
    pushr [compareBoAddress]
    call stringCompare
    pop eax
    ; return
        movr [compareResultNumber],eax
     movr eax,compareResultNumber
    movr ebx,1; length of output
    jmp numberConvert
section .bss
    resr numberCompareToNumber,byteBase
    resr numberCompareBoNumber,byteBase
section .bss
    resr numberCompareCaseWord,byteBase*2
section .text
numberCompare:
    ; compare to and bo strings
    ; convert to numbers, cmp, and return result
    movr eax,[compareInputSentence]
    movr ebx,numberCompareCaseWord
    movr ecx,to_name
    movr [ebx],ecx
    movr ecx,to_length
    movr [ebx+byteBase],ecx
    call caseConstrue
    movr [eax],eax
    movr [numberCompareToNumber],eax
    ;
    movr eax,[compareInputSentence]
    movr ebx,numberCompareCaseWord
    movr ecx,bo_name
    movr [ebx],ecx
    movr ecx,bo_length
    movr [ebx+byteBase],ecx
        call caseConstrue
    movr eax,[eax]
    movr [numberCompareBoNumber],eax
    movr ebx,[numberCompareToNumber];standard
    cmp eax,ebx
    pushf; flags
    pop eax
        ; return
        movr [compareResultNumber],eax
     movr eax,compareResultNumber
    movr ebx,byteBase
    jmp numberConvert
wordCompare:
    ; compare to and bo strings
    ; use stringCompare
    pushr compareToLength
    pushr compareToAddress
    pushr compareBoLength
    pushr compareBoAddress
    call wordsCompare
    pop eax
        movr [compareResultNumber],eax
     movr eax,compareResultNumber
    movr ebx,1;length of output
    jmp numberConvert
sentenceCompare:
    pushr compareToLength
    pushr compareToAddress
    pushr compareBoLength
    pushr compareBoAddress
    call sentenceGet
    pop eax
    pop ebx
    cmp eax,no
    jz compareNo
    ; if found then yes
    movr eax,yes
    movr ebx,yes
    call numberConvert
compareNo:
    movr eax,no
    movr ebx,no
    ret

bookCommands.asm te

link to sysh 0.4.1.3.1 release is here https://sourceforge.net/projects/rpoku/files/sysh/sysh-0.4.1.3.1.tbz2/download?use_mirror=iweb

HSPL: stringContains asm, and find pseudo-code

made a stringContains function today, “sees if a string contains the comparison string”,

string.asm

section .bss
  resr  stringCounter,byteBase
  resr stringAddr,byteBase
section .text
stringContains:  ; sees if a string contains the comparison string
; input,   string 1, full-length 2, contained-string 3,  contained-length 4
; iterate from start of string,
;  to full-length minus contained-length
;  at each point doinng a string-compare
;  if stringCompare returns success, then return success.
   mov eax,[esp+byteBase]; string-address
   mov ebx,[esp+byteBase*2]; full-length
   mov [stringAddr],eax;
   mov [stringCounter],ebx;
   jmp stringContainsLoop

stringContainsLoop:
   ; if stringCounter is 0, then exit
   mov eax,[stringCounter]; value for comparison
   cmp eax,1
   jl noStringContains
   mov eax,[stringAddr]; string-address
   mov ebx,[esp+byteBase*3]; contained-string address
   mov ecx,[esp+byteBase*4]; contained-length
   call stringCompare
   cmp eax,1 ; subtracts second-arg
   jl yesStringContains; less than 0 then success
   ; else,  increment stringAddr and continue loop
   mov eax,[stringAddr]
   mov ebx,[stringCounter]
   add eax,1 ; stringAddr
   sub ebx,1 ; stringCounter
   mov [stringAddr],eax
   mov [stringCounter],ebx
   jmp stringContainsLoop

yesStringContains:
     pushr 4
     call clearArgs
     pop eax
     pushr 1 ; indicating found
     push eax
     ret
noStringContains:
     pushr 4
     call clearArgs
     pop eax
     pushr 0 ; indicating none
     push eax
     ret

string.asm quote

it compiles, but I haven’t tested it yet,  am still writing the wrapper for it.

commands.asm

codeEntry find,”find”,4,0,[definitions]
    ; have some kind of search,
    ;   such as matching current sentence, to saved sentence
    ; output matching results
    ;   default search variables,  though can search from, or at
    ;    getSection relevant to name, then do stringContains to see if relevant

commands.asm quote

search.asm

; todo, break-up codeGet into several functions,
; then can re-use them for sentence-search or generic name-match
search.asm quote

HSPL Human Speakable Programming Language: caseInterpret, typeInterpret, codeGet

changelog.txt

October 16, 2011, hexDay 10, hexWeek 2,1 ya
 06:30 helo
 06:56 perhaps append should return a string
       meh, maybe a little later, after this is debugged to functioning properly
09:29 fixed codeGet, issue was improper arguments from sentenceInterpret
 10:04 todo debug caseInterpret
 12:00 caseInterpret debugged,
 13:41 working on debugging typeInterpret
 14:00-30 nap 30-15:00 cooking
15:52  fixed typeInterpret!
 15:55 fixed glyphsatofNumbers
 15:53 now should probably integrate caseInterpret in sentenceInterpret
 16:16 looking at B-tree’s,  seems it would be good to do as earlier planned,
     having extra space for each sentence and word, to make modifications easier.
     each sentence could be saved in a 256 glyph region (sentenceSize), some may of course overflow,
                              in such case can move next sentence to make room.
    in my magic-spell-book usually I don’t modify things, I just keep going, and add new sentences, as I update them.
    or sometimes when I go back, I write additions in the margins,  so that is like the “extra space”.
 16:43 issue with integrate caseInterpret, is that have to store the sentence, convert the cases, and only then run the verb
     obviously it can be achieved with recursion.  the questions abound, such as, will a sentence be enough room? perhaps I should do my modifications in a book.  currently the types convert to smaller things, but what if they reference a large quote,  I guess then it would simply resolve to the quote address, ahh, so then a sentenceSize should suffice,  since most of the cases will becomes smaller, merely addresses followed by lengths, though there could be some issue with recognizing addresses which have 0’s or synonyms of blanks.
 17:01 earlier versions of sysh, had everything arranged by addresses and lengths, there were no words or blanks, perhaps I could follow a similar example. 
 17:05 alternatively could let the command do the conversions..
 17:09 meh, for now, can blog caseInterpret, typeInterpret and codeGet
October 15, 2011 hexDay 9, hexWeek 2,1 ya
 15:30 todo write typePush and typeInterpret
 15:34 perhaps shall rename my .asm files to .nasm files for proper syntax highlighting
       hmmm .nasm extension doesn’t turn on syntax highlighting but,
       simply moving syntax/nasm.vim to syntax/asm.vim does work.
 15:50 wrote typePush
 16:23 working on typeInterpret algorithm
 15:39, gotta split sentenceInterpret, to make codeGet subfunction.
 18:30 finished writing typeInterpret, todo codeGet
 19:49 wrote codeGet
 19:56 it’s gonna be time to debug soon
 22:39 finished compile-time debugging
 23:57 going to sleep
October 14, 2011 hexDay 8, hexWeek 2,1 ya
 01:00 revising cases
 01:30 debugging cases
 02:06 aCaseGet works
 02:17 aLastCaseGet works
02:18 case revision complete, though casePush order could still be optimized, it depends on usage
 10:24 sentenceInterpret functioning properly
 10:25 maybe should make a case spreadsheet
 10:29 though soon should implement mov and such functions,  most interesting might be jmp
       also todo research how to use parallel processors so can do low-level implementation
 10:58 okay, have bunch of resources for doing parallel,  will leave it for later
       right now, more important to implement the simple functions
       like types,  to support registers, and numbers
 10:59 sleepy, nap time.
 14:50 back
 18:20 so samta tells me about adjectives, and that articles can be adjectives.
 18:21 I’m still somewhat confused about my being a case, as it seems more of an adjective to me.
       hmmm it seems any noun modifier is an adjective, so we have to be a bit more specific.
       other than case there are a variety of other grammatical categories, so how shall we deal with them?
       should we simply start with types, and then work from there?
       btw, my case is fine, it can be used to store meta-data, like optimization metrics, and personal relation.
       lets examine the various grammatical categories:
         animacy (chakra density), aspect(temporal flow), Clusivity (inclusive/exclusive),
         Definiteness (a, the), Degree of comparison (compare), Evidentiality (citation),
         Focus, Gender, Mirativity, Modality Mood Noun class Number Person Polarity Tense Topic Transitivity Voice
      grammatical functions: object, subject, adjunct (comment, optional-case), complement (necessary-case).
 19:37 okay anyways, I gotta do one thing at a time here,  lets get types to work
       that would imply hmmm what’s the algorithm for type?
       in caseInterpret,  drop case word, get last word, interpret last word,
            if last word is a type then process rest of case contents by sending to appropriate function and return result
            else return case contents
 22:08 wrote caseInterpret, todo typeInterpret, typePush
 23:00 working on nu type
 23:30 wrote nu type
 23:39 clearing args su subtraction with esp bo faster maybe
changelog.txt quote

interpret.asm quote

section .bss
  resr caseInterpretResultAddress,byteBase
;section .data
  resr caseInterpretResultLength,byteBase
section .text
caseInterpret: ; interperts case, such as type, and outputs result
      ; case address and case length bo input be
      ; word address and word length bo output be
      ; algorithm be
      ; in caseInterpret,  drop case word, get last word, interpret last word,
      ;      if last word is a type then process rest of case contents by sending to appropriate function and return result
      ;      else return case contents
      ; in caseInterpret,  drop case word,
      ;     to drop, have to get last word, then use it’s start address as end address
      mov eax,[esp+byteBase*1]
      mov ecx,[esp+byteBase*2]
      pushr ecx
      pushr eax
      call aLastWordGet
      pop eax
      pop ecx
      ; if no then exit
      cmp eax,no
      jz caseInterpretNo
      ; set length to end at word’s start
       ; string length su end bo word start at set be
      ;eax; word’s start
      ;[esp+byteBase*2]; string length
      movr ebx,[esp+byteBase*1]; string start
      subr eax,ebx; word start - string start = length
      movr [esp+byteBase*2],eax; length set
      ; set variables
      movr eax,[esp+byteBase*1]
      movr ecx,[esp+byteBase*2]
      movr [caseInterpretResultAddress],eax
      movr [caseInterpretResultLength],ecx
 ;     ; get last word, interpret last word,
 ;     pushr ecx
 ;     pushr eax
 ;     call aLastWordGet
 ;     pop eax
 ;     pop ecx
 ;     ; if is type then interpret
      push ecx
      push eax
      call typeInterpret
      pop eax
      pop ecx
      cmp eax,no
      jnz caseInterpretEnd
      ;      else return case contents
      jmp caseInterpretYes
;caseInterpretCallTypeInterpret:
;        pushr [caseInterpretResultLength]
;        pushr [caseInterpretResultAddress]; length
;    call typeInterpret
;    pop eax
;    pop ecx
;    jmp caseInterpretEnd
caseInterpretNo:
      movr ecx,no
      movr eax,no
      jmp caseInterpretEnd
caseInterpretYes:
      movr ecx,[caseInterpretResultLength]
      movr eax,[caseInterpretResultAddress]; length
      jmp caseInterpretEnd
caseInterpretEnd:
      pop edx; ret
      pop ebx; arg 1
      pop ebx; arg 2
      pushr ecx; length
      pushr eax; address
      pushr edx
      ret
     
interpret.asm sourcecode

type.asm

section .data
  datr typesQuantity,1
   ; types list,  number nu,  quote quo te,
section .text
typePush: ;pushes the available types onto the stack
   pop edx
   pushr nu_length
   pushr nu_name
   push edx
   ret
section .bss
  resr typeInterpretResultAddress,byteBase
  resr typeInterpretResultLength,byteBase
section .text
typeInterpret: ; interpret be types bo
   ; input be type address and type length bo
   ; output be word address and word length bo
   ; algorithm be quo
   ;     get be the typeWord ya from infer be type-contents ya
   ;     codeGet be typeWord su contents bo return so do te bo ya

   ;     get be the typeWord bo aLastWordGet with ya
   movr eax,[esp+byteBase*1]; type address
   movr ecx,[esp+byteBase*2]; type length
   push ecx
   push eax
   call aLastWordGet
   pop eax
   pop ecx
   ; if none then exit
   cmp eax,no
   jz typeInterpretNo
      ;      if last word is a type then process rest of case contents by sending to appropriate function and return result
      ;        first type to implement is numbers nu,  then can implement registers re
      ;        hmmm, perhaps can simply do a word lookup, or could use for higher level types, 
      ;         nu can be hardcoded as it is required for basic lookup, 
      ;         concievably we could simply not convert to letters,
      ;         but that would make it unreadable, and thereby unspeakable.
      ;        is there a generic way we could determine it is a type?
      ;             perhaps we could do an arLastWordGet instead, with a typePush to generify arguments
      call typePush
      pushr [typesQuantity]
      push ecx
      push eax
      call arLastWordGet
      pop eax
      pop ecx
   ; if is type then interpret
    cmp eax,0
    jz typeInterpretNo
   ;     su infer be type-contents bo ya
   ; result address su set be type start bo
   movr ebx,[esp+byteBase*1]; type start bo
   movr [typeInterpretResultAddress],ebx ; result address su set be
   ; su result length bo set be contents end address minus start address with be
   movr edx,eax; copy be end address bo
   subr edx,ebx; end address minus start address
   movr [typeInterpretResultLength],edx; result length bo set be
   ;
   ;     codeGet be typeWord bo book su return so do te bo ya
   pushr ecx ; type length
   pushr eax ; type address
   ;pushr bookletSize
   ;pushr [book]
   call codeGet
   pop eax ; code address, address
   pop ecx ; code address, length
   ; if none then default exit
   cmp eax,no
   jz typeInterpretYes
   ; make sure is byteBase long
   pushr [typeInterpretResultLength];[esp+byteBase*2]; contents length
   pushr [typeInterpretResultAddress];[esp+byteBase*1]; contents address
   call [eax]
   pop eax
   pop ecx
   ; return so
   jmp typeInterpretEnd
typeInterpretNo:
   movr eax,no
   movr ecx,no
   jmp typeInterpretEnd
typeInterpretYes:
   movr eax,[typeInterpretResultAddress]
   movr ecx,[typeInterpretResultLength]
   jmp typeInterpretEnd
typeInterpretEnd:
   pop edx; ret
   pop ebx; arg 1
   pop ebx; arg 2
   push ecx; length
   push eax; address
   push edx
   ret
type.asm sourcecode

book.asm

section .data
  datr typesQuantity,1
   ; types list,  number nu,  quote quo te,
section .text
typePush: ;pushes the available types onto the stack
   pop edx
   pushr nu_length
   pushr nu_name
   push edx
   ret
section .bss
  resr typeInterpretResultAddress,byteBase
  resr typeInterpretResultLength,byteBase
section .text
typeInterpret: ; interpret be types bo
   ; input be type address and type length bo
   ; output be word address and word length bo
   ; algorithm be quo
   ;     get be the typeWord ya from infer be type-contents ya
   ;     codeGet be typeWord su contents bo return so do te bo ya

   ;     get be the typeWord bo aLastWordGet with ya
   movr eax,[esp+byteBase*1]; type address
   movr ecx,[esp+byteBase*2]; type length
   push ecx
   push eax
   call aLastWordGet
   pop eax
   pop ecx
   ; if none then exit
   cmp eax,no
   jz typeInterpretNo
      ;      if last word is a type then process rest of case contents by sending to appropriate function and return result
      ;        first type to implement is numbers nu,  then can implement registers re
      ;        hmmm, perhaps can simply do a word lookup, or could use for higher level types, 
      ;         nu can be hardcoded as it is required for basic lookup, 
      ;         concievably we could simply not convert to letters,
      ;         but that would make it unreadable, and thereby unspeakable.
      ;        is there a generic way we could determine it is a type?
      ;             perhaps we could do an arLastWordGet instead, with a typePush to generify arguments
      call typePush
      pushr [typesQuantity]
      push ecx
      push eax
      call arLastWordGet
      pop eax
      pop ecx
   ; if is type then interpret
    cmp eax,0
    jz typeInterpretNo
   ;     su infer be type-contents bo ya
   ; result address su set be type start bo
   movr ebx,[esp+byteBase*1]; type start bo
   movr [typeInterpretResultAddress],ebx ; result address su set be
   ; su result length bo set be contents end address minus start address with be
   movr edx,eax; copy be end address bo
   subr edx,ebx; end address minus start address
   movr [typeInterpretResultLength],edx; result length bo set be
   ;
   ;     codeGet be typeWord bo book su return so do te bo ya
   pushr ecx ; type length
   pushr eax ; type address
   ;pushr bookletSize
   ;pushr [book]
   call codeGet
   pop eax ; code address, address
   pop ecx ; code address, length
   ; if none then default exit
   cmp eax,no
   jz typeInterpretYes
   ; make sure is byteBase long
   pushr [typeInterpretResultLength];[esp+byteBase*2]; contents length
   pushr [typeInterpretResultAddress];[esp+byteBase*1]; contents address
   call [eax]
   pop eax
   pop ecx
   ; return so
   jmp typeInterpretEnd
typeInterpretNo:
   movr eax,no
   movr ecx,no
   jmp typeInterpretEnd
typeInterpretYes:
   movr eax,[typeInterpretResultAddress]
   movr ecx,[typeInterpretResultLength]
   jmp typeInterpretEnd
typeInterpretEnd:
   pop edx; ret
   pop ebx; arg 1
   pop ebx; arg 2
   push ecx; length
   push eax; address
   push edx
   ret

book.asm sourcecode

0.4.1.4 write sysh HSPL human speakable programming language release

0.4.1.4 write sysh HSPL human speakable programming language release

changelog.txt

December 2, 2011, 9th hexDay, 5,1, hexWeek
        17:30 started looking at code
        17:58 todo make caseInterpret a register function.
        21:32 made caseInterpret a register function, fixed say
        23:38 wrote the write sysh function, default writes to current file
        23:39 todo make a safeCopy function.
        23:55 write is now operational, 0.4.1.4 release
changelog.txt te

bookCommands.txt

section .bss    
    resr writeInputString,byteBase*2
    resr writeBoString,byteBase*2
    resr writeToString,byteBase*2
    resr writeAtString,byteBase*2
section .text
codePut write,”write”,5,0,[book] ; 4
    ; writes bo sentence to context at address
    ; output yes or no
    ; algorithm,
    ;    gets bo, to, at
    ;        resolves context to address,   default is book
    ;        adds at value, if none, then insert to context
    ;        check that context can fit bo
    ;        write bo
    ;        return
    movr [writeInputString],eax
    movr [writeInputString+byteBase],ebx
    movr ecx,bo_name
    movr edx,bo_length
    call caseGet
    movr [writeBoString],eax
    movr [writeBoString+byteBase],ebx
    ; get to
    movr eax,[writeInputString]
    movr ebx,[writeInputString+byteBase]
    movr ecx,to_name
    movr edx,to_length
    call caseGet
    call caseInterpret;        resolves context to address,   
    cmp eax,no; if none
    jz writeToDefault
    jmp writeContinue
    writeToDefault:
    movr eax,book
    movr ebx,[book+byteBase]
    movr [writeToString],eax
    movr [writeToString+byteBase],ebx
    writeContinue:
    movr [writeToString],eax
    movr [writeToString+byteBase],ebx
    ; get at
    movr eax,[writeInputString]
    movr ebx,[writeInputString+byteBase]
    movr ecx,at_name
    movr edx,at_length
    call caseGet
    call caseInterpret; get at value
    movr [writeAtString],eax
    movr [writeAtString+byteBase],ebx
    ;        adds at value, if none, then insert to context
    movr ecx,[writeToString]
    movr edx,[writeAtString]; resolved at value
    movr eax,[ecx]; resolved address value
    addr eax,[edx]; resolved at value
    ;        check that context can fit bo
    ; movr ebx,[ecx+byteBase]; content length
    ; movr edx,[writeBoString+byteBase]; input length
    ;        write bo
    movr ecx,[writeBoString]
    movr ebx,[writeBoString+byteBase]
    pushr ecx ; source
    pushr eax ; destination
    pushr ebx ; length
    call copyMove
    ;        return
    movr eax,one_name
    movr ebx,one_length
    ret
bookCommands.asm te

here is the 0.4.1.4 release tarball https://sourceforge.net/projects/rpoku/files/sysh/sysh-0.4.1.4.tbz2/download

bookCommands.txt

 
HSPL human speakable programming language: codePut, textInsert, arWordGet, aCaseGet, aSentenceGet

HSPL human speakable programming language:

changelog.txt quote

September 14, hexDay 10, hexWeek 0,1
——————————————————
 07:30 started working on code
08:30 debugged append, wordAppend, codePut
  todo get codePut to write to book, currently does areaSay
 10:00 returned from returning heaven book to library
10:30 wrote and tested textInsert, seems to work
  okay so what now? getting function, return variable, do code
   arWordGet (ar) caseGet (wa) sentenceGet (ku)   codeDo (do)
 10:40-11:30 nap 11:40 making soup
 13:00 debugged numbersToGlyphs, now gives proper length
 13:12 might need to rewrite glyphsToNumbers to support infinite length numbers
 13:27 higher priority is arWordGet so lets test it with interpreter
 16:30 debugging arWordGet,
 17:00 added Length Result to arWordGet
17:40 debugged arWordGet
 17:50 what now? placeGet, sentenceGet, codeDo
    can’t use numbers till after code can be done anyhow
   though yes, it would be convenient to see the code-address in hexadecimal,                                                   perhaps with li function to convert it to code afterwards, yet again, requiring code doing to be operational first…
   anyhow writing fresh functions is more fun than debugging or rewriting :-).
 16:00 making burgers 16:30 went to get tomatoes 19:00 eating
 19:15 back, debugging aCaseGet
 19:52 debugged aCaseWordGet
 20:00 hmmm, to get first case, might have to rewrite arWordGet                                                                  to do full search on each aWordGet, rather than using wordGet,
20:22 debugged aCaseGet, added nest and nester to arWordGet
 20:30 debugging aSentenceGet
21:02 debugged aSentenceGet
 21:20 writing caseGet, lastWord
22:01 wrote notBlankReverseGet, blankReverseGet, lastWordGet

changelog.txt

datastruc.asm sourcecode

%macro codePut 5 ; label,name,nameLength,meta,index followed by code
; call %1_init ; to create entry after using macro
section .rodata
     %1_length  equ  %3
;section .bss
;    resr %1_sentence,sentenceSize; since this is only used once can used shared version,  
section .data ;
    datr %1_flags,%4
    datr %1_name,%2
section .text
%1_init:
    ; make sentence string, record to root book
    ;  name la su codeAddress rei bo code be ya
    ;      perhaps some stringBuilder functions would be good
    ;       such as,  append, taking stringAddress, length, returning newStart
    ;       could also make an wordAdd, which surrounds addition with spaces
    push %1_length
    push %1_name
    push sentence
    call wordAppend ; adds name
    pop eax
    push su_length ; is subject
    push su_name
    push eax
    call wordAppend ; indicates subject added
    pop eax
    ;movr [h1],eax; temporarily store eax
    ; convert number to glyphs, then add
    
    push byteBase
    push %1_code
    ;call numbersToGlyphs
    ;pop ebx; glyphAddress
    ;pop ecx; glyphLength
    ;movr eax,[h1]; retrieve eax
    ;push  ecx;
    ;push ebx
    push eax
    call wordAppend ; adds code; perhaps we should convert it to glyphs first
    pop eax
    push bo_length
    push bo_name
    push eax
    call wordAppend; indicates object added
    pop eax
    push code_length
    push code_name
    push eax
    call wordAppend ; add code
    pop eax
    push be_length
    push be_name
    push eax
    call wordAppend; add be
    pop eax
    ; finalize sentene with ya
    push ya_length
    push ya_name
    push eax
    call wordAppend
    pop eax;
    ; figure out length,
    ; find clear space in book of sufficient length
    movr ecx,eax
    movr ebx,sentence
    subr ecx,ebx ; length of sentence added
    ; add to book
    ; textInsert input, bookAddress, textAddress, textLength
    pushr ecx; length
    pushr ebx; textAddress
    pushr %5 ; bookAddress
    call textInsert
    
    ;push %1_flags; I’ve never used flags anyhow
    ;movr eax,%5; %5 is address of book to add it to
    ;pushr [eax+listLatestPlace] ; prevLink
    ;pushr 5 ; number of Entry sections
    ;push eax ; TODO make entries modular, arg  listAddress numberOfEntries pushed onto stack
    ;call addEntry
    ret
%1_code:
%endmacro

datastruc.asm

book.asm sourcecode


textInsert: ; inserts text to book, to first available cleanSpace in main-section
    ; input: bookAddress, textAddress, textLength
    ; output: none for now, perhaps later, success or otherwise
    ; cleanSpace input startAddress length amount, output spaceAddress
    movr ecx,[esp+byteBase*3]; textLength
    movr ebx,[esp+byteBase*1]; bookAddress
    ; later can skip cover of book
    pushr ecx ; amount
    pushr bookSize ; length
    pushr ebx; startAddress
    call cleanSpace
    pop eax; spaceAddress
    ; copyMove input, length, destination, source
    movr ecx,[esp+byteBase*3]; textLength
    movr ebx,[esp+byteBase*2]; textAddress
    pushr ebx; source
    pushr eax; destination
    pushr ecx; length
    call copyMove
    ; return
    pop edx; ret
    pop ebx; arg 1
    pop ebx; arg 2
    pop ebx; arg 3
    push edx; ret
    ret

book.asm

gramParser.asm sourcecode

section .bss
   resr arWordGetCounter,byteBase
   resr arWordGetAddress,byteBase
   resr arWordGetLength,byteBase
   resr arWordGetAddressResult,byteBase
   resr arWordGetLengthResult,byteBase
section .text
arWordGet:; Array Word Get: returns word encountered and length
     ; input,  stringAddress 1, stringLength 2, arrayLength 3,  
     ;          firstWordAddress 4, firstWordLength 5, NthWordAddress even, NthWordLength odd
     ; output, wordStartAddress, wordLength
     ; algorithm, can loop through array using countTillWord,
     jmp arWordGetNest
arWordGetNest:
  ; hmmm, might have to rewrite it so that it does a full search, for each aWordGet till no more words, or found
      ; algorithm,  arWordGet, then jmp aWordGetMid,  if returns 0, then jump back here, till no more
     ; clear counter
     xor ecx,ecx; start of Array
     movr [arWordGetCounter],ecx
     ; do aWordGet, store wordAddress and length
     movr ecx,[esp+byteBase*2];length
     movr eax,[esp+byteBase*1];address
     pushr ecx
     pushr eax
     call aWordGet
     popr eax; address
     popr ecx; length
     ; if length 0 then exit
     cmp ecx,no
     jz arWordGetNo
     movr [arWordGetLength],ecx
     movr [arWordGetAddress],eax    
     jmp arWordGetMid
arWordGetNester:
     ; increment address, and reduce length appropriately
     ; increment address
     movr ebx,[arWordGetAddress]
     addr ebx,[arWordGetLength]; get endOfWordAddress, shall be newAddres
     movr [esp+byteBase*1],ebx
     ; reduce length
     movr eax,[esp+byteBase*1]; stringAddress
     addr eax,[esp+byteBase*2]; stringLength; gets endOfStringAddress
     subr eax,ebx; new length, is endOfStringAddress - endOfWordAddress
     movr [esp+byteBase*2],eax
     jmp arWordGetNest
arWordGetMid:
     ; check has not yet reached end of array
     movr edx,[esp+byteBase*3]; arrayLength
     movr ecx,[arWordGetCounter]; current entry
     cmpr ecx,edx; compare counters
     jz arWordGetNester; if equal then go back to nest
     movr edx,[esp+byteBase*(4+ecx*2+1)]; wordLength
     movr ecx,[esp+byteBase*(4+ecx*2)]; wordAddress
     movr ebx,[arWordGetLength]; stringLength
     movr eax,[arWordGetAddress]; stringAddress
     movr [arWordGetLengthResult],edx ; save a copy of wordLength
     ; call wordGet
     pushr edx; wordLength
     pushr ecx ; wordAddress
     pushr ebx ; stringLength
     pushr eax ;stringAddress
     call wordGet
     pop eax; result
     ; if positive then exit successfully
     cmpr eax,no
     jnz arWordGetYes
     ; if negative then increment counter and recurse
     movr ecx,[arWordGetCounter]; current entry
     addr ecx,1
     movr [arWordGetCounter],ecx; current entry
     jmp arWordGetMid
arWordGetNo:
     ; a bit more complex to clear args,  
     ; number of array entries times 2 plus the 3 initial
     movr eax,[esp+byteBase*3]; arrayLength
     ; multiply by 2
     xor edx,edx; clear edx
     movr ebx,2
     mul ebx
     ; eax is number of args to clear
     addr eax,3; adding the final 3
     pushr eax
     call clearArgs
     pop edx ; ret
     pushr no ; no length
     pushr no ; no address
     push edx
     ret
arWordGetYes:
     ; save result
     movr [arWordGetAddressResult],eax
     ; a bit more complex to clear args,  
     ; number of array entries times 2 plus the 3 initial
     movr eax,[esp+byteBase*3]; arrayLength
     ; multiply
     xor edx,edx; clear edx
     movr ebx,2
     mul ebx
     ; eax is result
     addr eax,3; adding the final 3
     pushr eax
     call clearArgs
     pop edx;ret
     pushr [arWordGetLengthResult];
     pushr [arWordGetAddressResult]
     push edx;ret
     ret
; if we return with length including the word,  
;  a lastWord function could easily find the case, or sentence type
aCaseGet: ; gets next case word
   ; input stringStart, stringLength
   ; output caseLength
   ; algorithm call arWordGet
   movr ebx,[esp+byteBase*2]; stringLength
   movr eax,[esp+byteBase*1]; stringAddress
   pushr so_length
   pushr so_name
   pushr that_length
   pushr that_name
   pushr which_length
   pushr which_name
   pushr with_length
   pushr with_name
   pushr from_length
   pushr from_name
   pushr yo_length
   pushr yo_name
   pushr on_length
   pushr on_name
   pushr at_length
   pushr at_name
   pushr by_length
   pushr by_name
   pushr in_length
   pushr in_name
   pushr for_length
   pushr for_name
   pushr to_length
   pushr to_name
   pushr of_length
   pushr of_name
   pushr bo_length
   pushr bo_name
   pushr su_length
   pushr su_name
   pushr be_length
   pushr be_name
   pushr casesQuantity
   pushr ebx
   pushr eax
   call arWordGet
   popr eax; address
   pop  ecx; length
   ; return result
   jmp aCaseGetEnd
aCaseGetEnd:
   ; address can technically be original start address
   ; length can be distance from original startAddress to end of caseWord
   addr ecx,eax; makes ecx address at end of case word
   popr edx; ret
   popr eax; stringAddress
   subr ecx,eax ; makes ecx length till end of case word
   popr ebx; stringLength
   pushr ecx; length
   pushr edx; ret
   ret

caseGet: ; gets a particular case, from within first sentence and within length
   ; input,  stringAddress, stringLength, caseName, caseLength
   ; output,  caseStartAddress, caseLength, including caseName
   ; algorithm,  
   ;  caseStartAddress variable, caseLength variable,
   ;   aSentenceGet, to find end of sentence if within length, set as end
   ;   aCaseGet, if proper case return, else move-up startAddress and recurse.
   movr eax,[esp+byteBase*1]; stringAddress
   movr ecx,[esp+byteBase*2]; stringLength
   pushr ecx
   pushr eax
   call aSentenceGet
   pop ecx; length
   movr [esp+byteBase*2],ecx; update length
   xor ecx,ecx;
   jmp caseGetMid
caseGetMid:
   movr ecx,[esp+byteBase*2]; length
   movr eax,[esp+byteBase*1]; address
   pushr ecx
   pushr eax
   call aCaseGet
   pop ecx; length
   ; if no case, then exit
   cmp ecx,0
   jz caseGetNo
   ; if case, check if proper case, get lastWord, and stringCompare
   movr eax,[esp+byteBase*1]; start address
   movr ebx,[esp+byteBase*2]; length
   pushr ebx
   pushr eax
   call lastWordGet
   pop eax; lastWordAddress
   pop ebx; lastWordLength
caseGetNo:
   popr edx; ret
   pop eax; address
   pop ebx; length
   pushr ecx; length to end of case
   pushr eax; startAddress of case

gramParser.asm

sentence.asm sourcecode

aSentenceGet: ; gets next sentenceWord
   ; input stringStart, stringLength
   ; output sentenceStart, sentenceLength
   movr ecx,[esp+byteBase*2]; stringLength
   movr eax,[esp+byteBase*1]; stringAddress
   pushr ku_length
   pushr ku_name
   pushr do_length
   pushr do_name
   pushr ya_length
   pushr ya_name
   pushr sentenceTypesQuantity
   pushr ecx
   pushr eax
   call arWordGet
   popr eax; address
   pop ecx; length
   ; return result
   jmp aCaseGetEnd

sentence.asm

HSPL: sysh, lettersToNumbers and mathPower debugged

I implemented them as the function “li” which translates the trueSpace from letters to numbers

commands.asm

codeEntry li,”li”,2,0,[definitions]; 15; math, infinite
    ; li function, translates true literal into numeric representation.
    ;  etymology “li” was used to indicate numbers in lojban, end-quote was bo libo
                ; pa re ci vo mu xu ze bi so pau rau cau vau mua
     ; obviously later these commands will be part of the written text, for now (register-version) they aren’t recorded.
    ; where is the true space? the space where things are kept before they organized
    ; use lettersToNumbers
    pushr byteBase ; length
    pushr trueSpace; startAddress
    call lettersToNumbers
    popr eax; result
    movr [trueSpace],eax ; update trueSpace
    next


commands.asm sourcecode

math.asm


lettersToNumbers:; convert letters to number
    ; input strAddress length; right handed or left handed? assume right-handed? later can make arg
   ; takes letters, converts them to numbers of the appropriate base,
   ;   and adds them up with corresponding multiplication for significance of place.
   ;movr ebx,[numericBase]
   ; assuming right-handed numbers i.e. thousand = 0001
   xor ecx,ecx; place-counter
   movr [h1],ecx;  clear result holder
   movr [h2],ecx; something holder
   movr [h3],ecx; counter holder
   jmp lettersToNumbersMid
lettersToNumbersMid:
   ; check counter is less or equal to length
   movr ecx,[h3]; counter
   movr edx,[esp+byteBase*2];length
   cmpr ecx,edx
   jz lettersToNumbersEnd; if length reached, end
   ; get first letter, change to number, multiply by place, add to result
   movr edx,[esp+byteBase*1];startAddress
   addr edx,ecx; add counter to address
   xor ebx,ebx; clear ebx
   mov bl,[edx]; got first byte of number
   ; beneficial to have alphabet list, that corresponds to value of number,
     ; then can search through hexadecimal also, same function
   ; if we have a string charAt function, would be beneficial, it’s similar to stringContains
   ;  or can do it based on numeric ASCII to avoid calling external functions, meh hardcoding ~
   ; charAt
   ;pushr numAlphabetLen ; length
   ;pushr numAlphabet; string
   ;pushr ebx; char
   ;call charAt
   ;popr ebx; result, if negative then parseError with optional recovery, else process and add result to counter
   ;cmp ebx,0
   ;jl notLettersToNumbers
   ; hmmm, but if we use numberString, we don’t take into account alternative representations of numbers, such as lowercase.
   ; we could of course use multiple numberStrings, though perhaps can do faster with some math skills
   ;   if the number is between 0x30 and 0x39 then 0 through 9,  if 0x41 to 0x46 A to F, if 0x61 to 0x66 then a to f
   ; bl is current letter, so compare it to the various integer parts
   cmp bl,0x30 
   jl lettersNulltoNumbers
   cmp bl,0x40 
   jl letters0to9Numbers
   cmp bl,0x47
   jl lettersAtoFNumbers
   cmp bl,0x67
   jl lettersatofNumbers
   ;else continue, or throw error/exception
   jmp lettersNulltoNumbers
lettersNulltoNumbers:
   ; skip unrecognized numbers; todo can log exception, perhaps throuhg stderr
   jmp lettersToNumbersContinue
letters0to9Numbers:
  subr ebx,0x30 ; set to proper base
  jmp yesLettersToNumbers

lettersAtoFNumbers:
  subr ebx,0x41-9 ; set to proper base
  jmp yesLettersToNumbers

lettersatofNumbers:
  subr ebx,0x61-9 ; set to proper base
  jmp yesLettersToNumbers

yesLettersToNumbers:
  movr [h2],ebx; store ebx for call
  ; multiply by place, need to get exponent of base, so make power function
  pushr ecx
  pushr [numericBase]
  call powerMath
  popr eax
  movr ebx,[h2]
  mul ebx ; multiply number by it’s place to make it at it’s place,
           ; could also use the shr function, though only with hexadecimal
  movr ecx,[h1]; result-holder copied to ecx
  addr eax,ecx ; add  to current number
  movr [h1],eax ; store result
  jmp lettersToNumbersContinue ; continue

lettersToNumbersContinue:
   ; increment counter and recurse
   xor ecx,ecx;clear ecx
   movr ecx,[h3] ;retrieve counter
   addr ecx,1 ; increment counter
   movr [h3],ecx ; store counter
   jmp lettersToNumbersMid
  
lettersToNumbersEnd:
    popr edx; ret
    popr ebx; arg 1
    popr ebx; arg 2
    pushr [h1]; result; potentially could return address of number and length, so infinite size numbers
    pushr edx; ret
    ret
   
powerMath: ; multiplies base times itself, “power” times.
   ; input:  base,  power
   ; output: result
   movr eax,[esp+byteBase];base
   movr ecx,[esp+byteBase*2];power
   movr ebx,eax; copy base
   jmp powerMathMid
powerMathMid:
   cmp ecx,1          ; if power counter
   jz powerMathDone     ; is 1 then exit
   jl nullPowerMath     ; is 0 then set to 1 and exit
   mul ebx         ; else multiply base times self,
   subr ecx,1           ;   and decrement counter
   jmp powerMathMid       ; then recurse

nullPowerMath:
   movr eax,1; set to 1
   jmp powerMathDone; exit

powerMathDone:
   popr edx; ret
   popr ebx ; arg 1
   popr ebx ; arg 2
   pushr eax; result
   pushr edx ; ret
   ret

math.asm sourcecode

alpha version 0.4.1.1.4 full sentence output: HSPL Human Speakable Programming Language

alpha version 0.4.1.1.4  full sentence output: HSPL Human Speakable Programming Language

changelog.txt

October 26, 2011, 4th hexDay, 3,1 hexWeek
00:09 question sentence, ku, can run sentenceGet on the contents
00:51 add now returns a number
01:13 ku sentence implemented
01:30 0.4.1.1 version released
 09:00 updating readme.txt roadmap
 10:45 consensus is 0.4.1.1.4 write full sentence with result to book ya
 11:20 wrote sentenceInterpretStringResult
11:34 fixed sentenceInterpretStringResult
11:48 made numberConvert convenience function for syshMath functions
12:02 version 0.4.1.1.4 version released
changelog.txt quote

roadmap.txt

0.4.1.1.4 write full sentence with result to book ya

roadmap or todo-list be
alpha
0.4.1.2 quote be start since end till
0.4.1.3 compare be unknown bo standard to
0.4.1.4 write be contents bo address to
0.4.1.5 say be contents bo
0.4.1.6 see be contents so address at length for
0.4.1.7 jump be destination to conditional su
0.4.1.8 local be memory summary or book contents bo
0.4.1.9 extend be page or booklet by book bo
0.4.1.A number recognition, anyword that ends in a number is a number
0.4.1.B variable be contents bo name su
0.4.1.C update be variable bo new contents to
0.4.1.F function be contents bo code-address so
0.4.2.2 and connective
0.4.2.4 stack (push) be contents bo
0.4.2.5 call be command bo
0.4.2.6 retrieve (pop) be contents so
0.4.2.9 algebraic math functions
0.4.2.D index be book of words bo
0.4.2.E bind be pages or booklets bo so new book
0.4.2.F and parallel sentences by word also
0.4.3 allow for variables
0.4.3.1 conditional sentences by word if
0.4.3.3 or connective
0.4.3.E random number generator by word any
0.4.3.F or alternative sentences by word can
0.4.4 formating state, history, functions
0.4.5 expressing state, logs, functions
      save sentences by word ya as agreement
0.4.7 navigating memory, addresses, indexes in text mode,
0.4.8 file-system, file-manager
0.4.8.4 save to file
0.4.8.5 read file
0.4.8.6 search for file
0.4.9 multi-threading
0.4.9.1 processor names su
roadmap.txt quote

interpret.asm


section .bss
   resr sentenceInterpretResultString,sentenceSize
   resr sentenceInterpretResultAddress,byteBase
   resr sentenceInterpretResultLength,byteBase
section .data
   datr sentenceInterpretResultSuffix,” so ya”
   sentenceInterpretResultSuffixLength equ $-sentenceInterpretResultSuffix
section .text
sentenceInterpretStringResult:
    ; input eax result address, ebx result length,  sentence address sentenceInterpretAddress, sentence length sentenceInterpretLength.
        ; output eax resultString, ebx result string length
     ; algorithm return full sentence with result to book
        ;   input sentence, append result, append “so ya”
        movr [sentenceInterpretResultAddress],eax
        movr [sentenceInterpretResultLength],ebx
       movr ebx,[sentenceInterpretLength]
       movr eax,[sentenceInterpretAddress]; sentence
       push ebx
       push eax
       pushr sentenceInterpretResultString; string to append to
       call append
       pop ecx ; new end of string address
       pushr [sentenceInterpretResultLength]
       pushr [sentenceInterpretResultAddress]
       pushr ecx
       call wordAppend
       pop ecx;
       pushr sentenceInterpretResultSuffixLength
       pushr sentenceInterpretResultSuffix
       pushr ecx
       call append
       pop ebx; new end of string address
       movr eax,sentenceInterpretResultString
       subr ebx,eax; get length, by subtracting start of string from end of string
       ret

interpret.asm sourecode

commands.asm

section .bss
   resr numberConvertString,wordSize
section .text
numberConvert:
    ; input: eax number address,  ebx number length
    ; output: number glyphs suffixed by nu
    ; algorithm: convert number to glyphs, append suffix
    pushr byteBase; ebx; length of number;
    push eax; address of number
    call numbersToGlyphs
    pop eax; address of number string
    pop ebx; length of address string
    ; append type identifier
    pushr ebx
    pushr eax
    pushr numberConvertString
    call append
    pop ebx
    pushr nu_length
    pushr nu_name
    push ebx
    call wordAppend
    pop ebx
    ; return the converted number
    movr eax,numberConvertString
    subr ebx,eax; make length, by subtracting start address from end address
    ;mov eax,eax
    ;mov ebx,ebx
    ret
commands.asm sourcecode

here is the 0.4.1.4 version release https://sourceforge.net/projects/rpoku/files/sysh/sysh-0.4.1.1.4.tbz2/download

HSPL: sysh, major revision discourse sep 7.

here is the latest sysh alpha revision released today: https://sourceforge.net/projects/rpoku/files/sysh/sysh-0.4.1.0.7.tbz2/download

September 7, hexDay 3, hexWeek 01
————————————————-
 06:46 todo make do function, like ya, but runs/codeGets the be function
 13:18  to do that, how? we might have to save whole sentences, or migrate from heapList to book
    I’m not really sure how to work it at the moment, we’ll figure it out.
   can use tillLetters and tillBlanks to find length of words,
   can use stringCompare to match strings
   can store address of word in register,
    word can be followed by space, and then place identifier (be,of,to)
 13:29 alternatively can do finish making current set-up turing complete, then extend later
 13:30 perhaps it would be best to first work on saving in book format,
    though to properly save in (human-readable) book format, have to save with grammatical constructs in proper places
    it might have something to do with the Literal function in the search/codeGet file
    having addresses of sentences, could slow down the processing time
    alternatively we could have a place based saving, though that’s finite, and would likely have to be rewritten later
 17:44okay so if we wished to allow large words, list of places that would require modification,
   literal,  truth, save, ya, and all functions that use the string variables
    in sentence, we could save the address, followed by the length for each
  now this implies that we store the words someplace,  I was thinking in a book,
   considering we have to store sentences for logging and history anyhow, can write them immediately,
   perhaps we could write on a per-char basis,  though preferably per word, and how would we edit it?
    technically we should wait for a ya or do before making a write to history or log book
    that implies the words would require some kind of temporary storage,
    word lengths can vary from 1 to almost 200,000 letters,
    though most should fit in 32 letters, average word length in english is 5.1
     we could simply create a space to fit the word if it exceeds standard 16 letters,
         then remove the extra space once written, how to deallocate stuff? a deallocation function should be made
         ya would have to trigger the deallocation garbage collector
     meanwhile we could simply record only the first 32 0x20 letters of a word,
     could have a piece of memory 512 0x200 letters long, holding 16 0x10 words, and their place information
  20:44 hmmmm…. maybe there is an easier way
   technically, if I already know where the word starts, keeping track of it’s address is optional
    though it could be beneficial in long-term, when words could be in variety of places
   normally though it’s all held in the sentence, so perhaps we should do that,
   then we could generate a sentenceIndex to make it easier to keep track.
  20:58 if we think about it, we’ve already achieved a register-based sentence computer,

    perhaps we can simply work on the next layer of it… well actually we don’t preserve places atm, so doesn’t quite work,
  21:00 traditionally, in haskell implementations, the input was readLine, held in one variable,
         then when we wanted to get a certain place, there would be a search, and it would be found.
    how to make such a search algorithm in assembly?
     we’d need an array of the cases, and sentence delimiters.
      set start address as begining, initiate counter,
       if encounter sentence-delimiter, then fail,
       if encouther other case, then reset start, and counter
       if encounter proper case, then return start address and counter as length
  21:06 part of me wishes to rewrite much of this code from scratch, but perhaps can preserve some files
    personally I am familiar with my code, so perhaps it’ll be doable to migrate it gradually
    the interpreter would certainly have to be rewritten majorly
    ideally i’d figure out how to implement the base definitions likewise
  21:40 hmmm, the interpreter currently functions by readWord,
     if I wish to execute with do, then I’d have to do readSentence
  todo, in parser make countTillWord, which counts till it encounters a certain word, perhaps within a specified length
    alternatively I could use the stringContains which outputs address of the word found,
    would have to make it work with an array of words also, that would imply we can have an array of words,
     this leads us back to having a wordIndex consisting of startAddress,wordLength tuples
 21:48, this is such a major revision, that shall have to branch
 21:59, okay 0.4.1.0.7 uploaded to sourceforge

 22:57 should figure out how array shall be structured
  binary array can be,  name, length, tuples
  hspl array how to?
    array be like quote, with middle delimeters,
       address li su  length li for array be ar har har har
 23:30 wordArray su words of hello this is an array of words ar bo array be
       numArray su numbers of 34 li 56 li 23 li 34 li 43 li ar bo array be
 23:37, thinking about it, I could implement parsing functions, instead of length functions
    or rather, the parsing functions could give me the length, necessary for standard length functions
 23:40 what about multi-dimensional arrays? how do we implement those, it should be a seamless process
      multiArray su arrays of wordArray the numArray the ar bo array be
   for the sake of making it easier to edit sentences,
     can give each sentence a full 256 letters as buffer,
   this would mean the nextCleanSentencePlace would have to return 
           only addresses which start at 0x100 intervals from start

compare be word by 0.4.1.3.5 sysh, HSPL Human Speakable Programming Language

fixed the compare by word function

changelog.txt

18:06 fixed wordCompare now  operational! 0.4.1.3.5 :-)
changelog.txt te

bookCommands.asm

wordCompare:
    ; compare to and bo strings
    ; use stringCompare
    pushr [compareToLength]
    pushr [compareToAddress]
    pushr [compareBoLength]
    pushr [compareBoAddress]
    call wordsCompare
    pop eax
        movr [compareResultNumber],eax
     movr eax,compareResultNumber
    movr ebx,1;length of output
    jmp numberConvert

bookCommands.asm te

the sysh 0.4.1.3.5 release is here https://sourceforge.net/projects/rpoku/files/sysh/sysh-0.4.1.3.5.tbz2/download

HSPL: sysh, numbersToLetters

math.asm

section .rodata
    numAlphabet db “0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ”
    numAlphabetLen equ $-numAlphabet
section .data
    datr numericBase,0x10
section .text
; ASCII numbers are decimal 48-57 (0-9), 65-70 (A-F)
numbersToLetters:; convert number to letters
    ; input numAddress length
    ; divide number by numericBase
    ; use alphabetLetters to generate string
    ;  divide number by numeric base,  integerPortion of alphabetLetter do write, fractionPortion do recurse, till
    ;
    movr ebx,[numericBase]; numericBase
    ; division is edx and eax,
     ;  division works by, ax/op quotient in ax, remained in dx
    xor ecx,ecx; zero counter
    movr [h3],ecx;
    movr eax,[esp+byteBase]
    jmp numbersToLettersMid
numbersToLettersMid:
    ; compare counter to length
    ; exit if counter runs out
    movr ecx,[h3]; counter
    movr edx,[esp+byteBase*2];length
    jz numbersToLettersDone; if length reached, end
    div ebx
    mov [h1],eax ; quotient
    mov [h2],edx ; remainder
    ; to add get letter at the index of numAlphabet
    movr ebx,[numAlphabet+eax]
    movr [h4+ecx],eax
    ; prepare registers and recurse with remainder
    xor eax,eax
    movr eax,edx
    ; increment counter
    addr ecx,1

    jmp numbersToLettersMid

numbersToLettersDone:
    pushr 2
    call clearArgs
    return [h4]
math.asm sourcecode

HSPL Human Speakable Programming Language: sub, mul, div

changelog.txt

October 19, 2011, hexDay 13, hexWeek 2,1 ya
 18:22 at least implement syshSub today
18:28 syshSub implemented, and fixed, from case - bo case
 18:30 implement mul,  by case * bo case
20:41 mul implemented and fixed.
 21:29 wrote div
21:33 fixed div

changelog.txt

commands.asm

;codePut syshSub,”sub”,3,0,[book]
section .bss
   resr syshSubSentenceAddress,byteBase
   resr syshSubSentenceLength,byteBase
   resr syshSubBoNumber,wordSize
   resr syshSubBoLength,byteBase
   resr syshSubFromNumber,wordSize
   resr syshSubFromLength,byteBase
section .text
codePut syshSub,”sub”,3,0,[book]
    ; input be sentenceAddress eax, sentenceLength ebx.
    ;    requires cases bo, and to
    ; output be string with result in so case.
    ; algorithm be
    ; requried variables be sentence, cases for
    ; get interpert be ‘bo’ and ‘to’ cases bo
    ; do the subition,  return the function

    ; requried variables be sentence, cases for
    ; get interpert be ‘bo’ and ‘to’ cases bo
    movr [syshSubSentenceAddress],eax
    movr [syshSubSentenceLength],ebx
    push bo_length
    push bo_name
    push ebx
    push eax
    call caseGet
    pop eax
    pop ebx
    cmp eax,no;if no then exit
    jz syshSubNo
    push ebx
    push eax
    call caseInterpret
    pop eax
    pop ebx
    movr eax,[eax]; get actual number
    movr [syshSubBoNumber],eax
    movr [syshSubBoLength],ebx
    movr eax,[syshSubSentenceAddress]
    movr ebx,[syshSubSentenceLength]
    push from_length
    push from_name
    push ebx
    push eax
    call caseGet
    pop eax
    pop ebx
    cmp eax,no;if no then exit
    jz syshSubNo
    push ebx
    push eax
    call caseInterpret
    pop eax
    pop ebx
    ; do the subition,  return the function
    movr eax,[eax]
    movr ecx,[syshSubBoNumber]
    sub eax,ecx
    movr [syshSubFromNumber],eax
    movr eax,syshSubFromNumber ; output must be address of number, rather than number itself
    ; return the converted number
    ;mov eax,eax
    ;mov ebx,ebx
    ret
syshSubNo:
     mov eax,no
        mov ebx,no
    ret
section .bss
   resr syshMulSentenceAddress,byteBase
   resr syshMulSentenceLength,byteBase
   resr syshMulBoNumber,wordSize
   resr syshMulBoLength,byteBase
   resr syshMulByNumber,wordSize
   resr syshMulByLength,byteBase
section .text
codePut syshMul,”mul”,3,0,[book]
    ; input be sentenceAddress eax, sentenceLength ebx.
    ;    requires cases bo, and to
    ; output be string with result in so case.
    ; algorithm be
    ; requried variables be sentence, cases for
    ; get interpert be ‘bo’ and ‘to’ cases bo
    ; do the mulition,  return the function

    ; requried variables be sentence, cases for
    ; get interpert be ‘bo’ and ‘to’ cases bo
    movr [syshMulSentenceAddress],eax
    movr [syshMulSentenceLength],ebx
    push bo_length
    push bo_name
    push ebx
    push eax
    call caseGet
    pop eax
    pop ebx
    cmp eax,no;if no then exit
    jz syshMulNo
    push ebx
    push eax
    call caseInterpret
    pop eax
    pop ebx
    movr eax,[eax]; get actual number
    movr [syshMulBoNumber],eax
    movr [syshMulBoLength],ebx
    movr eax,[syshMulSentenceAddress]
    movr ebx,[syshMulSentenceLength]
    push by_length
    push by_name
    push ebx
    push eax
    call caseGet
    pop eax
    pop ebx
    cmp eax,no;if no then exit
    jz syshMulNo
    push ebx
    push eax
    call caseInterpret
    pop eax
    pop ebx
    ; do the mulition,  return the function
    movr eax,[eax]
    movr ecx,[syshMulBoNumber]
    ; clear edx (overflow register)
    xor edx,edx
    ; multiply
    mul ecx
    movr [syshMulByNumber],eax
    movr eax,syshMulByNumber ; output must be address of number, rather than number itself
    ; return the converted number
    ;mov eax,eax
    ;mov ebx,ebx
    ret
syshMulNo:
     mov eax,no
        mov ebx,no
    ret
section .bss
   resr syshDivSentenceAddress,byteBase
   resr syshDivSentenceLength,byteBase
   resr syshDivBoNumber,wordSize
   resr syshDivBoLength,byteBase
   resr syshDivByNumber,wordSize
   resr syshDivByLength,byteBase
section .text
codePut syshDiv,”div”,3,0,[book]
    ; input be sentenceAddress eax, sentenceLength ebx.
    ;    requires cases bo, and to
    ; output be string with result in so case.
    ; algorithm be
    ; requried variables be sentence, cases for
    ; get interpert be ‘bo’ and ‘to’ cases bo
    ; do the divition,  return the function

    ; requried variables be sentence, cases for
    ; get interpert be ‘bo’ and ‘to’ cases bo
    movr [syshDivSentenceAddress],eax
    movr [syshDivSentenceLength],ebx
    push by_length
    push by_name
    push ebx
    push eax
    call caseGet
    pop eax
    pop ebx
    cmp eax,no;if no then exit
    jz syshDivNo
    push ebx
    push eax
    call caseInterpret
    pop eax
    pop ebx
    movr eax,[eax]; get actual number
    movr [syshDivByNumber],eax
    movr [syshDivByLength],ebx
    movr eax,[syshDivSentenceAddress]
    movr ebx,[syshDivSentenceLength]
    push bo_length
    push bo_name
    push ebx
    push eax
    call caseGet
    pop eax
    pop ebx
    cmp eax,no;if no then exit
    jz syshDivNo
    push ebx
    push eax
    call caseInterpret
    pop eax
    pop ebx
    ; do the divition,  return the function
    movr eax,[eax]
    movr ecx,[syshDivByNumber]
    ; clear edx (overflow register)
    xor edx,edx
    ; divide
    div ecx
    movr [syshDivBoNumber],eax
    movr eax,syshDivBoNumber ; output must be address of number, rather than number itself
    ; return the converted number
    ;mov eax,eax
    ;mov ebx,ebx
    ret
syshDivNo:
     mov eax,no
        mov ebx,no
    ret

commands.asm

HSPL: sysh, lettersToNumbers

Logan wrote lettersToNumbers code,

usually my stuff works excellent,

and maximize efficiency with rapid prototyping, and stream-lining.

stream-lining in terms of doing coding all in one go, doing debugging all in one go, faster than going back and forth, changing mind-states.

so I leave the debugging till implementation.

command I’ll be implementing to use it, is the “to”,”from”,”at” grammatical-cases, so can read/write/modify at to or from various locations.

math.asm

lettersToNumbersContinue:
   ; increment counter and recurse
   xor ecx,ecx;clear ecx
   movr ecx,[h3] ;retrieve counter
   addr ecx,1 ; increment counter
   movr [h3],ecx ; store counter
   jmp lettersToNumbersMid

lettersToNumbersEnd:
    popr edx; ret
    popr ebx; arg 1
    popr ebx; arg 2
    pushr [h1]; result; potentially could return address of number and length, so infinite size numbers
    pushr edx; ret
    ret


math.asm sourcecode