Jump to content



Photo
- - - - -

Basic Extender & Problems


  • Please log in to reply
30 replies to this topic

#1 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 13 March 2004 - 09:28 AM

I experienced some problems while developing the CBE.

It seems that sometimes the calc crashes after the CBE was installed and
this still happens after reboot. Sometimes noting helps and I've to do
a memory reset (test menu / - Memory) and sometimes even directly after
this the calc still crashes.

Is there anyone who is willing to test wether this is caused by the CBE (what I don't believe)
or a Problem of my calc?

What is the menuitem "Cycle Test" in the test mode?
I executed it and it said sometimes after half an hour sometimes after 1 hour
that "Flash Test Failed". Sometimes this does not happen.

The Flash test from the test mode runs fine. (Shows OK)

Is there anyone who also had those problems? Have you any idea what the reason for this is?
It even appers to happen if the CBE was not installed into memory after a compelte reset at all.


Please help me!!!!

#2 X-thunder28

X-thunder28

    Casio Freak

  • Members
  • PipPipPipPip
  • 192 posts

  • Calculators:
    2 Graph100 (rom 1.02 and rom 1.03 (+) )

Posted 13 March 2004 - 11:07 AM

Have you already use 'P' button?

If this problem is software you could have created the first virus on afx :lol2:
(persistant code? personnalized boot?!)

sometimes it crash... but when you're doing nothing, it crash?

hmm

try to modify all interrupt with a program of your own (in begining, point them at nothing)

#3 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 13 March 2004 - 12:09 PM

The cycle test is maybe dangerous: it tests the flash for read and write over and over again... it's not supposed to be run for a long time, the AFX flash supports only 100,000 write/erase cycles.

What exacly happens when the calc crashes? What is the calc doing at this moment?

#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 13 March 2004 - 01:03 PM

I just reset the calc from the hidden menu (option memory) and
installed NOTHING on it and calced 7.2*2.45 and it crashed!!! Also sometimes when
drawing graphs.

Pointing all ints at nothing? This results in crash!!!
Use the P button? Damn what do you think rebooting is? I said I rebooted
it and it happens even after reset.

I don't want to install the app on my other calc until i'm COMPLETELY sure
that this is not cause by the program in ANY way.

When I used flash cycle the last time (2 hours) it worked the whole time without
displaing any error ... then I aborted it. Can I test it this is caused by a
non-working flash? If yes how?

#5 X-thunder28

X-thunder28

    Casio Freak

  • Members
  • PipPipPipPip
  • 192 posts

  • Calculators:
    2 Graph100 (rom 1.02 and rom 1.03 (+) )

Posted 13 March 2004 - 06:56 PM

"Use the P button? Damn what do you think rebooting is? I said I rebooted
it and it happens even after reset."
Roe said that Hidden Menu's reboot and P button's reboot are a bit different.

"calced 7.2*2.45 and it crashed" same crash when we try to put a menu from a different rom!

I don't think that flash is really damaged...

hmmm try to initialize the rom ( with Service(+) on hidden menu)... even if it is stupid (a lot of casio's stuff on AFX is stupid, so...)

(hu? i tried to do the 'Sector access' in the Flash menu. I pressed 'P' button. After the reboot, I got a DATA ERROR 40, So I type EXE, and the calc said that Storage Memory has been reseted. But the whole flash is intact, even the menu...)

#6 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 13 March 2004 - 07:27 PM

Roe said that Hidden Menu's reboot and P button's reboot are a bit different.

"calced 7.2*2.45 and it crashed" same crash when we try to put a menu from  a different rom!

1) But i used the P button after the first crash (no other way to continue and it didn't work afterwards. Strange ...

2) So this might be cause by failures on drive A or by failurs in the reset system?


anyways ... I'll continue development on this calc.

#7 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 20 March 2004 - 06:49 PM

I've a BIIIG problem (and thats why I haven't done any work on the CBE
for quite a long time now ...). I told you of the problems I had with my AFX?
They didn't happen again but now I tried my FX one week ago and
placed the batteries in it and turned it on and ... it rebooted ...
then I wanted to do some easy calculations ... and it rebooted. Either the
screen would fill itsself with freaky patterns or the calc would simply freeze.

