Jump to content
IGNORED

Supernotes


GDMike

Recommended Posts

13 minutes ago, apersson850 said:

Confuse, not diffuse. What we all meant is that selecting an abbreviation which easily can be misunderstood as a hexadecimal constant is to ask for a misunderstanding, now or later.

This is true.

 

You need helpful labels.

 

In the TurboForth source you will find labels such as 'tilt'1 and 'ohshit'.

 

These are very helpful. Well, at least to me. YMMV ;)

 

1 You have to be a certain age to know the significance of tilt.

  • Haha 3
Link to comment
Share on other sites

So "helpful" meaning no hex number characters. Today, everything is lol, so I shouldn't L0L hmm ? so 0nce isn't allowed, that's with a zero btw.

Ehhh, I'll just make sure I note things in my notes. But V3ry interesting to see that. And do my best, but I have soooo many labels that use numbers, like start1, go3 I'll just keep notes.

I have labels like APFR and AFPR back to Back too.

I'm a walking nightmare of labels.

Edited by GDMike
  • Like 2
Link to comment
Share on other sites

1 hour ago, Lee Stewart said:

 

Well—You could switch to @ralphb’s xas99 so you are not limited 6-character labels!

 

...lee

Interesting. I'm not familiar with it, but maybe I ought to be. Naaaaaa....I'm going to finish SNP 3 and get back to Forth, like I said I would. 

Just needed to get past this memory store issue I was having.

But, I'll definitely do that for a future assy project.

But I'm surely missing C @ 1 + . About right now.  Oops, I said "C".., C is not hex in this situation either. Just kidding around...

Edited by GDMike
  • Haha 1
Link to comment
Share on other sites

Joke about it as much as you like, but it's a fact. If you use names that confuse other people today, they'll confuse yourself in a few months.

It's not that it's "not allowed". It's just a question about making life as easy as possible. If you have a procedure that changes colors from higher to lower intensity ones, you may call it by BL @FADE. Although FADE is a valid hex number, there's no likely risk of confusion. But BL @F0DC may be misread to mean BL @>F0DC, so there has to be a good reason for choosing that as a label name.

 

It's just like with comments.

Some people don't comment at all. Not very helpful, neither to others nor to themselves, a few months later.

Some people comment a lot, but to no avail.

 

INCT R2  ;Increment register 2 by two

 

That's pointless. The comment is about what, not why. Anyone who knows coding can see that R2 is incremented. Those who can't don't read code anyway. It has a point teaching people assembly programming only, but that's not the idea when you write a program.

 

INCT R2  ;Advance index in list of valid numbers found

 

Now whoever reads the comment can see why the instruction is there, not just a repeat of what it does.

Edited by apersson850
  • Like 3
Link to comment
Share on other sites

16 hours ago, GDMike said:

Ehhh, I'll just make sure I note things in my notes.

pummeluup.thumb.jpg.aed64fccfa0f3f14da45b0af4ec27507.jpg

OK! You can make all the notes you want. But, hear me now... and believe me two weeks from now on a Tuesday! You can play all the kids games you want, but if you grow-up and stop doing it like a girly-man...

 

We wont have to come-over-there, and PUMMEL you all over your own thread with our big gigantic muscular arms! Embarrassing you, while everybody watches!

pummeludwn.jpg.2e9fd86fc9cd7207b8decdaa1f00e3bf.jpg

:-o

  • Haha 3
Link to comment
Share on other sites

5 hours ago, apersson850 said:

Joke about it as much as you like, but it's a fact. If you use names that confuse other people today, they'll confuse yourself in a few months.

It's not that it's "not allowed". It's just a question about making life as easy as possible. If you have a procedure that changes colors from higher to lower intensity ones, you may call it by BL @FADE. Although FADE is a valid hex number, there's no likely risk of confusion. But BL @F0DC may be misread to mean BL @>F0DC, so there has to be a good reason for choosing that as a label name.

 

It's just like with comments.

Some people don't comment at all. Not very helpful, neither to others nor to themselves, a few months later.

Some people comment a lot, but to no avail.

 

INCT R2  ;Increment register 2 by two

 

That's pointless. The comment is about what, not why. Anyone who knows coding can see that R2 is incremented. Those who can't don't read code anyway. It has a point teaching people assembly programming only, but that's not the idea when you write a program.

 

INCT R2  ;Advance index in list of valid numbers found

 

Now whoever reads the comment can see why the instruction is there, not just a repeat of what it does.

I've seen comments doing exactly that,

; incrementing 2

And I got caught thinking that is how it's done.

