TronDD wrote:The 1975 01 04 issue of Computer Notes has a memory clearing program:
The ultimate in memory clears seems to have been written by Ward Christensen (#731751).
"I have been using the follow-ing 'program' to clear memory in my Altair since the first week I had it. It clears all of memory except byte 0, and leaves the address in location 1. It works because the Altair seems to have the stack pointer at location 0 when powered up. At worst, it would have to be run twice."
0000 063 INX SP
0001 307 RST 0
Nice! Thanks. I miss creative programming like that even though 'creative' is a bit of a swear in my software development world. :)
If I reset and run as-is, I get alternating 0s and 2s though memory. If I single step over the INX SP once, examine 0, and then run, I can get zeroes until both instructions get smashed. Maybe that's the "run twice".
I got a couple hours in with the clone over the weekend but got completely squirreled with passing arguments on the stack. (Also, the holiday meant reduced hobby hours.) I spend my day job glued to current high level languages but I'm still embarrassed how rusty I am at assembly.
I found this in the BDS C source and I just felt I should have seen something similar a lot earlier. (ma0toh through ma7toh labels in CCC.ASM)
Code: Select all
LXI H,<n>
DAD SP
MOV A,M
INX H
MOV H,M
MOV L,A
RET
So far I don't have a need to pass args on the stack but maybe it's a comfort zone thing. No real reason as to why but I couldn't rest until I figured it out. Now that I see a way that it's
I guess LXI H,0 followed by DAD SP is the way to get the current SP w/o changing it.
Otherwise I managed to write a routine that copies memory from one location to another. IIRC it's a single Z80 instruction but took me nearly a dozen on 8080. (I misplaced my notebook, otw I'd post a listing.)
I really thought I'd have gotten more done by now. I just have to keep at it. I've gotten nothing on my initial list done..... but bright side is that this means that I'm having more fun with the Altair Clone than anticipated.