Jump to content



Photo
- - - - -

Turbo Pascal code worked, but...


  • Please log in to reply
15 replies to this topic

#1 Rigel

Rigel

    Newbie

  • Members
  • Pip
  • 12 posts

Posted 14 May 2003 - 10:23 PM

Hi,

I finally acquired an SB-87 cable, and downloaded the Calipso (cool!) and FA 123 software. I decided to check if Pascal compiled code runs on AFX. I wrote the simple code:

uses CRT;
begin
clrscr;
write('Hello world');
for n:=1 to 100000 do;
end.

(Turbo Pascal 7.0)

Although straightforward, I should explain that this program should clear the screen, print 'Hello world' on the screen, and pause for a few seconds. I packaged the hello.exe file into hellowor.cfx using Calipso and loaded this into AFX with FA123. It succesfully took its place in the main menu of the AFX with the default Calipso icon. When executed, nothing appeared on the LCD but the unit paused for a period approximately as I calculated for an 8 MHz 286. I then changed the iteration value to 200000, and it paused for twice as it did for 100000.
This proves that Pascal generated .exe programs really works on the AFX, except for screen I/O (and probably for many other things!).

Could anyone tell me how I can get around this? Should I write directly on video RAM? Where is it in the memory?

#2 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1564 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Alternative states of consciousness, programming, making things work the best they possibly can.

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 15 May 2003 - 12:05 AM

video ram is located at 0x1A20:0

#3 Brazzucko

Brazzucko

    UCF BASIC Programming Champion

  • Super Member
  • PipPipPipPipPipPip
  • 412 posts

  • Calculators:
    FX 1.0, CFX 9850 GB Plus and FX 9750G

Posted 15 May 2003 - 09:44 AM

:blink: For what I know C and assembly Works fine, how many languages Works in the AFX?

#4 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 15 May 2003 - 02:02 PM

but why should someone want to program in pascal if he has to
make the screen access and everything else in asm or c?
the programs are a big deal larger and slower!

#5 Guest_Bytefish Productions_*

Guest_Bytefish Productions_*
  • Guests

Posted 15 May 2003 - 05:00 PM

i think it's highly interesting, because you guys always said, you cant program pascal on the afx. :)
/edit: i meant you cant run pascal files on the afx.
and hi roeoender. :D

#6 Rigel

Rigel

    Newbie

  • Members
  • Pip
  • 12 posts

Posted 15 May 2003 - 06:59 PM

Hey,

I'd like to thank 2072 for the address!

Pascal is very well capable of doing great job all in itself, and I don't think I will delve into asm or anything for simple memory I/O routines. That's the crucial point here.. I assume any compiler that generates real mode DOS executables will be okay.

After Pascal, there comes the time for PROLOG, my favorite :)

Thank you all. Now I have to deal with some peeking poking..

#7 superna

superna

    Casio Addict

  • Members
  • PipPipPip
  • 88 posts

Posted 16 May 2003 - 06:24 AM

i think you can use pascal but with new graphic routines in asm

the advantage of turbo C is that he uses current DOS routines to write on the screen

#8 Martin

Martin

    Casio Freak

  • Members
  • PipPipPipPip
  • 121 posts
  • Gender:Male
  • Location:Praha
  • Interests:asm on cfx9850

  • Calculators:
    fx82l
    fx7700GB
    cfx9850G
    TI92
    fx9860G SD
    Rheinmetall KEL IIc
    H. W. Ebmeyer - Tarema
    fx cg20

Posted 16 May 2003 - 08:37 AM

Try another program, which will:
- not use CRT
- or disable direct video access (put "directvideo:=false;" to the beginning of the program)

this would force I/O routines to use DOS handler.

#9 Brazzucko

Brazzucko

    UCF BASIC Programming Champion

  • Super Member
  • PipPipPipPipPipPip
  • 412 posts

  • Calculators:
    FX 1.0, CFX 9850 GB Plus and FX 9750G

Posted 16 May 2003 - 01:38 PM

:lol: So the best language for the AFX are assembly and C++ right?, right now I?m studying C++?.. :)

#10 Guest_Bytefish Productions_*

Guest_Bytefish Productions_*
  • Guests

Posted 16 May 2003 - 04:18 PM

good luck man... you'll need it :D

#11 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 16 May 2003 - 04:42 PM

For small handheld devices like this, compact code is the most important factor as to deciding what language is most suitable

assembly will naturally reign superior in both compactness, and speed of exectution.. however, it can be very time consuming when it comes to developement

as for C, it's a very compact, and efficient language, and lets you mess around with anything you want (so no limitations)
C++ adds objects and all that stuff, so programs increase in size, and speed of exectution is slower (that is, if you take use of the c++ features). For the calc I would stick with pure C over C++.. though, if you really wanna go all the way, assembly is the thing :D

#12 Brazzucko

Brazzucko

    UCF BASIC Programming Champion

  • Super Member
  • PipPipPipPipPipPip
  • 412 posts

  • Calculators:
    FX 1.0, CFX 9850 GB Plus and FX 9750G

Posted 16 May 2003 - 06:55 PM

:blink: I choose C and C++ because I can get help, ?everyone? knows C, but assembly it?s not so used, or I?m wrong? :unsure:

:lol: I know that assembly it?s the best for the calc, see for example the platinum, a very good game in a very small size?. :)

#13 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 16 May 2003 - 07:00 PM

Not many ppl program in assembly

In normal computer programing it's not of much use. It's time consuming, and you usually have tons of clock cycles to waste anyway

Only in rare cases, operating systems, compilers, special algorithms, inner loops, and games developement (espacially for console) do you see assembly programming nowadays

#14 Brazzucko

Brazzucko

    UCF BASIC Programming Champion

  • Super Member
  • PipPipPipPipPipPip
  • 412 posts

  • Calculators:
    FX 1.0, CFX 9850 GB Plus and FX 9750G

Posted 16 May 2003 - 10:06 PM

:D So considering this the C and C++ is the best choice isn?t?

B) I want to be sure of my decision to not find in the end that I loose my time?..

:blink: And that I don?t make a GREAT friend lose his time to teach me?.

#15 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1564 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Alternative states of consciousness, programming, making things work the best they possibly can.

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 16 May 2003 - 11:01 PM

You won't wast your time learning C. This old language is still very used nowadays. When you know C you can learn other languages easily. Because a lot of programming laguages have a lot in comon with C.

So learn C, C++ is usefull for HUGE programs where you have a very complex organization but C is better for programs like we do on AFX.

#16 Brazzucko

Brazzucko

    UCF BASIC Programming Champion

  • Super Member
  • PipPipPipPipPipPip
  • 412 posts

  • Calculators:
    FX 1.0, CFX 9850 GB Plus and FX 9750G

Posted 17 May 2003 - 06:56 PM

:lol: I know that and thanks for you give this new motivation, I will learn C?.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users