libstd.pas 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. unit libstd;
  2. interface
  3. type
  4. Pdword = ^dword;
  5. Pshort = ^smallint;
  6. Pbyte = ^byte;
  7. Pinteger = ^integer;
  8. // stddef.h
  9. type
  10. size_t = dword;
  11. wchar_t = dword;
  12. u_char = byte;
  13. u_short = smallint;
  14. u_int = longint;
  15. u_long = longint;
  16. const
  17. WEOF = $ffffffff;
  18. NULL = 0;
  19. // errno.h
  20. const
  21. EPERM = 1; // Not owner
  22. ENOENT = 2; // No such file or directory
  23. ESRCH = 3; // No such process
  24. EINTR = 4; // Interrupted system call
  25. EIO = 5; // I/O error
  26. ENXIO = 6; // No such device or address
  27. E2BIG = 7; // Arg list too long
  28. ENOEXEC = 8; // Exec format error
  29. EBADF = 9; // Bad file number
  30. ECHILD = 10; // No children
  31. EAGAIN = 11; // No more processes
  32. ENOMEM = 12; // Not enough core
  33. EACCES = 13; // Permission denied
  34. EFAULT = 14; // Bad address
  35. ENOTBLK = 15; // Block device required
  36. EBUSY = 16; // Mount device busy
  37. EEXIST = 17; // File exists
  38. EXDEV = 18; // Cross-device link
  39. ENODEV = 19; // No such device
  40. ENOTDIR = 20; // Not a directory
  41. EISDIR = 21; // Is a directory
  42. EINVAL = 22; // Invalid argument
  43. ENFILE = 23; // File table overflow
  44. EMFILE = 24; // Too many open files
  45. ENOTTY = 25; // Not a typewriter
  46. ETXTBSY = 26; // Text file busy
  47. EFBIG = 27; // File too large
  48. ENOSPC = 28; // No space left on device
  49. ESPIPE = 29; // Illegal seek
  50. EROFS = 30; // Read-only file system
  51. EFORMAT = 31; // Bad file format
  52. EPIPE = 32; // Broken pipe
  53. // math software
  54. EDOM = 33; // Argument too large
  55. ERANGE = 34; // Result too large
  56. // non-blocking and interrupt i/o
  57. EWOULDBLOCK = 35; // Operation would block
  58. EINPROGRESS = 36; // Operation now in progress
  59. EALREADY = 37; // Operation already in progress
  60. var
  61. errno : longint; external;
  62. // types.h
  63. type
  64. ushort = smallint; // sys III compat */
  65. uint = dword; // sys V compat */
  66. ulong = dword; // sys V compat */
  67. _quad = packed record
  68. val : array [0..1] of longint;
  69. end;
  70. quad = _quad;
  71. daddr_t = longint;
  72. caddr_t = pchar;
  73. qaddr_t = ^longint; // should be typedef quad * qaddr_t; */
  74. ino_t = dword;
  75. swblk_t = longint;
  76. time_t = longint;
  77. dev_t = smallint;
  78. off_t = longint;
  79. uid_t = u_short;
  80. gid_t = u_short;
  81. const
  82. NBBY = 8; // number of bits in a byte */
  83. type
  84. _physadr = packed record
  85. r : array [0..0] of longint;
  86. end;
  87. physadr = ^_physadr;
  88. label_t = packed record
  89. val : array [0..11] of longint;
  90. end;
  91. const
  92. DescMask = $ff000000;
  93. DescTH = DescMask;
  94. DescHW = $f0000000;
  95. DescEV = $f1000000;
  96. DescRC = $f2000000;
  97. DescUEV = $f3000000; // User event
  98. DescSW = $f4000000; // BIOS
  99. HwVBLANK = DescHW or $01; // VBLANK
  100. HwGPU = DescHW or $02; // GPU
  101. HwCdRom = DescHW or $03; // CDROM Decorder
  102. HwDMAC = DescHW or $04; // DMA controller
  103. HwRTC0 = DescHW or $05; // RTC0
  104. HwRTC1 = DescHW or $06; // RTC1
  105. HwRTC2 = DescHW or $07; // RTC2
  106. HwCNTL = DescHW or $08; // Controller
  107. HwSPU = DescHW or $09; // SPU
  108. HwPIO = DescHW or $0a; // PIO
  109. HwSIO = DescHW or $0b; // SIO
  110. HwCPU = DescHW or $10; // Exception
  111. HwCARD = DescHW or $11; // memory card
  112. HwCARD_0 = DescHW or $12; // memory card
  113. HwCARD_1 = DescHW or $13; // memory card
  114. SwCARD = DescSW or $01; // memory card
  115. SwMATH = DescSW or $02; // libmath
  116. RCntCNT0 = DescRC or $00; // display pixel
  117. RCntCNT1 = DescRC or $01; // horizontal sync
  118. RCntCNT2 = DescRC or $02; // one-eighth of system clock
  119. RCntCNT3 = DescRC or $03; // vertical sync target value fixed to 1
  120. RCntMdINTR = $1000;
  121. RCntMdNOINTR= $2000;
  122. RCntMdSC = $0001;
  123. RCntMdSP = $0000;
  124. RCntMdFR = $0000;
  125. RCntMdGATE = $0010;
  126. EvSpCZ = $0001; // counter becomes zero
  127. EvSpINT = $0002; // interrupted
  128. EvSpIOE = $0004; // end of i/o
  129. EvSpCLOSE = $0008; // file was closed
  130. EvSpACK = $0010; // command acknowledged
  131. EvSpCOMP = $0020; // command completed
  132. EvSpDR = $0040; // data ready
  133. EvSpDE = $0080; // data end
  134. EvSpTIMOUT = $0100; // time out
  135. EvSpUNKNOWN = $0200; // unknown command
  136. EvSpIOER = $0400; // end of read buffer
  137. EvSpIOEW = $0800; // end of write buffer
  138. EvSpTRAP = $1000; // general interrupt
  139. EvSpNEW = $2000; // new device
  140. EvSpSYSCALL = $4000; // system call instruction
  141. EvSpERROR = $8000; // error happned
  142. EvSpPERROR = $8001; // previous write error happned
  143. EvSpEDOM = $0301; // domain error in libmath
  144. EvSpERANGE = $0302; // range error in libmath
  145. EvMdINTR = $1000;
  146. EvMdNOINTR = $2000;
  147. EvStUNUSED = $0000;
  148. EvStWAIT = $1000;
  149. EvStACTIVE = $2000;
  150. EvStALREADY = $4000;
  151. TcbMdRT = $1000; // reserved by system
  152. TcbMdPRI = $2000; // reserved by system
  153. TcbStUNUSED = $1000;
  154. TcbStACTIVE = $4000;
  155. NREGS = 40;
  156. type
  157. EXEC = packed record
  158. pc0 : dword; // Execution start address
  159. gp0 : dword; // gp register initial value
  160. t_addr : dword; // Starting address of initialized text section
  161. t_size : dword; // Size of text section
  162. d_addr : dword; // Starting address of initialized data section
  163. d_size : dword; // Size of initialized data section
  164. b_addr : dword; // Uninitialized data section start address
  165. b_size : dword; // Uninitialized data section size
  166. s_addr : dword; // Stack start address (specified by the user)
  167. s_size : dword; // Stack size (specified by the user)
  168. sp : dword; // Register shunt variable
  169. fp : dword; // Register shunt variable
  170. gp : dword; // Register shunt variable
  171. ret : dword; // Register shunt variable
  172. base : dword; // Register shunt variable
  173. end;
  174. PEXEC = ^EXEC;
  175. ToT = packed record
  176. head : pdword;
  177. size : longint;
  178. end;
  179. TCB = packed record
  180. status : longint;
  181. mode : longint;
  182. reg : array [0..NREGS - 1] of dword; // never change the offset of this
  183. system : array [0..5] of longint; // reserved by system
  184. end;
  185. PTCB = ^TCB;
  186. TCBH = packed record
  187. entry : PTCB; // NULL
  188. flag : longint;
  189. end;
  190. EvCB = packed record
  191. desc : dword;
  192. status : longint;
  193. spec : longint;
  194. mode : longint;
  195. FHandler : pointer;
  196. system : array [0..1] of longint; // reserved by system
  197. end;
  198. XF_HDR = packed record
  199. key : array [0..7] of char;
  200. text : dword;
  201. data : dword;
  202. _exec : EXEC;
  203. title : array [0..59] of char; // "PlayStation(tm) Executable A1"
  204. end;
  205. var
  206. SysToT : array [0..31] of ToT; external;
  207. SysClearRCnt : array [0..0] of longint; external;
  208. type
  209. PDIRENTRY = ^DIRENTRY;
  210. DIRENTRY = packed record
  211. name : array [0..29] of char; // Filename
  212. attr : longint; // Attributes (dependent on file system)
  213. size : longint; // File size (in bytes)
  214. next : PDIRENTRY; // Pointer to next file entry (for user)
  215. system : array [0..7] of char; // Reserved by system
  216. end;
  217. //
  218. // Basic system types and major/minor device constructing/busting macros.
  219. function major(x: longint): dword; // major part of a device
  220. function minor(x: longint): longint; // minor part of a device
  221. function makedev(x, y: longint): longint; // make a device number
  222. // memory.h
  223. function memcpy(dest: pointer; src: pointer; count: dword): pointer; stdcall external;
  224. function memmove(dest: pointer; const src: pointer; count: dword): pointer; stdcall external;
  225. function memcmp(const lhs: pointer; const rhs: pointer; count: dword): longint; stdcall external;
  226. function memchr(const ptr: pointer; val: char; num: dword): pointer; stdcall external;
  227. function memset(const dest: pointer; ch: byte; count: dword): pointer; stdcall external;
  228. function bcopy(const src: pointer; dest: pointer; len: dword): pointer; stdcall external;
  229. function bzero(s: pointer; n: dword): pointer; stdcall external;
  230. function bcmp(const s1: pointer; const s2: pointer; n: dword): longint; stdcall external;
  231. // malloc.h
  232. procedure InitHeap(p: pdword; l: dword); stdcall external;
  233. procedure free(p: pointer); stdcall external;
  234. function malloc(l: size_t): pointer; stdcall external;
  235. function calloc(nitems: size_t; l: size_t): pointer; stdcall external;
  236. function realloc(p: pointer; l: size_t): pointer; stdcall external;
  237. procedure InitHeap2(p: pdword; l: dword); stdcall external;
  238. procedure free2(p: pointer); stdcall external;
  239. function malloc2(l: size_t): pointer; stdcall external;
  240. function calloc2(l1: size_t; l2: size_t): pointer; stdcall external;
  241. function realloc2(p: pointer; l: size_t): pointer; stdcall external;
  242. procedure InitHeap3(p: pdword; l: dword); stdcall external;
  243. procedure free3(p: pointer); stdcall external;
  244. function malloc3(l: size_t): pointer; stdcall external;
  245. function calloc3(l1: size_t; l2: size_t): pointer; stdcall external;
  246. function realloc3(p: pointer; l: size_t): pointer; stdcall external;
  247. // strings.h
  248. const
  249. LMAX = 256;
  250. function strcat(dest: pchar; const src: pchar): pchar; stdcall external;
  251. function strncat(dest: pchar; const src: pchar; num: size_t): pchar; stdcall; external;
  252. function strcmp(str1: pchar; str2: pchar): longint; stdcall; external;
  253. function strncmp(const str1: pchar; const str2: pchar; num: size_t): longint; stdcall; external;
  254. function strcpy(dest: pchar; src: pchar): pchar; stdcall; external;
  255. function strncpy(dest: pchar; const src: pchar; num: size_t): pchar; stdcall; external;
  256. function strlen(s: pchar): longint; stdcall; external;
  257. function index(const s: pchar; pos: byte): pchar; stdcall; external;
  258. function rindex(const s: pchar; pos: byte): pchar; stdcall; external;
  259. function strchr(const src: pchar; ch: char): pchar; stdcall; external;
  260. function strrchr(const src: pchar; ch: char): pchar; stdcall; external;
  261. function strpbrk(const str1: pchar; const str2: pchar): pchar; stdcall; external;
  262. function strspn(const str1: pchar; const str2: pchar): longint; stdcall; external;
  263. function strcspn(const str1: pchar; const str2: pchar): longint; stdcall; external;
  264. function strtok(str1: pchar; const str2: pchar): pchar; stdcall; external;
  265. function strstr(const str1: pchar; const str2: pchar): pchar; stdcall; external;
  266. function strdup(p: pchar): pchar;
  267. // rand.h
  268. const
  269. RAND_MAX = 32767;
  270. function rand: longint; stdcall; external;
  271. procedure srand(x: longint); stdcall; external;
  272. // stdlib.h
  273. type
  274. Tcmp = function (const a: pointer; const b: pointer): longint;
  275. Pcmp = ^Tcmp;
  276. function bsearch(const key: pointer; const ptr: pointer; count: size_t; size: size_t; comp: Pcmp ) : pointer; stdcall; external;
  277. procedure exit; stdcall; external;
  278. // stdio.h
  279. const
  280. BUFSIZ = 1024;
  281. EOF = -1;
  282. SEEK_SET = 0;
  283. SEEK_CUR = 1;
  284. SEEK_END = 2;
  285. function printf(const fmt: pchar): longint; varargs; stdcall; external;
  286. function sprintf(buffer: pchar; const fmt: pchar): longint; varargs; stdcall; external;
  287. function getc(s: longint): char; stdcall; external;
  288. function getchar: char; stdcall; external;
  289. function gets(s: pchar): pchar; stdcall; external;
  290. procedure putc(ch: char; s: longint); stdcall; external;
  291. procedure putchar(ch: char); stdcall; external;
  292. procedure puts(const s: pchar); stdcall; external;
  293. // abs.h
  294. function abs(x: longint): longint; stdcall; external;
  295. // convert.h
  296. function atoi(const str: pchar): longint; stdcall; external;
  297. function atol(const str: pchar): longint; stdcall; external;
  298. function strtol(const str: pchar; endptr: pointer; base: longint): longint; stdcall; external;
  299. function strtoul(const str: pchar; endptr: pointer; base: longint): dword; stdcall; external;
  300. function labs(x: longint): longint; stdcall; external;
  301. //limits.h
  302. const
  303. CHAR_BIT = 8;
  304. SCHAR_MIN = -128;
  305. SCHAR_MAX = 127;
  306. UCHAR_MAX = 255;
  307. CHAR_MIN = SCHAR_MIN;
  308. CHAR_MAX = SCHAR_MAX;
  309. SHRT_MIN = -32768;
  310. SHRT_MAX = 32767;
  311. USHRT_MAX = 65535;
  312. INT_MIN = -2147483648;
  313. INT_MAX = 2147483647;
  314. UINT_MAX = 4294967295;
  315. LONG_MIN = -2147483648;
  316. LONG_MAX = 2147483647;
  317. ULONG_MAX = 4294967295;
  318. USI_MAX = 4294967295; // max decimal value of an "unsigned"
  319. WORD_BIT = 32; // # of bits in a "word" or "int"
  320. MB_LEN_MAX = 4;
  321. // qsort.h
  322. procedure qsort(base: pointer; num: size_t; size: size_t; compar: pointer); stdcall; external;
  323. // ctype.h
  324. const
  325. _U = $01; // upper case letter
  326. _L = $02; // lower case letter
  327. _N = $04; // digit
  328. _S = $08; // space, tab, newline, vertical tab, formfeed, or carriage return
  329. _P = $10; // punctuation character
  330. _C = $20; // control character or delete
  331. _X = $40; // hexadecimal digit [0-9a-fA-F]
  332. _B = $80; // blank (space)
  333. //extern char _ctype_[];
  334. function toupper(ch: char): char; stdcall; external;
  335. function tolower(ch: char): char; stdcall; external;
  336. function isalpha(ch: char): boolean;
  337. function isupper(ch: char): boolean;
  338. function islower(ch: char): boolean;
  339. function isdigit(ch: char): boolean;
  340. function isxdigit(ch: char): boolean;
  341. function isspace(ch: char): boolean;
  342. function ispunct(ch: char): boolean;
  343. function isalnum(ch: char): boolean;
  344. function isprint(ch: char): boolean;
  345. function isgraph(ch: char): boolean;
  346. function iscntrl(ch: char): boolean;
  347. function isascii(ch: char): boolean;
  348. function toascii(ch: char): char;
  349. //function _toupper(ch: char) ((unsigned char)(c)-'a'+'A')
  350. //function _tolower(ch: char) ((unsigned char)(c)-'A'+'a')
  351. // ioctl.h
  352. function FIOCNBLOCK: longint;
  353. function FIOCSCAN: longint; // scan for input
  354. // tty and sio
  355. function TIOCRAW: longint; // disable xon/xoff control
  356. function TIOCFLUSH: longint; // flush input buffer
  357. function TIOCREOPEN: longint; // reopen
  358. function TIOCBAUD: longint; // set baud rate
  359. function TIOCEXIT: longint; // console interrup
  360. function TIOCDTR: longint; // control DTR line
  361. function TIOCRTS: longint; // control RTS line
  362. function TIOCLEN: longint; // stop<<16 | char
  363. // stop 0:none 1:1 2:1.5 3:2bit
  364. // char 0:5 1:6 2:7 3:8bit
  365. function TIOCPARITY: longint; // parity 0:none 1:e 3:o
  366. function TIOSTATUS: longint; // return status
  367. function TIOERRRST: longint; // error reset
  368. function TIOEXIST: longint; // exist test with DTR/CTS
  369. function TIORLEN: longint; // receive buffer length
  370. // disk
  371. function DIOFORMAT: longint; // format
  372. // fcntl.h
  373. const
  374. FREAD = $0001; // readable
  375. FWRITE = $0002; // writable
  376. FNBLOCK = $0004; // non-blocking reads
  377. FRLOCK = $0010; // read locked (non-shared)
  378. FWLOCK = $0020; // write locked (non-shared)
  379. FAPPEND = $0100; // append on each write
  380. FCREAT = $0200; // create if nonexistant
  381. FTRUNC = $0400; // truncate to zero length
  382. FSCAN = $1000; // scan type
  383. FRCOM = $2000; // remote command entry
  384. FNBUF = $4000; // no ring buf. and console interrupt
  385. FASYNC = $8000; // asyncronous i/o
  386. // file.h
  387. const
  388. // Flag for open()
  389. O_RDONLY = FREAD;
  390. O_WRONLY = FWRITE;
  391. O_RDWR = FREAD or FWRITE;
  392. O_CREAT = FCREAT; // open with file create
  393. O_NOBUF = FNBUF; // no device buffer and console interrupt
  394. O_NBLOCK = FNBLOCK; // non blocking mode
  395. O_NOWAIT = FASYNC; // asyncronous i/o
  396. implementation
  397. function strdup(p: pchar): pchar;
  398. begin
  399. strdup:= malloc(strlen(p) + 1);
  400. strcpy(strdup, p);
  401. end;
  402. function isalpha(ch: char): boolean;
  403. begin
  404. isalpha:= boolean(byte(ch) and (_U or _L));
  405. end;
  406. function isupper(ch: char): boolean;
  407. begin
  408. isupper:= boolean(byte(ch) and _U);
  409. end;
  410. function islower(ch: char): boolean;
  411. begin
  412. islower:= boolean(byte(ch) and _L);
  413. end;
  414. function isdigit(ch: char): boolean;
  415. begin
  416. isdigit:= boolean(byte(ch) and _N);
  417. end;
  418. function isxdigit(ch: char): boolean;
  419. begin
  420. isxdigit:= boolean(byte(ch) and (_X or _N));
  421. end;
  422. function isspace(ch: char): boolean;
  423. begin
  424. isspace:= boolean(byte(ch) and _S);
  425. end;
  426. function ispunct(ch: char): boolean;
  427. begin
  428. ispunct:= boolean(byte(ch) and _P);
  429. end;
  430. function isalnum(ch: char): boolean;
  431. begin
  432. isalnum:= boolean(byte(ch) and (_U or _L or _N));
  433. end;
  434. function isprint(ch: char): boolean;
  435. begin
  436. isprint:= boolean(byte(ch) and (_P or _U or _L or _N or _B));
  437. end;
  438. function isgraph(ch: char): boolean;
  439. begin
  440. isgraph:= boolean(byte(ch) and (_P or _U or _L or _N));
  441. end;
  442. function iscntrl(ch: char): boolean;
  443. begin
  444. iscntrl:= boolean(byte(ch) and _C);
  445. end;
  446. function isascii(ch: char): boolean;
  447. begin
  448. isascii:= boolean(byte(ch) <= $7f);
  449. end;
  450. function toascii(ch: char): char;
  451. begin
  452. toascii:= char(byte(ch) and $7f);
  453. end;
  454. function major(x: longint): dword;
  455. begin
  456. major:= dword((x shr 8) and 0377);
  457. end;
  458. function minor(x: longint): longint;
  459. begin
  460. minor:= x and 0377;
  461. end;
  462. function makedev(x, y: longint): longint;
  463. begin
  464. makedev:= ((x shl 8) or y);
  465. end;
  466. function FIOCNBLOCK: longint;
  467. begin
  468. FIOCNBLOCK:= (dword('f') shl 8) or 1;
  469. end;
  470. function FIOCSCAN: longint;
  471. begin
  472. FIOCSCAN:= (dword('f') shl 8) or 2;
  473. end;
  474. function TIOCRAW: longint;
  475. begin
  476. TIOCRAW:= (dword('t') shl 8) or 1;
  477. end;
  478. function TIOCFLUSH: longint;
  479. begin
  480. TIOCFLUSH:= (dword('t') shl 8) or 2;
  481. end;
  482. function TIOCREOPEN: longint;
  483. begin
  484. TIOCREOPEN:= (dword('t') shl 8) or 3;
  485. end;
  486. function TIOCBAUD: longint;
  487. begin
  488. TIOCBAUD:= (dword('t') shl 8) or 4;
  489. end;
  490. function TIOCEXIT: longint;
  491. begin
  492. TIOCEXIT:= (dword('t') shl 8) or 5;
  493. end;
  494. function TIOCDTR: longint;
  495. begin
  496. TIOCDTR:= (dword('t') shl 8) or 6;
  497. end;
  498. function TIOCRTS: longint;
  499. begin
  500. TIOCRTS:= (dword('t') shl 8) or 7;
  501. end;
  502. function TIOCLEN: longint;
  503. begin
  504. TIOCLEN:= (dword('t') shl 8) or 8;
  505. end;
  506. function TIOCPARITY: longint;
  507. begin
  508. TIOCPARITY:= (dword('t') shl 8) or 9;
  509. end;
  510. function TIOSTATUS: longint;
  511. begin
  512. TIOSTATUS:= (dword('t') shl 8) or 10;
  513. end;
  514. function TIOERRRST: longint;
  515. begin
  516. TIOERRRST:= (dword('t') shl 8) or 11;
  517. end;
  518. function TIOEXIST: longint;
  519. begin
  520. TIOEXIST:= (dword('t') shl 8) or 12;
  521. end;
  522. function TIORLEN: longint;
  523. begin
  524. TIORLEN:= (dword('t') shl 8) or 13;
  525. end;
  526. function DIOFORMAT: longint;
  527. begin
  528. DIOFORMAT:= (dword('d') shl 8) or 1;
  529. end;
  530. begin
  531. end.