Author Topic: asmdream is waking up...  (Read 22680 times)

0 Members and 1 Guest are viewing this topic.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: asmdream is waking up...
« Reply #90 on: December 10, 2011, 12:01:15 pm »
Okay, did you do the other parts? Meaning store the name of the var at 9652h, the start address of the data (not the size bytes) at 965Bh, the error location at 965Dh and the end var address at 965Fh?

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #91 on: December 10, 2011, 12:45:16 pm »
Yeah =[

Also, tried both bcall & bjump but result is the same.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: asmdream is waking up...
« Reply #92 on: December 10, 2011, 05:30:36 pm »
Hmm, well then I am not sure what could cause the issue :/
Here is some code to give you an idea of how it works:
Code: [Select]
    ld de,9652h      ;115296  ;address to store the name
    ld hl,8478h      ;217884  ;ld hl,OP1
    ld bc,9          ;010900
    ldir             ;EDB0    ;copies the name in OP1
    bcall(42F1h)     ;EFF142  ;bcall(_CheckFindSym)
    ex de,hl         ;EB
    ld c,(hl)        ;4E
    inc hl           ;23
    ld b,(hl)        ;46
    inc hl           ;23      ;HL points to the start of the var
    ld (965Bh),hl    ;225B96

    ld d,h \ ld e,l  ;545D    ;points to the start of the var
    add hl,bc        ;09      ;HL is now the end of the var
    ld (965Fh),hl    ;225F96

    ld bc,4          ;010400  ;Offset into the var to error at
    ex de,hl         ;EB
    add hl,bc        ;09
    ld (965Dh),hl    ;225D96

    ld hl,ErrorMsg   ;21****
    ld de,984Dh      ;114D98  ;Where custom error message needs to be
    ld bc,14         ;010E00  ;14 is max size of message
    ldir             ;EDB0
    ld a,2Bh+80h     ;3EAB    ;Custom error
    bcall(44D7h)     ;EFD744  ;jError
    ret              ;C9      ;Don't think this is needed XD
ErrorMsg:
    .db "Oh Crap.",0 ;4F6820437261703A

For a bonus I can show errors in action with my own assembler project >.> (I haven't added nearly as much functionality as you). The errors jump to bad equates/labels or non-hex digits were hexadecimal is expected.

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #93 on: December 10, 2011, 09:11:15 pm »
Thx 4 help =]
I was just giving my custom chkfindsym routine a bad input.
My turn to help : dunno if you actually use a similar code in your projects, but you should consider adding a dec hl right before ld (965Fh),hl.

Now that that works, any idea if there's a way to bypass the ERR:XXXXX screen ?
« Last Edit: December 10, 2011, 09:12:10 pm by the_mad_joob »

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: asmdream is waking up...
« Reply #94 on: December 10, 2011, 09:29:50 pm »
Ah, now I see where you would need that. I took a peak at the bcalls, but I have not found a good way to do this, sorry :/

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #95 on: December 10, 2011, 09:45:53 pm »
If the code is not too heavy, i'll disassemble and take a look at _gotoerr ($4CD8) to see what it really does...
At least, its name suits my needs =]
« Last Edit: December 10, 2011, 09:46:46 pm by the_mad_joob »

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #96 on: December 11, 2011, 11:09:44 am »
Here is the disassembling of gotoerr :

Code: [Select]
call addr_2
ld bc,(erroffset)
ld hl,(editcursor)
add hl,bc
addr_1
ld de,(editcursor)
call off_2
ret z
ret c
push hl
call addr_3
pop hl
ret z
push hl
call addr_5
pop hl
jr addr_1
addr_2
ld hl,(editcursor)
ld de,(edittop)
or a
sbc hl,de
ret z
ld c,l
ld b,h
ld hl,(editcursor)
dec hl
ld de,(edittail)
dec de
lddr
inc hl
ld (editcursor),hl
inc de
ld (edittail),de
ret
addr_3
ld hl,(edittail)
ld de,(editbtm)
call off_2
ret z
call off_1
ld d,0
jr nz,addr_4
push hl
call addr_4
pop hl
ld d,e
inc hl
addr_4
ld e,(hl)
inc hl
ld (edittail),hl
ld hl,(editcursor)
ld (hl),e
inc hl
ld (editcursor),hl
or 1
ret
addr_5
bit 1,(iy+apiflg3)
jr z,addr_6
call off_3
ret
addr_6
call off_5
call off_4
ret

;calls to rom page 0 that i won't disassemble (lazy me) :
off_1 = $1937
off_2 = $1B1E
off_3 = $3100
off_4 = $3A9C
off_5 = $3BBC

As you can see, the edit buffer has to be opened before calling this routine.
Also, it reads erroffset, which is relative, starting from 0.
There's a high chance this code may be called when the goto option is validated.
I'll check this.
« Last Edit: December 11, 2011, 02:08:27 pm by the_mad_joob »

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #97 on: December 11, 2011, 02:12:43 pm »
Too hard for me =[
Looks like i'm gonna use the _jerror method (as a temporary solution i hope).
Thx again Xed =]