But then, I've never asked directly how one writes their notes. And when I started doing that same type of remark, I questioned myself and saying, wth. Everyone can already understand this because of the instruction. So I started keeping separate notes, but mainly because I wanted more room to write because I'm using the e/a editor and it can't store a lot in ram So i use, (plugin), SNP! in it's fine condition and productivity. It can handle lots of pages.. and it's stopwatch fast.. whatever that means, anyway, 

Im glad to hear that I shouldn't be doing

 ; incrementing 2 

That change up gives me relief really.

Thankfully I've not been bitten by the "what's going on"  WGO bug.

 

My joking really meant I got ya..10-4, copy that, affirmative and ok.

If I hadn't mentioned it I think you would think I didn't.

But I appreciate the tip. I gotcha ? 

 

And for the Forth programmers..

Forth's use of "\"  comment, for me anyway, gets worse than assembly. For one thing I always feel like I should be on a budget with my coding in Forth because of space for coding.  Depending on how many blocks you create to start with I find myself looking over my shoulder as to, how NOT to take up too much space for comments.

How much space do you allot between code and comment's?

Do you just leave out simple word def altogether? Do you place a comment on every line?

I find it very difficult placing comments in Forth.

So I completely leave them out and explain each word and "section" I'm working on in a complete different file. Because in Forth you just have such a small area for both.

Thx for the tips on commenting 

 

Edited by GDMike
  • Like 1
Link to comment
Share on other sites

55 minutes ago, GDMike said:

And for the Forth programmers..

Forth's use of "\"  comment, for me anyway, gets worse than assembly. For one thing I always feel like I should be on a budget with my coding in Forth because of space for coding.  Depending on how many blocks you create to start with I find myself looking over my shoulder as to, how NOT to take up too much space for comments.

How much space do you allot between code and comment's?

As much as you need to understand the code later.

 

Quote

Do you just leave out simple word def altogether? Do you place a comment on every line?

I find it very difficult placing comments in Forth.

So I completely leave them out and explain each word and "section" I'm working on in a complete different file. Because in Forth you just have such a small area for both.

Thx for the tips on commenting 

 

Most hobby Forth's didn't do this but the pro systems that used BLOCKs back in the old days normally had "shadow blocks".

 

Shadow blocks were used for comments and notes about the code in a block.

Some of the systems put shadow blocks a fixed number of blocks away for example CODE in block 1 had a shadow at block 301,  block 2 had a shadow at 302 etc.

The editor had a key to let you switch instantly between code block and shadow block to see/edit the comments.

 

You can do the shadow blocks on TI-99. You just do it manually. (or add a shadow block offset and hot key to the editor) ;-) 

 

Today Forth systems mostly use a text editor for source code like any other language and Forth compiles directly from text files. 

The pressure for the commercial companies was too great to resist. 

But on a small system BLOCKs are still the easiest to implement and give you source code storage and virtual memory for programs all in one structure.

Edited by TheBF
typo
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

2 minutes ago, TheBF said:

As much as you need to understand the code later.

 

Most hobby Forth's didn't do this but the pro systems that used BLOCKs back in the old days normally had "shadow blocks".

 

Shadow blocks were used for comments and notes about the code in a block.

Some of the systems put shadow blocks a fixed number of blocks away for example CODE in block 1 had a shadow at block 301,  block 2 had a shadow at 302 etc.

The editor had a key to let you switch instantly between code block and shadow block to see/edit the comments.

 

You can do the shadow blocks on TI-99. You just do it manually. (or add a shadow block offset and hot key to the editor) ;-) 

 

Today Forth systems mostly use a text editor for source code like any other language and Forth compiles directly from text files. 

The pressure for the commercial companies was too great to resist. 

But on a small system BLOCKs are still the easiest to implement and give you source code storage and virtual memory for programs all in one structure.

That's another way for sure. I'm thinking, maybe I'll use half a block to code and the bottom half for comments. Thx for explaining 

Link to comment
Share on other sites

The advantage of shadow blocks is that you don't need comment characters.

They are never loaded, just read by humans.

 

I am partial to text files now and so Camel99 followed the modern trend and made BLOCK a loadable option.

  • Like 2
Link to comment
Share on other sites

In Forth, you shouldn't need comment for your high-level code - it should be relatively self-documenting. It's the lower level routines that get down to the meat and potatoes that start juggling things on the stack etc; that's where it can get hairy!

 

I just had a look a look in the TF source code for example of 'good' commenting style. It's subjective, I guess, but I think the following is okay. This is the source for the word EXPECT which gets input from the keyboard (like TI Basic's INPUT command):

