home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / info / dbpatchs.doc < prev    next >
Encoding:
Text File  |  1994-09-02  |  6.0 KB  |  167 lines

  1.                    Patch points in DBASE 2.41
  2.                                                Naj Najarian
  3.                                                Kempton, PA 19519
  4.                                                6 March 1989
  5.  
  6. Before I came across Bruce Morgan's DBCLOCK routine to let DBASE 
  7. get the date from DateStamper, in fact, before I even ran 
  8. DateStamper, I used an alias to let DBASE get the date (but not 
  9. the time) from ZCPR, providing that I set the date at cold boot.
  10.  
  11. Before I got ZSDOS, before I used DateStamper, before I had a 
  12. computer with a clock (!), I used to store the current date in 
  13. the registers for use by me or any other program I could get to 
  14. read them.  I'd set the date on power-up with a simple REG S1 
  15. 06;REG S2 03;REG S3 89 (I couldn't use register #0, because other 
  16. programs take possession of it and store results there.  Other 
  17. programs require register #9.  Luckily progammers tend to leave 
  18. 1-8 alone.  Please note that I also store the date in European 
  19. form. You may have to change the alias for your own preference.)  
  20. As Jay improved ARUNZ, I could make the system prompt me for the 
  21. date a little more politely.
  22.  
  23. But I had to find a way to get the numbers from the registers and 
  24. into DBASE in a form it would understand.  I found where DBASE 
  25. stores the date ($44ff thru $4501) and could poke the date into 
  26. those places from the registers, but unless I ran a command file 
  27. from the commandline, DBASE would refuse to recognize that it 
  28. already knew the date.  I had to find a way to tell it NOT to ask 
  29. for the date.  
  30.  
  31. So a little Z8E-ing, and I found out which bites to change (see 
  32. below for the disassembly).  My script simply converts the date 
  33. to hexadecimal form (thus the need for hard-coding the addresses 
  34. of the registers in memory), pokes those values into DBASE 
  35. the current date, and tells it skip over the routine to verify 
  36. the date.  Looks like this: 
  37.                                                              jump over the date-checking routine
  38.                                where dbase stores the date           |            
  39.                dbase renamed            |    date from registers in hex (DANGER! Hard-coded for my system)
  40.                         |               |      |                     |                                   
  41.                         V               V      V                     V
  42. DO=DBASE  get 100 a2:dbase241.com;poke 44ff $mhecb1 $mhecb2 $mhecb3;poke 491b c3 ff 49;go $1;
  43.  
  44. And it works whether or not you give it a command file to run (cf 
  45. DBASE versus DBASE MAKORDER).  It's faster than DBCLOCK, and I 
  46. don't have to remember to insert the command into all my *.CMD 
  47. files.  It always runs.  Sole caveat: now that we have NZ-COM, 
  48. the address of the registers in memory could vary depending on 
  49. the system we running at the time of the call.
  50.  
  51.  
  52. While I'm at it, let me document a few other patch points in 
  53. DBASE 2.41, and I'll put out a query too: does anyone know of a 
  54. DBASE equivalent of WSBible or Ted Silvera's oft repeated 
  55. Profiles article?
  56.  
  57.  
  58.               PATCH BYTES IN DBASE.COM version 2.41
  59.  
  60. 0160   form of date: 
  61.        00 for American MM/DD/YY
  62.        FF for European DD/MM/YY
  63.  
  64. 015D   error correction
  65.        00 if you don't want chance to correct mistakes
  66.        FF if you want to be prompted for correction every time 
  67.           you enter an error
  68.  
  69. 30A0   name of alternate file when recording screen output to 
  70.        disk.  In the form THISFILE.TXT.  The dot twixt filename 
  71.        and extension is necessary
  72.  
  73. 44FF   day in hex if European, month if American
  74.  
  75. 4500   month in hex if European, day if American
  76.  
  77. 4501   hex for last two digits of year (e.g. 1989 would be $59)
  78.  
  79. 450B   logged drive (0=A, 1=B, etc.)
  80.  
  81. 4502   BELL (as adjusted by using SET BELL OFF)
  82.        00 for off
  83.        FF for on
  84.  
  85. 4505   CARRY (as adjusted by using SET CARRY OFF)
  86.        00 for off
  87.        FF for on
  88.  
  89. 4508   COLON (as adjusted by using SET COLON OFF)
  90.        00 for off
  91.        FF for on
  92.  
  93. 4509   CONFIRM (as adjusted by using SET CONFIRM OFF)
  94.        00 for off
  95.        FF for on
  96.  
  97. 442F   CONSOLE (as adjusted by using SET CONSOLE OFF)
  98.        00 for off
  99.        FF for on
  100.  
  101. 450A   DEBUG (as adjusted by using SET DEBUG OFF)
  102.        00 for off
  103.        FF for on
  104.  
  105. 450C   DELETE (as adjusted by using SET DELETED OFF)
  106.        00 for off
  107.        FF for on
  108.  
  109. 451F   ECHO (as adjusted by using SET ECHO OFF)
  110.        00 for off
  111.        FF for on
  112.  
  113. 452B   EJECT (as adjusted by using SET EJECT OFF)
  114.        00 for off
  115.        FF for on
  116.  
  117. 4521   ESCAPE (as adjusted by using SET ESCAPE OFF)
  118.        00 for off
  119.        FF for on
  120.  
  121. 4522   EXACT (as adjusted by using SET EXACT OFF)
  122.        00 for off
  123.        FF for on
  124.  
  125. 4526   INTENSITY (as adjusted by using SET INTENSITY OFF)
  126.        00 for off
  127.        FF for on
  128.  
  129. 4529   LINKAGE (as adjusted by using SET LINKAGE OFF)
  130.        00 for off
  131.        FF for on
  132.  
  133. 452E   TALK (as adjusted by using SET TALK OFF)
  134.        00 for off
  135.        FF for on
  136.  
  137. ; documentation on disassembled DBASE II 2.41 code
  138. ; particularly the date startup operations and mods 
  139. ; made to my daily use edition.  
  140. ;
  141. ; 17 May 1988
  142. ;
  143. ;
  144. 491B     xor       a        ; get a zero 
  145.                 ; it's this I changed to jp 49ff
  146.                 ; which avoids the user input altogether
  147.                 ; because I have ZCPR poke in the date
  148.                 ; before running dBase
  149. 491C    ld    (44ff),a    ; stick it in DD
  150.     ld    (4500),a    ; null out MM
  151.     ld    (4501),a    ; null out YY
  152. 4925    ld    a,76        ; ?
  153.     call     3c0b        ; ?? (is that called address right, too?)
  154. 492A    ld    a,(0160)    ; month first flag
  155.     or    a
  156. 492E    jz    493a        ; go there on American dating system
  157. 4931    ld    h,4b48        ; point to ' (DD/MM/YY) '
  158. 4934    call    36c5        ; print it
  159. 4937    jp    4940
  160. 493A    ld    h,4b56        ; point to ' (MM/DD/YY) '
  161. 493D    call    36c5        ; print it
  162. 4940    call    3a35        ; get date from user
  163. 4943    call    3a0f        ; check it for unacceptable values
  164. 4946    jz    49ff        ; jump if date is ok
  165. 4949    call    3899        ; uh-oh, bad date
  166.  
  167.