Download AMOS AlphaBasic
Transcript
SYSTEM FUNCTIONS 12.2 Page 12—2 DATE The DATE system function is identical, to the TIME function except that it and returns the two—word system date. On the AMO$/L system, you cannot set the DATE function. The system wilt ignore a DATE = sets <expr> command. DATE <expr> = DATE A Isets system date to expr !returns system date into A The following program translates the binary data stored in the system DATE location into floating point form. 10 15 20 25 30 35 40 45 The system stores the date in binary form; the small program below translates the binary date into floating point form. It also allows you to set the system date from within BASIC. MAP1 BINDATE,B,4 MAP1 FILLDATE,aBINDATE MAP? MONTH,B,1 MAP? DAY,B,1 ! MAP? YEAR,.B,1 50 BINDATE = DATE 55 60 65 70 12.3 PRINT "Month:";M0NTH,"Day:";DAy,"year:";yE INPUT "Enter Month, Day, Year: ",MONTH,DAY,YEAR DATE=BINDATE PRINT "Month:";M0NTH,"Day:";DAy,"year:";yA 10(X) The 10 system function allows the 256 I/O ports to be selectively read from written to. In both cases only one byte is considered/and an output expression greater than 255 merely ignores the unused bits. The range of ports available is 0 to 255. or 10(X) = A = <expr> 10(X) !writes the low byte of expr to decimal port X !reads decimal port X and places the result into A On the AMOS/I.. system, if (x) Is 0—255, it accesses the 256 external tO ports as it does on the AM—100/T (the addresses on the AMOS/L system are FFFFOO—FFFFFF). If the number is 256—511, it accesses the internal (on—board) 10 ports (addresses FFFEOO-'FFFEFF..) Note: 12.4 MEM(X) Returns a positive integer value which specifies the decimal ni.nber of bytes currently in use for various memory areas used by the compiler system. The most common use of this is to return the number of free bytes left in the user memory partition. This MEN(0) call duplicates the action performed by the FRE(X) function in other versions of BASIC. Other values of the argument X return memory allocations which pertain to various areas in use DWM—00100—J1 REV 804