Page 65 of 70

Re: EEC V file conversion

Posted: 2024 Dec 16, 14:36
by tvrfan
Thanks, best method is to get entire data set !

There was a bug to do with end of line after symbol name, but not that one. there's nothing wrong with comments that I can see.

OK - time to dig through the detail.

Re: EEC V file conversion

Posted: 2024 Dec 16, 18:34
by wwhite
jsa wrote: 2024 Dec 14, 16:46
wwhite wrote: 2024 Dec 14, 12:09 Reading the STB - Store Byte opcode description, there is absolutely zero mention of 'WORD'.
Indeed, the expectation being that address modes are well understood.

For STB I said;
R28 holds a word length address, so bytes 1 & 3 are combined as the word length address destination, with a store size of one byte, for the byte length data held in source R2B.
Byte1/R29 is the address word high byte.
Byte3/R28 is the address word low byte.

For STW I'd say;
R28 holds a word length address, so bytes 1 & 3 are combined as the word length address destination, with a store size of one word, for the word length data held in source R2A as an example.
Byte1/R29 is the address word high byte.
Byte3/R28 is the address word low byte.

Software_manual wrote: 3-2.3.5 INDIRECT ADDRESS MODE
.
.
location between addresses ^0000 to '^FFFF using a 16-bit effective address(EA). The 16-bit effective address is
stored as a WORD variable
.
.
OK, got it, thank you, re-read and re-read, makes sense now thank you.
Software specifies the location of the word variable as an 8-bit address in the Ra component of the address mode format.

Re: EEC V file conversion

Posted: 2024 Dec 16, 23:12
by tvrfan
BOOSTEDEVERYTHING wrote: 2024 Dec 14, 10:04 It just will not print the labels on arg lines. I used the same DIR, CMT, and BIN files for both versions and here is the same section of code from each.

V4.012

Code: Select all

Sbg07F12_RZAxxxxx_21.1.18.10_AIR_SELF_TEST_EO:
07f12: a0,79,26           ldw   R26,R178         TEMP1L = IMAF;
07f15: 8b,fe,0a,26        cmpw  R26,[Rfe+a]      
07f19: d1,13              jleu  07f2e            if (TEMP1L <= MAF_HI_KOEO) goto 07f2e; }

     # JGTU  from L07F07                                                           Sbg07EF0_RZA9BC2F_21.1.18.5_AIR_SELF_TEST_ER_ENTRY
     # SJump from L07F0F                                                           Sbg07EF0_RZA9BC2F_21.1.18.5_AIR_SELF_TEST_ER_ENTRY
