jeq instruction not documented in doc64/asm

2014-11-26 Thread Loyall, David
Hello.

FYI, I see an instruction 'jeq' in used in src64/io.l, but I don't see it 
described in doc64/asm.

Hm, for that matter, I don't see 'jne' or 'jgt' either.  Maybe I shouldn't 
expect to find 'jeq'?

I encountered 'jeq' in the 12th line of the definition of testEscA_F (which I 
pasted below my signature).  I guess ^@ is never valid inside a Transient 
Symbol?

: ^@
Bad input '@'
? 

Nope, it's not valid.  Looks like we jumped to badInputErrB.  So jeq is some 
kind of jmp if 

But it is different from these?

  jz adr# Jump to 'adr' if Zero [---]
  js adr# Jump to 'adr' if Sign [---]
  jc adr# Jump to 'adr' if Carry [---]

What does cmp do to the flags?

  cmp dst src   # Compare 'dst' with 'src' [zsc]

Within the flag notation [---] in doc64/asm, What is the difference between . 
and -?  I see that _ is clear.

Cheers, thanks,
--Dave

(code 'testEscA_F 0)
   do
  null A  # EOF?
  if s  # Yes
 clrc  # Return NO
 ret
  end
  cmp B (char \^)  # Caret?
  if eq  # Yes
 call (Get_A)  # Skip '^'
 cmp B (char @)  # At-mark?
 jeq badInputErrB  # Yes
 cmp B (char ?)  # Question-mark?
 if eq  # Yes
ld B 127  # DEL
 else
and B 31  # Control-character
 end
10   setc  # Return YES
 ret
  end
  cmp B (char \\)  # Backslash?
  jnz 10  # No
  call (Get_A)  # Skip '\'
  cmp B 10  # Newline?
  jnz 10  # No
  do
 call (Get_A)  # Skip white space
 cmp B 32
 continue eq
 cmp B 9
  until ne
   loop

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: jeq instruction not documented in doc64/asm

2014-11-26 Thread Alexander Burger
Hi Dave,

 FYI, I see an instruction 'jeq' in used in src64/io.l, but I don't see
 it described in doc64/asm.
 
 Hm, for that matter, I don't see 'jne' or 'jgt' either. Maybe I
 shouldn't expect to find 'jeq'?

That's right: 'jeq' is just an alias for 'jz', as 'jlt' is one for 'jc'.
You can find the complete list in src64/lib/asm.l:

   (de *Transfers
  call
  jmp
  jz jeq
  jnz jne
  js
  jns
  jsz
  jnsz
  jc jlt
  jnc jge
  jcz jle
  jncz jgt )

   (de *Conditions
  (T jmp . jmp)
  (z jz . jnz)
  (nz jnz . jz)
  (s js . jns)
  (ns jns . js)
  (sz jsz . jnsz)
  (nsz jnsz . jsz)
  (c jc . jnc)
  (nc jnc . jc)
  (cz jcz . jncz)
  (ncz jncz . jcz)
  (eq jz . jnz)
  (ne jnz . jz)
  (lt jc . jnc)
  (le jcz . jncz)
  (gt jncz . jcz)
  (ge jnc . jc) )


 I guess ^@ is never valid inside a Transient Symbol?
 
 : ^@
 Bad input '@'

Correct. Ctrl-@ is ASCII NULL, and is reserved as an end-of-name marker
in symbol names (just like in C).


 What does cmp do to the flags?
   cmp dst src   # Compare 'dst' with 'src' [zsc]

* The zero-flag is set if 'dst' and 'src' are equal

* The sign-flag is set if the signed two-complement difference ('dst'
  minus 'src') is negative

* The carry-flag is set if the unsigned difference ('dst' minus 'src')
  results in carry out of the most significant bit


 Within the flag notation [---] in doc64/asm, What is the difference
 between . and -? I see that _ is clear.

   '-' Flag is not modified
   '.' Value of the flag is undefined
   '_' Flag is cleared

For instructions where [...] isn't specified yet in the docs, we may
assume don't care for now.

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe