Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion with test snippet results (cell width vs variables?) #5

Open
raydeejay opened this issue Apr 6, 2021 · 1 comment
Open

Comments

@raydeejay
Copy link

the following code

^r3/lib/gui.r3

#mystr "hello you" "ahoy" "excuse" 0

#cellA #cellB
#cellC $12345678   #cellD $87654321
#cellE $1234567890abcdef

| #anon  [ 0 7 gotoxy  "anon here" print ; ]

:>>str  | a -- a'
  ( c@+ 1? drop ) drop
  dup c@ 0? ( 2drop 'mystr ; ) drop ;

:main
    cls home
    0 0 gotoxy  xypen "X: %d Y: %d" print
    0 1 gotoxy  'cellB 'cellA - "default variable size: %d" print
    0 3 gotoxy  "3 4 +  " print   3 4 + .b emits

    0 5 gotoxy  cellC "cellC: %x" print
    0 6 gotoxy  cellD "cellD: %x  (what?)" print
    [ 0 7 gotoxy  "anon here" print ; ] ex   | how to store elsewhere?
    0 8 gotoxy  cellE "cellE: %x  (what?)" print
    0 10 gotoxy  $1234567890abcdee 1 + "cell width %x" print

    15 15 gotoxy  'mystr >>str >>str >>str print
    xypen atxy  "Hello Human!" print
    key
      >esc< =? ( exit )
      >n<   =? ( exit )
    drop ;


: 'main onshow ;

produces the result in the attached image... which has me slightly confused :-D can you shed some light on it?

image

@phreda4
Copy link
Owner

phreda4 commented Apr 6, 2021

the size of var are 32 bits by default

#cellE $890abcdef $1234567

    0 8 gotoxy  'cellE q@ "cellE: %x  (what?)" print

get the value from memory preverse sign, but traslate to 64bits!!
if you use only the 32bits unsigned you can add "$ffffffff and"

Ray, write me a email !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants