In my post about the CASIO AI-1000, the only pocket computer that can be programmed in PROLOG and LISP natively, the observant reader may have noticed a reference to a CASL language ROM module (OM-54A). This language is also available in many pocket computers manufactured by CASIO or SHARP during the past decades, as well as on PCs. So, what is this CASL? CASL is the assembler of the COMET virtual machine. Although I would name COMET an ISA, the idea behind CASL is brilliant. Imagine you are in Japan during the ’90s and you want a technician or engineering degree to land an IT job. Whichever exam, wherever you pass it, when it comes to the programming test, you will have to do it in CASL. This way, your future employer can be sure that the A grade you scored is somehow equal to the A grade of the other candidates he is interviewing. Something the holder of a French baccalaureate can value for its universality ;-).
COMP-X/COMET/COMET II
In 2001, a new CASL specification has been released to cope with technology’s evolution (CASL II and COMET II). The same way CAP-X/COMP-X was swapped in 1985 for CASL/COMET. CASIO and SHARP manufactured until recently several educational pocket computers (for example the VX or G series), and most of them support the CASL language. As a student, you could practice and sharpen your CASL skills on the go and get ready for the exams during your daily commutes in the subway. Because COMET doesn’t exist as a hardware implementation – that I am aware of –, it is always available as an interpreter. Note that in addition, the native assembler of the computer’s processor was also available for raw speed-sensitive applications. If you want to play around with CASL II, you can download a JAVA based emulator from the Japan Information Technology Examination Center (JITEC) here.
;
; サンプル・プログラム
; 2000.5.8
COUNT1 START ;
; Input GR1:Bits to be tested
; Process Count '1' bits in GR1
; Output GR0:Number of '1' bits in GR1
PUSH 0,GR1
PUSH 0,GR2
SUBA GR2,GR2 Count = 0
AND GR1,GR1 Test if all zeros or not
JZE RETURN Return if all zeros
MORE LAD GR2,1,GR2 Count += 1
LAD GR0,-1,GR1 Change
AND GR1,GR0 one '1' to '0'
JNZ MORE Loop if not all zeros
RETURN LD GR0,GR2 GR0 = Count
POP GR2
POP GR1
RET ; Return to caller
END ;
Very interesting. I didn’t know about those Casio and Sharp handhelds. The code snippet looks for me like Z80 assembler syntax. Was or is there a relationship between CASL or COMET and the Z80?
Lorenz Born I do not know. We can just suppose that since the Z80 was a popular CPU in mid-80’s around the world (for microprocessor applications as well as among bedroom programmers) that the CASL définition team got inspired by it.
Very interesting. It seems to use stacks (GR0, GR1, GR2, …) instead of static registers. Sadly, there are no source files for the Java implementation.
I’m landing on an old thread but i’m just throwing myself back to the eighties and have bought some of the old Casio models, including the VX-4 and Z-1 which were the Japanese College Computers.
I’d like to play with Assembler on them as its been 20 years+ since I did any of that.
The CASL II java emulator decompiles fine, so I will make some sense of that source code.
Also found the text of the CASL 1 manual online which gives details of the virtual layout and full instruction set.
GR0-4 are static registers.
I’m good to start playing once my devices arrive in the post 🙂
Thank you for your comment and for sharing your experience with us David. Happy CASL/ASM once your babies are reaching you 😀