; EXPECT       addr +n --                    M,83                 
; Receive characters and store each into memory.  The transfer begins at addr 
; proceeding towards higher addresses one byte per character until either a 
; "return" is received or until +n characters have been transferred.  
; No more than +n characters will be stored. 
; The "return" is not stored into memory.  
; No characters are received or transferred if +n is zero.  
; All characters actually received and stored into memory will be displayed, 
; with the "return" displaying as a space.  See:  SPAN  "9.5.2 EXPECT"
expcth  data copywh,6
        text 'EXPECT'
expect  data $+2
        clr @in                     ; clear >IN variable
        clr r14                     ; counter for number of characters 
                                    ; *actually* in the buffer
        mov *stack+,r13             ; pop length in r13
        mov *stack+,r10             ; pop address address in r10
        mov r13,r13                 ; check length
        jeq zchars                  ; quit if 0 characters requested
expnxt  bl @kscn                    ; scan keyboard (wait for a keypress) 
                                    ; ascii code returned on the stack
    ; check for enter key...
        c *stack,@datCR             ; compare to carriage return (enter key)
        jeq exp2                    ; exit routine if enter was pressed 
;    ; check for backspace key...
        c *stack,@lit8+4            ; compare to backspace key
        jne skipbs                  ; skip if backspace not pressed
        inct stack                  ; remove backspace from stack
        mov r14,r14                 ; check if anything in the buffer
        jeq expnxt                  ; tib is empty, ignore...
    ; do backspace...
        bl @ccp                     ; compute cursor position
        li r1,>2000                 ; load a space character
        bl @vsbw                    ; erase the cursor
        mov @scrX,r0                ; get current x position
        jne back1                   ; if x>0 we don't need to move up one line
        mov @xmax,@scrX             ; move to end of line
        dec @scrX                   ; correct X
        dec @scrY                   ; up one screen line
        mov @scrY,r0                ; check y
        jlt bumpY                   ; if <0 then reset to 0
        jmp back2
back1   dec @scrX                   ; move back one character
back2   dec r14                     ; decrement buffer index pointer
        dec r10                     ; decrement buffer position
        jmp expnxt                  ; get another keypress
bumpY   inc @scrY                   ; prevent Y from going <0
        jmp back2

    ; process keypress...
skipbs  dect stack                  ; new stack entry
        mov @2(stack),*stack        ; duplicate value on stack for EMIT
        bl @emit_                   ; call emit (which may/may not call SCRLUP)
        swpb *stack                 ; shift ascii code into MSB
        mov *stack+,r1
        mov r10,r0
        inc r10
        bl @vsbw0
        inc r14                     ; increment 'number of characters in buffer so far'
                                    ; counter
        c r14,@tibsiz               ; do we have #TIB characters in the buffer?
        jeq exp1                    ; if so, exit the routine
        c r13,r14                   ; have we got 'length' characters?
        jne expnxt                  ; read another key if not
exp1    mov r14,@_span              ; move character count into _span
        b @space1+2                 ; type a space to the console and exit
exp2    inct stack                  ; pop ascii 13 off the stack
        jmp exp1

 

  • Like 3
Link to comment
Share on other sites

Vis the SuperCart, can I assume that it will function OK with the battery removed? I'd prefer it start from a completely zero'd out state with each start up - and don't need it to retain any data.

 

Sometimes it gets itself into a funky state and takes some convincing to get back to normal functioning (e.g. having Cortex Basic write zeros to every byte). It would be simpler if just powering down would do that. 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Yes, I use mine all the time with no battery. But I'm not sure what state that the computer will place the ram at boot. You might want to clear it before using anyway. But regardless, I have a couple programs that read and write and I don't see any weirdness.

Edited by GDMike
  • Like 1
Link to comment
Share on other sites

I'm a little sidetracked again. Looks like the Toyota rack and pinion we put in last month has sprung a leak in a seal. So I'm helping him replace it, again. And I lost a hard drive at the same time. So I'm restoring data, 

Just time consuming stuff. 

  • Sad 1
Link to comment
Share on other sites

I tried using DBF0(R5) and changing the value of R5 as a pointer during an incrementing of R5 for 4 increments pushing a different value into DBF0, which is a memory EQU label.

But when I tested to view the memory addresses manually, they did not show the values that I stored at DBF0 + the value of R5, or the next address of DBF0 which is pointing to>79D6,  I dunno why.

But I have an idea to just move the 4 bytes that happen Prior to my larger loop that isn't mentioned here, straight to high ram.

The only difference here is that I was gonna do the move after gathering the complete loop iterations, but I can handle it this way.

 

Edited by GDMike
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...