3 ms·
Back when I was coding on the Sharp MZ-80K (http://blog.jgc.org/2009/08/in-which-i-switch-on-30-year-old.html http://blog.jgc.org/2009/08/in-which-i-switch-on-3
by jgrahamc 14y ago
Back when I was coding on the Sharp MZ-80K (http://blog.jgc.org/2009/08/in-which-i-switch-on-30-year-old.html http://blog.jgc.org/2009/08/in-which-i-switch-on-30-year-old...) we used to write code by typing it directly onto the screen. The screen was just directly memory mapped with each character on screen being a single byte. And the machine had the complete character set available from its (odd) keyboard.
The program would be written in assembly, converted by hand to hex and then each hex byte found in the character map and typed in. It was then possible to CALL the start of screen memory to run the program.
- femto 14y agoA useful debugging technique on the VZ200 was to locate the stack in video memory. The display would be a mass of snow when the program was running, since the CPU activity left hardly any cycles for the video controller to access screen RAM, but when the program crashed its state could be read directly off the screen.
- jgrahamc 14y agoNice. I've used this type of technique in other situations where very high-speed debug output is needed. At one job we had a machine code ring buffer implementation that could be called via a software interrupt (INT 3 I believe with a single character in AL) to write a single byte of debug information. This could be used when tracing a program's execution. When the program crashed the ring buffer could be examined using a system debugger (typically Soft-ICE) to see what state it was in. Very useful when it was critical to get tracing information in a way that had minimal timing impact.
- femto 14y agoI'm using this exact technique in my daily work right now! :-). It's an embedded DSP doing real-time signal processing for digital radio, and the technique you describe allows the execution flow leading up to a crash to be determined, without the timing jitter introduced by the "real" debugger.
- lgieron 14y agoSomething similar was also used by C64 cracker groups adding their intros to cracked games. Before the intro ran, user saw a few seconds of random characters on screen - most likely a buffer for a decompression algorithm. In this was case it wasn't done to ease debugging - it's just that the game itself occupied almost all available memory and the only area left that was big enough was the screen buffer. Plus, the resulitng effect itself looked Matrix-like :)
- arethuza 14y ago"we used to write code by typing it directly onto the screen" I once knew a guy who had programmed by drilling holes in leather with a hand drill. :-) [Some ancient process control mainframe that booted originally from a paper tape - over the decades of use in a steel mill the paper tape had long since worn out and been replaced by a sturdy leather belt - he had to modify the boot code, hence the drill]