I only wanted to calc 21+23+18.8 and divide this by 3 and it didn't work.
Now you'd say that this is caused by a prog ...
Well it isn't. On this calc has only been CNC instaleld (for multi player testing)
and never anything else that does change OS things like interrupts.
I only had TOUCHE on it and this for sure doesn't cause such problems.
I don't know what to do. I initialized it and it didn't help. I rebooted it
in all possible ways and it didn't work. The problem is that I'm gonna write
an important test in my Mathematics advanced course where I need the FX 1.0
since I'm not allowed to use an AFX. But it crashes !!! I don't know what to do!
Do you have any suggestions? Might uploading an SYSTEM drive image
of the ones found on the internet help?

PLEASE HELP ME!!!

#8 Andy.Davies

Andy.Davies

    Forum Ghost

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1547 posts
  • Gender:Male
  • Location:Dorset, England
  • Interests:Age: 18
    Studying: MEng in cybernetics at Reading uni
    Interests: Progaming (VB, VB.Net, C#, Casio Basic)
    Computers UBBD (Using, Building, Breaking & Destroying)
    Gaming (FPS, RTS, RPG)
    Electronics
    Rock Music (Preferably Loud)
    Riley's (Pool & Snooker Bar)
    Driving (Preferably fast)
    Aikedo (Martial Art)

  • Calculators:
    Algebra FX 2.0 ROM 1.01, FX9750G

Posted 21 March 2004 - 11:13 AM

would changing the ROM version have any effect?

#9 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 21 March 2004 - 12:40 PM

huh? What do you mean? Both my calcs have ROM 1.03. I can't change
the rom anyways since I don't want to open it to avoide voiding my warranty.

#10 Roeoender

Roeoender

    UCF ASM/C Programming Only Winner

  • [Legends]
  • PipPipPipPip
  • 273 posts
  • Gender:Male
  • Location:Gdynia, Poland
  • Interests:Technical University student (informatics)
    Interests:
    Sport climbing
    Orieenting (100km walk in 23h31min)
    C/Asm on calculators

    Dislike cars

  • Calculators:
    CASIO AFX 2.0 ROM 1.01, 10 countable fingers

Posted 21 March 2004 - 03:01 PM

This is strange. I remember that after some messing with memory I had similiar but far less fatal probels: you can look here for one example.
Note that removing new installed add-in language (like polish, transfered by the exe probram from PC not by selecting it on the calc from memnu) by erasing memory is difficult too. So I suggest that you send a language pack and use different methods of erasing memory till this installed language will be removed.
You can also try to cause a transfer error (by for example altering system disk at different offsets) to force memory initialization ("Data error nn, pres <span class=EXE' /> to reset all memories", or so).
I bet that this can be recovered.
Good luck,
Roeoender.

#11 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 21 March 2004 - 03:52 PM

I'll try your suggestions. Thank you a lot!
I already got these data errors from alone.

I can't even select menu items some times. Not even the transfer menu.
Then after I let the calc some minutes or hours it would
let me choose the menus again but crash soon afterwards.

I had errrors 20 / 40 and 7C (standard data error) and after reset and some calulcations they
appeared again.

#12 Roeoender

Roeoender

    UCF ASM/C Programming Only Winner

  • [Legends]
  • PipPipPipPip
  • 273 posts
  • Gender:Male
  • Location:Gdynia, Poland
  • Interests:Technical University student (informatics)
    Interests:
    Sport climbing
    Orieenting (100km walk in 23h31min)
    C/Asm on calculators

    Dislike cars

  • Calculators:
    CASIO AFX 2.0 ROM 1.01, 10 countable fingers

Posted 21 March 2004 - 04:51 PM

You can always try to go to the casio service.
Explain your problem and ask if they could lend you a similiar calc
just for the exams (just as a "replacement" car when your own had an accident).
If they won't agree you can post a request at some of your local comuunity forum
that you give some money for lending AFX 1.0 for 1 day.

The cycle test just does all test from the sequence, I think.
There simply may be a mechanical damage (as you say about those flash error)
to your flash that cause this errors.

You can also try to use GComm or Touche (or something( to erase all flash disks one by one. You can also write an asm program that would zero all bytes of RAM memory and put this program at the end of the 256Kb of RAM - sequence of machine code instructions poked directly to RAM and than jmp to this code.
There is no magick if those two methods fail than there is a problem with hardware.

Roeoender.

#13 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 21 March 2004 - 07:01 PM

I uplaoded an completely corrupted drive A to provoke a complete reset
(enter random informatik every ~500 bytes).

It seems to work. Made some basic calcs and entered all menus without crashs.
Maybe it helped.
I'll lend an CFX 9850GB+ from a friend since me and my friend are the only
ones in town who own an FX 1.0+ since schools do only recommend 9850's for the pupils.
Since he has exams the same day he can't gieve me his 1.0+ ... sadly :)
So I'll have 2 calcs for my exam and I hope the other one won't get
infected from my 1.0+ (I hope it doesn't spread though air) :thumbsup: :greengrin:

While going through these errors I noticed that there are quite many and that
I don't know where they come from. Maybe we could make a list
with how to reproduce them (if possible).

I had:

20 / 40 / 7C / 70 / 60 / 58

Anyone had ever other errors (not math errors and this stuff!)

Thank you a lot for your help roe. The flash test of the memory menu does always say
OK. So it seems to be no flash error. Maybe I'll try the memory reset program.

Thanks once more! Huhn

#14 Andy.Davies

Andy.Davies

    Forum Ghost

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1547 posts
  • Gender:Male
  • Location:Dorset, England
  • Interests:Age: 18
    Studying: MEng in cybernetics at Reading uni
    Interests: Progaming (VB, VB.Net, C#, Casio Basic)
    Computers UBBD (Using, Building, Breaking &amp; Destroying)
    Gaming (FPS, RTS, RPG)
    Electronics
    Rock Music (Preferably Loud)
    Riley's (Pool &amp; Snooker Bar)
    Driving (Preferably fast)
    Aikedo (Martial Art)

  • Calculators:
    Algebra FX 2.0 ROM 1.01, FX9750G

Posted 21 March 2004 - 09:12 PM

i think i had error 78 or 40 or somthing like that, i had just sent a drive to the clac, i think the drives size was too big

#15 zar

zar

    Newbie

  • Members
  • Pip
  • 23 posts

  • Calculators:
    casio fx1.0+

Posted 22 March 2004 - 03:01 PM

i remember getting one of those errors (maybe 7C?) by initializing flash from the service menu. someone could find out what causes each one of them.

#16 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 16 April 2004 - 07:11 AM

I finally got a new FX 1.0+ from the casio repair center so coding can go on.

But I need some help. I wan't the Basic extender to have a plugin interface but
for this i need a possibility to call another executable from withing a TSR but when
I try I get an "out of memory" error from the DOs interrupt. I know that
I need to free some memory blocks so that the new program has space and
I know how to do that for an ordinary program but how do I do it for a TSR?

There must be some possibility to execute a program from within a TSR.
If anybody knows it would really help me.

As an alternative someone could also explain me how to link and compile
a C function in a way that it can be used in an ASM program.

Thank you guys! huhn

PS: I decided to go with crimsons suggestion and do the
#ECHO Hallo

command like style. It makes things easier for coders because only few would learn
the cryptic commands I intended to use before. This also enables me to pass
parameters directly without accessing the BASIC vaiables.

But I wan't the parsers to be in extra programs because the whole things should
never take up more than 10KB in ram so that the BASIC interperter of the CASIO
and other programs can still run well.

#17 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 16 April 2004 - 07:57 PM

thanks for taking my suggestion huhn :)
I have another idea about the check for the extender: on the first line check for a comment (') that reads:

'BASIC EXTENDER CHECK

then if found skip the second line and set the variable theta to -12345 (or some other number as long as its easy to remember)

demo code:
'BASIC EXTENDER CHECK
0->o
if o<>-12345
then "BASIC EXTENDER NOT FOUND!"
Stop
IfEnd


#18 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 17 April 2004 - 07:33 AM

Nope, I'll take my check since it is easier to implement and the extender can only catch
commands that are outputted to the screen (but it suppresses the actuall output of course).

I need someone with C & ASM knowledge:

I wan't to link a C and a ASM program together in order to use the SHELL function of
C in my asm program. This are the sourcecodes:

C:

#include <dos.h>
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <process.h>

extern char *filename;
extern main();

int execute()
{
	system("dir"); //filename);
	getch();
	return 0;
}

ASM:

.186
.MODEL TINY
locals @@
.DATA
        tst db 0
.STACK 256
.CODE
        extrn _execute : near
	public _main
_main:

        MOV AX,_DATA
        MOV DS,AX

        call _execute

        MOV AH,4Ch
        INT 21h

end _main

The compiling/assembling works fine.
The problem is the linking.
I try to link with TCC (from the CDK) and the folowing syntax:

TCC -L..\lib -edir1.exe dir1.obj bae.obj

where dir1.obj is the assembled ASM file and bae.obj is the compiled
C file. I get the error:

Undefined symbol _export in module dir1.asm

I need this for the plugin interface since I know no other way to
call a program from within a TSR.

Would be nice if someone could help me,

#19 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 17 April 2004 - 03:28 PM

i can ask my computer science teacher...

#20 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 17 April 2004 - 04:11 PM

I don't know how to do that, you could put your ASM code directly in TC.

Know that the system() function cannot work on the AFX because there is never enough memory, I don't remember if I tried with a very small C prog but I think it won't work. :(

#21 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 18 April 2004 - 08:37 AM

but I need to execute a program from withing a TSR somehow and
using TSRs with TC seemd quite complicated for me and
when I tried the DOS exec function it said not enough memory what is normal
since I have to free some but don't know how to do it from within a TSR.

Thats bad. But I can't write the CBE without the plugin interface.

(it would only include Portaccess / Memory acces / Interrupt access but no other
advanced functions like sprite drawing and file handling.

#22 Roeoender

Roeoender

    UCF ASM/C Programming Only Winner

  • [Legends]
  • PipPipPipPip
  • 273 posts
  • Gender:Male
  • Location:Gdynia, Poland
  • Interests:Technical University student (informatics)
    Interests:
    Sport climbing
    Orieenting (100km walk in 23h31min)
    C/Asm on calculators

    Dislike cars

  • Calculators:
    CASIO AFX 2.0 ROM 1.01, 10 countable fingers

Posted 18 April 2004 - 02:44 PM

Here is a sample program I made about 2 years ago while learning C/ASM at school (sorry for Polish comments) it also illustrates how to use ASM globals inside C.


C code:
#include <stdio.h>

/* Zmienne globalne zdefiniowane w C: */
char CGlobal='!';
char CTextGlobal [20]="Poczatkowy tekst";

/* Zmienne globalne zdefiniowane w ASM: */
extern char AGlobal;

/* funkcje zdefiniowane w ASM: */
extern void asm_func (long int BigNum,
        char chara,
        int number,
                      char tab [],
                      int *numP);

void main (void) {
  int numb=32000;
  char tab [100];
  printf ("\nNumb przed uruchomieniem funkcji: %x.\n",numb);
  asm_func (0x12345678,'J',0x0902,tab,&numb);
  printf ("\nNumb:%x\nAGlobal:%i\n",numb,AGlobal);
  printf ("tab: %s\n",tab);
  printf ("CTextGlobal: %s",CTextGlobal);
}

ASM code:
PUBLIC _asm_func
PUBLIC _AGlobal
ASSUME CS:_TEXT,DS:_DATA


;
; w konwencji jezyka C STRUKTURE odpowiadajaca sytuacji na stosie zaraz po
; wywolaniu danej funkcji buduje sie nastepujaca: BP,IP i potem kolejne
; zmienne w kolejnosci wystepowania w prototypie funkcji, pomimo, ze
; na stos te zmienne sa wrzucane w odwrotnej kolejnosci, zwroc uwage na
; zmienna chara oraz na tablice i wskazniki
;
asm_funcS STRUC
 dw ? ;bp;+0
 dw ? ;ip;+2
BigNum dd ?  ;+4
chara db ?  ;+8
 db ?  ;+9
number dw ?  ;+10
tab dw ?  ;+12
numP dw ?  ;+14
asm_funcS ENDS

_DATA SEGMENT word PUBLIC 'DATA'
_AGlobal db 113
EXTRN _CGlobal:BYTE;To jest global zdefiniowany w C
EXTRN _CTextGlobal:BYTE;To jest tablica
_DATA ENDS

_TEXT SEGMENT word PUBLIC 'CODE'
; asm_func (BigNum,chara,number,tab,numP);
_asm_func PROC near
push bp
mov bp,sp

;*** *** *** BIGNUM *** *** ***:
cmp word PTR [bp].BigNum+2,1234h;cmp BigNum 12345678h
jne go_on  ; |
cmp word PTR [bp].BigNum,5678h; |
jne go_on  ; |
   ;      \ /
mov dl,'A'  ;rowne to wyswietl 'A'
mov ah,02
int 21h
go_on:
;*** *** *** CHARA *** *** ***:
cmp [bp].chara,'J' ; cmp chara 'J'
jne go_on1  ; |
mov dl,'B'  ;      \ /
mov ah,02h  ;rowne to wyswietl 'B'
int 21h

go_on1:
;*** *** *** NUMBER *** *** ***:
cmp [bp].number,1902h
jne go_on2
mov dl,'C'
mov ah,02h
int 21h

go_on2:
;*** *** *** TAB *** *** ***:
mov di,[bp].tab  ;wypelnij tablice
mov byte PTR [di],'J'
mov byte PTR [di]+1,'a'
mov byte PTR [di]+2,'r'
mov byte PTR [di]+3,'e'
mov byte PTR [di]+4,'k'
mov byte PTR [di]+5,0

;*** *** *** numP *** *** ***:
;  gdy numP wskazywa? na liczbe == 32000
;  to ta liczba zostanie zmieniona na 0x1023
mov di,[bp].numP
cmp [di],32000
jne go_on3
mov [di],1023h
mov dl,'D'
mov ah,02h
int 21h

go_on3:
;*** *** *** C_GLOBAL *** *** ***:
cmp _CGlobal,'!'
jne go_on9
mov dl,'Z'
mov ah,02
int 21h
go_on9:
;*** *** *** C_TEXT_GLOBAL *** *** ***:
mov _CTextGlobal,'K' ;pierwszy znak globala
   ;teraz jest == 'K'

pop bp
ret
_asm_func ENDP


_TEXT ENDS
END

Make file
uruchom.exe : main.obj asmmod.obj
	tlink -Ld:\prog\bc\lib c0s.obj main.obj + asmmod.obj, \
	uruchom.exe,, cs.lib
	del *.obj

main.obj : main.c
	bcc -c main.c
asmmod.obj : asmmod.asm
	cls
	tasm asmmod.asm

important stuff:
- adding underscodes before function names
- linking with c0s.obj and cs.lib (s means 'small model' other letters for other models) the order of linking is important.
- I used borland C/C++ 3.1 but porobably TC 2.01 or something works the same way.
- I bet there is much stuff about it in internet. There was some kind of SWAG (Pascal) version for C which used asm a lot.

Some other quick tips:
- in BC 3.1 there is included full source of all standard functions so you can look at sources for functions like 'system' or 'exec' but they aren't that easy as you could expect.
- for some strange reason execXX function worked for me only when string buffers were long (I use 200byte). I really don't know why.
- for your basic extension - you can put ASM procedures that obtain arguments through registers or memory buffer, those functions would be put at fixed position in the calc's mem and you extender would only interpret parts of the program that call those functions and then make far jmp to proc.

Sorry but I didn't have time to read the whole thread. And wrote it in a hurry.
Roeoender.

Edited by CrimsonCasio, 18 April 2004 - 07:25 PM.


#23 Roeoender

Roeoender

    UCF ASM/C Programming Only Winner

  • [Legends]
  • PipPipPipPip
  • 273 posts
  • Gender:Male
  • Location:Gdynia, Poland
  • Interests:Technical University student (informatics)
    Interests:
    Sport climbing
    Orieenting (100km walk in 23h31min)
    C/Asm on calculators

    Dislike cars

  • Calculators:
    CASIO AFX 2.0 ROM 1.01, 10 countable fingers

Posted 18 April 2004 - 03:21 PM

Ups I forgot to paste the ASM code. I walked 75km yesterday so I am a bit dizzy now :)
Sadly I don't have permission to edit previous post. Some mod/admin could correct it.

CC: Done.

#24 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 18 April 2004 - 04:00 PM

just a note
TASM automatically prefixes the names with underscores

#25 Roeoender

Roeoender

    UCF ASM/C Programming Only Winner

  • [Legends]
  • PipPipPipPip
  • 273 posts
  • Gender:Male
  • Location:Gdynia, Poland
  • Interests:Technical University student (informatics)
    Interests:
    Sport climbing
    Orieenting (100km walk in 23h31min)
    C/Asm on calculators

    Dislike cars

  • Calculators:
    CASIO AFX 2.0 ROM 1.01, 10 countable fingers

Posted 18 April 2004 - 04:32 PM

TASM automatically prefixes the names with underscores

And this is the reason why you have to do it manually when calling those functions in your program. This was the reason of: "Undefined symbol _export in module dir1.asm".
Roeoender.

#26 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 19 April 2004 - 04:53 AM

1) No it's vice versa. C does automatic underscores but ASM does not.
2) I don't want to
include an ASM function ito C code but a C function into ASM code (so
that the ASM program is the main program.

Anyways some of the tips might proove usefull. I'll try this afternoon.

#27 X-thunder28

X-thunder28

    Casio Freak

  • Members
  • PipPipPipPip
  • 192 posts

  • Calculators:
    2 Graph100 (rom 1.02 and rom 1.03 (+) )

Posted 19 April 2004 - 07:20 AM

I don't think it' s possible because a lot of C code need startup code for work...

#28 Roeoender

Roeoender

    UCF ASM/C Programming Only Winner

  • [Legends]
  • PipPipPipPip
  • 273 posts
  • Gender:Male
  • Location:Gdynia, Poland
  • Interests:Technical University student (informatics)
    Interests:
    Sport climbing
    Orieenting (100km walk in 23h31min)
    C/Asm on calculators

    Dislike cars

  • Calculators:
    CASIO AFX 2.0 ROM 1.01, 10 countable fingers

Posted 19 April 2004 - 01:49 PM

Ofcourse it is possible as I did it in both directions when I had to do it at school. You just have to link your asm code with objs and libs as I have wrote eariler.
Sadly I couldn't find my code for this direction, but as I have wrote there should be examples somewhere on the web (or discussion groups). It is even possible to use Pascal functions (compiled to objs) in your C programs.

Roeoender.

#29 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 22 April 2004 - 04:40 PM

i got an idea:

Just a theory:

Could I make a TSR installer that copies the TSR code into a basic file and point the interrupt to the addresse of that basic file in ram? That would save a lot user ram and
would let me get arround this difficult calling thing. It would also speed things up.

So just for theorie: Is it possible? If yes I'll try to write it.

#30 Roeoender

Roeoender

    UCF ASM/C Programming Only Winner

  • [Legends]
  • PipPipPipPip
  • 273 posts
  • Gender:Male
  • Location:Gdynia, Poland
  • Interests:Technical University student (informatics)
    Interests:
    Sport climbing
    Orieenting (100km walk in 23h31min)
    C/Asm on calculators

    Dislike cars

  • Calculators:
    CASIO AFX 2.0 ROM 1.01, 10 countable fingers

Posted 22 April 2004 - 05:09 PM

The problem with such solution is that basic (and other) memory structures aren't at fixed position - if you add program "AAA" then it will be inserted before enything after (like program "BBB", etc) so you cannot just copy your TSR and set interrupt vector to it as after a while this TSR code will be moved. You can try to find "the first possible" thing - that everything user adds will be placed past it, but you won't be 100% sure if you really found it.
Pointing to flash disk mapped to memory isn't good too as you still need some place for variables (maybe you can use stack for dynamic vars but you won't have any "globals" then), for simple functions that only use registers for I/O using flash mem would be good enough. Someone could make a multipurpose Casio library to save programs size this way.
Roeoender.

#31 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 22 April 2004 - 05:22 PM

If I use all chars of the filename as #1 then it should work since
they won't ever move .... I think ... I'll simply try it.




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users