The conversion of ti83plus.inc is now at about 50%.
« Last Edit: December 11, 2011, 02:13:02 pm by the_mad_joob »

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: asmdream is waking up...
« Reply #98 on: December 11, 2011, 03:05:32 pm »
That's okay, I have been looking at the code that is run when you actually press "Goto"  and I am trying to see if there is a bcall that matches it. Maybe ask ThePenguin77 or KermM? I know DoorsCS has its own custom error routine and then lets you jump to the offending error.

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #99 on: December 11, 2011, 05:23:24 pm »
I already PMed Quigibo long time ago but still no answer and i don't want to bother him u know...
But, i haven't tried to reach Kerm yet.

[EDIT] : I figured out the digits in your username hé hé =]
« Last Edit: December 11, 2011, 05:27:25 pm by the_mad_joob »

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: asmdream is waking up...
« Reply #100 on: December 11, 2011, 05:59:26 pm »
It is one of the Lovely Sequences :3

(I call them Lovely Sequences, I don't think anybody else does...)

But yeah, Kerm seems to have made a decent job of accessing the Goto option without making the user go through the OS menu. Though, of course, that could be a hook, now that I think about it x.x

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #101 on: December 12, 2011, 11:24:55 pm »
Created a dedicated topic on cemetech.
Anyway, if nobody can help me on this, the _jerror method will be just fine.

For now, i have converted, let's say, 85% of ti83plus.inc.
The whole thing will probably be around 100K, so i plan on splitting all the equates into 4, or maybe 5 include prgms.
My only (and last) fear is the assembling speed, cause even with an optimized code, seeking an equate thru 100K bytes can take a lot of time for such a slow processor.
Can't wait to see what it gets...

That said, looks like i'm not so far from the end of the tunel =]

Offline C0deH4cker

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 258
  • Rating: +11/-1
    • View Profile
    • iNinjas Forum/Repo
Re: asmdream is waking up...
« Reply #102 on: December 13, 2011, 01:23:44 am »
Maybe have the equates sectioned off into categories.

EQU1: B_CALL addresses
EQU2: Ram pointers
EQU3: GetKey and GetCSC codes
EQU4: Flags
EQU5: Tokens


Maybe split up tokens into 2 EQU files or something.


Idea: how about for the equates, you make a compressed file format for them. You could compress the equate names down to just 5-6 bits if you make the predefined ones case insensitive. Then, have the null byte actually, use a LBS instead, followed by the value. Example of structure:

[$XX (str len)][COMPRESSED STR DATA (padded to nearest byte)][VALUE]

_examp1 .EQU $9D95 ;just an example

    "_examp1" = 7 chrs * 6 bits = 42 bits / 8 bits per byte = 6 bytes (padded)
[$06][000000 000101 011000 000001 001101 010000 011100][$9D95]
In total, that is just 9 bytes. It could probably be compressed further, but this is just an example. Also, there would be better compression for longer equate strings.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: asmdream is waking up...
« Reply #103 on: December 13, 2011, 07:36:04 am »
I know I just took all of what I considered the most common equates and put it into one file and had the user define their own equates if they needed (and they could create their own). If you split it up into 5 files or whatever, will they be by some category?

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #104 on: December 13, 2011, 11:10:49 am »
Maybe have the equates sectioned off into categories.

EQU1: B_CALL addresses
EQU2: Ram pointers
EQU3: GetKey and GetCSC codes
EQU4: Flags
EQU5: Tokens


Maybe split up tokens into 2 EQU files or something.


Idea: how about for the equates, you make a compressed file format for them. You could compress the equate names down to just 5-6 bits if you make the predefined ones case insensitive. Then, have the null byte actually, use a LBS instead, followed by the value. Example of structure:

[$XX (str len)][COMPRESSED STR DATA (padded to nearest byte)][VALUE]

_examp1 .EQU $9D95 ;just an example

    "_examp1" = 7 chrs * 6 bits = 42 bits / 8 bits per byte = 6 bytes (padded)
[$06][000000 000101 011000 000001 001101 010000 011100][$9D95]
In total, that is just 9 bytes. It could probably be compressed further, but this is just an example. Also, there would be better compression for longer equate strings.

For now, i keep the idea of includes being readable and editable by the user (That's mainly why i decided to use unprotected prgms.).
If assembling is too slow, i will probably go for something similar (but hope not, since it'll be very long to convert).
Thx anyway =]

I know I just took all of what I considered the most common equates and put it into one file and had the user define their own equates if they needed (and they could create their own). If you split it up into 5 files or whatever, will they be by some category?

The idea is to have the fewest number of includes as possible.
For now, i'm thinking of using the comment feature, like, for example :

PROGRAM:ASMDINC1
:>LAB
:
:,CONTENT :
:,RAM
:,KEYS
:,TOKENS
:
:,RAM
:...
:
:,KEYS
:...
:
:,TOKENS
:...
:
:End
« Last Edit: December 13, 2011, 11:13:51 am by the_mad_joob »