Spectrum Progress #01
30 сентября 1996 |
|
Notes programmer - bug monitor debugger ZS Scorpion 256.
If you look at the Anglo-Russian Dictionary computer basics, then read that glitch (read - "glitch") - short-term impulse noise, but still - a chronic defect, which has the wrong reason stated requirements for the program. So, here. If somewhere, someone has place a "defect, which has its cause ...", then it's certainly - glitch. But if the mother is lying computer, it is still - a bug. (C), Alexander Mayorov (MAS), 1996. Since then, as I expanded my Comrosite 48 Scorpion to 256, I vryamya from time to time there is one and the same question. Why do all sorts of "ksorki" Register with <R> need to go completely either in trace mode or in real time, and not part of ottrassirovat, and the rest run in real time? I'm not particularly worried, but just recently, carefully looking at the screen when tracing STS-th and the Monitor-th one and the same program, I "Caught" the bug. The thing that working with the register <R> in skorpionovskom monitor not implemented absolutely correct! Just want to say that this bug is present on all versions of the Scorpion, which I could find: Version 2.7b, 2.95, and even on the prof version 3.42! Now specifically about the bug: blame the team LD R, A and LD A, R. Let's start with the first. Write ma-vermillion program from: DI LD A, # 00 LD R, A and obtain the following results: - In trace mode in <R> will: STS: R = # 00 (as it should be) MONITOR: R = # 01 (glyuk-s. ..) - Real-time (Ie put a breakpoint after LD R, A) STS: R = # 00 (as expected) MONITOR: R = # 02 (..........!!!) And now the team LD A, R: - STS: after completing the battery, as well as in the case <R>, will be register value to the regeneration team, plus two. (Which corresponds to the reference data) - MONITOR: after the command register <R> increase by two, but the battery gets value of the register before <R> team, plus one! (Ie One unit of LESS than it should be) If someone does not understand vysheskazanoe, then Look nizhenarisovanuyu plate: the command LD A, R Register R Battery to any team # 00 in the STS-e # 02 # 02 in MONITOR-e # 02 # 01 In my view everything is clear. I hope you have already guessed why "ksorki" normally take place in the trace, in spite of these mistakes ... But just in case, try to explain: Initially, the register <R> sent a certain number. Due to an error, there (in the case <R>) is the number plus one. Then, when the number of <R> sent to the battery, it gets there DECREASE One unit, and since (-1) + (+1) = 0, then all the Broad would be in order. But if the middle "ksorki" you get tired of pushing on "True Video" or tired of waiting (slow ...) and You are putting breakpoint, run the program in real-time ... And another important point. If you log in shadow businesses by Magik-y, or breakpoint-in (which is basically the same thing), you seen in the case <R> a certain number (eg # 25) - do not believe my eyes! There should be number two less! Ie should command "R = r-2, but not forgetting that the 7-th bit is not must change.
Other articles:
Similar articles:
В этот день... 21 November