[sebhc] HASL-8 Bug/Corruption?

Dave Dunfield dave04a at dunfield.com
Wed May 12 17:27:55 CDT 2004


At 18:21 12/05/2004 +0000, you wrote:
>Since Carroll was able to run HASL-8 past the point in question, I loaded it 
>up in the (DAW) emulator and looked at those locations...
>
>>It is however getting called! - the offending call instruction is located 
>>at
>>$3961 (071 141). The opcode is C3(303) 21(041) 32(062)
>
>Except that 303 is a JMP, not a CALL.  However, I do see a CALL there (315), 
>to that address (did you just write it down wrong?)  Maybe this really is a 
>bug, but one that works on a real H8 (or perhaps if you change your emulator 
>to ignore undefined codes).  In a real 8080, the eight codes that match 0?0 
>are all no-ops.

Yeah, it's a typo on my part ... I work in hex (main reason I never really
liked the H8) - and I sometimes interchange C3 (JMP) with CD (CALL), apparently
I wrote down C3 - in this case it does not matter, as it's a valid transfer
of control to an invalid opcode. My emulator has a 4k traceback buffer which
allows me to see "how it got here" up to 4k instructions in the past, so I
could easily see exactly where it came from.

If you look at the code, you will see that Data and Executable codes are mixed
all over the place... Here's the offending sequence, with enough extra shown
around it so that you can see code/data:

3200 C2 DF 31  ..1          JNZ     $31DF   <-  Executable code
3203 7D        }            MOV     A,L
3204 32 64 2A  2d*          STA     $2A64
3207 FE D5     ..           CPI     $D5
3209 C2 3A 32  .:2          JNZ     $323A
320C F7        .            RST     6       <- Ends here with transfer to vector
320D 13        .            INX     D       <- This must be data
320E 00        .            NOP
320F 42        B            MOV     B,D     <- This is clearly data
3210 49        I            MOV     C,C
3211 4E        N            MOV     C,M
3212 41        A            MOV     B,C
3213 52        R            MOV     D,D
3214 59        Y            MOV     E,C
3215 20                     DB      $20
3216 54        T            MOV     D,H
3217 41        A            MOV     B,C
3218 50        P            MOV     D,B
3219 45        E            MOV     B,L
321A 20                     RIM
321B 28        (            DB      $28
321C 59        Y            MOV     E,C
321D 2F        /            CMA
321E 4E        N            MOV     C,M
321F 29        )            DAD     H
3220 3F        ?            CMC
3221 20                     DB      $20     <- Offending instruction (probably SPACE)
3222 CD 46 20  .F           CALL    $2046   <- Immediately followed by executable
3225 CD 49 20  .I           CALL    $2049
3228 2E 3A     .:           MVI     L,$3A
322A FE 59     .Y           CPI     $59
322C CA 36 32  .62          JZ      $3236
322F 2E C3     ..           MVI     L,$C3
 ... much deleted ...
3950 05        .            DCR     B       <- This is data
3951 53        S            MOV     D,E
3952 41        A            MOV     B,C
3953 56        V            MOV     D,M
3954 45        E            MOV     B,L
3955 3F        ?            CMC
3956 CD 46 20  .F           CALL    $2046   <- This is executable
3959 CD 49 20  .I           CALL    $2049
395C FE 59     .Y           CPI     $59
395E C2 C2 38  ..8          JNZ     $38C2
3961 CD 21 32  .!2          CALL    $3221   <- Here's where it came from
3964 21 01 81  !..          LXI     H,$8101
3967 CD 03 33  ..3          CALL    $3303
396A 21 37 18  !7.          LXI     H,$1837
396D CD 22 33  ."3          CALL    $3322


>Maybe Carroll would confirm the contents of those locations on his real H8?

Thats what I'm hoping - I also got a set of tapes from Jack today, so if I can
get my H8 to load I may be able to perform this test as well.


>By the way, it doesn't run on the DAW emulator even that far - the first key 
>I hit on the keyboard causes the INT light to go out and it gets lost in 
>some loop.  I'm guessing there's still some bug in that emulator related to 
>I/O or interrupt function.

I had a fair bit of trouble with the interrupt system, as the H8 uses interrupts
a lot, and some tricks they use are not so obvious - Now that I have it figured
out, all the code that I have (including HASL-8 if I ignore the bad opcode) appears
to run correctly under the emulator.

I didn't do much to it today (have to do my real work sometimes) - I added a key to
toggle the panel display ON/OFF, you can run run with the H8 panel visible and a 13
line terminal, or with the H8 panel hidden and a 24 line terminal - I also added a
status line on the bottom, and a few other cosmetic improvements.

I'll try and post a preliminary version of it somewhere soon so that you guys can
play with it if you are interested.

Regards,
-- 
dave04a (at)    Dave Dunfield
dunfield (dot)  Firmware development services & tools: www.dunfield.com
com             Vintage computing equipment collector.
                http://www.parse.com/~ddunfield/museum/index.html

--
Delivered by the SEBHC Mailing List



More information about the Sebhc mailing list