07f1b: b3,d8,2d,c6        ldb   Rc6,[Rd8+2d]     FLAGTEMP_BG = AIR_BACK_FLAGS;
07f1f: 3b,c6,0c           jb    B3,Rc6,07f2e     if (B3_FLAGTEMP_BG = 0)  {
07f22: b3,d8,2d,c6        ldb   Rc6,[Rd8+2d]     FLAGTEMP_BG = AIR_BACK_FLAGS;
07f26: 3a,c6,05           jb    B2,Rc6,07f2e     if (B2_FLAGTEMP_BG = 0)  {
07f29: ef,2e,59           call  0d85a            Sxx0D85A_ALSO_RZA0F887_39.1.1.2.8_STORE_CODE(&Pxxx) (
07f2c: 9e,0a                    #arg 1              a9e ); } } } } } }

     # JLEU  from L07EF5                                                           Sbg07EF0_RZA9BC2F_21.1.18.5_AIR_SELF_TEST_ER_ENTRY
     # JLEU  from L07EFE                                                           Sbg07EF0_RZA9BC2F_21.1.18.5_AIR_SELF_TEST_ER_ENTRY
     # JC    from L07F0D                                                           Sbg07EF0_RZA9BC2F_21.1.18.5_AIR_SELF_TEST_ER_ENTRY
     # JLEU  from L07F19                                                           Sbg07F11_RZA9BC52_12.1.18.6_AIR_SELF_TEST_EO_ENTRY
     # JB    from L07F1F B3_FLAGTEMP_BG = 1                                        Sbg07F11_RZA9BC52_12.1.18.6_AIR_SELF_TEST_EO_ENTRY
     # JB    from L07F26 B2_FLAGTEMP_BG = 1                                        Sbg07F11_RZA9BC52_12.1.18.6_AIR_SELF_TEST_EO_ENTRY
07f2e: 20,63              sjmp  07f93            goto 07f93;
V4.07.16b

Code: Select all

 Sbg07F12_RZAxxxxx_21.1.18.10_AIR_SELF_TEST_EO:
07f12: a0,79,26           ldw   R26,R178         TEMP1L = IMAF;
07f15: 8b,fe,0a,26        cmpw  R26,[Rfe+a]      
07f19: d1,13              jleu  07f2e            if (TEMP1L <= MAF_HI_KOEO) goto 07f2e; }

     # JGTU  from L07F07                                                           uuwFnACTUAL_TQ
     # SJump from L07F0F                                                           uuwFnACTUAL_TQ
07f1b: b3,d8,2d,c6        ldb   Rc6,[Rd8+2d]     FLAGTEMP_BG = AIR_BACK_FLAGS;
07f1f: 3b,c6,0c           jb    B3,Rc6,07f2e     if (B3_FLAGTEMP_BG = 0)  {
07f22: b3,d8,2d,c6        ldb   Rc6,[Rd8+2d]     FLAGTEMP_BG = AIR_BACK_FLAGS;
07f26: 3a,c6,05           jb    B2,Rc6,07f2e     if (B2_FLAGTEMP_BG = 0)  {
07f29: ef,2e,59           call  0d85a            Sxx0D85A_ALSO_RZA0F887_39.1.1.2.8_STORE_CODE(&Pxxx) (
07f2c: 9e,0a                    #arg 1              p1101_RECORD ); } } } } } }

     # JLEU  from L07EF5                                                           uuwFnACTUAL_TQ
     # JLEU  from L07EFE                                                           uuwFnACTUAL_TQ
     # JC    from L07F0D                                                           uuwFnACTUAL_TQ
     # JLEU  from L07F19                                                           
     # JB    from L07F1F B3_FLAGTEMP_BG = 1                                        
     # JB    from L07F26 B2_FLAGTEMP_BG = 1                                        
07f2e: 20,63              sjmp  07f93            goto 07f93;
To clarify things -

According to the files you sent, the cmt entries require symbol 07ef0
07F1A \n\n # JGTU from L07F07 \t83\s07EF0
07F1A \n # SJump from L07F0F \t83\s07EF0
07F2D \n\n # JLEU from L07EF5 \t83\s07EF0
07F2D \n # JLEU from L07EFE \t83\s07EF0

your dir file has entries
SYM 07EF0 "Sbg07EF0_RZA9BC2F_21.1.18.5_AIR_SELF_TEST_ER_ENTRY"
SYM 17EF0 "uuwFnACTUAL_TQ"

so just to confirm v4.12 is correct and v 4.07 is WRONG.
This is a 4.07 bug that was fixed, when symbol references in comment ( \s ) got the bank number incorrect.

comment alignment -
If you are complaining that comments don't print on the same line as an #arg, then that's because your .cmt file tells SAD to print 2 newlines before comment starts.

Rules are that a \n is a newline to print. If you want a comment on same line as code , do NOT put any \n in your comment text. Also spaces (except after the first address) are passed on unchanged so you can line things up.

If you change your .cmt entries to

Code: Select all


07F2D # JLEU  from L07EF5   \s07EF0
07F2D \w# JLEU  from L07EFE   \s07EF0
07F2D \w# JC    from L07F0D   \s07EF0
07F2D \w# JLEU  from L07F19   \s07F11
07F2D \w# JB    from L07F1F \sC6:3 = 1 \s07F11
07F2D \w# JB    from L07F26 \sC6:2 = 1 \s07F11

SAD will print THIS

Code: Select all

07f26: 3a,c6,05           jb    B2,Rc6,07f2e     if (B2_FLAGTEMP_BG = 0)  {
07f29: ef,2e,59           call  0d85a            Sxx0D85A_ALSO_RZA0F887_39.1.1.2.8_STORE_CODE(&Pxxx) (
07f2c: 9e,0a                    #arg 1              a9e ); } } } } } }             # JLEU  from L07EF5   Sbg07EF0_RZA9BC2F_21.1.18.5_AIR_SELF_TEST_ER_ENTRY
                                                                                   # JLEU  from L07EFE   Sbg07EF0_RZA9BC2F_21.1.18.5_AIR_SELF_TEST_ER_ENTRY
                                                                                   # JC    from L07F0D   Sbg07EF0_RZA9BC2F_21.1.18.5_AIR_SELF_TEST_ER_ENTRY
                                                                                   # JLEU  from L07F19   Sbg07F11_RZA9BC52_12.1.18.6_AIR_SELF_TEST_EO_ENTRY
                                                                                   # JB    from L07F1F B3_FLAGTEMP_BG = 1 Sbg07F11_RZA9BC52_12.1.18.6_AIR_SELF_TEST_EO_ENTRY
                                                                                   # JB    from L07F26 B2_FLAGTEMP_BG = 1 Sbg07F11_RZA9BC52_12.1.18.6_AIR_SELF_TEST_EO_ENTRY
07f2e: 20,63              sjmp  07f93            goto 07f93;
so that's probably why you are not getting what you expect.

to get the comments to line up, you can see I have used a \w which is a 'wrap line', to start on a new comment line, but starting at the standard comment column.

Re: EEC V file conversion

Posted: 2024 Dec 17, 07:08
by BOOSTEDEVERYTHING
The problem I am having is that the Labels from my DIR file are not showing up.

Code: Select all

07f2c: 9e,0a                    #arg 1              a9e ); } } } } } } 
Should read

Code: Select all

07f2c: 9e,0a                    #arg 1              p1101_RECORD ); } } } } } } 
But, thank you for clarifying the error in v4.07. Guess I need to stop using that one all together. Might be why I am getting some conflicting address entries in my DIR file from what JSA has sent me.

Re: EEC V file conversion

Posted: 2024 Dec 17, 14:30
by tvrfan
OK. Unfortunately ...

This is a catch 22 which has been discussed a good few times, but with no (immediate) answer. Basically there's no way to know if 'a9e' is an address (look for a symbol) or a plain value (no symbol) without analysing how that number is used within the subroutine. Given the way some of the code works, that can be REALLY TOUGH to decode.

I did always look for symbol names by default in earlier versions, but then discovered SAD was adding names to things which were plain numbers (it caused a problem in indexed opcodes too), which is just as wrong. Also in multibanks, it's possible that that argument value is an address (symbol) that may be in any bank, making it even harder to work out.

You can force subroutine arguments in your dir file like this -

Subr 0d85a : U W N

with separate SYM command, or merge in the name with -

subr 0d85a "Sxx0D85A_ALSO_RZA0F887_39.1.1.2.8_STORE_CODE(&Pxxx)" : UWN

This defines that the subroutine has one unsigned word argument (2 bytes), and to look for a symbol name (the 'N'). Without a bank, this will default to Bank 1 (where data normally resides), but if it's in another bank, you can do

Subr 0d85a : U W N K8

which would define a symname for 80a9e in this case.

yes, it's a bit messy, but no easy way around it I can see.

There is a similar problem trying to work out the size of arguments, as that's not obvious either. All arguments are read as bytes, but some are then used as words inside the subroutine, or worse, passed as an argument to another subroutine, which all makes it obfuscated and tough to work out.

e.g. When there is say 7 bytes of arguments, is it 3 words + 1 byte or 1 byte and 3 words, or some other combination ?



This is why I ended up with all sorts of commands to force the printout to get what you want.

Re: EEC V file conversion

Posted: 2024 Dec 22, 18:10
by tvrfan
OOPS !! My mistake....

Now that I have said that in previous post...looking at code again and checking printouts there *IS A BUG* in 4.12 to do with printing words and symbol names when items are marked as pointers. This will apply to args and other places too, and so symbol names may be missing.

So my above post is not completely wrong, but not right either, sorry for any confusion there. I think it may even stop my recommended " Subr 0d85a : U W N K8 " working .

An example in multibanks is that the RBASE registers are set up correctly (i.e. in bank1) but the printout of 0x82060 onwards shows them WITHOUT the bank. Looking at the print code, it was changed for a different bug, and it looks like that change is the cause. More checking/testing required.

4.12 Bugs found so far -

bug 1. Comments set at end of bank (e.g. 1ffff, 8ffff) do not print correctly or at all for last bank. (reported by jsa)
bug 2. symbol names not printed due to missing bank sometimes in printouts (reported here by Boosted...)

change - need to add options K (bank) and R (pointer) to word and args, subr commands , as currently no way to designate a word in ROM which is a pointer to something else (important for multibanks). (requested by jsa)

Note that change request overlaps with bug 2. Symbol names always have a bank internally to SAD, which is part of the bug cause.

NB. this still won't fix the missing names problem entirely as recognising an argument item as a pointer is not always easy.

so working on 4.13.1 now.

Re: EEC V file conversion

Posted: 2024 Dec 28, 13:07
by tvrfan
Just released 4.13.1 in Github.

Status is -

4.0.13.1 changes

1. Add - Allow options bank (K) and pointer (R) in data items for word, args, subr commands.
2. Add - add options / for divide, and * for multiply (both floating point)

3. Fixed - Symbol names not appearing. Caused by incorrect bank handling in print (may not fix all cases yet) - word,args,struct, vect commands
4. Fixed - comments assigned at end of bank (e.g. 1ffff ) do not get printed correctly (or at all).
5. Fixed - bins with missing bytes at front may not be processed correctly. Added extra checks for end of bank.

6. Change - tighter checks for faulty data or pointers whilst emulating code.

NOT FIXED - For subroutines which jump into another subroutine (instead of a CALL) arguments occasionally get missed. Still working on this.

Re: EEC V file conversion

Posted: 2024 Dec 29, 12:27
by BOOSTEDEVERYTHING
YAY!!! Thank you very much for all of your help!!! It is very much appreciated!

Re: EEC V file conversion

Posted: 2024 Dec 29, 16:27
by tvrfan
As always, if you do find something weird, report it here and I will (try to) find if it's a bug and fix it.

I do test new versions, but there's many different bin versions and 'tricks', so errors can still sneak through.
Last big SAD change was for the discovery that some bins have RAM at the top of their Bank 1 (RZASAMA series).
FM20M06 still doesn't work, and still unclear how some of the 'special chips' work from the raw code perspective.

Boosted - Sorry I did misunderstand what you were reporting, but your post cleared that up, and then I found code that didn't look right.

There are still some 'catch 22' situations which I haven't worked out how to resolve yet ...

Note - I decided to add some 'maths operators' to options , so 'V' now has a '/' (divide) and added a '*' for multiply, which is new, and maybe will add a '+' for 'D' (offset by) and maybe a '-' (minus) too, so it's more obvious to everyone. Complex formulas in Version 5, but tough to bolt onto V4.

Re: EEC V file conversion

Posted: 2024 Dec 30, 13:41
by BOOSTEDEVERYTHING
May have found a bug displaying functions incorrectly.

Code: Select all

 suwFn348A:
136f8: ff,7f,90,00        func   32767,   144
136fc: 78,00,90,00        func     120,   144
13700: 6e,00,83,00        func     110,   131
13704: 69,00,74,00        func     105,   116
13708: 55,00,74,00        func      85,   116
1370c: 4b,00,fe,00        func      75,   254
13710: 23,00,16,02        func      35,   534
13714: 14,00,de,03        func      20,   990
13718: 0a,00,c2,06        func      10,  1730
1371c: 00,00,f6,08        func       0,  2294
13720: 00,80,f6,08        func   32768,  2294



SYM 136F8 "suwFn348A"                                                   #CRANK FUEL PULSEWIDTH PURPOSE:CRANK FUEL AS A FUNCTION OF ECT INPUT: ENGINE COOLANT TEMPERATURE {2}
FUN 136F8 13723 :SW :UW #[SW=flo(X/0.5)] [UW=flo(X/65.536)]             #X Input:ECT Units:degF Units: MS 0-0.6 Resolution: 0.000015 XY Pairs: 11