Jump to content
IGNORED

Mad Pascal


Recommended Posts

The idea of having VBXE as a 2nd S: device is great. Maybe there could also be error handling in/after the OPEN like "Cannot open device", if VBXE is not active.

Because that's the first thing I ran into ?.

Compiled as a separate device driver it could make VBXE accessible in other language like Basic or Turbobasic.

Link to comment
Share on other sites

23 hours ago, tebe said:

 

yes, this is the same S2: (S_VBXE.SYS) from drac030

 

That is even cooler. But the SYS on you ATR is an SDX binary. So does MP now contain a relocatable loader for the SDX format?

Link to comment
Share on other sites

Action!
BYTE RTCLOCK2=20 ; sys timer
BYTE RTCLOCK1=19

CARD COUNT=$F4,PRIME=$F6,STOP

PROC sieve()
 BYTE ARRAY FLAGS(8190)
 CARD I=$F0,K=$F2

 PRIME=0
 COUNT=0         ; init count
 SETBLOCK(FLAGS,8190,'T)

 FOR I=0 TO 8190 ; and flags
   DO
   IF FLAGS(I)='T THEN
     PRIME=I+I+3
     K=I+PRIME
     WHILE K<=8190
       DO
       FLAGS(K)='F
       K==+PRIME
       OD
     COUNT==+1
   FI
   OD
RETURN

PROC main()
 BYTE I=[0]

 RTCLOCK1=0
 RTCLOCK2=0
 WHILE I<10
  DO
   sieve()
   I==+1
  OD
 STOP=RTCLOCK1 * 256 + RTCLOCK2

 PRINTF("%E %U PRIMES IN",COUNT)
 PRINTF("%E %U JIFFIES",STOP)
 PRINTF("%E %U iterations",I)
RETURN

Action! 746 ticks Vs. Mad Pascal 635 ticks

Edited by zbyti
add comparsion
Link to comment
Share on other sites

  • 2 weeks later...

https://github.com/tebe6502/Mad-Pascal

 

VBXE S2: handler ready to use (LIB\S2.PAS)

ClearDevice
ClearLine
CloseGraph
GetPaletteEntries
InitGraph
LoadBitmap
Position
SaveBitmap
ScrollDown
ScrollUp
SetGraphMode
SetPaletteEntries
TextOut

Memory layout:

- $0700: xDOSBoot

- $8000: SDXLD.COM -> Instal S_VBXE.SYS

- S_VBXE.SYS: SDX $0400-$06FD
- S_VBXE.SYS: SDX $4800-$612F

- $2000: MP program (ROM is disabled and accessible if needed)

 

example: execute 1/9 *.BAT

vbxe_s2.7z

Edited by tebe
  • Like 2
  • Thanks 2
Link to comment
Share on other sites

Waw, that's great. This is great news for new version. It provides a way for easier reading and writing to device channels, for example writing to device number 6 in text modes 1 and 2. No need for extra code as it was till now.

 

Btw, I would suggest to rename some routines to more meaningful names, more specifically for routines opn and cls. I understand it is necessary to distinguish from actual Pascal command (f.e. close => cls), but this routine sounds more like a clear screen routine. So, I would suggest a different name, such as CloseDevice or CloseD. The same would apply to opn function => OpenDevice or OpenD.

 

And thanks for XIO command, that's new.

 

  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...
On 5/12/2020 at 11:28 AM, Gury said:

Btw, I would suggest to rename some routines to more meaningful names, more specifically for routines opn and cls. I understand it is necessary to distinguish from actual Pascal command (f.e. close => cls), but this routine sounds more like a clear screen routine. So, I would suggest a different name, such as CloseDevice or CloseD. The same would apply to opn function => OpenDevice or OpenD.

it's similar to command 'CLS #6' from BASIC

 

new improvements:

- new SIODISK unit, separated from the SYSTEM
- SYSTEM: corrected Val(string, real, code) ; Val(string, single, code)
- new CIO unit: Opn, Cls, Get, Put, BGet, BPut, XIO
- GRAPH, FASTGRAPH: SetActiveBuffer, SetDisplayBuffer, NewDisplayBuffer, SwitchDisplayBuffer, example demoeffects\lines2.pas, line3.pas, line4.pas
- GRAPH: Ellipse procedure (X, Y, StAngle, EndAngle, xRadius,yRadius: Word);
- new S2 unit, integrated with handler installer VBXE-S2: (S_VBXE.SYS)
- new DEFLATE unit, which performs DEFLATE decompression (procedure unDEF), example compression\undef.pas
- new LZ4 unit, implementing LZ4 decompression (procedure unLZ4), example compression\unlz4.pas, unlz4_stream.pas
- new APLIB unit, which performs apLib decompression (procedure unApl), example compression\unapl.pas, unapl_stream.pas
- new CRC unit: function crc32(crc: cardinal; buf: Pbyte; len: word)
- a new PASCAL procedure/function modifier, causing a new memory block to be assigned/released for variables each time a procedure/function is called, example 'math\evaluate.pas'.
- added ability to disable ROM while maintaining system operation, {$DEFINE ROMOFF}
Edited by tebe
  • Like 2
  • Thanks 3
Link to comment
Share on other sites

2 minutes ago, tebe said:

it's similar to command 'CLS #6' from BASIC

 

new improvements:

 


- new SIODISK unit, separated from the SYSTEM
- new S2 unit, integrated with handler installer VBXE-S2: (S_VBXE.SYS)
- new LZ4 unit, implementing LZ4 decompression (procedure unLZ4), example compression\unlz4.pas, unlz4_stream.pas
- new APLIB unit, which performs apLib decompression (procedure unApl), example compression\unapl.pas, unapl_stream.pas
- new CRC unit: function crc32(crc: cardinal; buf: Pbyte; len: word)
- a new PASCAL procedure/function modifier, causing a new memory block to be assigned/released for variables each time a procedure/function is called, example 'math\evaluate.pas'.
- added ability to disable ROM while maintaining system operation, {$DEFINE ROMOFF}

 

especially {$DEFINE ROMOFF} is great!

  • Like 1
Link to comment
Share on other sites

12 hours ago, tebe said:

it's similar to command 'CLS #6' from BASIC

 

new improvements:


- new SIODISK unit, separated from the SYSTEM
- SYSTEM: corrected Val(string, real, code) ; Val(string, single, code)
- new CIO unit: Opn, Cls, Get, Put, BGet, BPut, XIO
- GRAPH, FASTGRAPH: SetActiveBuffer, SetDisplayBuffer, NewDisplayBuffer, SwitchDisplayBuffer, example demoeffects\lines2.pas, line3.pas, line4.pas
- GRAPH: Ellipse procedure (X, Y, StAngle, EndAngle, xRadius,yRadius: Word);
- new S2 unit, integrated with handler installer VBXE-S2: (S_VBXE.SYS)
- new DEFLATE unit, which performs DEFLATE decompression (procedure unDEF), example compression\undef.pas
- new LZ4 unit, implementing LZ4 decompression (procedure unLZ4), example compression\unlz4.pas, unlz4_stream.pas
- new APLIB unit, which performs apLib decompression (procedure unApl), example compression\unapl.pas, unapl_stream.pas
- new CRC unit: function crc32(crc: cardinal; buf: Pbyte; len: word)
- a new PASCAL procedure/function modifier, causing a new memory block to be assigned/released for variables each time a procedure/function is called, example 'math\evaluate.pas'.
- added ability to disable ROM while maintaining system operation, {$DEFINE ROMOFF}

Wow!

Link to comment
Share on other sites

  • 2 weeks later...

New version has many new improvements and speed-ups which are very important for future development. For me, most important is device manipulation using CIO unit, which, besides other things, speeds up get and put operations on bytes. This unit does not require the use of file handling variables and block reads/writes using BlockRead and BlockWrite. You can open device and use Get, BGet, Put and BPut routines for direct device manipulation. Only thing I am missing is EOF handling similar to file variable handling (f.e. EOF(f)).

I wonder if there will be any non-VBXE examples using {$define ROMOFF} directive.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...