Post B2ehDobjtVS2jsATuC by tomjennings@tldr.nettime.org
 (DIR) More posts by tomjennings@tldr.nettime.org
 (DIR) Post #B2cQCZC5udlBn5WfrM by brouhaha@mastodon.social
       2026-01-24T02:13:11Z
       
       0 likes, 0 repeats
       
       @riley Isn't all use of the XTHL instruction "abuse"?:-)
       
 (DIR) Post #B2cQCaXOuuOhxSVCi0 by tomjennings@tldr.nettime.org
       2026-01-24T18:49:48Z
       
       0 likes, 0 repeats
       
       @brouhahaLolMeh. In 8080 land any documented feetch is legit. BDS C uses BC as stack index. There's a nice discipline involved. And a couple of ugly hacks, the main one called appropriately ARGHAK. YOUNG PEOPLE TODAY! lol it seems get insulted when instruction sets are not all orthogonal'n'shit. Thats a modern fetish. Oh, its better when they are no argument!I always wonder about motives when i hear modern attempts to force new techniques on old systems without first learning why the old things were as they were. Ive been poking more and more in the bowels of BDS C, and marvelling at the compromises, horror kludges, and brilliance of a law student writing his own C compiler almost 40 years ago, and find nothing really ro be ashamed of, and lots to be proud of. Leor Zolman is still s cool guyHorror: external data is literally FORTRAN COMMON BLOCK. And i mean old Fortran common block. Theres no sumbolic names, just offsets from a hardcoded base.  It only bites you if you write multimodule programs which was nearly no one in 1982. (The fix is to put it all in a .h. ugly, but legal even today. Or do as i do, dont use externals but pass refs down down down.)I commonly compile and have pass 2 say 7000 BYTES FREE. Its fkn marvelous. @riley
       
 (DIR) Post #B2cSAl2T6RaRr7HxfU by brouhaha@mastodon.social
       2026-01-24T02:19:23Z
       
       0 likes, 0 repeats
       
       @riley @woozle When the 8086 was new, there were at least two 8080-to-8086 assembly translators, CONV86 from Intel that ran under ISIS II on the MDS development systems, and XLT86 from Digital Research. The first PC version of Wordstar was the CP/M-80 version run through such a translator. I wonder what they translated the XTHL instruction into.For any "real" program fed through such a translator, it was generally necessary for a skilled programmer to fix problems in the translation.
       
 (DIR) Post #B2cSAmk6lg5Z8kiKKO by tomjennings@tldr.nettime.org
       2026-01-24T19:11:54Z
       
       0 likes, 0 repeats
       
       @brouhaha @riley @woozle I used WordStar to convert my fancy z80 boot rom/debugger to 8086. Took one day.
       
 (DIR) Post #B2cTi7EbhU6UCmR8Nc by tomjennings@tldr.nettime.org
       2026-01-24T19:29:10Z
       
       0 likes, 0 repeats
       
       @brouhaha @riley Context save for interrupts is interesting. Often you don't need ISRs to be reentrant. You can't use the stack because CP/M programs are usually so memory stingy you can't push more than a couple things (much ado on this in the MP/M docs).Reentrancy in the XIOS (realtime "BIOS") RTC ISR has been obviated by Digital Research, with a flag that tells MP/M to not generate task switch etc during RTC interrupts. I'm sure this was a decision to make it easy on implementors of XIOSs; who wants to handle *those* phone calls?Here's RTC ISR storage overhead:tickToSec  db 50; ticks per second  ; Timer tick ISR save data.  dw 0, 0, 0, 0, 0, 0, 0, 0; RTC ISR stack  dw 0, 0, 0, 0, 0, 0, 0, 0isrStack:isrHL      dw 0; RTC ISR register savesisrRET     dw 0isrSP      dw 0(isrStack is too large, I could prune that. And I might; leave it running for a month then see how much depth was used.)The actual tick ISR doesn't use XTHL, alas, lol. But note that this uses *zero* user stack. This is safest.  ; Full context save. Lifted directly   ; from System Guide Appendix D.  shld isrHL  pop h  shld isrRET  push psw  lxi h, 0  dad sp  shld isrSP  lxi sp, isrStack  push d  push b...Then this DRI accommodation of practical reality:  ; Stop MP/M from enabling interrupts  ; during our XDOS calls.  mvi a, 255  sta preempt(There's an XIOS call for MPM to poll that preempt flag.)The dirty business of counting ticks and telling the XDOS when one second has passed, etc, then exit is:  xra a  sta preempt  pop b  pop d  lhld isrSP  sphl  pop psw  lhld isrRET  push h  lhld isrHL  jmp PDISPThat last thing ("JMP PDISP") is more typically  EI  RET(Assuming Z80 interrupt mode 0, IM 0, or 8080)but PDISP is an MPM XDOS call to the dispatcher, informing MPM/XDOS that now's a good time to switch a task. The docs state clearly PDISP will enable interrupts, eg when done will do EI, RET.
       
 (DIR) Post #B2cTqslKsPvNvWvRHU by tomjennings@tldr.nettime.org
       2026-01-24T19:30:45Z
       
       0 likes, 0 repeats
       
       @brouhaha @riley Of course there is literally no way to debug this code with a debugger. It's paper and pencil time.
       
 (DIR) Post #B2ccmWC5k7doMSQyzQ by tomjennings@tldr.nettime.org
       2026-01-24T21:10:47Z
       
       0 likes, 0 repeats
       
       @riley Is xthl really slow? I assume so.
       
 (DIR) Post #B2ehDobjtVS2jsATuC by tomjennings@tldr.nettime.org
       2026-01-25T06:44:55Z
       
       0 likes, 0 repeats
       
       @rileyNahh. I work only natively. Otherwise whats the point?Ok applying modern ideas to mp/m, writing those tools for it. This approach is working great. Picking at performance through strategy not brute force. Nice tools like grep, a tool that turns user number and drive letter into "location", allows naming locations, you can go to a location then go "back" via s stack, like pushd snd popd. Consistent getOpts() command line that's sweet. Writing a less/more prog. Mostly BDS C and assembler. I havent explored RDT, the relocatable realtime debugger yet.  DRI wrote some amazing code thats never veen explored that i lnow of. Writing up some permaculture ideas separating code and computing from the ideology of technology. Gonna setup to do a show'n'tell at some event in 2026. @brouhaha