Search found 317 matches

by wwhite
2024 Jan 13, 20:02
Forum: Hardware, Programming & Disassembly
Topic: SAD Version 5 (alpha)
Replies: 142
Views: 13640

Re: SAD Version 5 (alpha)

SAD created the following:

Code: Select all

sym 4 "AD_Cmd" W [B 0 71]               #Auto Added by SAD
Still not happy:

Code: Select all


## sym 2 "CPU_OK" [B 6]               
   ## Error - '[' expected
## sym 4 "AD_Cmd"  [W B 0 71]               
   ## Error - Invalid End Bit after 'B 0 71' 
by wwhite
2024 Jan 13, 15:43
Forum: Hardware, Programming & Disassembly
Topic: SAD Version 5 (alpha)
Replies: 142
Views: 13640

Re: SAD Version 5 (alpha)

I was working on an emulator for 8061, I had stopped because of exactly that, setting of the PSW.
I'm going to start working on it again.
PSW should be accessible globally in code.

I think what you are saying is SAD only checks previous instruction setting of PSW, but doesn't account for if an instruction doesn't set it, and hence doesn't know what the actual previous PSW was, wherever it was last set, if that makes any sense.
by wwhite
2024 Jan 11, 23:24
Forum: Hardware, Programming & Disassembly
Topic: SAD Version 5 (alpha)
Replies: 142
Views: 13640

Re: SAD Version 5 (alpha)

Ok, fixed it. My dir actually works, still need to verify.

I removed all subroutines, like sub 2131 "Background_Loop" , caused duplicate command
because it is defined as sym 2131 "Sub_2131"

I also removed all symbols that were #Auto Added by SAD.
It appears without them defined in the dir, SAD will auto create on the fly.

Here's my resulting msg file:

Code: Select all

# ----------------------------
# SAD Version 5.0.5 Alpha (11 Jan 2024)
# ----------------------------

# ---------------------------------------------------------------------------------------------
# NB - All commands and errors are printed in new command format
# ---------------------------------------------------------------------------------------------


# Input file is 'C:\Users\wwhite\Programming\SAD\\KID2.bin'

# File is 56K (0xe000) bytes


# Read commands from directive file 'C:\Users\wwhite\Programming\SAD\\KID2_dir.txt'



# ----- Start Disassembly phase 1 -----

# ----- End   Disassembly phase 1 -----

# ----- Start Disassembly phase 2 -----

# ----- End   Disassembly phase 2  -----

# ----- Output Listing to file C:\Users\wwhite\Programming\SAD\\KID2_lst.txt



# ---------------------------------------------------------------------------------------------
# The disassembler has scanned the binary and produced the following equivalent command list.
# This list includes any user commands read in. It can be copied and pasted into a directives file.
# Commented command lines printed for information but may be uncommented (e.g. bank)
# ---------------------------------------------------------------------------------------------
by wwhite
2024 Jan 11, 23:10
Forum: Hardware, Programming & Disassembly
Topic: SAD Version 5 (alpha)
Replies: 142
Views: 13640

Re: SAD Version 5 (alpha)

Well, I have 5.0.5 working the best I can with my dir.

Now I get the following in msg from SAD:

Code: Select all

## sym 2 "CPU_OK" [B 6]               
   ## Error - '[' expected
## sym 4 "AD_Cmd" W [B 0 71]               
   ## Error - '[' expected after '_Cmd" ' 
## sym 5 "WDG_Timer" W [B 0 71]               
   ## Error - '[' expected after 'imer" ' 
   
and I get a whole bunch of this:

Code: Select all

## sym 2131 "Sub_2131"
   ## Error - Duplicate Command

## sym 2148 "Sub_2148"
   ## Error - Duplicate Command

## sym 2164 "Sub_2164"
   ## Error - Duplicate Command
   
by wwhite
2024 Jan 10, 23:42
Forum: Hardware, Programming & Disassembly
Topic: SAD Version 5 (alpha)
Replies: 142
Views: 13640

Re: SAD Version 5 (alpha)

Here's a good one, actually probably a really bad bug.

Who see's the problem with this one:

Code: Select all

7de5: 14,01                     #arg 1              114,
7de7: d6,f0                     #arg 2              f0d6,
7deb: 28,03                     #arg 3              328,
7ded: 34,03                     #arg 4              334 );  
What happened to address 0x7de9 and 0x7dea ?
by wwhite
2024 Jan 10, 22:55
Forum: Hardware, Programming & Disassembly
Topic: SAD Version 5 (alpha)
Replies: 142
Views: 13640

Re: SAD Version 5 (alpha)

5.0.5, better, sort of, doesn't seg fault.
Creates lst and msg files, no dbg.
Once I add dir, program hangs or is stuck in a loop, at: | Analyse Data Structs

Old dir:

Code: Select all

args    76af 76b2 : O 2 UY  : UW N 
args    772c 772f : O 2 UY  : UW N 
word    7732 7733

