wperko
Experienced Member
- Joined
- Jul 4, 2007
- Messages
- 473
Code:00001 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 00002 ; 00003 ; Writes a "zero" into all the RAM from 0C00 to 0FFF. 00004 ; 00005 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 00006 0005 00007 BDOS equ 5 ; CP/M function entry point 00008 0100 00009 org 100h ; It runs in the TPA 00010 0100 00011 Start: 0100 21 0C00 [10] 00012 lxi H,0C00h ; Point HL to 0C00h 0103 11 0400 [10] 00013 lxi D,0FFFh-0C00h+1 ; Load number of bytes 00014 0106 00015 Loop: 0106 36 00 [10] 00016 mvi M,0 ; Store a zero at [HL] 00017 0108 23 [5] 00018 inx H ; Point HL to next location 00019 0109 1B [5] 00020 dcx D ; Decrement count 00021 010A 7A [5] 00022 mov A,D ; Has count reached 0? 010B B3 [4] 00023 ora E 010C C2 0106 [10] 00024 jnz Loop ; No 00025 010F 0E 00 [7] 00026 mvi C,0 ; Exit to CP/M 0111 CD 0005 [17] 00027 call BDOS 00028 0100 00029 end Start
Hi,
Yeah, under CP/M the program needs to start at 0100 so to exit back to CP/M the program should check for an exit character like an "ESC" or something else.
I did try the program, but I can't see any zeros starting at address C00h or 140 0000Q ...
.