7729: ef,bf,04            call  7beb             Sub_7beb (
772c: 0f                        #arg 1              f,
772d: 02                        #arg 2              2,
772e: 80,a7                     #arg 3              a780 );
7730: 20,11               sjmp  7743             goto 7743;

7732: 34,77               word   7734
New dir:

Code: Select all

args    76af  76b2     [ UY ][ UY ][ UY ][ UW N ]
args    772c  772f     [ UY ][ UY ][ UY ][ UW N ]
word    7732  7733     

7729: ef,bf,04            call  7beb             Sub_7beb (
772c: 0f                        #arg 1              f,
772d: 02                        #arg 2              2,
772e: 80                        #arg 3              80,
772f: a7,20                     #arg 4              20a7 );
7732: 34,77,04            jnb   B4,R77,7739      if (B4_R77 = 1) {
Sad 5.0.5 is creating too many args, there should be two(2) byte args and one(1) word arg for a total of three(3) args, not four(4) args.
by wwhite
2024 Jan 09, 20:48
Forum: Hardware, Programming & Disassembly
Topic: SAD Version 5 (alpha)
Replies: 142
Views: 13640

Re: SAD Version 5 (alpha)

I get exact same seg fault as before using 5.0.4

Code: Select all

Reading symbols from SAD_5.0.4.exe...
(gdb) run
Starting program: C:\Users\wwhite\Programming\SAD\SAD_5.0.4.exe
[New Thread 14704.0x3b80]
KID2

Thread 1 received signal SIGSEGV, Segmentation fault.
0x0040c25a in add_spf_register (p=0xce1c90, dest=58, sce=0, popaddr=622135)
    at C:/CLProjects/SAD/WSAD/Core.cpp:6205
warning: Source file is more recent than executable.
6205
(gdb) bt
#0  0x0040c25a in add_spf_register (p=0xce1c90, dest=58, sce=0,
    popaddr=622135) at C:/CLProjects/SAD/WSAD/Core.cpp:6205
#1  0x0040c7fe in ldx (s=0xc2898c, c=0x438720 <einst>)
    at C:/CLProjects/SAD/WSAD/Core.cpp:6522
#2  0x0040f036 in do_code (s=0xc2898c, c=0x438720 <einst>)
    at C:/CLProjects/SAD/WSAD/Core.cpp:8107
#3  0x0040a2db in scan_blk (s=0xc2898c, c=0x438720 <einst>)
    at C:/CLProjects/SAD/WSAD/Core.cpp:3689
#4  0x0040e40e in scl (s=0xc28c44, c=0x438720 <einst>)
    at C:/CLProjects/SAD/WSAD/Core.cpp:7580
#5  0x0040f036 in do_code (s=0xc28c44, c=0x438720 <einst>)
    at C:/CLProjects/SAD/WSAD/Core.cpp:8107
#6  0x0040a2db in scan_blk (s=0xc28c44, c=0x438720 <einst>)
    at C:/CLProjects/SAD/WSAD/Core.cpp:3689
#7  0x0040a46b in emulate_blk (addr=623014, caller=0xceab88)
    at C:/CLProjects/SAD/WSAD/Core.cpp:3860
#8  0x0040e13e in do_sub_scan (caller=0xceab88, c=0x438660 <cinst>)
    at C:/CLProjects/SAD/WSAD/Core.cpp:7435
#9  0x0040e354 in scl (s=0xceab88, c=0x438660 <cinst>)
    at C:/CLProjects/SAD/WSAD/Core.cpp:7540
#10 0x0040f036 in do_code (s=0xceab88, c=0x438660 <cinst>)
    at C:/CLProjects/SAD/WSAD/Core.cpp:8107
#11 0x0040a2db in scan_blk (s=0xceab88, c=0x438660 <cinst>)
    at C:/CLProjects/SAD/WSAD/Core.cpp:3689
#12 0x0040f736 in scan_all () at C:/CLProjects/SAD/WSAD/Core.cpp:8520
#13 0x004123cc in disassemble (fstr=0xce1658 "KID2")
    at C:/CLProjects/SAD/WSAD/Core.cpp:10579
#14 0x00422bee in main (argc=1, argv=0xce1678)
    at C:/CLProjects/SAD/WSAD/main.cpp:593
(gdb)

by wwhite
2024 Jan 05, 16:19
Forum: Hardware, Programming & Disassembly
Topic: SAD Version 5 (alpha)
Replies: 142
Views: 13640

Re: SAD Version 5 (alpha)

Both, yes.

Get same back trace and seg fault same location with precompiled binary.
by wwhite
2024 Jan 05, 02:57
Forum: Hardware, Programming & Disassembly
Topic: SAD Version 5 (alpha)
Replies: 142
Views: 13640

Re: SAD Version 5 (alpha)

Spoke too soon.
Works with no dir file, and with a dir file it seg faults still.
by wwhite
2024 Jan 05, 02:42
Forum: Hardware, Programming & Disassembly
Topic: SAD Version 5 (alpha)
Replies: 142
Views: 13640

Re: SAD Version 5 (alpha)

Well, I commented out line# 6508 in core.cpp, and it works!!

I have no idea what the following does, but for single bank its good.

Code: Select all

6508: //add_spf_register(p, o->addr, 0, c->opr[1].addr); 
Screenshot 2024-01-04 234023.png